export declare type CacheOptions = { /** * max number of element store in cache */ max?: number; /** * data validity expiration date */ maxAge?: number; /** * get function will return the outdated value before delete it */ stale?: Boolean; }; declare type MapDataType = { expires: number | false; content: V; }; /** * TypeScript implementation of https://github.com/lukeed/tmp-cache * LRU caches operate on a first-in-first-out queue. * This means that the first item is the oldest and will therefore be deleted once the max limit has been reached. * * When a maxAge value is set, items are given an expiration date. * This allows existing items to become stale over time which, depending on your stale config, * is equivalent to the item not existing at all! * * In order to counteract this idle decay, all set() and get() operations on an item "refresh" its expiration date. * By doing so, a new expires value is issued & the item is moved to the end of the list — aka, * it's the newest kid on the block! * */ export declare class Cache { private readonly store; private readonly max; private readonly maxAge; private readonly stale; constructor(opts?: CacheOptions | number); peek(key: K): V | undefined; get size(): number; clear(): void; delete(key: K): boolean; forEach(callBack: (value: V, key: K) => void): void; has(key: K): boolean; set(key: K, content: V, maxAge?: number): Map>; get(key: K, mut?: boolean): V | undefined; keys(): IterableIterator; } export {};