export type LRUCacheOptions = { /** * Maximum amount of entries the cache can have * (defaults to 100) */ max_size?: number; }; /** * Least-Recently-Used (LRU) Cache */ declare class LRUCache { #private; constructor(opts?: LRUCacheOptions); /** * Get the currently configured max size of the cache */ get max_size(): number; /** * Reconfigure the max size of the cache * * @param {number} max_size - New max size */ set max_size(max_size: number); /** * Returns whether or not a key exists in cache * * @param {string} key - Key to retrieve */ has(key: string): boolean; /** * Retrieves a value from the cache * * @param {string} key - Key to retrieve */ get(key: string): V | undefined; /** * Sets a value on to the cache * * @param {string} key - Key to set * @param {V} value - Value to set for the key */ set(key: string, value: V): void; /** * Removes a single value from the cache * * @param {string} key - Key to remove */ del(key: string): void; /** * Clears all contents of the cache */ clear(): void; /** * MARK: Private */ private addToFront; private removeNode; private moveToFront; private evictTail; } export { LRUCache, LRUCache as default };