export interface InstalledNpmPackage {
    installedVersion: string;
    installedAt: string;
}
export interface InstalledBrowser {
    installedVersion: string;
    installedAt: string;
    latestKnownVersion?: string;
    latestCheckedAt?: string;
}
export interface InstalledRecord {
    npmPackages: Record<string, InstalledNpmPackage>;
    browsers: Record<string, InstalledBrowser>;
}
export interface CacheDirContext {
    cacheDir?: string;
}
/**
 * Resolve the cache root, honoring DOC_DETECTIVE_CACHE_DIR > config.cacheDir
 * > <os.tmpdir()>/doc-detective. The directory is created if missing — every
 * downstream helper depends on it existing, and lazy-mkdir at first read is
 * the single chokepoint that lets us avoid sprinkling existsSync/mkdirSync
 * across the codebase.
 */
export declare function getCacheDir(ctx?: CacheDirContext): string;
export declare function assertSafeRuntimePath(p: string, label: string): void;
export declare function getRuntimeDir(ctx?: CacheDirContext): string;
export declare function getBrowsersDir(ctx?: CacheDirContext): string;
export declare function getInstalledRecordPath(ctx?: CacheDirContext): string;
/**
 * Reads the installed-asset record. Returns an empty record when:
 *   - the file is missing (wipe-on-reboot, first run)
 *   - the file is unparseable (interrupted write, hand-corruption)
 *
 * Never throws. The lazy resolver treats "empty record" as "install
 * everything you need," which is the safe degradation.
 */
export declare function readInstalledRecord(ctx?: CacheDirContext): InstalledRecord;
/**
 * Atomically write the installed record. Write-to-tmp + rename ensures the
 * file is never observed half-written by a concurrent reader (e.g., another
 * `doc-detective install …` invocation racing on the same cache).
 */
export declare function writeInstalledRecord(record: InstalledRecord, ctx?: CacheDirContext): void;
//# sourceMappingURL=cacheDir.d.ts.map