@react-native-firebase/firestore 23.8.6 → 24.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/RNFBFirestore.podspec +2 -1
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreCollectionModule.java +17 -4
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreDocumentModule.java +2 -2
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineExecutor.java +1243 -0
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineNodeBuilder.java +3919 -0
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineParser.java +1735 -0
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreSerialize.java +1 -1
- package/dist/module/FieldPath.js +59 -0
- package/dist/module/FieldPath.js.map +1 -0
- package/dist/module/FieldValue.js +82 -0
- package/dist/module/FieldValue.js.map +1 -0
- package/{lib → dist/module}/FirestoreAggregate.js +31 -43
- package/dist/module/FirestoreAggregate.js.map +1 -0
- package/dist/module/FirestoreBlob.js +56 -0
- package/dist/module/FirestoreBlob.js.map +1 -0
- package/dist/module/FirestoreCollectionReference.js +70 -0
- package/dist/module/FirestoreCollectionReference.js.map +1 -0
- package/{lib → dist/module}/FirestoreDocumentChange.js +12 -15
- package/dist/module/FirestoreDocumentChange.js.map +1 -0
- package/dist/module/FirestoreDocumentReference.js +170 -0
- package/dist/module/FirestoreDocumentReference.js.map +1 -0
- package/dist/module/FirestoreDocumentSnapshot.js +88 -0
- package/dist/module/FirestoreDocumentSnapshot.js.map +1 -0
- package/dist/module/FirestoreFilter.js +146 -0
- package/dist/module/FirestoreFilter.js.map +1 -0
- package/dist/module/FirestoreGeoPoint.js +80 -0
- package/dist/module/FirestoreGeoPoint.js.map +1 -0
- package/{lib → dist/module}/FirestorePath.js +5 -12
- package/dist/module/FirestorePath.js.map +1 -0
- package/{lib → dist/module}/FirestorePersistentCacheIndexManager.js +11 -4
- package/dist/module/FirestorePersistentCacheIndexManager.js.map +1 -0
- package/dist/module/FirestoreQuery.js +298 -0
- package/dist/module/FirestoreQuery.js.map +1 -0
- package/{lib → dist/module}/FirestoreQueryModifiers.js +25 -136
- package/dist/module/FirestoreQueryModifiers.js.map +1 -0
- package/dist/module/FirestoreQuerySnapshot.js +98 -0
- package/dist/module/FirestoreQuerySnapshot.js.map +1 -0
- package/dist/module/FirestoreSnapshotMetadata.js +38 -0
- package/dist/module/FirestoreSnapshotMetadata.js.map +1 -0
- package/dist/module/FirestoreStatics.js +50 -0
- package/dist/module/FirestoreStatics.js.map +1 -0
- package/{lib → dist/module}/FirestoreTimestamp.js +39 -39
- package/dist/module/FirestoreTimestamp.js.map +1 -0
- package/dist/module/FirestoreTransaction.js +113 -0
- package/dist/module/FirestoreTransaction.js.map +1 -0
- package/dist/module/FirestoreTransactionHandler.js +137 -0
- package/dist/module/FirestoreTransactionHandler.js.map +1 -0
- package/dist/module/FirestoreVectorValue.js +75 -0
- package/dist/module/FirestoreVectorValue.js.map +1 -0
- package/dist/module/FirestoreWriteBatch.js +113 -0
- package/dist/module/FirestoreWriteBatch.js.map +1 -0
- package/dist/module/LoadBundleTask.js +70 -0
- package/dist/module/LoadBundleTask.js.map +1 -0
- package/dist/module/index.js +31 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/modular/Bytes.js +67 -0
- package/dist/module/modular/Bytes.js.map +1 -0
- package/dist/module/modular/FieldPath.js +25 -0
- package/dist/module/modular/FieldPath.js.map +1 -0
- package/dist/module/modular/FieldValue.js +37 -0
- package/dist/module/modular/FieldValue.js.map +1 -0
- package/dist/module/modular/GeoPoint.js +22 -0
- package/dist/module/modular/GeoPoint.js.map +1 -0
- package/dist/module/modular/Timestamp.js +22 -0
- package/dist/module/modular/Timestamp.js.map +1 -0
- package/dist/module/modular/VectorValue.js +25 -0
- package/dist/module/modular/VectorValue.js.map +1 -0
- package/dist/module/modular/query.js +222 -0
- package/dist/module/modular/query.js.map +1 -0
- package/dist/module/modular/snapshot.js +32 -0
- package/dist/module/modular/snapshot.js.map +1 -0
- package/dist/module/modular.js +229 -0
- package/dist/module/modular.js.map +1 -0
- package/dist/module/namespaced.js +298 -0
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/pipelines/expressions.js +1273 -0
- package/dist/module/pipelines/expressions.js.map +1 -0
- package/dist/module/pipelines/index.js +32 -0
- package/dist/module/pipelines/index.js.map +1 -0
- package/dist/module/pipelines/pipeline-result.js +58 -0
- package/dist/module/pipelines/pipeline-result.js.map +1 -0
- package/dist/module/pipelines/pipeline-source.js +4 -0
- package/dist/module/pipelines/pipeline-source.js.map +1 -0
- package/dist/module/pipelines/pipeline.js +4 -0
- package/dist/module/pipelines/pipeline.js.map +1 -0
- package/dist/module/pipelines/pipeline_impl.js +42 -0
- package/dist/module/pipelines/pipeline_impl.js.map +1 -0
- package/dist/module/pipelines/pipeline_options.js +4 -0
- package/dist/module/pipelines/pipeline_options.js.map +1 -0
- package/dist/module/pipelines/pipeline_runtime.js +526 -0
- package/dist/module/pipelines/pipeline_runtime.js.map +1 -0
- package/dist/module/pipelines/pipeline_support.js +71 -0
- package/dist/module/pipelines/pipeline_support.js.map +1 -0
- package/dist/module/pipelines/pipeline_validate.js +183 -0
- package/dist/module/pipelines/pipeline_validate.js.map +1 -0
- package/dist/module/pipelines/stage_options.js +4 -0
- package/dist/module/pipelines/stage_options.js.map +1 -0
- package/dist/module/pipelines/types.js +2 -0
- package/dist/module/pipelines/types.js.map +1 -0
- package/dist/module/types/firestore.js +4 -0
- package/dist/module/types/firestore.js.map +1 -0
- package/dist/module/types/internal.js +4 -0
- package/dist/module/types/internal.js.map +1 -0
- package/dist/module/types/namespaced.js +338 -0
- package/dist/module/types/namespaced.js.map +1 -0
- package/{lib → dist/module}/utils/index.js +59 -114
- package/dist/module/utils/index.js.map +1 -0
- package/{lib → dist/module}/utils/serialize.js +58 -116
- package/dist/module/utils/serialize.js.map +1 -0
- package/{lib → dist/module}/utils/typemap.js +6 -20
- package/dist/module/utils/typemap.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/module/web/RNFBFirestoreModule.android.js +5 -0
- package/dist/module/web/RNFBFirestoreModule.android.js.map +1 -0
- package/dist/module/web/RNFBFirestoreModule.ios.js +5 -0
- package/dist/module/web/RNFBFirestoreModule.ios.js.map +1 -0
- package/dist/module/web/RNFBFirestoreModule.js +387 -0
- package/dist/module/web/RNFBFirestoreModule.js.map +1 -0
- package/{lib → dist/module}/web/convert.js +60 -94
- package/dist/module/web/convert.js.map +1 -0
- package/dist/module/web/pipelines/pipeline.js +34 -0
- package/dist/module/web/pipelines/pipeline.js.map +1 -0
- package/dist/module/web/pipelines/pipeline_bridge_factory.js +217 -0
- package/dist/module/web/pipelines/pipeline_bridge_factory.js.map +1 -0
- package/dist/module/web/pipelines/pipeline_node_builder.js +294 -0
- package/dist/module/web/pipelines/pipeline_node_builder.js.map +1 -0
- package/dist/module/web/pipelines/pipeline_parser.js +21 -0
- package/dist/module/web/pipelines/pipeline_parser.js.map +1 -0
- package/dist/module/web/pipelines/pipeline_snapshot_serializer.js +89 -0
- package/dist/module/web/pipelines/pipeline_snapshot_serializer.js.map +1 -0
- package/dist/module/web/query.js +95 -0
- package/dist/module/web/query.js.map +1 -0
- package/dist/typescript/lib/FieldPath.d.ts +10 -0
- package/dist/typescript/lib/FieldPath.d.ts.map +1 -0
- package/dist/typescript/lib/FieldValue.d.ts +17 -0
- package/dist/typescript/lib/FieldValue.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreAggregate.d.ts +40 -0
- package/dist/typescript/lib/FirestoreAggregate.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreBlob.d.ts +11 -0
- package/dist/typescript/lib/FirestoreBlob.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreCollectionReference.d.ts +15 -0
- package/dist/typescript/lib/FirestoreCollectionReference.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreDocumentChange.d.ts +27 -0
- package/dist/typescript/lib/FirestoreDocumentChange.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreDocumentReference.d.ts +30 -0
- package/dist/typescript/lib/FirestoreDocumentReference.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreDocumentSnapshot.d.ts +30 -0
- package/dist/typescript/lib/FirestoreDocumentSnapshot.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreFilter.d.ts +52 -0
- package/dist/typescript/lib/FirestoreFilter.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreGeoPoint.d.ts +22 -0
- package/dist/typescript/lib/FirestoreGeoPoint.d.ts.map +1 -0
- package/dist/typescript/lib/FirestorePath.d.ts +12 -0
- package/dist/typescript/lib/FirestorePath.d.ts.map +1 -0
- package/dist/typescript/lib/FirestorePersistentCacheIndexManager.d.ts +16 -0
- package/dist/typescript/lib/FirestorePersistentCacheIndexManager.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreQuery.d.ts +39 -0
- package/dist/typescript/lib/FirestoreQuery.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreQueryModifiers.d.ts +59 -0
- package/dist/typescript/lib/FirestoreQueryModifiers.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreQuerySnapshot.d.ts +49 -0
- package/dist/typescript/lib/FirestoreQuerySnapshot.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreSnapshotMetadata.d.ts +8 -0
- package/dist/typescript/lib/FirestoreSnapshotMetadata.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreStatics.d.ts +23 -0
- package/dist/typescript/lib/FirestoreStatics.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreTimestamp.d.ts +33 -0
- package/dist/typescript/lib/FirestoreTimestamp.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreTransaction.d.ts +42 -0
- package/dist/typescript/lib/FirestoreTransaction.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreTransactionHandler.d.ts +26 -0
- package/dist/typescript/lib/FirestoreTransactionHandler.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreVectorValue.d.ts +17 -0
- package/dist/typescript/lib/FirestoreVectorValue.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreWriteBatch.d.ts +21 -0
- package/dist/typescript/lib/FirestoreWriteBatch.d.ts.map +1 -0
- package/dist/typescript/lib/LoadBundleTask.d.ts +16 -0
- package/dist/typescript/lib/LoadBundleTask.d.ts.map +1 -0
- package/dist/typescript/lib/index.d.ts +6 -0
- package/dist/typescript/lib/index.d.ts.map +1 -0
- package/dist/typescript/lib/modular/Bytes.d.ts +22 -0
- package/dist/typescript/lib/modular/Bytes.d.ts.map +1 -0
- package/dist/typescript/lib/modular/FieldPath.d.ts +4 -0
- package/dist/typescript/lib/modular/FieldPath.d.ts.map +1 -0
- package/dist/typescript/lib/modular/FieldValue.d.ts +8 -0
- package/dist/typescript/lib/modular/FieldValue.d.ts.map +1 -0
- package/dist/typescript/lib/modular/GeoPoint.d.ts +3 -0
- package/dist/typescript/lib/modular/GeoPoint.d.ts.map +1 -0
- package/dist/typescript/lib/modular/Timestamp.d.ts +3 -0
- package/dist/typescript/lib/modular/Timestamp.d.ts.map +1 -0
- package/dist/typescript/lib/modular/VectorValue.d.ts +4 -0
- package/dist/typescript/lib/modular/VectorValue.d.ts.map +1 -0
- package/dist/typescript/lib/modular/query.d.ts +93 -0
- package/dist/typescript/lib/modular/query.d.ts.map +1 -0
- package/dist/typescript/lib/modular/snapshot.d.ts +30 -0
- package/dist/typescript/lib/modular/snapshot.d.ts.map +1 -0
- package/dist/typescript/lib/modular.d.ts +69 -0
- package/dist/typescript/lib/modular.d.ts.map +1 -0
- package/dist/typescript/lib/namespaced.d.ts +13 -0
- package/dist/typescript/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/expressions.d.ts +723 -0
- package/dist/typescript/lib/pipelines/expressions.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/index.d.ts +31 -0
- package/dist/typescript/lib/pipelines/index.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline-result.d.ts +30 -0
- package/dist/typescript/lib/pipelines/pipeline-result.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline-source.d.ts +64 -0
- package/dist/typescript/lib/pipelines/pipeline-source.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline.d.ts +61 -0
- package/dist/typescript/lib/pipelines/pipeline.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_impl.d.ts +21 -0
- package/dist/typescript/lib/pipelines/pipeline_impl.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_options.d.ts +17 -0
- package/dist/typescript/lib/pipelines/pipeline_options.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_runtime.d.ts +10 -0
- package/dist/typescript/lib/pipelines/pipeline_runtime.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_support.d.ts +7 -0
- package/dist/typescript/lib/pipelines/pipeline_support.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_validate.d.ts +9 -0
- package/dist/typescript/lib/pipelines/pipeline_validate.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/stage_options.d.ts +326 -0
- package/dist/typescript/lib/pipelines/stage_options.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/types.d.ts +10 -0
- package/dist/typescript/lib/pipelines/types.d.ts.map +1 -0
- package/dist/typescript/lib/types/firestore.d.ts +263 -0
- package/dist/typescript/lib/types/firestore.d.ts.map +1 -0
- package/dist/typescript/lib/types/internal.d.ts +483 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -0
- package/dist/typescript/lib/types/namespaced.d.ts +2285 -0
- package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/utils/index.d.ts +15 -0
- package/dist/typescript/lib/utils/index.d.ts.map +1 -0
- package/dist/typescript/lib/utils/serialize.d.ts +17 -0
- package/dist/typescript/lib/utils/serialize.d.ts.map +1 -0
- package/dist/typescript/lib/utils/typemap.d.ts +3 -0
- package/dist/typescript/lib/utils/typemap.d.ts.map +1 -0
- package/dist/typescript/lib/version.d.ts +2 -0
- package/dist/typescript/lib/version.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.android.d.ts +3 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.android.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.d.ts +75 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.ios.d.ts +3 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.ios.d.ts.map +1 -0
- package/dist/typescript/lib/web/convert.d.ts +14 -0
- package/dist/typescript/lib/web/convert.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline.d.ts +4 -0
- package/dist/typescript/lib/web/pipelines/pipeline.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline_bridge_factory.d.ts +5 -0
- package/dist/typescript/lib/web/pipelines/pipeline_bridge_factory.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline_node_builder.d.ts +5 -0
- package/dist/typescript/lib/web/pipelines/pipeline_node_builder.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline_parser.d.ts +3 -0
- package/dist/typescript/lib/web/pipelines/pipeline_parser.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline_snapshot_serializer.d.ts +4 -0
- package/dist/typescript/lib/web/pipelines/pipeline_snapshot_serializer.d.ts.map +1 -0
- package/dist/typescript/lib/web/query.d.ts +23 -0
- package/dist/typescript/lib/web/query.d.ts.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/ios/RNFBFirestore/RNFBFirestoreCollectionModule.m +52 -2
- package/ios/RNFBFirestore/RNFBFirestorePipelineBridgeFactory.swift +384 -0
- package/ios/RNFBFirestore/RNFBFirestorePipelineCallHandler.swift +86 -0
- package/ios/RNFBFirestore/RNFBFirestorePipelineNodeBuilder.swift +1500 -0
- package/ios/RNFBFirestore/RNFBFirestorePipelineParser.swift +1352 -0
- package/ios/RNFBFirestore/RNFBFirestorePipelineSnapshotSerializer.swift +98 -0
- package/lib/{FirestoreFieldPath.js → FieldPath.ts} +10 -12
- package/lib/{FirestoreFieldValue.js → FieldValue.ts} +22 -19
- package/lib/FirestoreAggregate.ts +124 -0
- package/lib/FirestoreBlob.ts +73 -0
- package/lib/FirestoreCollectionReference.ts +99 -0
- package/lib/FirestoreDocumentChange.ts +71 -0
- package/lib/FirestoreDocumentReference.ts +310 -0
- package/lib/FirestoreDocumentSnapshot.ts +149 -0
- package/lib/FirestoreFilter.ts +232 -0
- package/lib/{FirestoreGeoPoint.js → FirestoreGeoPoint.ts} +48 -8
- package/lib/FirestorePath.ts +54 -0
- package/lib/FirestorePersistentCacheIndexManager.ts +46 -0
- package/lib/{FirestoreQuery.js → FirestoreQuery.ts} +208 -100
- package/lib/FirestoreQueryModifiers.ts +411 -0
- package/lib/{FirestoreQuerySnapshot.js → FirestoreQuerySnapshot.ts} +61 -32
- package/lib/{FirestoreSnapshotMetadata.js → FirestoreSnapshotMetadata.ts} +8 -6
- package/lib/{FirestoreStatics.js → FirestoreStatics.ts} +18 -11
- package/lib/FirestoreTimestamp.ts +161 -0
- package/lib/{FirestoreTransaction.js → FirestoreTransaction.ts} +64 -27
- package/lib/{FirestoreTransactionHandler.js → FirestoreTransactionHandler.ts} +54 -75
- package/lib/{FirestoreVectorValue.js → FirestoreVectorValue.ts} +36 -15
- package/lib/{FirestoreWriteBatch.js → FirestoreWriteBatch.ts} +45 -21
- package/lib/LoadBundleTask.ts +85 -0
- package/lib/index.ts +71 -0
- package/lib/modular/Bytes.ts +81 -0
- package/lib/modular/FieldPath.ts +24 -0
- package/lib/modular/FieldValue.ts +40 -0
- package/lib/modular/GeoPoint.ts +20 -0
- package/lib/modular/Timestamp.ts +20 -0
- package/lib/modular/VectorValue.ts +24 -0
- package/lib/modular/query.ts +368 -0
- package/lib/modular/snapshot.ts +137 -0
- package/lib/modular.ts +552 -0
- package/lib/{index.js → namespaced.ts} +170 -80
- package/lib/pipelines/expressions.ts +2321 -0
- package/lib/pipelines/index.ts +203 -0
- package/lib/pipelines/pipeline-result.ts +78 -0
- package/lib/pipelines/pipeline-source.ts +83 -0
- package/lib/pipelines/pipeline.ts +99 -0
- package/lib/pipelines/pipeline_impl.ts +46 -0
- package/lib/pipelines/pipeline_options.ts +32 -0
- package/lib/pipelines/pipeline_runtime.ts +863 -0
- package/lib/pipelines/pipeline_support.ts +134 -0
- package/lib/pipelines/pipeline_validate.ts +242 -0
- package/lib/pipelines/stage_options.ts +376 -0
- package/lib/pipelines/types.ts +26 -0
- package/lib/types/firestore.ts +477 -0
- package/lib/types/internal.ts +747 -0
- package/lib/{index.d.ts → types/namespaced.ts} +280 -79
- package/lib/utils/index.ts +244 -0
- package/lib/utils/serialize.ts +314 -0
- package/lib/utils/typemap.ts +65 -0
- package/lib/version.ts +2 -0
- package/lib/web/{RNFBFirestoreModule.js → RNFBFirestoreModule.ts} +222 -234
- package/lib/web/convert.ts +287 -0
- package/lib/web/pipelines/pipeline.ts +47 -0
- package/lib/web/pipelines/pipeline_bridge_factory.ts +377 -0
- package/lib/web/pipelines/pipeline_node_builder.ts +413 -0
- package/lib/web/pipelines/pipeline_parser.ts +23 -0
- package/lib/web/pipelines/pipeline_snapshot_serializer.ts +133 -0
- package/lib/web/query.ts +150 -0
- package/package.json +46 -7
- package/tsconfig.json +35 -0
- package/lib/FirestoreBlob.js +0 -107
- package/lib/FirestoreCollectionReference.js +0 -70
- package/lib/FirestoreDocumentReference.js +0 -222
- package/lib/FirestoreDocumentSnapshot.js +0 -132
- package/lib/FirestoreFilter.js +0 -156
- package/lib/modular/Bytes.d.ts +0 -11
- package/lib/modular/Bytes.js +0 -62
- package/lib/modular/FieldPath.d.ts +0 -20
- package/lib/modular/FieldPath.js +0 -7
- package/lib/modular/FieldValue.d.ts +0 -67
- package/lib/modular/FieldValue.js +0 -41
- package/lib/modular/GeoPoint.d.ts +0 -17
- package/lib/modular/GeoPoint.js +0 -3
- package/lib/modular/Timestamp.d.ts +0 -85
- package/lib/modular/Timestamp.js +0 -3
- package/lib/modular/VectorValue.d.ts +0 -30
- package/lib/modular/VectorValue.js +0 -11
- package/lib/modular/index.d.ts +0 -788
- package/lib/modular/index.js +0 -410
- package/lib/modular/query.d.ts +0 -370
- package/lib/modular/query.js +0 -233
- package/lib/modular/snapshot.d.ts +0 -256
- package/lib/modular/snapshot.js +0 -33
- package/lib/modular/utils/observer.js +0 -16
- package/lib/version.js +0 -2
- package/lib/web/query.js +0 -112
- /package/lib/web/{RNFBFirestoreModule.android.js → RNFBFirestoreModule.android.ts} +0 -0
- /package/lib/web/{RNFBFirestoreModule.ios.js → RNFBFirestoreModule.ios.ts} +0 -0
|
@@ -16,32 +16,39 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import {
|
|
19
|
+
createDeprecationProxy,
|
|
20
|
+
isAndroid,
|
|
19
21
|
isBoolean,
|
|
20
22
|
isFunction,
|
|
21
23
|
isNumber,
|
|
22
24
|
isObject,
|
|
23
25
|
isString,
|
|
24
26
|
isUndefined,
|
|
25
|
-
|
|
26
|
-
createDeprecationProxy,
|
|
27
|
+
isOther,
|
|
27
28
|
} from '@react-native-firebase/app/dist/module/common';
|
|
28
|
-
import { setReactNativeModule } from '@react-native-firebase/app/dist/module/internal/nativeModule';
|
|
29
29
|
import {
|
|
30
30
|
createModuleNamespace,
|
|
31
31
|
FirebaseModule,
|
|
32
32
|
getFirebaseRoot,
|
|
33
|
+
type ModuleConfig,
|
|
33
34
|
} from '@react-native-firebase/app/dist/module/internal';
|
|
34
|
-
import
|
|
35
|
-
import
|
|
35
|
+
import { setReactNativeModule } from '@react-native-firebase/app/dist/module/internal/nativeModule';
|
|
36
|
+
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
37
|
+
import CollectionReference from './FirestoreCollectionReference';
|
|
38
|
+
import DocumentReference from './FirestoreDocumentReference';
|
|
36
39
|
import FirestorePath from './FirestorePath';
|
|
37
|
-
import
|
|
38
|
-
import
|
|
40
|
+
import FirestorePersistentCacheIndexManager from './FirestorePersistentCacheIndexManager';
|
|
41
|
+
import Query from './FirestoreQuery';
|
|
42
|
+
import QueryModifiers from './FirestoreQueryModifiers';
|
|
39
43
|
import FirestoreStatics from './FirestoreStatics';
|
|
40
44
|
import FirestoreTransactionHandler from './FirestoreTransactionHandler';
|
|
41
45
|
import FirestoreWriteBatch from './FirestoreWriteBatch';
|
|
42
|
-
import
|
|
46
|
+
import { LoadBundleTask } from './LoadBundleTask';
|
|
47
|
+
import type { LoadBundleTaskProgress } from './types/firestore';
|
|
48
|
+
import { version } from './version';
|
|
49
|
+
import type { FirebaseFirestoreTypes } from './types/namespaced';
|
|
50
|
+
import type { FirestoreInternal } from './types/internal';
|
|
43
51
|
import fallBackModule from './web/RNFBFirestoreModule';
|
|
44
|
-
import FirestorePersistentCacheIndexManager from './FirestorePersistentCacheIndexManager';
|
|
45
52
|
|
|
46
53
|
// react-native at least through 0.77 does not correctly support URL.host, which
|
|
47
54
|
// is needed by firebase-js-sdk. It appears that in 0.80+ it is supported, so this
|
|
@@ -51,49 +58,76 @@ import 'react-native-url-polyfill/auto';
|
|
|
51
58
|
|
|
52
59
|
const namespace = 'firestore';
|
|
53
60
|
|
|
54
|
-
const
|
|
61
|
+
const nativeModuleNames = [
|
|
55
62
|
'RNFBFirestoreModule',
|
|
56
63
|
'RNFBFirestoreCollectionModule',
|
|
57
64
|
'RNFBFirestoreDocumentModule',
|
|
58
65
|
'RNFBFirestoreTransactionModule',
|
|
59
|
-
];
|
|
66
|
+
] as const;
|
|
60
67
|
|
|
61
68
|
const nativeEvents = [
|
|
62
69
|
'firestore_collection_sync_event',
|
|
63
70
|
'firestore_document_sync_event',
|
|
64
71
|
'firestore_transaction_event',
|
|
65
72
|
'firestore_snapshots_in_sync_event',
|
|
66
|
-
];
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
] as const;
|
|
74
|
+
|
|
75
|
+
type FirestoreModuleSettingsState = {
|
|
76
|
+
ignoreUndefinedProperties: boolean;
|
|
77
|
+
persistence: boolean;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** Sync event payload from emitter when fanning out collection/document/snapshots-in-sync events. */
|
|
81
|
+
type FirestoreSyncEventWithListenerId = { listenerId: string | number };
|
|
82
|
+
|
|
83
|
+
class FirebaseFirestoreModule extends FirebaseModule<'RNFBFirestoreModule'> {
|
|
84
|
+
type = 'firestore' as const;
|
|
85
|
+
_referencePath: FirestorePath;
|
|
86
|
+
_transactionHandler: FirestoreTransactionHandler;
|
|
87
|
+
_settings: FirestoreModuleSettingsState;
|
|
88
|
+
_databaseId: string | null;
|
|
89
|
+
|
|
90
|
+
constructor(
|
|
91
|
+
app: ReactNativeFirebase.FirebaseAppBase,
|
|
92
|
+
config: ModuleConfig,
|
|
93
|
+
databaseId?: string | null,
|
|
94
|
+
) {
|
|
70
95
|
super(app, config);
|
|
96
|
+
|
|
71
97
|
if (isString(databaseId) || databaseId === undefined) {
|
|
72
|
-
this.
|
|
73
|
-
|
|
98
|
+
this._databaseId = databaseId || '(default)';
|
|
99
|
+
// Kept for backwards compatibility with the modular API
|
|
100
|
+
this._customUrlOrRegion = this._databaseId;
|
|
101
|
+
} else {
|
|
74
102
|
throw new Error('firebase.app().firestore(*) database ID must be a string');
|
|
75
103
|
}
|
|
104
|
+
|
|
76
105
|
this._referencePath = new FirestorePath();
|
|
77
|
-
this._transactionHandler = new FirestoreTransactionHandler(
|
|
106
|
+
this._transactionHandler = new FirestoreTransactionHandler(
|
|
107
|
+
this as unknown as FirestoreInternal,
|
|
108
|
+
);
|
|
78
109
|
|
|
79
110
|
// Fan out native events
|
|
80
111
|
this.emitter.addListener(this.eventNameForApp('firestore_collection_sync_event'), event => {
|
|
112
|
+
const syncEvent = event as FirestoreSyncEventWithListenerId;
|
|
81
113
|
this.emitter.emit(
|
|
82
|
-
this.eventNameForApp(`firestore_collection_sync_event:${
|
|
114
|
+
this.eventNameForApp(`firestore_collection_sync_event:${syncEvent.listenerId}`),
|
|
83
115
|
event,
|
|
84
116
|
);
|
|
85
117
|
});
|
|
86
118
|
|
|
87
119
|
this.emitter.addListener(this.eventNameForApp('firestore_document_sync_event'), event => {
|
|
120
|
+
const syncEvent = event as FirestoreSyncEventWithListenerId;
|
|
88
121
|
this.emitter.emit(
|
|
89
|
-
this.eventNameForApp(`firestore_document_sync_event:${
|
|
122
|
+
this.eventNameForApp(`firestore_document_sync_event:${syncEvent.listenerId}`),
|
|
90
123
|
event,
|
|
91
124
|
);
|
|
92
125
|
});
|
|
93
126
|
|
|
94
127
|
this.emitter.addListener(this.eventNameForApp('firestore_snapshots_in_sync_event'), event => {
|
|
128
|
+
const syncEvent = event as FirestoreSyncEventWithListenerId;
|
|
95
129
|
this.emitter.emit(
|
|
96
|
-
this.eventNameForApp(`firestore_snapshots_in_sync_event:${
|
|
130
|
+
this.eventNameForApp(`firestore_snapshots_in_sync_event:${syncEvent.listenerId}`),
|
|
97
131
|
event,
|
|
98
132
|
);
|
|
99
133
|
});
|
|
@@ -104,20 +138,28 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
104
138
|
};
|
|
105
139
|
}
|
|
106
140
|
|
|
107
|
-
|
|
108
|
-
return
|
|
141
|
+
toJSON(): object {
|
|
142
|
+
return {
|
|
143
|
+
app: this.app,
|
|
144
|
+
databaseId: this._databaseId,
|
|
145
|
+
settings: this._settings,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// Kept for backwards compatibility with the modular API
|
|
149
|
+
get customUrlOrRegion(): string {
|
|
150
|
+
return this._databaseId as string;
|
|
109
151
|
}
|
|
110
152
|
|
|
111
|
-
// We override the FirebaseModule's
|
|
112
|
-
eventNameForApp(...args) {
|
|
113
|
-
return `${this.app.name}-${this.
|
|
153
|
+
// We override the FirebaseModule's eventNameForApp() method to include the customUrlOrRegion
|
|
154
|
+
eventNameForApp(...args: Array<string | number>): string {
|
|
155
|
+
return `${this.app.name}-${this._databaseId}-${args.join('-')}`;
|
|
114
156
|
}
|
|
115
157
|
|
|
116
|
-
batch() {
|
|
117
|
-
return new FirestoreWriteBatch(this);
|
|
158
|
+
batch(): FirestoreWriteBatch {
|
|
159
|
+
return new FirestoreWriteBatch(this as unknown as FirestoreInternal);
|
|
118
160
|
}
|
|
119
161
|
|
|
120
|
-
loadBundle(bundle) {
|
|
162
|
+
loadBundle(bundle: string): LoadBundleTask {
|
|
121
163
|
if (!isString(bundle)) {
|
|
122
164
|
throw new Error("firebase.firestore().loadBundle(*) 'bundle' must be a string value.");
|
|
123
165
|
}
|
|
@@ -126,10 +168,15 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
126
168
|
throw new Error("firebase.firestore().loadBundle(*) 'bundle' must be a non-empty string.");
|
|
127
169
|
}
|
|
128
170
|
|
|
129
|
-
|
|
171
|
+
const task = new LoadBundleTask();
|
|
172
|
+
this.native
|
|
173
|
+
.loadBundle(bundle)
|
|
174
|
+
.then((progress: LoadBundleTaskProgress) => task._completeWith(progress))
|
|
175
|
+
.catch((error: Error) => task._failWith(error));
|
|
176
|
+
return task;
|
|
130
177
|
}
|
|
131
178
|
|
|
132
|
-
namedQuery(queryName) {
|
|
179
|
+
namedQuery(queryName: string): Query | null {
|
|
133
180
|
if (!isString(queryName)) {
|
|
134
181
|
throw new Error("firebase.firestore().namedQuery(*) 'queryName' must be a string value.");
|
|
135
182
|
}
|
|
@@ -138,43 +185,52 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
138
185
|
throw new Error("firebase.firestore().namedQuery(*) 'queryName' must be a non-empty string.");
|
|
139
186
|
}
|
|
140
187
|
|
|
141
|
-
return new
|
|
188
|
+
return new Query(
|
|
189
|
+
this as unknown as FirestoreInternal,
|
|
190
|
+
this._referencePath,
|
|
191
|
+
new QueryModifiers(),
|
|
192
|
+
queryName,
|
|
193
|
+
);
|
|
142
194
|
}
|
|
143
195
|
|
|
144
|
-
async clearPersistence() {
|
|
196
|
+
async clearPersistence(): Promise<void> {
|
|
145
197
|
await this.native.clearPersistence();
|
|
146
198
|
}
|
|
147
199
|
|
|
148
|
-
async waitForPendingWrites() {
|
|
200
|
+
async waitForPendingWrites(): Promise<void> {
|
|
149
201
|
await this.native.waitForPendingWrites();
|
|
150
202
|
}
|
|
151
203
|
|
|
152
|
-
async terminate() {
|
|
204
|
+
async terminate(): Promise<void> {
|
|
153
205
|
await this.native.terminate();
|
|
154
206
|
}
|
|
155
207
|
|
|
156
|
-
useEmulator(host, port) {
|
|
208
|
+
useEmulator(host: string, port: number): void {
|
|
157
209
|
if (!host || !isString(host) || !port || !isNumber(port)) {
|
|
158
210
|
throw new Error('firebase.firestore().useEmulator() takes a non-empty host and port');
|
|
159
211
|
}
|
|
160
|
-
|
|
212
|
+
|
|
213
|
+
let mappedHost = host;
|
|
161
214
|
const androidBypassEmulatorUrlRemap =
|
|
162
215
|
typeof this.firebaseJson.android_bypass_emulator_url_remap === 'boolean' &&
|
|
163
216
|
this.firebaseJson.android_bypass_emulator_url_remap;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
217
|
+
|
|
218
|
+
if (!androidBypassEmulatorUrlRemap && isAndroid && mappedHost) {
|
|
219
|
+
if (mappedHost === 'localhost' || mappedHost === '127.0.0.1') {
|
|
220
|
+
mappedHost = '10.0.2.2';
|
|
167
221
|
// eslint-disable-next-line no-console
|
|
168
222
|
console.log(
|
|
169
223
|
'Mapping firestore host to "10.0.2.2" for android emulators. Use real IP on real devices. You can bypass this behaviour with "android_bypass_emulator_url_remap" flag.',
|
|
170
224
|
);
|
|
171
225
|
}
|
|
172
226
|
}
|
|
173
|
-
|
|
174
|
-
|
|
227
|
+
|
|
228
|
+
this.native.useEmulator(mappedHost, port);
|
|
229
|
+
// @ts-ignore - undocumented return, just used to unit test android host remapping
|
|
230
|
+
return [mappedHost, port];
|
|
175
231
|
}
|
|
176
232
|
|
|
177
|
-
collection(collectionPath) {
|
|
233
|
+
collection(collectionPath: string): CollectionReference {
|
|
178
234
|
if (!isString(collectionPath)) {
|
|
179
235
|
throw new Error(
|
|
180
236
|
"firebase.firestore().collection(*) 'collectionPath' must be a string value.",
|
|
@@ -195,10 +251,12 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
195
251
|
);
|
|
196
252
|
}
|
|
197
253
|
|
|
198
|
-
return createDeprecationProxy(
|
|
254
|
+
return createDeprecationProxy(
|
|
255
|
+
new CollectionReference(this as unknown as FirestoreInternal, path),
|
|
256
|
+
);
|
|
199
257
|
}
|
|
200
258
|
|
|
201
|
-
collectionGroup(collectionId) {
|
|
259
|
+
collectionGroup(collectionId: string): Query {
|
|
202
260
|
if (!isString(collectionId)) {
|
|
203
261
|
throw new Error(
|
|
204
262
|
"firebase.firestore().collectionGroup(*) 'collectionId' must be a string value.",
|
|
@@ -211,27 +269,27 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
211
269
|
);
|
|
212
270
|
}
|
|
213
271
|
|
|
214
|
-
if (collectionId.
|
|
272
|
+
if (collectionId.includes('/')) {
|
|
215
273
|
throw new Error(
|
|
216
274
|
"firebase.firestore().collectionGroup(*) 'collectionId' must not contain '/'.",
|
|
217
275
|
);
|
|
218
276
|
}
|
|
219
277
|
|
|
220
278
|
return createDeprecationProxy(
|
|
221
|
-
new
|
|
222
|
-
this,
|
|
279
|
+
new Query(
|
|
280
|
+
this as unknown as FirestoreInternal,
|
|
223
281
|
this._referencePath.child(collectionId),
|
|
224
|
-
new
|
|
282
|
+
new QueryModifiers().asCollectionGroupQuery(),
|
|
225
283
|
undefined,
|
|
226
284
|
),
|
|
227
285
|
);
|
|
228
286
|
}
|
|
229
287
|
|
|
230
|
-
async disableNetwork() {
|
|
288
|
+
async disableNetwork(): Promise<void> {
|
|
231
289
|
await this.native.disableNetwork();
|
|
232
290
|
}
|
|
233
291
|
|
|
234
|
-
doc(documentPath) {
|
|
292
|
+
doc(documentPath: string): DocumentReference {
|
|
235
293
|
if (!isString(documentPath)) {
|
|
236
294
|
throw new Error("firebase.firestore().doc(*) 'documentPath' must be a string value.");
|
|
237
295
|
}
|
|
@@ -246,14 +304,16 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
246
304
|
throw new Error("firebase.firestore().doc(*) 'documentPath' must point to a document.");
|
|
247
305
|
}
|
|
248
306
|
|
|
249
|
-
return createDeprecationProxy(
|
|
307
|
+
return createDeprecationProxy(
|
|
308
|
+
new DocumentReference(this as unknown as FirestoreInternal, path),
|
|
309
|
+
);
|
|
250
310
|
}
|
|
251
311
|
|
|
252
|
-
async enableNetwork() {
|
|
312
|
+
async enableNetwork(): Promise<void> {
|
|
253
313
|
await this.native.enableNetwork();
|
|
254
314
|
}
|
|
255
315
|
|
|
256
|
-
runTransaction(updateFunction) {
|
|
316
|
+
runTransaction(updateFunction: (transaction: unknown) => Promise<unknown>): Promise<unknown> {
|
|
257
317
|
if (!isFunction(updateFunction)) {
|
|
258
318
|
return Promise.reject(
|
|
259
319
|
new Error("firebase.firestore().runTransaction(*) 'updateFunction' must be a function."),
|
|
@@ -263,7 +323,7 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
263
323
|
return this._transactionHandler._add(updateFunction);
|
|
264
324
|
}
|
|
265
325
|
|
|
266
|
-
settings(settings) {
|
|
326
|
+
settings(settings: Record<string, unknown>): Promise<void> {
|
|
267
327
|
if (!isObject(settings)) {
|
|
268
328
|
return Promise.reject(
|
|
269
329
|
new Error("firebase.firestore().settings(*) 'settings' must be an object."),
|
|
@@ -271,18 +331,20 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
271
331
|
}
|
|
272
332
|
|
|
273
333
|
const keys = Object.keys(settings);
|
|
274
|
-
|
|
275
334
|
const opts = [
|
|
276
335
|
'cacheSizeBytes',
|
|
277
336
|
'host',
|
|
337
|
+
'localCache',
|
|
278
338
|
'persistence',
|
|
279
339
|
'ssl',
|
|
280
340
|
'ignoreUndefinedProperties',
|
|
281
341
|
'serverTimestampBehavior',
|
|
342
|
+
'experimentalForceLongPolling',
|
|
343
|
+
'experimentalAutoDetectLongPolling',
|
|
344
|
+
'experimentalLongPollingOptions',
|
|
282
345
|
];
|
|
283
346
|
|
|
284
|
-
for (
|
|
285
|
-
const key = keys[i];
|
|
347
|
+
for (const key of keys) {
|
|
286
348
|
if (!opts.includes(key)) {
|
|
287
349
|
return Promise.reject(
|
|
288
350
|
new Error(
|
|
@@ -303,7 +365,7 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
303
365
|
|
|
304
366
|
if (
|
|
305
367
|
settings.cacheSizeBytes !== FirestoreStatics.CACHE_SIZE_UNLIMITED &&
|
|
306
|
-
settings.cacheSizeBytes < 1048576
|
|
368
|
+
settings.cacheSizeBytes < 1048576
|
|
307
369
|
) {
|
|
308
370
|
return Promise.reject(
|
|
309
371
|
new Error(
|
|
@@ -329,15 +391,16 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
329
391
|
}
|
|
330
392
|
|
|
331
393
|
if (isAndroid) {
|
|
332
|
-
|
|
333
|
-
|
|
394
|
+
const host = settings.host as string;
|
|
395
|
+
if (host.startsWith('localhost')) {
|
|
396
|
+
settings.host = host.replace('localhost', '10.0.2.2');
|
|
334
397
|
// eslint-disable-next-line no-console
|
|
335
398
|
console.log(
|
|
336
399
|
'Mapping firestore host "localhost" to "10.0.2.2" for android emulators. Use real IP on real devices.',
|
|
337
400
|
);
|
|
338
401
|
}
|
|
339
|
-
if (settings.host.startsWith('127.0.0.1')) {
|
|
340
|
-
settings.host = settings.host.replace('127.0.0.1', '10.0.2.2');
|
|
402
|
+
if ((settings.host as string).startsWith('127.0.0.1')) {
|
|
403
|
+
settings.host = (settings.host as string).replace('127.0.0.1', '10.0.2.2');
|
|
341
404
|
// eslint-disable-next-line no-console
|
|
342
405
|
console.log(
|
|
343
406
|
'Mapping firestore host "127.0.0.1" to "10.0.2.2" for android emulators. Use real IP on real devices.',
|
|
@@ -360,7 +423,7 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
360
423
|
|
|
361
424
|
if (
|
|
362
425
|
!isUndefined(settings.serverTimestampBehavior) &&
|
|
363
|
-
!['estimate', 'previous', 'none'].includes(settings.serverTimestampBehavior)
|
|
426
|
+
!['estimate', 'previous', 'none'].includes(settings.serverTimestampBehavior as string)
|
|
364
427
|
) {
|
|
365
428
|
return Promise.reject(
|
|
366
429
|
new Error(
|
|
@@ -376,10 +439,8 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
376
439
|
"firebase.firestore().settings(*) 'settings.ignoreUndefinedProperties' must be a boolean value.",
|
|
377
440
|
),
|
|
378
441
|
);
|
|
379
|
-
} else {
|
|
380
|
-
this._settings.ignoreUndefinedProperties = settings.ignoreUndefinedProperties;
|
|
381
442
|
}
|
|
382
|
-
|
|
443
|
+
this._settings.ignoreUndefinedProperties = settings.ignoreUndefinedProperties;
|
|
383
444
|
delete settings.ignoreUndefinedProperties;
|
|
384
445
|
}
|
|
385
446
|
|
|
@@ -388,41 +449,70 @@ class FirebaseFirestoreModule extends FirebaseModule {
|
|
|
388
449
|
this._settings.persistence = false;
|
|
389
450
|
}
|
|
390
451
|
|
|
391
|
-
|
|
452
|
+
const settingsToApply = isOther ? settings : { ...settings };
|
|
453
|
+
|
|
454
|
+
if (!isOther) {
|
|
455
|
+
delete settingsToApply.localCache;
|
|
456
|
+
delete settingsToApply.experimentalForceLongPolling;
|
|
457
|
+
delete settingsToApply.experimentalAutoDetectLongPolling;
|
|
458
|
+
delete settingsToApply.experimentalLongPollingOptions;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return this.native.settings(settingsToApply);
|
|
392
462
|
}
|
|
393
463
|
|
|
394
|
-
persistentCacheIndexManager() {
|
|
464
|
+
persistentCacheIndexManager(): FirestorePersistentCacheIndexManager | null {
|
|
395
465
|
if (this._settings.persistence === false) {
|
|
396
466
|
return null;
|
|
397
467
|
}
|
|
398
|
-
return createDeprecationProxy(
|
|
468
|
+
return createDeprecationProxy(
|
|
469
|
+
new FirestorePersistentCacheIndexManager(this as unknown as FirestoreInternal),
|
|
470
|
+
);
|
|
399
471
|
}
|
|
400
472
|
}
|
|
401
473
|
|
|
402
474
|
// import { SDK_VERSION } from '@react-native-firebase/firestore';
|
|
403
475
|
export const SDK_VERSION = version;
|
|
404
476
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
// import firestore from '@react-native-firebase/firestore';
|
|
408
|
-
// firestore().X(...);
|
|
409
|
-
export default createModuleNamespace({
|
|
477
|
+
const firestoreNamespace = createModuleNamespace({
|
|
410
478
|
statics: FirestoreStatics,
|
|
411
479
|
version,
|
|
412
480
|
namespace,
|
|
413
|
-
nativeModuleName,
|
|
414
|
-
nativeEvents,
|
|
481
|
+
nativeModuleName: [...nativeModuleNames],
|
|
482
|
+
nativeEvents: [...nativeEvents],
|
|
415
483
|
hasMultiAppSupport: true,
|
|
416
484
|
hasCustomUrlOrRegionSupport: true,
|
|
417
485
|
ModuleClass: FirebaseFirestoreModule,
|
|
418
486
|
});
|
|
419
487
|
|
|
488
|
+
type FirestoreNamespace = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<
|
|
489
|
+
FirebaseFirestoreTypes.Module,
|
|
490
|
+
FirebaseFirestoreTypes.Statics
|
|
491
|
+
> & {
|
|
492
|
+
firestore: ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<
|
|
493
|
+
FirebaseFirestoreTypes.Module,
|
|
494
|
+
FirebaseFirestoreTypes.Statics
|
|
495
|
+
>;
|
|
496
|
+
firebase: ReactNativeFirebase.Module;
|
|
497
|
+
app(name?: string): ReactNativeFirebase.FirebaseApp;
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
// import firestore from '@react-native-firebase/firestore';
|
|
501
|
+
// firestore().X(...);
|
|
502
|
+
export default firestoreNamespace as unknown as FirestoreNamespace;
|
|
503
|
+
|
|
420
504
|
// import firestore, { firebase } from '@react-native-firebase/firestore';
|
|
421
505
|
// firestore().X(...);
|
|
422
506
|
// firebase.firestore().X(...);
|
|
423
|
-
export const firebase =
|
|
507
|
+
export const firebase =
|
|
508
|
+
getFirebaseRoot() as unknown as ReactNativeFirebase.FirebaseNamespacedExport<
|
|
509
|
+
'firestore',
|
|
510
|
+
FirebaseFirestoreTypes.Module,
|
|
511
|
+
FirebaseFirestoreTypes.Statics,
|
|
512
|
+
true
|
|
513
|
+
>;
|
|
424
514
|
|
|
425
515
|
// Register the interop module for non-native platforms.
|
|
426
|
-
for (
|
|
427
|
-
setReactNativeModule(
|
|
516
|
+
for (const moduleName of nativeModuleNames) {
|
|
517
|
+
setReactNativeModule(moduleName, fallBackModule);
|
|
428
518
|
}
|