import type { MultiCacheInstances } from '../types/index.js'; import type { CacheTagRegistry } from '../types/CacheTagRegistry.js'; /** * A helper class to debounce cache tag invalidation. * * This prevents having too many invalidation requests coming in at once that * could lead to performance issues since tag invalidation can be very * inefficient. */ export declare class CacheTagInvalidator { /** * The caches. */ private cache; /** * The cache tag registry. */ private cacheTagRegistry; /** * Buffer of tags to invalidate in the next run. */ private tags; /** * The current timeout ID for the next run. Reset after each run. */ private timeout; constructor( /** * The caches. */ cache: MultiCacheInstances, /** * The cache tag registry. */ cacheTagRegistry: CacheTagRegistry | null); /** * Add tags to be purged. */ add(tags?: string[]): void; getCacheTags(cacheName: keyof MultiCacheInstances, key: string): Promise; /** * Invalidate the tags in the buffer. */ invalidate(): Promise; }