import type { ReadonlyJSONValue } from '../../../shared/src/json.ts'; import type { AST, Condition, Parameter, SimpleOperator, System } from '../../../zero-protocol/src/ast.ts'; import type { Schema } from '../../../zero-schema/src/builder/schema-builder.ts'; import type { Format, ViewFactory } from '../ivm/view.ts'; import { type ExpressionFactory } from './expression.ts'; import type { CustomQueryID } from './named.ts'; import type { QueryDelegate } from './query-delegate.ts'; import { delegateSymbol, type ExistsOptions, type GetFilterType, type HumanReadable, type MaterializeOptions, type PreloadOptions, type PullRow, type Query, type QueryReturn, type QueryTable, type RunOptions } from './query.ts'; import { type TTL } from './ttl.ts'; import type { TypedView } from './typed-view.ts'; export type AnyQuery = Query; export declare function materialize(query: Q, delegate: QueryDelegate, factoryOrOptions?: ViewFactory, QueryReturn, T> | MaterializeOptions | undefined, maybeOptions?: MaterializeOptions | undefined): T | TypedView<{ [x: string]: any; }>; declare const astSymbol: unique symbol; export declare function ast(query: AnyQuery): AST; export declare function newQuery(delegate: QueryDelegate | undefined, schema: TSchema, table: TTable): Query; export declare function staticParam(anchorClass: 'authData' | 'preMutationRow', field: string | string[]): Parameter; export declare const SUBQ_PREFIX = "zsubq_"; export declare const defaultFormat: { readonly singular: false; readonly relationships: {}; }; export declare const newQuerySymbol: unique symbol; export declare abstract class AbstractQuery> implements Query { #private; protected readonly _delegate: QueryDelegate | undefined; readonly _ast: AST; readonly format: Format; readonly customQueryID: CustomQueryID | undefined; constructor(delegate: QueryDelegate | undefined, schema: TSchema, tableName: TTable, ast: AST, format: Format, system: System, customQueryID: CustomQueryID | undefined, currentJunction?: string | undefined); [delegateSymbol](delegate: QueryDelegate): Query; nameAndArgs(name: string, args: ReadonlyArray): Query; get [astSymbol](): AST; get ast(): AST; hash(): string; protected abstract [newQuerySymbol](delegate: QueryDelegate | undefined, schema: TSchema, table: TTable, ast: AST, format: Format, customQueryID: CustomQueryID | undefined, currentJunction: string | undefined): AbstractQuery; one: () => Query; whereExists: (relationship: string, cbOrOptions?: ((q: AnyQuery) => AnyQuery) | ExistsOptions | undefined, options?: ExistsOptions | undefined) => Query; related: (relationship: string, cb?: (q: AnyQuery) => AnyQuery) => AnyQuery; where: (fieldOrExpressionFactory: string | ExpressionFactory, opOrValue?: SimpleOperator | GetFilterType | Parameter, value?: GetFilterType | Parameter) => Query; start: (row: Partial>, opts?: { inclusive: boolean; } | undefined) => Query; limit: (limit: number) => Query; orderBy: (field: TSelector, direction: "asc" | "desc") => Query; protected _exists: (relationship: string, cb: ((query: AnyQuery) => AnyQuery) | undefined, options?: ExistsOptions | undefined) => Condition; protected _completeAst(): AST; abstract materialize(ttl?: TTL | undefined): TypedView>; abstract materialize(factory: ViewFactory, ttl?: TTL | undefined): T; abstract run(options?: RunOptions): Promise>; abstract preload(): { cleanup: () => void; complete: Promise; }; } declare const completedAstSymbol: unique symbol; export declare function completedAST(q: Query): AST; export declare class QueryImpl> extends AbstractQuery { #private; constructor(delegate: QueryDelegate | undefined, schema: TSchema, tableName: TTable, ast?: AST, format?: Format, system?: System, customQueryID?: CustomQueryID | undefined, currentJunction?: string | undefined); get [completedAstSymbol](): AST; protected [newQuerySymbol](delegate: QueryDelegate | undefined, schema: TSchema, tableName: TTable, ast: AST, format: Format, customQueryID: CustomQueryID | undefined, currentJunction: string | undefined): QueryImpl; materialize(factoryOrTTL?: ViewFactory | TTL, ttl?: TTL): T; run(options?: RunOptions): Promise>; preload(options?: PreloadOptions): { cleanup: () => void; complete: Promise; }; } export {}; //# sourceMappingURL=query-impl.d.ts.map