import * as firebase from "firebase"; import { EventEmitter, Observer } from "../util"; import { MockQueryDocumentSnapshot } from "./document-snapshot"; import { MockFirestore } from "./firestore"; import { MockQuerySnapshot } from "./query-snapshot"; declare type QueryFilter = (doc: MockQueryDocumentSnapshot, index: number, allDocs: MockQueryDocumentSnapshot[]) => boolean; declare type Ordering = { fieldPath: string; direction: "asc" | "desc"; }; export declare const QUERY_SNAPSHOT_NEXT_EVENT = "snapshot:next"; export declare const QUERY_SNAPSHOT_ERROR_EVENT = "snapshot:error"; export declare const QUERY_SNAPSHOT_COMPLETE_EVENT = "snapshot:complete"; export declare class MockQuery implements firebase.firestore.Query { readonly firestore: MockFirestore; readonly path: string; converter: firebase.firestore.FirestoreDataConverter; protected docsStartLimit?: number; protected docsEndLimit?: number; protected filters: Record; protected ordering?: Ordering; private noInitialSnapshot; protected get emitter(): EventEmitter; constructor(firestore: MockFirestore, path: string, converter: firebase.firestore.FirestoreDataConverter); emitChange(): Promise; setNoInitialSnapshot(): this; protected clone(): MockQuery; where(fieldPath: string | firebase.firestore.FieldPath, opStr: firebase.firestore.WhereFilterOp, value: any): firebase.firestore.Query; orderBy(fieldPath: string | firebase.firestore.FieldPath, direction?: "desc" | "asc"): firebase.firestore.Query; limit(limit: number): firebase.firestore.Query; limitToLast(limit: number): firebase.firestore.Query; startAt(snapshot: firebase.firestore.DocumentSnapshot): firebase.firestore.Query; startAt(...fieldValues: any[]): firebase.firestore.Query; startAfter(snapshot: firebase.firestore.DocumentSnapshot): firebase.firestore.Query; startAfter(...fieldValues: any[]): firebase.firestore.Query; private addStartFilter; endBefore(snapshot: firebase.firestore.DocumentSnapshot): firebase.firestore.Query; endBefore(...fieldValues: any[]): firebase.firestore.Query; endAt(snapshot: firebase.firestore.DocumentSnapshot): firebase.firestore.Query; endAt(...fieldValues: any[]): firebase.firestore.Query; private addEndFilter; isEqual(other: firebase.firestore.Query): boolean; private compareFunction; /** * Gets a list of doc keys that should be fetched by the #get() method. * Made protected so that the collection group implementation can override it. */ protected getCandidateDocKeys(): Set; get(options?: firebase.firestore.GetOptions): Promise>; onSnapshot(observer: Observer>): () => void; onSnapshot(options: firebase.firestore.SnapshotListenOptions, observer: Observer>): () => void; onSnapshot(onNext: (snapshot: firebase.firestore.QuerySnapshot) => void, onError?: ((error: Error) => void) | undefined, onCompletion?: (() => void) | undefined): () => void; onSnapshot(options: firebase.firestore.SnapshotListenOptions, onNext: (snapshot: firebase.firestore.QuerySnapshot) => void, onError?: ((error: Error) => void) | undefined, onCompletion?: (() => void) | undefined): () => void; withConverter(converter: firebase.firestore.FirestoreDataConverter): MockQuery; } export {};