/** * Scan-mode full-text search — ranks **already-decrypted** records by * BM25 against a tokenized query. Pure client-side: nothing is written to the * store, so this adds **zero** leakage (unlike a store-usable blind index, * which is a separate, gated opt-in). * * O(n) over the collection; intended for small/medium collections (the pilot's * scale) where moving the existing userland scan into the DB is the win. */ import { type Tokenizer } from './tokenize.js'; export interface SearchOptions { /** Top-N by score (default: all matches). */ readonly limit?: number; /** `'any'` (default) = OR of query terms; `'all'` = every term must match. */ readonly match?: 'any' | 'all'; /** Treat the LAST query term as a prefix (typeahead). */ readonly prefix?: boolean; } export interface SearchResult { readonly id: string; readonly score: number; readonly record: T; } export interface SearchEntry { readonly id: string; readonly record: T; } export declare function searchScan(entries: ReadonlyArray>, field: string, query: string, opts?: SearchOptions, tokenizer?: Tokenizer): SearchResult[];