/** * Search Index Use Case * * Orchestrates searching the indexed codebase. */ import type { Config, SearchResult, SearchOptions } from '../entities'; import type { FileSystem } from '../ports'; import type { IndexModule, FileIndex } from '../../types'; /** * Options for the search use case */ export interface SearchIndexOptions extends SearchOptions { /** Callback for progress updates */ onProgress?: (message: string) => void; } /** * Dependencies required by this use case */ export interface SearchIndexDependencies { /** Filesystem abstraction */ fileSystem: FileSystem; /** Load configuration */ loadConfig: (rootDir: string) => Promise; /** Get indexed modules from global manifest */ getIndexedModules: (rootDir: string, config: Config) => Promise; /** Get module by ID */ getModule: (moduleId: string) => IndexModule | undefined; /** Initialize a module */ initializeModule: (module: IndexModule, config: Config) => Promise; /** Load file index */ loadFileIndex: (rootDir: string, moduleId: string, filepath: string, config: Config) => Promise; /** List indexed files for a module */ listIndexedFiles: (rootDir: string, moduleId: string, config: Config) => Promise; } /** * Search the indexed codebase. * * This use case: * 1. Loads configuration * 2. Finds modules that have indexes * 3. Searches each module * 4. Aggregates and ranks results */ export declare function searchIndex(rootDir: string, query: string, deps: SearchIndexDependencies, options?: SearchIndexOptions): Promise; /** * Format search results for display */ export declare function formatSearchResults(results: SearchResult[]): string;