export interface CacheStore { readonly name: string; get(key: string): unknown; keys(): Iterable; size(): number; deleteWhere?(predicate: (key: string) => boolean): number; keyBelongsToProject?(key: string, projectId: string): boolean; } export declare class MapCacheStore implements CacheStore { private readonly map; readonly keyBelongsToProject?: ((key: string, projectId: string) => boolean) | undefined; readonly name: string; constructor(name: string, map: CacheStatsSource, keyBelongsToProject?: ((key: string, projectId: string) => boolean) | undefined); get(key: string): unknown; keys(): Iterable; size(): number; deleteWhere(predicate: (key: string) => boolean): number; } interface LRULike { get(key: string): unknown; keys(): Iterable; size: number; delete(key: string): boolean; } /** * Narrow view of a key/value store sufficient for cache stats + inspection. * Both native `Map` and the LRU cache wrapper structurally satisfy this, so * callers can register lightweight wrappers without unsound `Map` casts. */ export interface CacheStatsSource { get(key: string): unknown; keys(): Iterable; readonly size: number; delete(key: string): boolean; } export declare class LRUCacheStore implements CacheStore { private readonly cache; readonly name: string; constructor(name: string, cache: LRULike); get(key: string): unknown; keys(): Iterable; size(): number; deleteWhere(predicate: (key: string) => boolean): number; } declare class CacheRegistry { private stores; register(store: CacheStore): void; unregister(name: string): boolean; get(name: string): CacheStore | undefined; getStoreNames(): string[]; getAllKeys(): Map; getKeysForProject(projectId: string): Map; countKeysForProject(projectId: string): number; deleteKeysForProject(projectId: string): number; /** Delete cache entries for a specific project and environment */ deleteKeysForProjectEnvironment(projectId: string, environment: "production" | "preview"): number; /** Delete cache entries for a specific content source (branch or release) */ deleteKeysForContentSource(projectId: string, contentSourceId: string): number; getStats(): Array<{ name: string; size: number; sampleKeys: string[]; }>; clear(): void; scanRedisKeys(pattern: string, limit?: number): Promise; getRedisKeysForProject(projectId: string): Promise>; getAllKeysForProjectAsync(projectId: string, includeRedis?: boolean): Promise<{ memory: Map; redis: Map; }>; deleteRedisKeysForProject(projectId: string): Promise; deleteAllKeysForProjectAsync(projectId: string): Promise<{ memoryDeleted: number; redisDeleted: number; }>; /** Delete all cache entries for a specific project and environment (memory + Redis) */ deleteAllKeysForProjectEnvironmentAsync(projectId: string, environment: "production" | "preview"): Promise<{ memoryDeleted: number; redisDeleted: number; }>; private deleteRedisKeysForProjectEnvironment; } export declare function isKeyForProject(key: string, projectId: string): boolean; /** Check if a cache key belongs to a specific project and environment */ export declare function isKeyForProjectEnvironment(key: string, projectId: string, environment: "production" | "preview"): boolean; export declare function extractProjectIdFromKey(key: string): string | null; export declare const cacheRegistry: CacheRegistry; export declare function registerMapCache(name: string, map: CacheStatsSource, keyBelongsToProject?: (key: string, projectId: string) => boolean): void; export declare function registerLRUCache(name: string, cache: LRULike): void; export {}; //# sourceMappingURL=registry.d.ts.map