/** * Cache Storage Layer * * Low-level cache storage with integrity protection using SHA-256 checksums. * Handles reading/writing cache files and validating their integrity. */ import type { CacheConfig, CacheEntryMeta, CacheEntryName, CacheLoadResult, CacheManifest } from './types.js'; /** * Cache storage class */ export declare class CacheStorage { private config; private manifest; private manifestLoaded; constructor(config?: Partial); /** * Ensure the cache directory exists */ ensureCacheDir(): Promise; /** * Load the cache manifest */ loadManifest(): Promise; /** * Save the cache manifest */ private saveManifest; /** * Create an empty manifest */ private createEmptyManifest; /** * Read a cache entry with integrity validation */ read(entryName: CacheEntryName, ttlMs: number): Promise>; /** * Write a cache entry with checksum */ write(entryName: CacheEntryName, data: T, ttlMs: number, formatVersion?: string): Promise; /** * Delete a cache entry */ delete(entryName: CacheEntryName): Promise; /** * Clear all cache entries */ clear(): Promise; /** * Get cache entry metadata */ getMeta(entryName: CacheEntryName): Promise; /** * Check if a cache entry exists and is fresh */ isFresh(entryName: CacheEntryName, ttlMs: number): Promise; /** * Get cache statistics */ getStats(): Promise<{ entryCount: number; entries: Array<{ name: string; updatedAt: string; ageMs: number; isFresh: boolean; ttlMs: number; }>; }>; } /** * Get or create the global cache storage instance */ export declare function getCacheStorage(config?: Partial): CacheStorage; /** * Reset the global cache storage (mainly for testing) */ export declare function resetCacheStorage(): void; //# sourceMappingURL=storage.d.ts.map