(options?: GetOptions)
| 806 | } |
| 807 | |
| 808 | get(options?: GetOptions): Promise<DocumentSnapshot<T>> { |
| 809 | return new Promise((resolve, reject) => { |
| 810 | let source: FIRFirestoreSource; |
| 811 | switch (options) { |
| 812 | case GetOptions.Cache: |
| 813 | source = FIRFirestoreSource.Cache; |
| 814 | break; |
| 815 | case GetOptions.Server: |
| 816 | source = FIRFirestoreSource.Server; |
| 817 | break; |
| 818 | default: |
| 819 | source = FIRFirestoreSource.Default; |
| 820 | break; |
| 821 | } |
| 822 | this.native.getDocumentWithSourceCompletion(source, (ss, error) => { |
| 823 | if (error) { |
| 824 | reject(FirebaseError.fromNative(error)); |
| 825 | } else { |
| 826 | resolve(DocumentSnapshot.fromNative(ss)); |
| 827 | } |
| 828 | }); |
| 829 | }); |
| 830 | } |
| 831 | |
| 832 | onSnapshot(observer: { complete?: () => void; error?: (error: Error) => void; next?: (snapshot: DocumentSnapshot<T>) => void }): () => void; |
| 833 | onSnapshot(options: SnapshotListenOptions, observer: { complete?: () => void; error?: (error: Error) => void; next?: (snapshot: DocumentSnapshot<T>) => void }): () => void; |
nothing calls this directly
no test coverage detected