export interface CacheConfig { enabled: boolean; cacheDir: string; ttlMs?: number; } export interface CacheEntry { version: string; timestamp: number; ttlMs: number; keyHash: string; keyComponents: { diffHash: string; model: string; qaatlasVersion: string; configHash: string; }; data: T; } export interface CacheKeyInput { diffContent: string; model: string; qaatlasVersion: string; configOptions: Record; } /** * Generate a SHA-256 hash of the input string */ export declare function hashString(input: string): string; /** * Generate a cache key from input components */ export declare function generateCacheKey(input: CacheKeyInput): string; /** * Get detailed cache key components for debugging/display */ export declare function getCacheKeyComponents(input: CacheKeyInput): CacheEntry['keyComponents']; /** * Ensure the cache directory exists */ export declare function ensureCacheDir(cacheDir: string): void; /** * Get the path for a cache entry */ export declare function getCachePath(cacheDir: string, keyHash: string): string; /** * Check if a cache entry exists and is valid */ export declare function isCacheValid(entry: CacheEntry | null, ttlMs?: number): boolean; /** * Read a cache entry from disk */ export declare function readCacheEntry(cacheDir: string, keyHash: string): CacheEntry | null; /** * Write a cache entry to disk */ export declare function writeCacheEntry(cacheDir: string, keyHash: string, data: T, keyComponents: CacheEntry['keyComponents'], ttlMs?: number): void; /** * Delete a specific cache entry */ export declare function deleteCacheEntry(cacheDir: string, keyHash: string): boolean; /** * Clear all cache entries */ export declare function clearCache(cacheDir: string): { deleted: number; failed: number; }; /** * Get cache statistics */ export declare function getCacheStats(cacheDir: string): { entries: number; totalSizeBytes: number; oldestTimestamp: number | null; newestTimestamp: number | null; }; /** * Clean up expired cache entries */ export declare function cleanExpiredEntries(cacheDir: string, ttlMs?: number): number; /** * High-level cache interface for the analyzer */ export declare class AnalysisCache { private config; constructor(config?: Partial); get enabled(): boolean; get cacheDir(): string; /** * Try to get a cached result */ get(input: CacheKeyInput): T | null; /** * Store a result in the cache */ set(input: CacheKeyInput, data: T): void; /** * Clear all cached results */ clear(): { deleted: number; failed: number; }; /** * Get cache statistics */ stats(): ReturnType; /** * Clean up expired entries */ cleanup(): number; } export default AnalysisCache; //# sourceMappingURL=cache.d.ts.map