/** * cache.ts — Body-content cache for `--inline` mode. * * Bodies live in `/.raw` (one file per content snapshot), * separate from the lockfile JSON which only tracks metadata. Keeping * bodies on disk (not in the lockfile) keeps the JSON small and makes * offline runs possible — once a body is cached, `--inline` can reuse * it without any network round trip. * * Default cache directory: `cache/` inside the `.doc-lok/` directory * that also holds `lock.json`. So the full layout is: * * .doc-lok/ * ├── lock.json * └── cache/ * ├── .raw original fetched body * ├── .md converted Markdown * └── .index.json section index * * Override with `--cache-dir ` (CLI) or `cacheDir` (library). */ import type { Section } from "./sections.js"; /** Resolve the cache directory, defaulting to `cache/` next to the lockfile (inside `.doc-lok/`). */ export declare function resolveCacheDir(lockfilePath: string, cacheDir?: string): string; /** Return the absolute path where the body for `sha` should be stored. */ export declare function bodyPath(cacheDir: string, sha: string): string; /** Atomically write a body to the cache. Returns the path written. */ export declare function writeBody(cacheDir: string, sha: string, body: string): Promise; /** Read a cached body. Returns `null` if the file does not exist. */ export declare function readBody(cacheDir: string, sha: string): Promise; /** Remove a cached body. Returns `true` if deleted, `false` if it didn't exist. */ export declare function removeBody(cacheDir: string, sha: string): Promise; /** Remove every file in the cache directory. Returns the count deleted. */ export declare function clearCache(cacheDir: string): Promise; /** Return the path to the converted-Markdown cache file for `sha`. */ export declare function markdownPath(cacheDir: string, sha: string): string; /** Write the converted Markdown for `sha` to the cache, atomically. */ export declare function writeMarkdown(cacheDir: string, sha: string, md: string): Promise; /** Read the cached converted Markdown for `sha`. `null` if absent. */ export declare function readMarkdown(cacheDir: string, sha: string): Promise; /** Return the path to the section-index cache file for `sha`. */ export declare function indexPath(cacheDir: string, sha: string): string; /** Atomically write the section index for `sha` to the cache. */ export declare function writeIndex(cacheDir: string, sha: string, sections: Section[]): Promise; /** Read the cached section index for `sha`. `null` if absent or malformed. */ export declare function readIndex(cacheDir: string, sha: string): Promise; //# sourceMappingURL=cache.d.ts.map