/** * Lightweight TTL + max-size cache. * * Entries expire after `ttlMs` milliseconds and are lazily evicted on * access. When the cache exceeds `maxSize`, the oldest entry (by * insertion / last-update order) is dropped — Map iteration order * guarantees FIFO. */ export declare class TtlCache { private readonly map; private readonly maxSize; private readonly ttlMs; private readonly now; constructor(options: { maxSize: number; ttlMs: number; now?: () => number; }); get(key: K): V | undefined; set(key: K, value: V): this; has(key: K): boolean; delete(key: K): boolean; get size(): number; /** Iterate live (non-expired) entries. */ entries(): IterableIterator<[K, V]>; /** Sweep all expired entries in one pass. */ sweep(): number; clear(): void; private evictOverflow; } /** * TTL + max-size Set — thin wrapper around TtlCache. */ export declare class TtlSet { private readonly cache; constructor(options: { maxSize: number; ttlMs: number; now?: () => number; }); add(value: V): this; has(value: V): boolean; delete(value: V): boolean; get size(): number; sweep(): number; clear(): void; }