/** * @packageDocumentation * Shared bounded-cache helpers with lightweight LRU semantics for hot-path * parser/type-analysis caches. */ /** * Result shape returned by bounded-cache lookups. */ export type BoundedCacheLookupResult = Readonly<{ found: false; }> | Readonly<{ found: true; value: Value; }>; /** * Read a cache entry and mark it as most-recently-used. * * @param cache - Mutable cache map. * @param key - Entry key. * * @returns Lookup result describing whether an entry was found. When found, * includes the cached value (which can itself be `undefined`/`null`). */ export declare const getBoundedCacheValue: (cache: Map, key: Key) => BoundedCacheLookupResult; /** * Insert or update a cache entry and evict least-recently-used entries beyond * the configured max size. * * @param options - Bounded-cache insertion options. * * - `cache`: Mutable cache map. * - `key`: Entry key. * - `maxEntries`: Maximum number of cache entries to retain. * - `value`: Entry value. */ export declare const setBoundedCacheValue: ({ cache, key, maxEntries, value, }: Readonly<{ cache: Map; key: Key; maxEntries: number; value: Value; }>) => void; //# sourceMappingURL=bounded-cache.d.ts.map