UNPKG

403 BTypeScriptView Raw
1/**
2 Shares the same API as a native browser's localStorage but uses in-memory cache
3 instead of fs.
4 */
5export declare class LocalCache<T = any> {
6 cache: {
7 [key: string]: T;
8 };
9 constructor();
10 getItem(key: string): T | null;
11 setItem(key: string, value: T): void;
12 removeItem(key: any): void;
13 key(n: number): string;
14 clear(): void;
15 readonly length: number;
16}