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

14 lines
429 B
TypeScript

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 };