@@ -3,7 +3,7 @@ import lazy from "@nativescript/core/utils/lazy";
33import { DocumentSnapshot as DocumentSnapshotBase , FieldValue , firebase , GeoPoint , isDocumentReference } from "./firebase-common" ;
44import * as firebaseFunctions from "./functions/functions" ;
55import * as firebaseMessaging from "./messaging/messaging" ;
6- import { firestore } from "./platforms/web/typings/ firebase-webapi " ;
6+ import { firestore } from "./firebase" ;
77
88export enum QueryOrderByType {
99 KEY ,
@@ -2226,7 +2226,7 @@ const ensureFirestore = (): void => {
22262226 }
22272227} ;
22282228
2229- class FirestoreWriteBatch implements firestore . WriteBatch {
2229+ class FirestoreWriteBatch {
22302230
22312231 public nativeWriteBatch : com . google . firebase . firestore . WriteBatch ;
22322232
@@ -2239,7 +2239,7 @@ class FirestoreWriteBatch implements firestore.WriteBatch {
22392239 return this ;
22402240 }
22412241
2242- public update = ( documentRef : firestore . DocumentReference , data : firestore . UpdateData ) : any => {
2242+ public update ( documentRef : firestore . DocumentReference , data : firestore . UpdateData ) : any {
22432243 this . nativeWriteBatch . update ( ( < any > documentRef ) . android , firebase . toValue ( data ) ) ;
22442244 return this ;
22452245 }
@@ -2494,7 +2494,7 @@ firebase.firestore._getDocumentReference = (docRef?: JDocumentReference): firest
24942494 get : ( options ?: firestore . GetOptions ) => firebase . firestore . getDocument ( collectionPath , docRef . getId ( ) , options ) ,
24952495 update : ( data : any ) => firebase . firestore . update ( collectionPath , docRef . getId ( ) , data ) ,
24962496 delete : ( ) => firebase . firestore . delete ( collectionPath , docRef . getId ( ) ) ,
2497- onSnapshot : ( optionsOrCallback : firestore . SnapshotListenOptions | ( ( snapshot : DocumentSnapshot ) => void ) , callbackOrOnError ?: ( docOrError : DocumentSnapshot | Error ) => void , onError ?: ( error : Error ) => void ) => firebase . firestore . onDocumentSnapshot ( docRef , optionsOrCallback , callbackOrOnError , onError ) ,
2497+ onSnapshot : ( optionsOrCallback : firestore . SnapshotListenOptions | ( ( snapshot : firestore . DocumentSnapshot ) => void ) , callbackOrOnError ?: ( docOrError : firestore . DocumentSnapshot | Error ) => void , onError ?: ( error : Error ) => void ) => firebase . onDocumentSnapshot ( docRef , optionsOrCallback , callbackOrOnError , onError ) ,
24982498 android : docRef
24992499 } ;
25002500} ;
@@ -2729,7 +2729,7 @@ firebase.firestore.getDocument = (collectionPath: string, documentPath: string,
27292729 reject ( ex && ex . getReason ? ex . getReason ( ) : ex ) ;
27302730 } else {
27312731 const result : com . google . firebase . firestore . DocumentSnapshot = task . getResult ( ) ;
2732- resolve ( new DocumentSnapshot ( result ) ) ;
2732+ resolve ( new firebase . DocumentSnapshot ( result ) ) ;
27332733 }
27342734 }
27352735 } ) ;
@@ -2759,7 +2759,7 @@ firebase.firestore._getQuery = (collectionPath: string, query: com.google.fireba
27592759 return {
27602760 get : ( ) => new Promise ( ( resolve , reject ) => {
27612761 const onCompleteListener = new gmsTasks . OnCompleteListener ( {
2762- onComplete : task => {
2762+ onComplete : ( task : any ) => {
27632763 if ( ! task . isSuccessful ( ) ) {
27642764 const ex = task . getException ( ) ;
27652765 reject ( ex && ex . getReason ? ex . getReason ( ) : ex ) ;
@@ -2874,7 +2874,7 @@ function convertDocChangeType(type: com.google.firebase.firestore.DocumentChange
28742874}
28752875
28762876function convertDocument ( qDoc : com . google . firebase . firestore . QueryDocumentSnapshot ) : firestore . QueryDocumentSnapshot {
2877- return new DocumentSnapshot ( qDoc ) ;
2877+ return new firebase . DocumentSnapshot ( qDoc ) ;
28782878}
28792879
28802880export class QuerySnapshot implements firestore . QuerySnapshot {
@@ -2893,7 +2893,7 @@ export class QuerySnapshot implements firestore.QuerySnapshot {
28932893 const docSnapshots : firestore . QueryDocumentSnapshot [ ] = [ ] ;
28942894 for ( let i = 0 ; i < this . snapshot . size ( ) ; i ++ ) {
28952895 const documentSnapshot : com . google . firebase . firestore . DocumentSnapshot = this . snapshot . getDocuments ( ) . get ( i ) ;
2896- docSnapshots . push ( new DocumentSnapshot ( documentSnapshot ) ) ;
2896+ docSnapshots . push ( new firebase . DocumentSnapshot ( documentSnapshot ) ) ;
28972897 }
28982898 this . _docSnapshots = docSnapshots ;
28992899
0 commit comments