import { CacheProvider } from '../interfaces'; /** * Options for the version invalidator */ export interface VersionInvalidatorOptions { /** * Key prefix for version markers */ versionPrefix?: string; /** * Separator between version and key */ separator?: string; /** * Whether to enable logging */ enableLogging?: boolean; /** * Log level */ logLevel?: 'debug' | 'info' | 'warn' | 'error'; } /** * Version-based cache invalidator * Invalidates cache entries by changing version numbers */ export declare class VersionInvalidator { private provider; private options; private logger; private versions; /** * Creates a new VersionInvalidator * @param provider Cache provider to invalidate * @param options Version invalidator options */ constructor(provider: CacheProvider, options?: VersionInvalidatorOptions); /** * Initialize the version invalidator * Loads existing versions from the cache * @returns Promise resolving when initialized */ init(): Promise; /** * Set a value in the cache with versioning * @param key Cache key * @param value Value to cache * @param namespace Namespace for versioning * @param ttl Time-to-live in milliseconds (optional) * @returns Promise resolving to true if successful */ set(key: string, value: T, namespace: string, ttl?: number): Promise; /** * Get a value from the cache with versioning * @param key Cache key * @param namespace Namespace for versioning * @returns Promise resolving to the cached value or undefined if not found */ get(key: string, namespace: string): Promise; /** * Invalidate all keys in a namespace by incrementing its version * @param namespace Namespace to invalidate * @returns Promise resolving to the new version */ invalidateNamespace(namespace: string): Promise; /** * Set a specific version for a namespace * @param namespace Namespace to set version for * @param version New version * @returns Promise resolving when completed */ setNamespaceVersion(namespace: string, version: string | number): Promise; /** * Get the current version for a namespace * @param namespace Namespace to get version for * @returns Promise resolving to the current version */ getVersion(namespace: string): Promise; /** * Get all version keys from the cache * @returns Promise resolving to array of version keys */ private getAllVersionKeys; /** * Get the namespace from a version key * @param versionKey Version key * @returns Namespace */ private getNamespaceFromVersionKey; /** * Get the cache key for a namespace version * @param namespace Namespace * @returns Version key */ private getVersionKey; /** * Get the versioned cache key * @param key Original key * @param namespace Namespace * @param version Version * @returns Versioned key */ private getVersionedKey; /** * Get the initial version for a new namespace * @returns Initial version */ private getInitialVersion; /** * Increment a version * @param version Current version * @returns Incremented version */ private incrementVersion; } //# sourceMappingURL=version-invalidator.d.ts.map