import { Query as QueryOrig, QuerySnapshot as QuerySnapshotOrig, QueryConstraint } from "firebase/firestore"; import { Entity } from "."; import { IFieldMeta, _ICollection, _IQuery } from "./types"; import QuerySnapshot from "./QuerySnapshot"; /** * Firestorm representation of a query. Queries can be chained * together, as per the standard firestore SDK. * @typeparam T The entity for the query. */ export default class _Query implements _IQuery { private _Entity; private _collection; private _native; private _fields; /** * Create a collection query for an [[Entity]]. * @param Entity T The entity to represent. * @param collection The collection to query. * @param fields The list of field for the collection. * @param native The native firestore query. */ constructor(Entity: new () => T, collection: _ICollection, fields: Map, native: QueryOrig); get native(): QueryOrig; /** * Attaches a listener to the query. * @param onNext Callback which is called when new snapshot is available. * @param onError Callback which is called when an error occurs. * @returns An unsubscribe function. */ /** * Appends a query to the current query. * @param query The query to append. */ appendNativeQuery(query: QueryOrig): _Query; /** * Creates a firestorm snapshot from the firestore snapshot. * @param nativeSnapshot The native query document snapshot. */ buildSnapshot(nativeSnapshot: QuerySnapshotOrig): QuerySnapshot; } export declare const _getDocs: (query: _IQuery) => Promise>; export declare const _onSnapshotDocs: (query: _Query, onNext: (snapshot: QuerySnapshot) => void, onError?: ((error: Error) => void) | undefined) => (() => void); export declare function _query(query_: _IQuery, ...queryConstraints: QueryConstraint[]): _Query; export declare function _query(query_: _ICollection): _Query;