/** * Interface for cache storage backends * This abstracts the underlying storage mechanism (TTLCache, KV, Redis, etc.) */ export interface ICacheStorage { /** * Get a value from the cache * Returns undefined if not found or expired */ get(key: string): Promise; /** * Set a value in the cache * @param key Cache key * @param value Value to store * @param ttlMs Time-to-live in milliseconds (optional, uses default if not provided) */ set(key: string, value: V, ttlMs?: number): Promise; /** * Delete a value from the cache */ delete(key: string): Promise; /** * Clear all values from the cache (optional - not all implementations support this) */ clear?(): Promise; } /** * Configuration for creating cache storage instances */ export interface CacheStorageConfig { /** Default TTL in milliseconds */ ttlMs?: number; /** Maximum number of entries (for size-limited caches) */ maxSize?: number; /** Key postfix (for differentiating things like positive/negative entitlements) */ keyPostfix?: string; } /** * Factory function type for creating cache storage instances * This allows injection of different storage backends (memory, KV, etc.) * keys are unique per instantiation, and unique globally once `keyPostfix` is applied */ export type CreateStorageFn = (config: CacheStorageConfig) => ICacheStorage; //# sourceMappingURL=ICacheStorage.d.ts.map