import { FilterAst, FilterScalar } from "./shared/ast.mjs"; import { FieldRange, IndexCondition, IndexExpansion, NativeRange, QueryIndex } from "./filters.mjs"; import { GroupSelection, RelationMetadata, RelationRegistryIdentity, SelectionMask, getRelationExecutor } from "../relations.mjs"; import { GenericSchema, SchemaDefinition } from "convex/server"; import { z } from "zod"; import { Value } from "convex/values"; //#region src/querying/planner.d.ts interface SelectionTree { [name: string]: true | SelectionTree; } interface GroupTree { relations: Record; } /** What one cursor binding can depend on: a root, the path to its table and what it reads there. */ export interface RegistryScope { readonly root: string; readonly path: readonly string[]; readonly selection: SelectionTree; readonly groups: GroupTree; readonly filters: readonly FilterAst[]; } export type QueryInput = z.input['pagination']>>; export type StoredConstraint = NonNullable; export declare function createPlanner(schema: SchemaDefinition, relations: RelationRegistryIdentity): { metadata: RelationMetadata; select: (table: string, selection: SelectionMask) => void; groups: (table: string, groups: GroupSelection) => GroupSelection; validateDocument: (table: string, row: Record) => void; streamSchema: SchemaDefinition; registryVersion: (scope: RegistryScope) => Promise; beforeLeaf(table: string): void; complete(table: string, document: Record, permitted: boolean, residual: FilterAst, groups?: readonly string[]): any; plan(table: string, input: QueryInput, conditions: readonly IndexCondition[], constraints: readonly StoredConstraint[], ordering?: string, traversal?: 'root' | 'relation'): { 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; }[]; args: { cursor: string | null; endCursor?: string | null | undefined; id?: number | undefined; onEmptyBudget?: "split" | undefined; numItems: number; maximumRowsRead?: number | undefined; maximumBytesRead?: number | undefined; filters?: unknown; order?: "asc" | "desc" | undefined; }; clientIdentity: Value; serverIdentity: Value; }; }; export declare function scalarMatches(ast: FilterAst, document: Record): boolean; /** Lowercase hex SHA-256 of the UTF-8 text. */ export declare function digest(text: string): Promise; //#endregion //# sourceMappingURL=planner.d.mts.map