2
0
mirror of synced 2025-02-27 21:40:40 +00:00

[firestore][typings] Add better type for DocumentChange.type #1180

This commit is contained in:
Chris Bianca 2018-06-17 16:35:02 +01:00
parent a32cb27c43
commit 9e549d60b1
2 changed files with 3 additions and 3 deletions

2
lib/index.d.ts vendored
View File

@ -1808,7 +1808,7 @@ declare module 'react-native-firebase' {
readonly doc: DocumentSnapshot;
readonly newIndex: number;
readonly oldIndex: number;
readonly type: string;
readonly type: 'added' | 'modified' | 'removed';
}
interface DocumentReference {

View File

@ -14,7 +14,7 @@ export default class DocumentChange {
_document: DocumentSnapshot;
_newIndex: number;
_oldIndex: number;
_type: string;
_type: 'added' | 'modified' | 'removed';
constructor(firestore: Firestore, nativeData: NativeDocumentChange) {
this._document = new DocumentSnapshot(firestore, nativeData.document);