/** * Context extraction for search matches */ import type { SearchMatch } from './types.js'; /** * Extract context around a match with smart boundaries * * @param text - Full text content * @param matchIndex - Index of the line/position where match occurs * @param queryTerms - Query terms to highlight * @param contextLength - Characters before/after (default: 80) * @returns Context text with match highlighted */ export declare function extractContext(text: string, matchIndex: number, queryTerms: string[], contextLength?: number): { text: string; highlights: Array<[number, number]>; }; /** * Extract context with sentence boundaries * * @param text - Full text content * @param matchIndex - Index where match occurs * @param queryTerms - Query terms to highlight * @param contextLength - Target characters before/after * @returns Context text respecting sentence boundaries */ export declare function extractSmartContext(text: string, matchIndex: number, queryTerms: string[], contextLength?: number): { text: string; highlights: Array<[number, number]>; }; /** * Deduplicate nearby matches * * If matches are within a certain distance, keep only the best scoring one. * * @param matches - All matches for a spec * @param minDistance - Minimum line distance between matches (default: 3) * @returns Deduplicated matches */ export declare function deduplicateMatches(matches: SearchMatch[], minDistance?: number): SearchMatch[]; /** * Limit matches per spec * * @param matches - All matches * @param maxMatches - Maximum matches to keep (default: 5) * @returns Limited matches (best scoring) */ export declare function limitMatches(matches: SearchMatch[], maxMatches?: number): SearchMatch[]; //# sourceMappingURL=context.d.ts.map