import { DocumentSnapshot, QueryDocumentSnapshot } from './document'; import EcomClient from '../index'; export declare abstract class DocumentReference { protected _ecom: EcomClient; private _id; private _parent; /** * @hideconstructor */ constructor(ecom: EcomClient, id: string, parent: CollectionReference); readonly id: string; readonly parent: CollectionReference; abstract get(): Promise; abstract delete(): Promise; } export declare class Query { protected readonly _ecom: EcomClient; /** * @hideconstructor */ constructor(_ecom: EcomClient); readonly ecom: EcomClient; /** * Returns a new Query that constrains the value of a Document property. */ where(field: string, opStr: string, value: unknown): Query; /** * Executes the query and returns the results as a * [QuerySnapshot]{@link QuerySnapshot}. * * @returns {Promise.} A Promise that resolves with the results * of the Query. */ get(): Promise; } /** * @class * @extends Query */ export declare abstract class CollectionReference extends Query { private _parent; /** * @hideconstructor * * @param ecom The Ecom client. */ constructor(ecom: EcomClient, parent: DocumentReference | null); /** * A reference to the containing DocumentReference if this is a * subcollection. If this isn't a subcollection, the reference * is null. * * @readonly */ readonly parent: DocumentReference | null; abstract doc(id: string): DocumentReference; abstract add(data: any): Promise; abstract get(): Promise; } /** * A QuerySnapshot contains zero or more DocumentSnapshot objects representing * the results of a query. The documents can be accessed as an array via the * docs property or enumerated using the forEach method. The number of * documents can be determined via the empty and size properties. */ export declare class QuerySnapshot { protected readonly _query: Query; private _docs; constructor(_query: Query, _docs: QueryDocumentSnapshot[]); /** * @readonly */ readonly docs: QueryDocumentSnapshot[]; /** * Enumerates all of the documents in the QuerySnapshot. * @param {function} callback */ forEach(callback: (qds: QueryDocumentSnapshot) => void): void; [Symbol.iterator](): { next: () => { value: QueryDocumentSnapshot; done: boolean; }; }; }