import * as firebase from 'firebase'; import 'firebase/firestore'; export declare class FirestoreProvider { db: firebase.firestore.Firestore; constructor(); /** * Gets snapshot from a collection * @param path collection's path */ getCollection(path: string): Promise; /** * Gets the reference from a collection * @param path collection's path */ watchCollection(path: string): firebase.firestore.CollectionReference; /** * Adds a document do a collection * @param path collection's path * @param doc document to create */ addToCollection(path: string, doc: any): Promise; /** * Gets a snapshot from a document * @param path document's path */ getDocument(path: string): Promise; /** * Gets the reference from a document * @param path document's path */ watchDocument(path: string): firebase.firestore.DocumentReference; /** * Creates a document if it does not exists or update existing document * @param path document's path * @param doc document to create or update */ addDocument(path: string, doc: any): Promise; /** * Creates a batch, saves the documents array and commits it * @param path collection's path * @param docsArray documents to add */ addDocumentsInBatch(path: string, docsArray: Array): any; /** * Update a document with new fields * @param path document's path * @param doc doc with new fields to update */ updateDocument(path: string, doc: any): Promise; /** * Deletes document * @param path document's path */ removeDocument(path: string): Promise; /** * Close all subscriptions * @param subscriptions object with subscriptions to close */ unsubscribe(subscriptions: any): any; }