/** * JSON-file persistent index for codebase data. * Fallback for environments where better-sqlite3 can't compile. * Stores indexed symbols, files, and imports for fast repeated queries. */ interface IndexedFile { path: string; mtime: number; lines: number; language: string; size: number; } interface IndexedSymbol { name: string; /** Symbol kind: function, class, interface, etc. */ type: string; file: string; line: number; exported: boolean; } /** * JSON-file backed persistent index for codebase data. */ export declare class JsonStore { private indexPath; private index; private dirty; /** * Create a new JsonStore instance. * @param cwd - The working directory for the index file. */ constructor(cwd: string); /** * Load index from disk. Returns false if no index exists. * @returns True if the index was loaded successfully. */ load(): Promise; /** * Save index to disk. */ save(): Promise; /** * Initialize a new empty index. * @param cwd - The working directory for the index. */ init(cwd: string): void; /** * Check if a file needs re-indexing (mtime changed). * @param filePath - The file path to check. * @returns True if the file needs re-indexing. */ needsReindex(filePath: string): Promise; /** * Update file entry in index. * @param file - The file entry to update. */ updateFile(file: IndexedFile): void; /** * Update symbols for a file. * @param filePath - The file path whose symbols are being updated. * @param symbols - The new symbols for the file. */ updateSymbols(filePath: string, symbols: IndexedSymbol[]): void; /** * Update imports for a file. * @param filePath - The file path whose imports are being updated. * @param imports - The new import paths for the file. */ updateImports(filePath: string, imports: string[]): void; /** * Query symbols by name pattern. * @param pattern - Regex pattern to match symbol names. * @param type - Optional symbol type filter. * @returns Matching symbols. */ findSymbols(pattern: string, type?: string): IndexedSymbol[]; /** * Get all files in index. * @returns All indexed files. */ getFiles(): IndexedFile[]; /** * Get imports for a file. * @param filePath - The file path to look up. * @returns The import paths for the file. */ getImports(filePath: string): string[]; /** * Get importers of a file (reverse lookup). * @param filePath - The file path to find importers for. * @returns Files that import the given file. */ getImporters(filePath: string): string[]; /** * Remove a file from the index. * @param filePath - The file path to remove. */ removeFile(filePath: string): void; /** * Get index stats. * @returns Stats object or null if no index loaded. */ stats(): { files: number; symbols: number; imports: number; updated: string; } | null; } export {}; //# sourceMappingURL=json-store.d.ts.map