/** * Path mapping utilities for DocShell * * Handles mapping between original document paths and view cache paths */ /** * Generate a view ID based on search context * View ID should be stable for repeated runs in same context */ export declare function generateViewId(cwd: string, searchRoots: string[], configSig: string): string; /** * Convert original document path to view path * For original file `relative/path/foo.docx`, view path: * `views//relative/path/foo.docx.txt` * * If the file is outside baseDir, we hash the path to keep it within the view cache. */ export declare function originalToViewPath(originalPath: string, viewRoot: string, viewId: string, baseDir: string): string; /** * Convert view path back to original document path * Strips the viewRoot prefix and removes `.txt` suffix for doc types * * @param viewPath - The path to convert (from grep/rg output) * @param viewRoot - The full view root path (e.g., ~/.cache/docsh/views/) * @param baseDir - The original base directory being searched */ export declare function viewPathToOriginal(viewPath: string, viewRoot: string, baseDir: string): string; /** * Rewrite grep/rg output line to replace view paths with original paths * Handles formats: * - path:line:text * - path:text * - path (for -l/-L) * * @param line - The output line from grep/rg * @param viewRoot - The full view root path (e.g., ~/.cache/docsh/views/) * @param baseDir - The original base directory being searched */ export declare function rewriteOutputPath(line: string, viewRoot: string, baseDir: string): string; /** * Check if a file is a binary file based on extension */ export declare function isBinaryFile(filepath: string): boolean; /** * Check if a directory should be skipped */ export declare function isSkippedDir(dirName: string): boolean; /** * Check if a file should be skipped * - Office temp/lock files (~$...) * - macOS metadata files (._ prefix) */ export declare function isSkippedFile(fileName: string): boolean;