@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
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this library except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { isArray, isString } from '@react-native-firebase/app/dist/module/common';
|
|
19
|
-
import FirestoreDocumentReference, {
|
|
20
|
-
provideDocumentSnapshotClass,
|
|
21
|
-
} from './FirestoreDocumentReference';
|
|
22
|
-
import FirestoreFieldPath, { fromDotSeparatedString } from './FirestoreFieldPath';
|
|
23
|
-
import FirestorePath from './FirestorePath';
|
|
24
|
-
import FirestoreSnapshotMetadata from './FirestoreSnapshotMetadata';
|
|
25
|
-
import { extractFieldPathData } from './utils';
|
|
26
|
-
import { parseNativeMap } from './utils/serialize';
|
|
27
|
-
|
|
28
|
-
export default class FirestoreDocumentSnapshot {
|
|
29
|
-
constructor(firestore, nativeData) {
|
|
30
|
-
this._data = parseNativeMap(firestore, nativeData.data);
|
|
31
|
-
this._metadata = new FirestoreSnapshotMetadata(nativeData.metadata);
|
|
32
|
-
this._ref = new FirestoreDocumentReference(firestore, FirestorePath.fromName(nativeData.path));
|
|
33
|
-
this._exists = nativeData.exists;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
get id() {
|
|
37
|
-
return this._ref.id;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
get metadata() {
|
|
41
|
-
return this._metadata;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
get ref() {
|
|
45
|
-
return this._ref;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
exists() {
|
|
49
|
-
return this._exists;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
data() {
|
|
53
|
-
// TODO: ehesp: Figure out how to handle this.
|
|
54
|
-
// const snapshotOptions = {};
|
|
55
|
-
//
|
|
56
|
-
// if (!isUndefined(options)) {
|
|
57
|
-
// if (!isObject(options)) {
|
|
58
|
-
// throw new Error(
|
|
59
|
-
// `firebase.firestore() DocumentSnapshot.data(*) 'options' expected an object if defined.`,
|
|
60
|
-
// );
|
|
61
|
-
// }
|
|
62
|
-
//
|
|
63
|
-
// if (
|
|
64
|
-
// options.serverTimestamps &&
|
|
65
|
-
// options.serverTimestamps !== 'estimate' &&
|
|
66
|
-
// options.serverTimestamps !== 'previous' &&
|
|
67
|
-
// options.serverTimestamps !== 'none'
|
|
68
|
-
// ) {
|
|
69
|
-
// throw new Error(
|
|
70
|
-
// `firebase.firestore() DocumentSnapshot.data(*) 'options.serverTimestamps' expected one of 'estimate', 'previous' or 'none'.`,
|
|
71
|
-
// );
|
|
72
|
-
// }
|
|
73
|
-
// }
|
|
74
|
-
|
|
75
|
-
return this._data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
get(fieldPath) {
|
|
79
|
-
// TODO: ehesp: How are SnapshotOptions handled?
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
!isString(fieldPath) &&
|
|
83
|
-
!(fieldPath instanceof FirestoreFieldPath) &&
|
|
84
|
-
!Array.isArray(fieldPath)
|
|
85
|
-
) {
|
|
86
|
-
throw new Error(
|
|
87
|
-
"firebase.firestore() DocumentSnapshot.get(*) 'fieldPath' expected type string, array or FieldPath.",
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
let path;
|
|
92
|
-
|
|
93
|
-
if (isString(fieldPath)) {
|
|
94
|
-
try {
|
|
95
|
-
path = fromDotSeparatedString(fieldPath);
|
|
96
|
-
} catch (e) {
|
|
97
|
-
throw new Error(`firebase.firestore() DocumentSnapshot.get(*) 'fieldPath' ${e.message}.`);
|
|
98
|
-
}
|
|
99
|
-
} else if (isArray(fieldPath)) {
|
|
100
|
-
path = new FirestoreFieldPath(...fieldPath);
|
|
101
|
-
} else {
|
|
102
|
-
// Is already field path
|
|
103
|
-
path = fieldPath;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return extractFieldPathData(this._data, path._segments);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
isEqual(other) {
|
|
110
|
-
if (!(other instanceof FirestoreDocumentSnapshot)) {
|
|
111
|
-
throw new Error(
|
|
112
|
-
"firebase.firestore() DocumentSnapshot.isEqual(*) 'other' expected a DocumentSnapshot instance.",
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (
|
|
117
|
-
this.exists() !== other.exists() ||
|
|
118
|
-
!this.metadata.isEqual(other.metadata) ||
|
|
119
|
-
!this.ref.isEqual(other.ref)
|
|
120
|
-
) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const thisData = JSON.stringify(this.data());
|
|
125
|
-
const otherData = JSON.stringify(other.data());
|
|
126
|
-
|
|
127
|
-
return thisData === otherData;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// To avoid React Native require cycle
|
|
132
|
-
provideDocumentSnapshotClass(FirestoreDocumentSnapshot);
|
package/lib/FirestoreFilter.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isString,
|
|
3
|
-
isNull,
|
|
4
|
-
isUndefined,
|
|
5
|
-
isArray,
|
|
6
|
-
} from '@react-native-firebase/app/dist/module/common';
|
|
7
|
-
import { fromDotSeparatedString } from './FirestoreFieldPath';
|
|
8
|
-
import { generateNativeData } from './utils/serialize';
|
|
9
|
-
import { OPERATORS } from './FirestoreQueryModifiers';
|
|
10
|
-
const AND_QUERY = 'AND';
|
|
11
|
-
const OR_QUERY = 'OR';
|
|
12
|
-
|
|
13
|
-
export function Filter(fieldPath, operator, value) {
|
|
14
|
-
return new _Filter(fieldPath, operator, value);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function _Filter(fieldPath, operator, value, filterOperator, queries) {
|
|
18
|
-
if ([AND_QUERY, OR_QUERY].includes(filterOperator)) {
|
|
19
|
-
// AND or OR Filter (list of Filters)
|
|
20
|
-
this.operator = filterOperator;
|
|
21
|
-
this.queries = queries;
|
|
22
|
-
|
|
23
|
-
this._toMap = function _toMap() {
|
|
24
|
-
return {
|
|
25
|
-
operator: this.operator,
|
|
26
|
-
queries: this.queries.map(query => query._toMap()),
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return this;
|
|
31
|
-
} else {
|
|
32
|
-
// Filter
|
|
33
|
-
this.fieldPath = fieldPath;
|
|
34
|
-
this.operator = operator;
|
|
35
|
-
this.value = value;
|
|
36
|
-
|
|
37
|
-
this._toMap = function _toMap() {
|
|
38
|
-
return {
|
|
39
|
-
fieldPath: this.fieldPath,
|
|
40
|
-
operator: this.operator,
|
|
41
|
-
value: this.value,
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
Filter.and = function and(...queries) {
|
|
50
|
-
if (queries.length > 10 || queries.length < 1) {
|
|
51
|
-
throw new Error(`Expected 1-10 instances of Filter, but got ${queries.length} Filters`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const validateFilters = queries.every(filter => filter instanceof _Filter);
|
|
55
|
-
|
|
56
|
-
if (!validateFilters) {
|
|
57
|
-
throw new Error('Expected every argument to be an instance of Filter');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return new _Filter(null, null, null, AND_QUERY, queries);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
function hasOrOperator(obj) {
|
|
64
|
-
return obj.operator === 'OR' || (Array.isArray(obj.queries) && obj.queries.some(hasOrOperator));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
Filter.or = function or(...queries) {
|
|
68
|
-
if (queries.length > 10 || queries.length < 1) {
|
|
69
|
-
throw new Error(`Expected 1-10 instances of Filter, but got ${queries.length} Filters`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const validateFilters = queries.every(filter => filter instanceof _Filter);
|
|
73
|
-
|
|
74
|
-
if (!validateFilters) {
|
|
75
|
-
throw new Error('Expected every argument to be an instance of Filter');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const hasOr = queries.some(hasOrOperator);
|
|
79
|
-
|
|
80
|
-
if (hasOr) {
|
|
81
|
-
throw new Error('OR Filters with nested OR Filters are not supported');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return new _Filter(null, null, null, OR_QUERY, queries);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
function mapFieldQuery({ fieldPath, operator, value, queries }, modifiers) {
|
|
88
|
-
if (operator === AND_QUERY || operator === OR_QUERY) {
|
|
89
|
-
return {
|
|
90
|
-
operator,
|
|
91
|
-
queries: queries.map(filter => mapFieldQuery(filter, modifiers)),
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
let path;
|
|
96
|
-
if (isString(fieldPath)) {
|
|
97
|
-
try {
|
|
98
|
-
path = fromDotSeparatedString(fieldPath);
|
|
99
|
-
} catch (e) {
|
|
100
|
-
throw new Error(`first argument of Filter(*,_ , _) 'fieldPath' ${e.message}.`);
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
path = fieldPath;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (!modifiers.isValidOperator(operator)) {
|
|
107
|
-
throw new Error(
|
|
108
|
-
"second argument of Filter(*,_ , _) 'opStr' is invalid. Expected one of '==', '>', '>=', '<', '<=', '!=', 'array-contains', 'not-in', 'array-contains-any' or 'in'.",
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (isUndefined(value)) {
|
|
113
|
-
throw new Error("third argument of Filter(*,_ , _) 'value' argument expected.");
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (
|
|
117
|
-
isNull(value) &&
|
|
118
|
-
!modifiers.isEqualOperator(operator) &&
|
|
119
|
-
!modifiers.isNotEqualOperator(operator)
|
|
120
|
-
) {
|
|
121
|
-
throw new Error(
|
|
122
|
-
"third argument of Filter(*,_ , _) 'value' is invalid. You can only perform equals comparisons on null",
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (modifiers.isInOperator(operator)) {
|
|
127
|
-
if (!isArray(value) || !value.length) {
|
|
128
|
-
throw new Error(
|
|
129
|
-
`third argument of Filter(*,_ , _) 'value' is invalid. A non-empty array is required for '${operator}' filters.`,
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (value.length > 10) {
|
|
134
|
-
throw new Error(
|
|
135
|
-
`third argument of Filter(*,_ , _) 'value' is invalid. '${operator}' filters support a maximum of 10 elements in the value array.`,
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return {
|
|
141
|
-
fieldPath: path,
|
|
142
|
-
operator: OPERATORS[operator],
|
|
143
|
-
value: generateNativeData(value, true),
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export function generateFilters(filter, modifiers) {
|
|
148
|
-
const filterMap = filter._toMap();
|
|
149
|
-
|
|
150
|
-
const queriesMaps = filterMap.queries.map(filter => mapFieldQuery(filter, modifiers));
|
|
151
|
-
|
|
152
|
-
return {
|
|
153
|
-
operator: filterMap.operator,
|
|
154
|
-
queries: queriesMaps,
|
|
155
|
-
};
|
|
156
|
-
}
|
package/lib/modular/Bytes.d.ts
DELETED
package/lib/modular/Bytes.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import FirestoreBlob from '../FirestoreBlob';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* An immutable object representing an array of bytes.
|
|
5
|
-
*/
|
|
6
|
-
export class Bytes extends FirestoreBlob {
|
|
7
|
-
/**
|
|
8
|
-
* @hideconstructor
|
|
9
|
-
* @param {firebase.firestore.Blob} blob
|
|
10
|
-
*/
|
|
11
|
-
constructor(blob) {
|
|
12
|
-
super(true);
|
|
13
|
-
// binary string was already parsed and created, potentially expensive
|
|
14
|
-
// don't parse it again, just set it into the new FirebaseBlob
|
|
15
|
-
this._binaryString = blob._binaryString;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @param {string} base64
|
|
20
|
-
* @returns {Bytes}
|
|
21
|
-
*/
|
|
22
|
-
static fromBase64String(base64) {
|
|
23
|
-
return new Bytes(FirestoreBlob.fromBase64String(base64));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @param {Uint8Array} array
|
|
28
|
-
* @returns {Bytes}
|
|
29
|
-
*/
|
|
30
|
-
static fromUint8Array(array) {
|
|
31
|
-
return new Bytes(FirestoreBlob.fromUint8Array(array));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @returns {string}
|
|
36
|
-
*/
|
|
37
|
-
toBase64() {
|
|
38
|
-
return super.toBase64();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @returns {Uint8Array}
|
|
43
|
-
*/
|
|
44
|
-
toUint8Array() {
|
|
45
|
-
return super.toUint8Array();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @returns {string}
|
|
50
|
-
*/
|
|
51
|
-
toString() {
|
|
52
|
-
return 'Bytes(base64: ' + this.toBase64() + ')';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @param {Bytes} other
|
|
57
|
-
* @returns {boolean}
|
|
58
|
-
*/
|
|
59
|
-
isEqual(other) {
|
|
60
|
-
return super.isEqual(other);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A `FieldPath` refers to a field in a document. The path may consist of a
|
|
3
|
-
* single field name (referring to a top-level field in the document), or a
|
|
4
|
-
* list of field names (referring to a nested field in the document).
|
|
5
|
-
*
|
|
6
|
-
* Create a `FieldPath` by providing field names. If more than one field
|
|
7
|
-
* name is provided, the path will point to a nested field in a document.
|
|
8
|
-
*/
|
|
9
|
-
export declare class FieldPath {
|
|
10
|
-
constructor(...fieldNames: string[]);
|
|
11
|
-
|
|
12
|
-
isEqual(other: FieldPath): boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Returns a special sentinel FieldPath to refer to the ID of a document
|
|
17
|
-
* It can be used in queries to sort or filter by the document ID
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
export declare function documentId(): FieldPath;
|
package/lib/modular/FieldPath.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sentinel values that can be used when writing document fields with `set()`
|
|
3
|
-
* or `update()`.
|
|
4
|
-
*/
|
|
5
|
-
export declare class FieldValue {
|
|
6
|
-
isEqual(other: FieldValue): boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Returns a sentinel for use with {@link @firebase/firestore#(updateDoc:1)} or
|
|
11
|
-
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
12
|
-
*/
|
|
13
|
-
export function deleteField(): FieldValue;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Returns a sentinel used with {@link @firebase/firestore#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
17
|
-
* include a server-generated timestamp in the written data.
|
|
18
|
-
*/
|
|
19
|
-
export function serverTimestamp(): FieldValue;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Returns a special value that can be used with {@link @firebase/firestore#(setDoc:1)} or {@link
|
|
23
|
-
* @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array
|
|
24
|
-
* value that already exists on the server. Each specified element that doesn't
|
|
25
|
-
* already exist in the array will be added to the end. If the field being
|
|
26
|
-
* modified is not already an array it will be overwritten with an array
|
|
27
|
-
* containing exactly the specified elements.
|
|
28
|
-
*
|
|
29
|
-
* @param elements - The elements to union into the array.
|
|
30
|
-
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
31
|
-
* `updateDoc()`.
|
|
32
|
-
*/
|
|
33
|
-
export function arrayUnion(...elements: unknown[]): FieldValue;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Returns a special value that can be used with {@link (setDoc:1)} or {@link
|
|
37
|
-
* updateDoc:1} that tells the server to remove the given elements from any
|
|
38
|
-
* array value that already exists on the server. All instances of each element
|
|
39
|
-
* specified will be removed from the array. If the field being modified is not
|
|
40
|
-
* already an array it will be overwritten with an empty array.
|
|
41
|
-
*
|
|
42
|
-
* @param elements - The elements to remove from the array.
|
|
43
|
-
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
44
|
-
* `updateDoc()`
|
|
45
|
-
*/
|
|
46
|
-
export function arrayRemove(...elements: unknown[]): FieldValue;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Returns a special value that can be used with {@link @firebase/firestore#(setDoc:1)} or {@link
|
|
50
|
-
* @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by
|
|
51
|
-
* the given value.
|
|
52
|
-
*
|
|
53
|
-
* If either the operand or the current field value uses floating point
|
|
54
|
-
* precision, all arithmetic follows IEEE 754 semantics. If both values are
|
|
55
|
-
* integers, values outside of JavaScript's safe number range
|
|
56
|
-
* (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to
|
|
57
|
-
* precision loss. Furthermore, once processed by the Firestore backend, all
|
|
58
|
-
* integer operations are capped between -2^63 and 2^63-1.
|
|
59
|
-
*
|
|
60
|
-
* If the current field value is not of type `number`, or if the field does not
|
|
61
|
-
* yet exist, the transformation sets the field to the given value.
|
|
62
|
-
*
|
|
63
|
-
* @param n - The value to increment by.
|
|
64
|
-
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
65
|
-
* `updateDoc()`
|
|
66
|
-
*/
|
|
67
|
-
export function increment(n: number): FieldValue;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import FirestoreFieldValue from '../FirestoreFieldValue';
|
|
2
|
-
|
|
3
|
-
export const FieldValue = FirestoreFieldValue;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @returns {FieldValue}
|
|
7
|
-
*/
|
|
8
|
-
export function deleteField() {
|
|
9
|
-
return FieldValue.delete();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @returns {FieldValue}
|
|
14
|
-
*/
|
|
15
|
-
export function serverTimestamp() {
|
|
16
|
-
return FieldValue.serverTimestamp();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {unknown} elements
|
|
21
|
-
* @returns {FieldValue}
|
|
22
|
-
*/
|
|
23
|
-
export function arrayUnion(...elements) {
|
|
24
|
-
return FieldValue.arrayUnion(...elements);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @param {unknown} elements
|
|
29
|
-
* @returns {FieldValue}
|
|
30
|
-
*/
|
|
31
|
-
export function arrayRemove(...elements) {
|
|
32
|
-
return FieldValue.arrayRemove(...elements);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @param {number} n
|
|
37
|
-
* @returns {FieldValue}
|
|
38
|
-
*/
|
|
39
|
-
export function increment(n) {
|
|
40
|
-
return FieldValue.increment(n);
|
|
41
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An immutable object representing a geographic location in Firestore. The
|
|
3
|
-
* location is represented as latitude/longitude pair.
|
|
4
|
-
*
|
|
5
|
-
* Latitude values are in the range of [-90, 90].
|
|
6
|
-
* Longitude values are in the range of [-180, 180].
|
|
7
|
-
*/
|
|
8
|
-
export declare class GeoPoint {
|
|
9
|
-
readonly latitude: number;
|
|
10
|
-
readonly longitude: number;
|
|
11
|
-
|
|
12
|
-
constructor(latitude: number, longitude: number);
|
|
13
|
-
|
|
14
|
-
isEqual(other: GeoPoint): boolean;
|
|
15
|
-
|
|
16
|
-
toJSON(): { latitude: number; longitude: number };
|
|
17
|
-
}
|
package/lib/modular/GeoPoint.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A `Timestamp` represents a point in time independent of any time zone or
|
|
3
|
-
* calendar, represented as seconds and fractions of seconds at nanosecond
|
|
4
|
-
* resolution in UTC Epoch time.
|
|
5
|
-
*
|
|
6
|
-
* It is encoded using the Proleptic Gregorian Calendar which extends the
|
|
7
|
-
* Gregorian calendar backwards to year one. It is encoded assuming all minutes
|
|
8
|
-
* are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second
|
|
9
|
-
* table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to
|
|
10
|
-
* 9999-12-31T23:59:59.999999999Z.
|
|
11
|
-
*
|
|
12
|
-
* For examples and further specifications, refer to the
|
|
13
|
-
* {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.
|
|
14
|
-
*/
|
|
15
|
-
export declare class Timestamp {
|
|
16
|
-
readonly seconds: number;
|
|
17
|
-
readonly nanoseconds: number;
|
|
18
|
-
|
|
19
|
-
constructor(seconds: number, nanoseconds: number);
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Creates a new timestamp with the current date, with millisecond precision.
|
|
23
|
-
*
|
|
24
|
-
* @returns a new timestamp representing the current date.
|
|
25
|
-
*/
|
|
26
|
-
static now(): Timestamp;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Creates a new timestamp from the given date.
|
|
30
|
-
*
|
|
31
|
-
* @param date - The date to initialize the `Timestamp` from.
|
|
32
|
-
* @returns A new `Timestamp` representing the same point in time as the given
|
|
33
|
-
* date.
|
|
34
|
-
*/
|
|
35
|
-
static fromDate(date: Date): Timestamp;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Creates a new timestamp from the given number of milliseconds.
|
|
39
|
-
*
|
|
40
|
-
* @param milliseconds - Number of milliseconds since Unix epoch
|
|
41
|
-
* 1970-01-01T00:00:00Z.
|
|
42
|
-
* @returns A new `Timestamp` representing the same point in time as the given
|
|
43
|
-
* number of milliseconds.
|
|
44
|
-
*/
|
|
45
|
-
static fromMillis(milliseconds: number): Timestamp;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Converts a `Timestamp` to a JavaScript `Date` object. This conversion
|
|
49
|
-
* causes a loss of precision since `Date` objects only support millisecond
|
|
50
|
-
* precision.
|
|
51
|
-
*
|
|
52
|
-
* @returns JavaScript `Date` object representing the same point in time as
|
|
53
|
-
* this `Timestamp`, with millisecond precision.
|
|
54
|
-
*/
|
|
55
|
-
toDate(): Date;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Converts a `Timestamp` to a numeric timestamp (in milliseconds since
|
|
59
|
-
* epoch). This operation causes a loss of precision.
|
|
60
|
-
*
|
|
61
|
-
* @returns The point in time corresponding to this timestamp, represented as
|
|
62
|
-
* the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.
|
|
63
|
-
*/
|
|
64
|
-
toMillis(): number;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Returns true if this `Timestamp` is equal to the provided one.
|
|
68
|
-
*
|
|
69
|
-
* @param other - The `Timestamp` to compare against.
|
|
70
|
-
* @returns true if this `Timestamp` is equal to the provided one.
|
|
71
|
-
*/
|
|
72
|
-
isEqual(other: Timestamp): boolean;
|
|
73
|
-
|
|
74
|
-
/** Returns a JSON-serializable representation of this `Timestamp`. */
|
|
75
|
-
toJSON(): { seconds: number; nanoseconds: number };
|
|
76
|
-
|
|
77
|
-
/** Returns a textual representation of this `Timestamp`. */
|
|
78
|
-
toString(): string;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Converts this object to a primitive string, which allows `Timestamp` objects
|
|
82
|
-
* to be compared using the `>`, `<=`, `>=` and `>` operators.
|
|
83
|
-
*/
|
|
84
|
-
valueOf(): string;
|
|
85
|
-
}
|
package/lib/modular/Timestamp.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a vector type in Firestore documents. Create an instance with vector().
|
|
3
|
-
*/
|
|
4
|
-
export declare class VectorValue {
|
|
5
|
-
// Note the values array and constructor are not public APIs.
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Builds a VectorValue instance from a JSON object created by VectorValue.toJSON().
|
|
9
|
-
*
|
|
10
|
-
* @param json a JSON object represention of a VectorValue instance.
|
|
11
|
-
*/
|
|
12
|
-
static fromJSON(json: object): VectorValue;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise.
|
|
16
|
-
*/
|
|
17
|
-
isEqual(other: VectorValue): boolean;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Returns a copy of the raw number array form of the vector.
|
|
21
|
-
*/
|
|
22
|
-
toArray(): number[];
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Returns a JSON-serializable representation of this VectorValue instance.
|
|
26
|
-
*/
|
|
27
|
-
toJSON(): { values: number[] };
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export declare function vector(values?: number[]): VectorValue;
|