1 | type Timer = ReturnType<typeof setTimeout>;
|
2 | type CachedKey = string | number;
|
3 | export interface CachedData<TData = any, TParams = any> {
|
4 | data: TData;
|
5 | params: TParams;
|
6 | time: number;
|
7 | }
|
8 | interface RecordData extends CachedData {
|
9 | timer: Timer | undefined;
|
10 | }
|
11 | declare const setCache: (key: CachedKey, cacheTime: number, cachedData: CachedData) => void;
|
12 | declare const getCache: (key: CachedKey) => RecordData | undefined;
|
13 | declare const clearCache: (key?: string | string[]) => void;
|
14 | export { getCache, setCache, clearCache };
|