/** * Symbolic Index Storage * * Manages the keyword-based index for fast file filtering. * Handles file I/O for persisting index data. * * Structure: * .raggrep/index//symbolic/ * ├── _meta.json (BM25 statistics + serialized BM25 data) * └── .json (per-file summaries) */ import type { FileSummary } from "../../domain/entities"; /** * Symbolic Index Manager * * Manages the keyword-based index for fast file filtering. * Supports incremental updates to avoid full rebuilds. */ export declare class SymbolicIndex { private meta; private fileSummaries; private bm25Index; private symbolicPath; private moduleId; constructor(indexDir: string, moduleId: string); /** * Initialize or load the symbolic index */ initialize(): Promise; /** * Add or update a file summary (for batch operations, use with buildBM25Index) */ addFile(summary: FileSummary): void; /** * Add or update a file summary with incremental BM25 update. * Use this for incremental indexing instead of addFile + buildBM25Index. */ addFileIncremental(summary: FileSummary): void; /** * Remove a file from the index (for batch operations) */ removeFile(filepath: string): boolean; /** * Remove a file from the index with incremental BM25 update. * Use this for incremental indexing. */ removeFileIncremental(filepath: string): boolean; /** * Get tokens for a file summary (for BM25 indexing) */ private getTokensForSummary; /** * Build BM25 index from file summaries (full rebuild) */ buildBM25Index(): void; /** * Find candidate files using BM25 keyword search */ findCandidates(query: string, maxCandidates?: number): string[]; /** * Get all file paths in the index */ getAllFiles(): string[]; /** * Get summary for a specific file */ getFileSummary(filepath: string): FileSummary | undefined; /** * Save the index to disk (per-file structure with BM25 serialization) */ save(): Promise; /** * Save only the updated file summaries (for incremental saves) * @param filepaths - List of filepaths that were updated */ saveIncremental(filepaths: string[]): Promise; /** * Load the index from disk */ load(): Promise; /** * Recursively load file summaries from the symbolic directory */ private loadFileSummariesRecursive; /** * Get the path for a file summary */ private getFileSummaryPath; /** * Delete a file summary from disk */ deleteFileSummary(filepath: string): Promise; /** * Check if the index exists on disk */ exists(): Promise; /** * Get the number of indexed files */ get size(): number; /** * Clear the index */ clear(): void; } /** * Get the symbolic index path for a module */ export declare function getSymbolicPath(rootDir: string, moduleId: string, indexDir?: string): string;