https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 31915549b84b31f234ef044df12110861846b010 authored by Chris Nardi on 13 March 2018, 21:27:03 UTC
Correct serialization of overflow
Tip revision: 3191554
cookie-store.idl
// https://github.com/WICG/cookie-store/blob/gh-pages/explainer.md

dictionary CookieListItem {
  USVString name;
  USVString value;
};

typedef sequence<CookieListItem> CookieList;

[
  Exposed=(ServiceWorker,Window)
] interface CookieStore {
  Promise<CookieList?> getAll(USVString name, optional CookieStoreGetOptions options);
  Promise<CookieList?> getAll(optional CookieStoreGetOptions options);

  Promise<CookieListItem?> get(USVString name, optional CookieStoreGetOptions options);
  Promise<CookieListItem?> get(optional CookieStoreGetOptions options);

  Promise<boolean> has(USVString name, optional CookieStoreGetOptions options);
  Promise<boolean> has(optional CookieStoreGetOptions options);

  Promise<void> set(USVString name, USVString value, optional CookieStoreSetOptions options);
  Promise<void> set(CookieStoreSetOptions options);

  Promise<void> delete(USVString name, optional CookieStoreSetOptions options);
  Promise<void> delete(CookieStoreSetOptions options);
};

enum CookieMatchType {
  "equals",
  "startsWith"
};

dictionary CookieStoreGetOptions {
  USVString name;
  USVString url;
  CookieMatchType matchType = "equals";
};

dictionary CookieStoreSetOptions {
  USVString name;
  USVString value;
  DOMTimeStamp? expires = null;
  USVString domain;
  USVString path = "/";
  boolean? secure;
  boolean httpOnly = false;
};

partial interface Window {
  [Replaceable, SameObject] readonly attribute CookieStore cookieStore;
};

partial interface ServiceWorkerGlobalScope {
  [Replaceable, SameObject] readonly attribute CookieStore cookieStore;
};
back to top