import { type SearchableResourceRegistration } from "./registry.js"; export type SearchIndexNotReadyReason = "capture-missing" | "rebuilding" | "backlog" | "failed-changes" | "outdated-registration" | "unavailable"; export interface SearchIndexStatus { ready: boolean; reason?: SearchIndexNotReadyReason; } /** Forgets per-process memos. Tests use it between databases. */ export declare function resetSearchIndexRuntime(): void; /** * Drains pending changes for one registration until `deadline` and reports * whether the index is complete and current, meaning a search can trust it. * Concurrent calls in one process share a single drain, which finishes the * batch it is on before stopping. */ export declare function drainSearchIndex(registration: SearchableResourceRegistration, deadline: number): Promise; /** * Call before searching. Reports whether the index can answer: it reflects * every change committed before this call and was built by this * registration's version. When changes are pending, it spends up to the * budget indexing them, and answers by then either way. When the index can't * answer (first build, a backlog, a change that keeps failing, missing * capture, a newer deploy), use the app's fallback search for this request. * * `budgetMs` defaults to `runtime.searchDrainBudgetMs`. Zero indexes nothing * here and leaves pending changes to the drains that follow writes and the * recurring sweep. */ export declare function prepareSearchIndex(registration: SearchableResourceRegistration, options?: { budgetMs?: number; }): Promise; /** Drains every registration, in turn, until `deadline`. */ export declare function drainAllSearchIndexes(deadline: number): Promise;