/** * Fast Code Search Engine * Uses ripgrep (rg) for blazing fast search, falls back to grep * Handles codebases of any size efficiently */ /** * Interface representing a single search result match. */ export interface SearchResult { file: string; line: number; column?: number; text: string; before?: string[]; after?: string[]; } /** * Configuration options for code search. */ export interface SearchOptions { cwd: string; pattern: string; /** * Glob pattern to filter files (e.g. "*.ts"). */ fileGlob?: string; isRegex?: boolean; caseSensitive?: boolean; wholeWord?: boolean; maxResults?: number; /** * Number of context lines to include before and after the match. */ contextLines?: number; includeHidden?: boolean; excludeDirs?: string[]; } /** * Resets the cached availability of ripgrep. * Intended for testing purposes only. */ export declare function resetRgAvailability(): void; /** * Primary search function that delegates to ripgrep if available, otherwise falls back to grep. * * @param opts - The search options including pattern, cwd, and filters. * @returns A promise resolving to an array of search results. */ export declare function searchCode(opts: SearchOptions): Promise; /** * Options for file listing. */ export interface ListOptions { glob?: string; maxDepth?: number; excludeDirs?: string[]; type?: 'file' | 'dir' | 'all'; } /** * Lists files in a directory using 'fd' or 'find'. * * @param cwd - Directory to search in. * @param options - Filtering options. * @returns List of file paths relative to cwd. */ export declare function listFiles(cwd: string, options?: ListOptions): Promise; /** * Counts the number of lines in a file efficiently using 'wc -l'. * * @param filePath - Path to the file. * @returns Number of lines. */ export declare function countLines(filePath: string): Promise; /** * Result of reading a file range. */ export interface ReadFileResult { content: string; totalLines: number; } /** * Reads a specific range of lines from a file. * * @param filePath - Path to the file. * @param startLine - 1-based start line. * @param endLine - 1-based end line (inclusive). * @returns Content and total line count. */ export declare function readFileRange(filePath: string, startLine?: number, endLine?: number): Promise; //# sourceMappingURL=fast-search.d.ts.map