import { Doc } from "./docs.js"; interface SearchResult { doc: Doc; score: number; snippet: string; } /** Simple TF-IDF search engine — no external dependencies */ export declare class SearchEngine { private idfCache; private docTermFreqs; private totalDocs; private static STOP_WORDS; /** Lightweight synonym map for common gamedev query expansions */ private static QUERY_SYNONYMS; /** Lightweight stemmer — strips common English suffixes for better recall */ private stem; /** Tokenize text into lowercase terms, splitting hyphens and handling special tokens */ private tokenize; /** Build the index from a list of docs */ index(docs: Doc[]): void; /** Expand query tokens with synonyms (discounted weight) */ private expandWithSynonyms; /** Search docs, return sorted by relevance. Callers pass filtered doc * subsets, so results are computed fresh each call — a sub-millisecond * scan; a query-keyed cache here once leaked results across filters. */ search(query: string, docs: Doc[], limit?: number): SearchResult[]; /** Extract a relevant snippet containing query terms */ private extractSnippet; } export {};