UNPKG

840 BTypeScriptView Raw
1import Cookies from 'universal-cookie';
2declare type Store = Record<string, string>;
3declare type Context = {
4 req?: any;
5};
6export declare class UniversalStorage implements Storage {
7 cookies: Cookies;
8 store: Store;
9 constructor(context?: Context);
10 get length(): number;
11 clear(): void;
12 getItem(key: keyof Store): string;
13 protected getLocalItem(key: keyof Store): string;
14 protected getUniversalItem(key: keyof Store): any;
15 key(index: number): string;
16 removeItem(key: string): void;
17 protected removeLocalItem(key: keyof Store): void;
18 protected removeUniversalItem(key: keyof Store): void;
19 setItem(key: keyof Store, value: string): void;
20 protected setLocalItem(key: keyof Store, value: string): void;
21 protected setUniversalItem(key: keyof Store, value: string): void;
22}
23export {};