import { RequestCache } from './RequestCache'; export interface MemoryRequestCacheOptions { maxElementsInCache?: number; } export declare class MemoryRequestCache implements RequestCache { private _maxElementsInCache; private readonly _data; private _defaultCleanupCount; private readonly _disposeCallback?; private readonly _referenceCounts; private static readonly CLEANUP_COUNT_TO_CAPACITY_RATIO; constructor(maxElementsInCache: number, defaultCleanupCount: number, disposeCallback?: (data: Data) => void); has(id: Key): boolean; forceInsert(id: Key, data: Data): void; insert(id: Key, data: Data): void; remove(id: Key): void; get(id: Key): Data; isFull(): boolean; cleanCache(count: number, forceRemoval?: boolean): void; /** * Adds a reference to the cached item. Items with active references will not be disposed * until all references are removed. * @param id The cache key to add a reference to */ addReference(id: Key): void; /** * Removes a reference to the cached item. Items remain in cache even when * reference count reaches 0, allowing for potential reuse. Disposal only * happens during cache cleanup when memory pressure exists. * @param id The cache key to remove a reference from */ removeReference(id: Key): void; /** * Gets the current reference count for a cached item. * @param id The cache key to get reference count for * @returns The number of active references, or 0 if not found */ getReferenceCount(id: Key): number; resize(cacheSize: number): void; clear(): void; }