UNPKG

900 BTypeScriptView Raw
1interface ClientStorageOptions {
2 daysUntilExpire?: number;
3 cookieDomain?: string;
4}
5/**
6 * Defines a type that handles storage to/from a storage location
7 */
8export type ClientStorage = {
9 get<T extends Object>(key: string): T | undefined;
10 save(key: string, value: any, options?: ClientStorageOptions): void;
11 remove(key: string, options?: ClientStorageOptions): void;
12};
13/**
14 * A storage protocol for marshalling data to/from cookies
15 */
16export declare const CookieStorage: ClientStorage;
17/**
18 * Cookie storage that creates a cookie for modern and legacy browsers.
19 * See: https://web.dev/samesite-cookie-recipes/#handling-incompatible-clients
20 */
21export declare const CookieStorageWithLegacySameSite: ClientStorage;
22/**
23 * A storage protocol for marshalling data to/from session storage
24 */
25export declare const SessionStorage: ClientStorage;
26export {};