UNPKG

baqend

Version:

Baqend JavaScript SDK

44 lines (43 loc) 1.42 kB
import { Entity } from '../binding'; import { CountCallback, FailCallback, Query, ResultListCallback, ResultOptions, SingleResultCallback } from './Query'; /** * A Query Node saves the state of the query being built */ export declare class Node<T extends Entity> extends Query<T> { /** * The offset how many results should be skipped */ firstResult: number; /** * The limit how many objects should be returned * @type number * @readonly */ maxResults: number; /** * The properties which should be used sort the result */ order: { [field: string]: 1 | -1; }; /** * @inheritDoc */ resultList(options?: ResultOptions | ResultListCallback<T>, doneCallback?: ResultListCallback<T> | FailCallback, failCallback?: FailCallback): Promise<T[]>; /** * @inheritDoc */ singleResult(options?: ResultOptions | SingleResultCallback<T>, doneCallback?: SingleResultCallback<T> | FailCallback, failCallback?: FailCallback): Promise<T | null>; /** * @inheritDoc */ count(doneCallback?: CountCallback, failCallback?: FailCallback): Promise<any>; private serializeQuery; private serializeSort; private createResultList; addOrder(fieldOrSort: string | { [field: string]: 1 | -1; }, order?: 1 | -1): this; addOffset(offset: number): this; addLimit(limit: number): this; }