/** * Simple LRU cache with TTL support. * * @template T The type of values stored in the cache * * @example * ```typescript * const cache = new LruCache(100, 300000); // 100 items, 5 min TTL * cache.set('Account', describeResult); * const result = cache.get('Account'); * ``` */ export declare class LruCache { private readonly cache; private readonly maxSize; private readonly ttl; /** * Creates a new LRU cache. * * @param maxSize - Maximum number of entries (default: 100) * @param ttl - Time-to-live in milliseconds (default: 300000 = 5 minutes) */ constructor(maxSize?: number, ttl?: number); /** * Gets the current number of entries in the cache. */ get size(): number; /** * Gets a value from the cache if it exists and is not expired. * * @param key - The cache key * @returns The cached value or undefined if not found or expired */ get(key: string): T | undefined; /** * Sets a value in the cache. * * @param key - The cache key * @param value - The value to cache */ set(key: string, value: T): void; /** * Checks if a key exists in the cache (and is not expired). * * @param key - The cache key * @returns True if the key exists and is not expired */ has(key: string): boolean; /** * Deletes an entry from the cache. * * @param key - The cache key * @returns True if the entry was deleted */ delete(key: string): boolean; /** * Invalidates cache entries matching a pattern. * * Supports glob-style wildcards: `*` matches any characters. * Example: `describe:*` matches all keys starting with "describe:" * * @param pattern - Optional pattern to match keys. If not provided, clears all entries. */ invalidate(pattern?: string): void; /** * Clears all entries from the cache. */ clear(): void; }