/** * View cache for DocShell * * Directory tree of converted text files arranged to preserve * relative paths for grep/rg * * Layout: * views//relative/path/foo.docx.txt - converted doc * views//relative/path/foo.txt -> symlink to original text file */ import type { DocShellConfig } from '../types/index.js'; export interface ViewCacheStats { totalFiles: number; docFiles: number; textFiles: number; convertedCount: number; cachedCount: number; skippedCount: number; } export declare class ViewCache { private cacheDir; private viewsDir; private viewId; private viewRoot; private baseDir; private blobCache; private config; constructor(config: DocShellConfig, baseDir: string, searchRoots: string[]); /** * Get the view root directory */ getViewRoot(): string; /** * Get the view ID */ getViewId(): string; /** * Get the base directory */ getBaseDir(): string; /** * Ensure view directory exists */ ensureDirs(): void; /** * Build or update the view cache for given paths */ buildView(searchPaths: string[]): Promise; /** * Collect all files from search paths */ private collectFiles; /** * Recursively collect files from a directory */ private collectFilesFromDir; /** * Process a document file - convert and cache */ private processDocFile; /** * Process a text file - copy to view * (We use copy instead of symlink for better grep/rg compatibility) */ private processTextFile; /** * Write converted text to view file */ private writeViewFile; /** * Clear the view cache */ clear(): void; }