UNPKG

multibridge

Version:

A multi-database connection framework with centralized configuration

25 lines (24 loc) 644 B
/** * Simple LRU (Least Recently Used) Cache implementation * Used for connection and config caching with size limits */ interface CacheEntry<T> { value: T; lastAccessed: number; } export declare class LRUCache<K, V> { private cache; private maxSize; private ttl?; constructor(maxSize?: number, ttl?: number); get(key: K): V | undefined; set(key: K, value: V): void; has(key: K): boolean; delete(key: K): boolean; clear(): void; size(): number; keys(): IterableIterator<K>; entries(): IterableIterator<[K, CacheEntry<V>]>; getEntry(key: K): CacheEntry<V> | undefined; } export {};