/** * Exact Search Use Case * * Orchestrates grep-like exact text search across source files. * This use case coordinates filesystem access and the simple search service. */ import type { FileSystem } from "../ports"; import type { ExactMatchResults } from "../entities"; /** * Options for exact search operation. */ export interface ExactSearchOptions { /** Root directory to search in */ rootDir: string; /** The literal string to search for */ literal: string; /** Optional path filter patterns */ pathFilter?: string[]; /** Maximum number of files to return */ maxFiles?: number; /** Maximum occurrences per file */ maxOccurrencesPerFile?: number; /** Case-insensitive matching */ caseInsensitive?: boolean; } /** * Check if a file path matches any of the given filters. * * Supports two modes: * - Glob patterns: Contains wildcards like *, ?, etc. * - Path prefixes: Plain directory paths * * @param relativePath - File path relative to root * @param filters - Array of filters (glob patterns or path prefixes) * @param matchFn - Function to test glob patterns (e.g., minimatch) * @returns true if the path matches any filter */ export declare function matchesPathFilter(relativePath: string, filters: string[], matchFn: (path: string, pattern: string) => boolean): boolean; /** * Execute exact search across the codebase. * * This use case: * 1. Walks the filesystem to find searchable files * 2. Filters files based on path patterns * 3. Uses the simple search service to find exact matches * 4. Returns results sorted by match count * * @param fs - FileSystem implementation (injected dependency) * @param options - Search options * @param matchFn - Glob pattern matching function (e.g., minimatch) * @returns Exact match results */ export declare function executeExactSearch(fs: FileSystem, options: ExactSearchOptions, matchFn: (path: string, pattern: string) => boolean): Promise;