/** * A verbatim TypeScript translation of the interfaces defined in the * [WICG Cookie Store API](https://wicg.github.io/cookie-store/#CookieStore) working draft. */ export interface CookieStore extends EventTarget { get(name?: string): Promise; get(options?: CookieStoreGetOptions): Promise; getAll(name?: string): Promise; getAll(options?: CookieStoreGetOptions): Promise; set(name: string, value: string): Promise; set(options: CookieInit): Promise; delete(name: string): Promise; delete(options: CookieStoreDeleteOptions): Promise; } export interface CookieStoreGetOptions { name?: string; url?: string; } export type CookieSameSite = 'strict' | 'lax' | 'none'; export interface CookieInit { name: string; value: string; expires?: number | Date | null; domain?: string | null; path?: string; sameSite?: CookieSameSite; httpOnly?: boolean, } export interface CookieStoreDeleteOptions { name: string; domain?: string | null; path?: string; } export interface CookieListItem { name: string; value: string; domain?: string | null; path?: string; expires?: Date | null; secure?: boolean; sameSite?: CookieSameSite; } export type CookieList = CookieListItem[];