UNPKG

diginext-utils

Version:
22 lines 632 B
interface CacheEntry { value: any; lastAccessed: number; maxAge: number; } export interface ICacheManager { maxCacheSize?: number; } export default class CacheManager { private cache; private MAX_CACHE_SIZE; constructor(props?: ICacheManager); get(id: string, updateLastAccessed?: boolean): any | undefined; add(id: string, value: any, maxAge?: number): void; private evictEntryOutdate; private evictMaxAgeEntry; update(id: string, value: Partial<CacheEntry>): void; getRoughSize(): string; private getRoughSizeOfObject; } export {}; //# sourceMappingURL=CacheManager.d.ts.map