import { CollectionReference } from "firebase/firestore"; import { ICollectionQuery, _ICollection, IDocumentRef, _IDocumentSnapshot } from "./types"; import Entity from "./Entity"; /** * Firestorm representation of a collection reference. * @typeparam T The entity for the collection documents. * @typeparam P The entity for the collection parent. */ export declare class CollectionClass//eslint-disable-next-line @typescript-eslint/indent implements _ICollection { /** * @hidden */ private _Entity; /** * @hidden */ private _native; /** * @hidden */ private _path; /** * @hidden */ private _parent; /** * Create a collection reference from an [[Entity]] and optional parent. * @param E The entity class for the collections documents. * @param parent The parent document for the collection. */ constructor(E: new () => T, parent?: IDocumentRef

); /** * The path to this collection. */ get path(): string; /** * The parent document reference for the collection. */ get parent(): IDocumentRef

| null; /** * The native firestore collection reference. */ get native(): CollectionReference; get entity(): new () => T; /** * @hidden * Creates the path to the collection. */ private buildPath; /** * @hidden * Creates the native firestore reference. */ private buildNative; } declare const _default: (model: new () => T, parent?: IDocumentRef

| undefined) => _ICollection; /** * Collection factory * @returns A collection reference. */ export default _default; export declare const _doc: (col: _ICollection, id: string) => IDocumentRef; export declare const _getDocByRef: (ref: IDocumentRef) => Promise; /** * Gets a document with a provided ID * @param id The ID of the document. * * @returns The entity. */ export declare const _getDoc: (col: _ICollection, id: string) => Promise; /** * Updates a document from an entity instance. * @param entity The entity (with ID) to update. * * @returns The updated entity. */ export declare const _updateDoc: (col: _ICollection, entity: T) => Promise; /** * Creates a new document from an entity instance. * @param entity An instance of the entity. * * @returns The created entity. */ export declare const _createDoc: (col: _ICollection, entity: T) => Promise; export declare const _findDocs: (col: _ICollection, query?: ICollectionQuery | undefined) => Promise; /** * Removes a document from the collection. * @param id The document ID to remove. */ export declare const _removeDoc: (col: _ICollection, id: string) => Promise; /** * Entry point for building queries. */ export declare const _onSnapshotDoc: (entity: T, onNext: (snapshot: _IDocumentSnapshot) => void, onError?: ((e: Error) => void) | undefined) => (() => void);