// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://wicg.github.io/cookie-store/explainer.html
[
Exposed=(ServiceWorker,Window),
SecureContext
] interface CookieStore : EventTarget {
// https://wicg.github.io/cookie-store/explainer.html#the-query-api
[CallWith=ScriptState, Measure, RaisesException] Promise<CookieListItem?> get(
USVString name);
[CallWith=ScriptState, Measure, RaisesException] Promise<CookieListItem?> get(
optional CookieStoreGetOptions options = {});
[CallWith=ScriptState, Measure, RaisesException] Promise<CookieList> getAll(
USVString name);
[CallWith=ScriptState, Measure, RaisesException] Promise<CookieList> getAll(
optional CookieStoreGetOptions options = {});
// https://wicg.github.io/cookie-store/explainer.html#the-modifications-api
[CallWith=ScriptState, Measure, RaisesException] Promise<undefined> set(
USVString name, USVString value);
[CallWith=ScriptState, Measure, RaisesException] Promise<undefined> set(
CookieInit cookieInit);
[CallWith=ScriptState, ImplementedAs=Delete, Measure, RaisesException]
Promise<undefined> delete(USVString name);
[CallWith=ScriptState, ImplementedAs=Delete, Measure, RaisesException]
Promise<undefined> delete(CookieStoreDeleteOptions options);
// https://wicg.github.io/cookie-store/explainer.html#the-change-events-api
[Exposed=Window] attribute EventHandler onchange;
};