import { Filter } from './Filter'; import { Condition } from './Condition'; import { Operator } from './Operator'; import { FailCallback, Query, ResultOptions, ResultListCallback, SingleResultCallback, CountCallback } from './Query'; import type { Entity } from '../binding'; import { Node } from './Node'; /** * The Query Builder allows creating filtered and combined queries */ export interface Builder extends Query, Condition { } export declare class Builder extends Query { /** * Joins the conditions by an logical AND * @param args The query nodes to join * @return Returns a new query which joins the given queries by a logical AND */ and(...args: Array | Query[]>): Operator; /** * Joins the conditions by an logical OR * @param args The query nodes to join * @return Returns a new query which joins the given queries by a logical OR */ or(...args: Array | Query[]>): Operator; /** * Joins the conditions by an logical NOR * @param args The query nodes to join * @return Returns a new query which joins the given queries by a logical NOR */ nor(...args: Array | Query[]>): Operator; /** * @inheritDoc */ resultList(options?: ResultOptions | ResultListCallback, doneCallback?: ResultListCallback | FailCallback, failCallback?: FailCallback): Promise; /** * @inheritDoc */ singleResult(options?: ResultOptions | SingleResultCallback, doneCallback?: SingleResultCallback | FailCallback, failCallback?: FailCallback): Promise; /** * @inheritDoc */ count(doneCallback?: CountCallback, failCallback?: FailCallback): Promise; addOperator(operator: string, args: Node[]): Operator; addOrder(fieldOrSort: string | { [field: string]: 1 | -1; }, order?: 1 | -1): Filter; addFilter(field: string | null, filter: string | null, value: any): Filter; addOffset(offset: number): Filter; addLimit(limit: number): Filter; }