/** * Code Index Service * Main service functions for managing the function index using LokiJS + FlexSearch */ import { FunctionMetadata, EnhancedFunctionMetadata, SearchOptions, RegisterResult, SearchResult, IndexStats } from './types.js'; import { CodeIndexDB } from './codeIndexDB.js'; export declare class CodeIndexError extends Error { code: string; constructor(message: string, code: string); } export declare class ValidationError extends CodeIndexError { constructor(message: string); } export declare class DatabaseError extends CodeIndexError { constructor(message: string); } export declare class SearchError extends CodeIndexError { constructor(message: string); } /** * Initialize database with schema. * Default (no path): same on-disk singleton as CodeIndexDB.getInstance() / MCP. * Explicit file path: separate DB instance (tests or advanced use). */ export declare function initializeCodeIndex(dbPath?: string): Promise; /** * Primary entry: persisted singleton (or explicit path via initializeCodeIndex elsewhere). * Aligns search/sync/register with MCP's CodeIndexDB.getInstance() — previously defaulted to :memory:. */ export declare function getDatabase(): Promise; /** * Validate function metadata */ export declare function validateFunctionMetadata(func: any): string | null; /** * Register functions in the index */ export declare function registerFunctions(functions: FunctionMetadata[], options?: { overwrite?: boolean; }): Promise; /** * Search functions with full-text search */ export declare function searchFunctions(searchOptions: SearchOptions): Promise; /** * Synchronize file index - ensures index matches current file state */ export declare function syncFileIndex(filePath: string, currentFunctions: FunctionMetadata[]): Promise<{ added: number; updated: number; removed: number; }>; /** * Find a specific function definition */ export declare function findDefinition(name: string, filePath?: string): Promise; /** * Get index statistics */ export declare function getIndexStats(): Promise; /** * Clear analysis-derived index data (functions, search, audits, code maps, schemas). * Does not remove project tasks, analyzer configs, or whitelist entries. */ export declare function clearIndex(): Promise; /** * Close the database connection */ export declare function closeDatabase(): Promise; /** * Update dependency graph for all functions or specific file */ export declare function updateDependencyGraph(filePath?: string): Promise; /** * Get transitive dependencies for a function */ export declare function getTransitiveDependencies(functionName: string, maxDepth?: number): Promise>; /** * Get transitive callers for a function */ export declare function getTransitiveCallers(functionName: string, maxDepth?: number): Promise>; /** * Detect circular dependencies in the codebase */ export declare function detectCircularDependencies(): Promise>; /** * Calculate dependency depths for all functions */ export declare function calculateDependencyDepths(): Promise; /** * Get all functions from the index */ export declare function getAllFunctions(): Promise; //# sourceMappingURL=codeIndexService.d.ts.map