forgeplus-react/node_modules/@ahooksjs/use-request/lib/utils/cache.d.ts

14 lines
429 B
TypeScript
Raw Normal View History

2023-07-29 21:19:10 +08:00
declare type Timer = ReturnType<typeof setTimeout>;
export declare type CachedKeyType = string | number;
export declare type cachedData = {
data: any;
timer: Timer | undefined;
startTime: number;
};
declare const setCache: (key: CachedKeyType, cacheTime: number, data: any) => void;
declare const getCache: (key: CachedKeyType) => {
data: any;
startTime: number | undefined;
};
export { getCache, setCache };