import { FilterAst, FilterScalar } from "./shared/ast.mjs"; import { FieldRange, IndexExpansion, NativeRange, QueryIndex } from "./filters.mjs"; import { EnginePaginationResult } from "../zod-table.mjs"; import { SearchIndexMetadata } from "../relations.mjs"; import { ManagedReadRequest } from "./security.mjs"; import { QueryInput, StoredConstraint, createPlanner } from "./planner.mjs"; import { CursorBinding, createCursorCodec } from "./cursors.mjs"; import { GenericDataModel, GenericDocument } from "convex/server"; import { Value } from "convex/values"; //#region src/querying/search.d.ts export type SearchErrorCode = 'SEARCH_TEXT_REQUIRED' | 'SEARCH_END_CURSOR_UNSUPPORTED' | 'SEARCH_ORDER_UNSUPPORTED' | 'SEARCH_RELATION_UNSUPPORTED' | 'SEARCH_OPTIONS_UNSUPPORTED' | 'SEARCH_PROTOCOL_UNSUPPORTED'; export declare class SearchError extends Error { readonly code: SearchErrorCode; constructor(code: SearchErrorCode); } export type SearchPaginationResult = Omit, 'splitCursor' | 'pageStatus'> & { paginationMode: 'native-search'; splitCursor: null; pageStatus: null; }; export interface SearchInput { numItems: number; cursor: string | null; id?: number; scanLimit?: number; filters?: QueryInput['filters']; } /** Search compilation deliberately supplies no browse indexes or expansion directives. */ export declare function planSearch(planner: ReturnType, table: string, index: string, text: string, input: SearchInput, constraints: readonly StoredConstraint[]): { plan: { expansion: IndexExpansion | null; sets: ReadonlyMap; residual: FilterAst; bindings: ReadonlyMap; ranges: ReadonlyMap; range: NativeRange | null; unsatisfiable: boolean; index: QueryIndex | null; prefix: readonly { field: string; value: FilterScalar; }[]; clientIdentity: Value; serverIdentity: Value; args: { cursor: string | null; endCursor?: string | null | undefined; id?: number | undefined; onEmptyBudget?: "split" | undefined; maximumRowsRead?: number | undefined; maximumBytesRead?: number | undefined; filters?: unknown; order?: "asc" | "desc" | undefined; numItems: number; }; }; text: string; metadata: SearchIndexMetadata; scanLimit: number | undefined; equalities: { field: string; value: string | number | bigint | boolean; }[]; }; type SearchPlan = ReturnType; /** One complete native window. No result token is minted until all descendants finish. */ export declare function executeSearch(request: ManagedReadRequest, table: string, search: SearchPlan, codec: ReturnType, binding: CursorBinding, maxPageSize: number, complete: (document: GenericDocument) => Promise | null>): Promise>>; //#endregion //# sourceMappingURL=search.d.mts.map