type DisposeReason = 'set' | 'delete' | 'evict' | 'expired'; export interface LRUCacheOptions { /** The maximum number of items that remain in the cache. default 500 */ max?: number; /** how long to live in ms. default 0 */ ttl?: number; updateAgeOnGet?: boolean; /** Function that is called on items when they are dropped from the cache */ dispose?(val: LRUCacheItem, key: K, reason: DisposeReason): void; } interface LRUCacheItem { t: number; ttl: number; v: V; } export declare class LRUCache { protected options: Required>; protected cache: Map>; constructor(options: LRUCacheOptions); /** Add a value to the cache */ set(key: K, value: T, opts?: { ttl?: number; }): void; /** Return a value from the cache */ get(key: K, options?: { updateAgeOnGet?: boolean; }): T | undefined; /** Deletes a key out of the cache */ delete(key: K, reason?: DisposeReason): boolean; /** Clear the cache */ clear(): void; dump(): [K, LRUCacheItem][]; load(entries: string | [K, LRUCacheItem][]): void; /** Delete any stale entries. */ purgeStale(): boolean; info(): { capacity: number; /** The total number of items held in the cache at the current moment */ size: number; }; keys(): K[]; values(): V[]; } export {};