mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-06-17 04:09:38 +08:00
[firestore][typings] Add better type for DocumentChange.type #1180
This commit is contained in:
4
lib/index.d.ts
vendored
4
lib/index.d.ts
vendored
@@ -807,7 +807,7 @@ declare module 'react-native-firebase' {
|
||||
event: string,
|
||||
observer: (snapshot: PhoneAuthSnapshot) => void,
|
||||
errorCb?: (error: PhoneAuthError) => void,
|
||||
successCb?: (snapshot: PhoneAuthSnapshot) => void
|
||||
successCb?: (snapshot: PhoneAuthSnapshot) => void
|
||||
): PhoneAuthListener;
|
||||
|
||||
then(fn: (snapshot: PhoneAuthSnapshot) => void): Promise<any>;
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user