[firestore][typings] Add better type for DocumentChange.type #1180
This commit is contained in:
parent
a32cb27c43
commit
9e549d60b1
2
lib/index.d.ts
vendored
2
lib/index.d.ts
vendored
@ -1808,7 +1808,7 @@ declare module 'react-native-firebase' {
|
|||||||
readonly doc: DocumentSnapshot;
|
readonly doc: DocumentSnapshot;
|
||||||
readonly newIndex: number;
|
readonly newIndex: number;
|
||||||
readonly oldIndex: number;
|
readonly oldIndex: number;
|
||||||
readonly type: string;
|
readonly type: 'added' | 'modified' | 'removed';
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DocumentReference {
|
interface DocumentReference {
|
||||||
|
@ -14,7 +14,7 @@ export default class DocumentChange {
|
|||||||
_document: DocumentSnapshot;
|
_document: DocumentSnapshot;
|
||||||
_newIndex: number;
|
_newIndex: number;
|
||||||
_oldIndex: number;
|
_oldIndex: number;
|
||||||
_type: string;
|
_type: 'added' | 'modified' | 'removed';
|
||||||
|
|
||||||
constructor(firestore: Firestore, nativeData: NativeDocumentChange) {
|
constructor(firestore: Firestore, nativeData: NativeDocumentChange) {
|
||||||
this._document = new DocumentSnapshot(firestore, nativeData.document);
|
this._document = new DocumentSnapshot(firestore, nativeData.document);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user