import type { SearchResult, SymbolKind, SymbolLang } from './schema.js'; export interface WriterSearchFilter { kind?: SymbolKind | undefined; lang?: SymbolLang | undefined; file?: string | undefined; lspKind?: number | undefined; } export interface WriterSearchRow { id: number; lang: string; kind: string; name: string; file: string; line: number; col: number; signature: string; doc_comment: string; text?: string; score?: number; snippet?: string; } /** * Ceiling on how many LIKE candidates the FTS5-less ranked fallback pulls into * memory before scoring (WS-031). * * The fallback ranks with an in-process BM25 pass, so it needs more than the * caller's `limit` (≤100) to rank well — but it does not need the whole corpus. * Without a bound, a broad query on a large index materializes every matching * row as a JS object; this subsystem has a documented OOM history, and search * runs on the request path. * * Set far above any query a human would type, so ranking quality is unchanged * in practice: it bounds the pathological case, it does not shape normal ones. * `total` is reported from a SQL `COUNT(*)` rather than the truncated array, so * capping never makes the reported match count wrong. */ export declare const SEARCH_CANDIDATE_SCAN_CAP = 5000; export declare function normalizeSearchLimit(limit: number | undefined): number | undefined; /** * The symbol kinds a search may return. * * `undefined` — no kind constraint. `null` — the filter can match nothing (an * LSP kind with no internal equivalent, or a `kind` outside the `lspKind`'s * set). Otherwise the allowed kinds. `kind` and `lspKind` INTERSECT: the old * code let `lspKind` silently override an explicit `kind`. */ export declare function resolveKindFilter(filter: WriterSearchFilter | undefined): readonly SymbolKind[] | null | undefined; export declare function buildWriterSearchWhere(query: string, filter?: WriterSearchFilter | undefined): { where: string; values: unknown[]; } | null; export declare function mapWriterSearchRow(row: WriterSearchRow, lspKind: number | undefined, score?: number, snippet?: string): SearchResult; //# sourceMappingURL=writer-search-helpers.d.ts.map