/** * @template T * @description Implements an LRU (Least Recently Used) Cache with TTL (Time-to-Live) support. * Allows for efficient storage and retrieval of key-value pairs. */ export declare class LRUCacheOption { private static instance; private readonly capacity; private readonly hash; private head?; private tail?; private hitCount; private missCount; private evictionCount; private constructor(); /** * Creates or retrieves the singleton instance of the LRU cache. * @template T * @param {number} [capacity=10] - Maximum capacity of the cache. * @returns {LRUCacheOption} The singleton instance of the cache. */ static getInstance(capacity?: number): LRUCacheOption; /** * Inserts or updates an item in the cache. * If the key already exists, it updates its value and moves it to the head. * If the cache exceeds capacity, the least recently used item is evicted. * @param {string} key - The key associated with the value. * @param {T} value - The value to store in the cache. * @param {number} [ttl=60000] - Time-to-Live in milliseconds for the item. * @returns {LRUCacheOption} The current cache instance for chaining. */ put(key: string, value: T, ttl?: number): LRUCacheOption; /** * Retrieves an item from the cache by key. * If the item has expired, it returns undefined and counts as a miss. * @param {string} key - The key to search for. * @returns {T | undefined} The value associated with the key, or undefined if not found or expired. */ get(key: string): T | undefined; /** * Clears all items from the cache. */ clear(): void; private prepend; private pop; private evict; private getHitRate; private getMissRate; private getEvictionRate; /** * Resets cache performance metrics. */ clearMetrics(): void; /** * Logs cache performance metrics to the console. * Includes hit rate, miss rate, and eviction rate. */ logMetrics(): void; /** * Logs debugging information about the cache to the console. * Includes the current state of the linked list and the hash map. */ debugLRU(): void; }