export interface CacheConfig { /** Enable/disable caching. Default: true */ enabled?: boolean; /** * Max entries per resolver cache namespace. Default: 100_000. * Set to 0 to disable the resolver cache explicitly. */ maxSize?: number; /** DNS result TTL in ms. Default: 1_440_000 (24 min) */ dnsTtl?: number; } /** * In-memory LRU cache with TTL-based expiry and size-based eviction. * Uses Map insertion order for O(1) LRU tracking. * Unlike `CacheConfig.maxSize`, this standalone utility requires a positive * capacity; construct no cache when storage must be disabled. */ export declare class LruCache { private cache; private readonly maxSize; constructor(maxSize?: number); /** Get a value by key. Returns undefined if missing or expired. Promotes to MRU on hit. */ get(key: string): T | undefined; /** Set a value with a TTL in milliseconds. TTL 0 expires immediately. Evicts LRU at capacity. */ set(key: string, data: T, ttlMs: number): void; /** Check if a key exists and is not expired. */ has(key: string): boolean; /** Delete a specific key. Returns true if the key existed. */ delete(key: string): boolean; /** Remove all entries. */ clear(): void; /** Number of entries (including potentially expired ones not yet evicted). */ get size(): number; /** Iterate all non-expired keys. Lazily evicts expired entries. */ keys(): IterableIterator; /** Iterate all non-expired values. Lazily evicts expired entries. */ values(): IterableIterator; /** Iterate all non-expired [key, value] pairs. Lazily evicts expired entries. */ entries(): IterableIterator<[string, T]>; /** Purge all expired entries. Returns number of entries removed. */ prune(): number; /** Peek at a value without promoting it in the LRU order. */ peek(key: string): T | undefined; /** Get remaining TTL in ms for a key. Returns 0 if missing or expired. */ ttl(key: string): number; }