import type { ModuleRecord, Finding, AnalysisReport } from "./types.js"; export interface CacheEntry { hash: string; moduleRecord: ModuleRecord; findings?: Finding[]; isReachable?: boolean; timestamp: number; /** Compact per-file analysis summary for tooling and diagnostics. */ result?: Array<{ line?: number; rule: string; message: string; }>; } export interface AnalysisCache { version: string; /** Core package version that produced this cache. */ coreVersion?: string; /** Versions of the enabled plugins that produced this cache. */ pluginVersions?: Record; entries: Record; /** Fingerprint of options that affect analysis output. */ analysisKey?: string; /** SHA-256 fingerprints for every discovered source file. */ fileHashes?: Record; /** Cheap filesystem metadata used to avoid rereading unchanged files. */ fileStats?: Record; /** Complete report, stored compactly enough for fast unchanged reruns. */ report?: AnalysisReport; } export declare function getFileHash(content: string): string; export declare function loadCache(rootDir: string): AnalysisCache; export declare function saveCache(rootDir: string, cache: AnalysisCache): void; /** * Exports the current cache to a standalone JSON file, * suitable for uploading to a remote storage or CI cache. */ export declare function exportCache(rootDir: string, targetPath: string): Promise; /** * Imports a cache from an external JSON file into the local .optiprune directory. */ export declare function importCache(rootDir: string, sourcePath: string): Promise; export declare function isCacheValid(entry: CacheEntry, currentContent: string): boolean;