/** * Cookie management built on the asynchronous Cookie Store API. * https://developer.mozilla.org/en-US/docs/Web/API/Cookie_Store_API * * The public surface mirrors the legacy `docCookies` wrapper (same method * names, same parameter order, same semantics), but every method is `async` * because the Cookie Store API is Promise-based -- callers must `await` all * results. Intended for new apps; existing apps can keep using `docCookies` * (the synchronous `document.cookie` wrapper) without changes. * * Note: the Cookie Store API is only available in secure contexts (HTTPS or * localhost). When `window.cookieStore` is unavailable, methods resolve to * the same "failure" defaults the previous implementation used for invalid * input (`null` / `false` / `[]`) instead of rejecting, so callers do not * need to wrap every call in try/catch. */ interface ICookieStoreAPI { getItem(sKey: string): Promise; setItem(sKey: string, sValue: string, vEnd?: number | string | Date, sPath?: string, sDomain?: string, bSecure?: boolean, vSameSite?: string | number | boolean): Promise; removeItem(sKey: string, sPath?: string, sDomain?: string, bSecure?: boolean, vSameSite?: string | number | boolean): Promise; hasItem(sKey: string): Promise; keys(): Promise; clear(sPath?: string, sDomain?: string, bSecure?: boolean, vSameSite?: string | number | boolean): Promise; } declare class CookieStoreAPI implements ICookieStoreAPI { getItem(sKey: string): Promise; setItem(sKey: string, sValue: string, vEnd?: number | string | Date, sPath?: string, sDomain?: string, bSecure?: boolean, vSameSite?: string | number | boolean): Promise; removeItem(sKey: string, sPath?: string, sDomain?: string, bSecure?: boolean, vSameSite?: string | number | boolean): Promise; hasItem(sKey: string): Promise; keys(): Promise; clear(sPath?: string, sDomain?: string, bSecure?: boolean, vSameSite?: string | number | boolean): Promise; } declare const cookieStoreApi: CookieStoreAPI; export default cookieStoreApi; export { cookieStoreApi };