-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.d.ts
More file actions
20 lines (18 loc) · 762 Bytes
/
index.d.ts
File metadata and controls
20 lines (18 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export interface IStorageAdapter {
getItem(key: string): Promise<string | null>;
setItem(key: string, value: string): Promise<void>;
removeItem(key: string): Promise<void>;
clear(): Promise<void>;
}
export interface GhostCacheOptions {
ttl?: number;
persistent?: boolean;
maxEntries?: number;
storage?: "localStorage" | "sessionStorage" | IStorageAdapter;
}
export declare function enableGhostCache(options?: GhostCacheOptions): void;
export declare function disableGhostCache(): void;
export declare function clearGhostCache(): void;
export declare function setCache(key: string, value: any): Promise<void>;
export declare function getCache<T = any>(key: string): Promise<T | null>;
export declare function registerAxios(instance: any): void;