/** * Generic LRU (Least Recently Used) cache with O(1) get/set operations. * Uses JavaScript Map which maintains insertion order - LRU is first key, MRU is last. */ export declare class LRUCache { private readonly cache; private readonly maxSize; /** * Creates a new LRU cache with the specified maximum size. * @param maxSize - Maximum number of entries to cache (must be positive) */ constructor(maxSize: number); /** * Clears all entries from the cache. */ clear(): void; /** * Gets a value from the cache and moves it to MRU position. * @param key - The key to look up * @returns The cached value, or undefined if not found */ get(key: K): V | undefined; /** * Returns the maximum number of entries the cache can hold. */ getMaxSize(): number; /** * Checks if a key exists in the cache without affecting LRU order. * @param key - The key to check * @returns true if the key exists, false otherwise */ has(key: K): boolean; /** * Sets a value in the cache. If the cache is at capacity, evicts the LRU entry. * If the key already exists, updates the value and moves to MRU position. * @param key - The key to set * @param value - The value to cache */ set(key: K, value: V): void; /** * Returns the current number of entries in the cache. */ size(): number; } //# sourceMappingURL=lru-cache.d.ts.map