@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.
Files changed (359) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/RNFBFirestore.podspec +2 -1
  3. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreCollectionModule.java +17 -4
  4. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreDocumentModule.java +2 -2
  5. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineExecutor.java +1243 -0
  6. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineNodeBuilder.java +3919 -0
  7. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineParser.java +1735 -0
  8. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreSerialize.java +1 -1
  9. package/dist/module/FieldPath.js +59 -0
  10. package/dist/module/FieldPath.js.map +1 -0
  11. package/dist/module/FieldValue.js +82 -0
  12. package/dist/module/FieldValue.js.map +1 -0
  13. package/{lib → dist/module}/FirestoreAggregate.js +31 -43
  14. package/dist/module/FirestoreAggregate.js.map +1 -0
  15. package/dist/module/FirestoreBlob.js +56 -0
  16. package/dist/module/FirestoreBlob.js.map +1 -0
  17. package/dist/module/FirestoreCollectionReference.js +70 -0
  18. package/dist/module/FirestoreCollectionReference.js.map +1 -0
  19. package/{lib → dist/module}/FirestoreDocumentChange.js +12 -15
  20. package/dist/module/FirestoreDocumentChange.js.map +1 -0
  21. package/dist/module/FirestoreDocumentReference.js +170 -0
  22. package/dist/module/FirestoreDocumentReference.js.map +1 -0
  23. package/dist/module/FirestoreDocumentSnapshot.js +88 -0
  24. package/dist/module/FirestoreDocumentSnapshot.js.map +1 -0
  25. package/dist/module/FirestoreFilter.js +146 -0
  26. package/dist/module/FirestoreFilter.js.map +1 -0
  27. package/dist/module/FirestoreGeoPoint.js +80 -0
  28. package/dist/module/FirestoreGeoPoint.js.map +1 -0
  29. package/{lib → dist/module}/FirestorePath.js +5 -12
  30. package/dist/module/FirestorePath.js.map +1 -0
  31. package/{lib → dist/module}/FirestorePersistentCacheIndexManager.js +11 -4
  32. package/dist/module/FirestorePersistentCacheIndexManager.js.map +1 -0
  33. package/dist/module/FirestoreQuery.js +298 -0
  34. package/dist/module/FirestoreQuery.js.map +1 -0
  35. package/{lib → dist/module}/FirestoreQueryModifiers.js +25 -136
  36. package/dist/module/FirestoreQueryModifiers.js.map +1 -0
  37. package/dist/module/FirestoreQuerySnapshot.js +98 -0
  38. package/dist/module/FirestoreQuerySnapshot.js.map +1 -0
  39. package/dist/module/FirestoreSnapshotMetadata.js +38 -0
  40. package/dist/module/FirestoreSnapshotMetadata.js.map +1 -0
  41. package/dist/module/FirestoreStatics.js +50 -0
  42. package/dist/module/FirestoreStatics.js.map +1 -0
  43. package/{lib → dist/module}/FirestoreTimestamp.js +39 -39
  44. package/dist/module/FirestoreTimestamp.js.map +1 -0
  45. package/dist/module/FirestoreTransaction.js +113 -0
  46. package/dist/module/FirestoreTransaction.js.map +1 -0
  47. package/dist/module/FirestoreTransactionHandler.js +137 -0
  48. package/dist/module/FirestoreTransactionHandler.js.map +1 -0
  49. package/dist/module/FirestoreVectorValue.js +75 -0
  50. package/dist/module/FirestoreVectorValue.js.map +1 -0
  51. package/dist/module/FirestoreWriteBatch.js +113 -0
  52. package/dist/module/FirestoreWriteBatch.js.map +1 -0
  53. package/dist/module/LoadBundleTask.js +70 -0
  54. package/dist/module/LoadBundleTask.js.map +1 -0
  55. package/dist/module/index.js +31 -0
  56. package/dist/module/index.js.map +1 -0
  57. package/dist/module/modular/Bytes.js +67 -0
  58. package/dist/module/modular/Bytes.js.map +1 -0
  59. package/dist/module/modular/FieldPath.js +25 -0
  60. package/dist/module/modular/FieldPath.js.map +1 -0
  61. package/dist/module/modular/FieldValue.js +37 -0
  62. package/dist/module/modular/FieldValue.js.map +1 -0
  63. package/dist/module/modular/GeoPoint.js +22 -0
  64. package/dist/module/modular/GeoPoint.js.map +1 -0
  65. package/dist/module/modular/Timestamp.js +22 -0
  66. package/dist/module/modular/Timestamp.js.map +1 -0
  67. package/dist/module/modular/VectorValue.js +25 -0
  68. package/dist/module/modular/VectorValue.js.map +1 -0
  69. package/dist/module/modular/query.js +222 -0
  70. package/dist/module/modular/query.js.map +1 -0
  71. package/dist/module/modular/snapshot.js +32 -0
  72. package/dist/module/modular/snapshot.js.map +1 -0
  73. package/dist/module/modular.js +229 -0
  74. package/dist/module/modular.js.map +1 -0
  75. package/dist/module/namespaced.js +298 -0
  76. package/dist/module/namespaced.js.map +1 -0
  77. package/dist/module/package.json +1 -0
  78. package/dist/module/pipelines/expressions.js +1273 -0
  79. package/dist/module/pipelines/expressions.js.map +1 -0
  80. package/dist/module/pipelines/index.js +32 -0
  81. package/dist/module/pipelines/index.js.map +1 -0
  82. package/dist/module/pipelines/pipeline-result.js +58 -0
  83. package/dist/module/pipelines/pipeline-result.js.map +1 -0
  84. package/dist/module/pipelines/pipeline-source.js +4 -0
  85. package/dist/module/pipelines/pipeline-source.js.map +1 -0
  86. package/dist/module/pipelines/pipeline.js +4 -0
  87. package/dist/module/pipelines/pipeline.js.map +1 -0
  88. package/dist/module/pipelines/pipeline_impl.js +42 -0
  89. package/dist/module/pipelines/pipeline_impl.js.map +1 -0
  90. package/dist/module/pipelines/pipeline_options.js +4 -0
  91. package/dist/module/pipelines/pipeline_options.js.map +1 -0
  92. package/dist/module/pipelines/pipeline_runtime.js +526 -0
  93. package/dist/module/pipelines/pipeline_runtime.js.map +1 -0
  94. package/dist/module/pipelines/pipeline_support.js +71 -0
  95. package/dist/module/pipelines/pipeline_support.js.map +1 -0
  96. package/dist/module/pipelines/pipeline_validate.js +183 -0
  97. package/dist/module/pipelines/pipeline_validate.js.map +1 -0
  98. package/dist/module/pipelines/stage_options.js +4 -0
  99. package/dist/module/pipelines/stage_options.js.map +1 -0
  100. package/dist/module/pipelines/types.js +2 -0
  101. package/dist/module/pipelines/types.js.map +1 -0
  102. package/dist/module/types/firestore.js +4 -0
  103. package/dist/module/types/firestore.js.map +1 -0
  104. package/dist/module/types/internal.js +4 -0
  105. package/dist/module/types/internal.js.map +1 -0
  106. package/dist/module/types/namespaced.js +338 -0
  107. package/dist/module/types/namespaced.js.map +1 -0
  108. package/{lib → dist/module}/utils/index.js +59 -114
  109. package/dist/module/utils/index.js.map +1 -0
  110. package/{lib → dist/module}/utils/serialize.js +58 -116
  111. package/dist/module/utils/serialize.js.map +1 -0
  112. package/{lib → dist/module}/utils/typemap.js +6 -20
  113. package/dist/module/utils/typemap.js.map +1 -0
  114. package/dist/module/version.js +5 -0
  115. package/dist/module/version.js.map +1 -0
  116. package/dist/module/web/RNFBFirestoreModule.android.js +5 -0
  117. package/dist/module/web/RNFBFirestoreModule.android.js.map +1 -0
  118. package/dist/module/web/RNFBFirestoreModule.ios.js +5 -0
  119. package/dist/module/web/RNFBFirestoreModule.ios.js.map +1 -0
  120. package/dist/module/web/RNFBFirestoreModule.js +387 -0
  121. package/dist/module/web/RNFBFirestoreModule.js.map +1 -0
  122. package/{lib → dist/module}/web/convert.js +60 -94
  123. package/dist/module/web/convert.js.map +1 -0
  124. package/dist/module/web/pipelines/pipeline.js +34 -0
  125. package/dist/module/web/pipelines/pipeline.js.map +1 -0
  126. package/dist/module/web/pipelines/pipeline_bridge_factory.js +217 -0
  127. package/dist/module/web/pipelines/pipeline_bridge_factory.js.map +1 -0
  128. package/dist/module/web/pipelines/pipeline_node_builder.js +294 -0
  129. package/dist/module/web/pipelines/pipeline_node_builder.js.map +1 -0
  130. package/dist/module/web/pipelines/pipeline_parser.js +21 -0
  131. package/dist/module/web/pipelines/pipeline_parser.js.map +1 -0
  132. package/dist/module/web/pipelines/pipeline_snapshot_serializer.js +89 -0
  133. package/dist/module/web/pipelines/pipeline_snapshot_serializer.js.map +1 -0
  134. package/dist/module/web/query.js +95 -0
  135. package/dist/module/web/query.js.map +1 -0
  136. package/dist/typescript/lib/FieldPath.d.ts +10 -0
  137. package/dist/typescript/lib/FieldPath.d.ts.map +1 -0
  138. package/dist/typescript/lib/FieldValue.d.ts +17 -0
  139. package/dist/typescript/lib/FieldValue.d.ts.map +1 -0
  140. package/dist/typescript/lib/FirestoreAggregate.d.ts +40 -0
  141. package/dist/typescript/lib/FirestoreAggregate.d.ts.map +1 -0
  142. package/dist/typescript/lib/FirestoreBlob.d.ts +11 -0
  143. package/dist/typescript/lib/FirestoreBlob.d.ts.map +1 -0
  144. package/dist/typescript/lib/FirestoreCollectionReference.d.ts +15 -0
  145. package/dist/typescript/lib/FirestoreCollectionReference.d.ts.map +1 -0
  146. package/dist/typescript/lib/FirestoreDocumentChange.d.ts +27 -0
  147. package/dist/typescript/lib/FirestoreDocumentChange.d.ts.map +1 -0
  148. package/dist/typescript/lib/FirestoreDocumentReference.d.ts +30 -0
  149. package/dist/typescript/lib/FirestoreDocumentReference.d.ts.map +1 -0
  150. package/dist/typescript/lib/FirestoreDocumentSnapshot.d.ts +30 -0
  151. package/dist/typescript/lib/FirestoreDocumentSnapshot.d.ts.map +1 -0
  152. package/dist/typescript/lib/FirestoreFilter.d.ts +52 -0
  153. package/dist/typescript/lib/FirestoreFilter.d.ts.map +1 -0
  154. package/dist/typescript/lib/FirestoreGeoPoint.d.ts +22 -0
  155. package/dist/typescript/lib/FirestoreGeoPoint.d.ts.map +1 -0
  156. package/dist/typescript/lib/FirestorePath.d.ts +12 -0
  157. package/dist/typescript/lib/FirestorePath.d.ts.map +1 -0
  158. package/dist/typescript/lib/FirestorePersistentCacheIndexManager.d.ts +16 -0
  159. package/dist/typescript/lib/FirestorePersistentCacheIndexManager.d.ts.map +1 -0
  160. package/dist/typescript/lib/FirestoreQuery.d.ts +39 -0
  161. package/dist/typescript/lib/FirestoreQuery.d.ts.map +1 -0
  162. package/dist/typescript/lib/FirestoreQueryModifiers.d.ts +59 -0
  163. package/dist/typescript/lib/FirestoreQueryModifiers.d.ts.map +1 -0
  164. package/dist/typescript/lib/FirestoreQuerySnapshot.d.ts +49 -0
  165. package/dist/typescript/lib/FirestoreQuerySnapshot.d.ts.map +1 -0
  166. package/dist/typescript/lib/FirestoreSnapshotMetadata.d.ts +8 -0
  167. package/dist/typescript/lib/FirestoreSnapshotMetadata.d.ts.map +1 -0
  168. package/dist/typescript/lib/FirestoreStatics.d.ts +23 -0
  169. package/dist/typescript/lib/FirestoreStatics.d.ts.map +1 -0
  170. package/dist/typescript/lib/FirestoreTimestamp.d.ts +33 -0
  171. package/dist/typescript/lib/FirestoreTimestamp.d.ts.map +1 -0
  172. package/dist/typescript/lib/FirestoreTransaction.d.ts +42 -0
  173. package/dist/typescript/lib/FirestoreTransaction.d.ts.map +1 -0
  174. package/dist/typescript/lib/FirestoreTransactionHandler.d.ts +26 -0
  175. package/dist/typescript/lib/FirestoreTransactionHandler.d.ts.map +1 -0
  176. package/dist/typescript/lib/FirestoreVectorValue.d.ts +17 -0
  177. package/dist/typescript/lib/FirestoreVectorValue.d.ts.map +1 -0
  178. package/dist/typescript/lib/FirestoreWriteBatch.d.ts +21 -0
  179. package/dist/typescript/lib/FirestoreWriteBatch.d.ts.map +1 -0
  180. package/dist/typescript/lib/LoadBundleTask.d.ts +16 -0
  181. package/dist/typescript/lib/LoadBundleTask.d.ts.map +1 -0
  182. package/dist/typescript/lib/index.d.ts +6 -0
  183. package/dist/typescript/lib/index.d.ts.map +1 -0
  184. package/dist/typescript/lib/modular/Bytes.d.ts +22 -0
  185. package/dist/typescript/lib/modular/Bytes.d.ts.map +1 -0
  186. package/dist/typescript/lib/modular/FieldPath.d.ts +4 -0
  187. package/dist/typescript/lib/modular/FieldPath.d.ts.map +1 -0
  188. package/dist/typescript/lib/modular/FieldValue.d.ts +8 -0
  189. package/dist/typescript/lib/modular/FieldValue.d.ts.map +1 -0
  190. package/dist/typescript/lib/modular/GeoPoint.d.ts +3 -0
  191. package/dist/typescript/lib/modular/GeoPoint.d.ts.map +1 -0
  192. package/dist/typescript/lib/modular/Timestamp.d.ts +3 -0
  193. package/dist/typescript/lib/modular/Timestamp.d.ts.map +1 -0
  194. package/dist/typescript/lib/modular/VectorValue.d.ts +4 -0
  195. package/dist/typescript/lib/modular/VectorValue.d.ts.map +1 -0
  196. package/dist/typescript/lib/modular/query.d.ts +93 -0
  197. package/dist/typescript/lib/modular/query.d.ts.map +1 -0
  198. package/dist/typescript/lib/modular/snapshot.d.ts +30 -0
  199. package/dist/typescript/lib/modular/snapshot.d.ts.map +1 -0
  200. package/dist/typescript/lib/modular.d.ts +69 -0
  201. package/dist/typescript/lib/modular.d.ts.map +1 -0
  202. package/dist/typescript/lib/namespaced.d.ts +13 -0
  203. package/dist/typescript/lib/namespaced.d.ts.map +1 -0
  204. package/dist/typescript/lib/pipelines/expressions.d.ts +723 -0
  205. package/dist/typescript/lib/pipelines/expressions.d.ts.map +1 -0
  206. package/dist/typescript/lib/pipelines/index.d.ts +31 -0
  207. package/dist/typescript/lib/pipelines/index.d.ts.map +1 -0
  208. package/dist/typescript/lib/pipelines/pipeline-result.d.ts +30 -0
  209. package/dist/typescript/lib/pipelines/pipeline-result.d.ts.map +1 -0
  210. package/dist/typescript/lib/pipelines/pipeline-source.d.ts +64 -0
  211. package/dist/typescript/lib/pipelines/pipeline-source.d.ts.map +1 -0
  212. package/dist/typescript/lib/pipelines/pipeline.d.ts +61 -0
  213. package/dist/typescript/lib/pipelines/pipeline.d.ts.map +1 -0
  214. package/dist/typescript/lib/pipelines/pipeline_impl.d.ts +21 -0
  215. package/dist/typescript/lib/pipelines/pipeline_impl.d.ts.map +1 -0
  216. package/dist/typescript/lib/pipelines/pipeline_options.d.ts +17 -0
  217. package/dist/typescript/lib/pipelines/pipeline_options.d.ts.map +1 -0
  218. package/dist/typescript/lib/pipelines/pipeline_runtime.d.ts +10 -0
  219. package/dist/typescript/lib/pipelines/pipeline_runtime.d.ts.map +1 -0
  220. package/dist/typescript/lib/pipelines/pipeline_support.d.ts +7 -0
  221. package/dist/typescript/lib/pipelines/pipeline_support.d.ts.map +1 -0
  222. package/dist/typescript/lib/pipelines/pipeline_validate.d.ts +9 -0
  223. package/dist/typescript/lib/pipelines/pipeline_validate.d.ts.map +1 -0
  224. package/dist/typescript/lib/pipelines/stage_options.d.ts +326 -0
  225. package/dist/typescript/lib/pipelines/stage_options.d.ts.map +1 -0
  226. package/dist/typescript/lib/pipelines/types.d.ts +10 -0
  227. package/dist/typescript/lib/pipelines/types.d.ts.map +1 -0
  228. package/dist/typescript/lib/types/firestore.d.ts +263 -0
  229. package/dist/typescript/lib/types/firestore.d.ts.map +1 -0
  230. package/dist/typescript/lib/types/internal.d.ts +483 -0
  231. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  232. package/dist/typescript/lib/types/namespaced.d.ts +2285 -0
  233. package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
  234. package/dist/typescript/lib/utils/index.d.ts +15 -0
  235. package/dist/typescript/lib/utils/index.d.ts.map +1 -0
  236. package/dist/typescript/lib/utils/serialize.d.ts +17 -0
  237. package/dist/typescript/lib/utils/serialize.d.ts.map +1 -0
  238. package/dist/typescript/lib/utils/typemap.d.ts +3 -0
  239. package/dist/typescript/lib/utils/typemap.d.ts.map +1 -0
  240. package/dist/typescript/lib/version.d.ts +2 -0
  241. package/dist/typescript/lib/version.d.ts.map +1 -0
  242. package/dist/typescript/lib/web/RNFBFirestoreModule.android.d.ts +3 -0
  243. package/dist/typescript/lib/web/RNFBFirestoreModule.android.d.ts.map +1 -0
  244. package/dist/typescript/lib/web/RNFBFirestoreModule.d.ts +75 -0
  245. package/dist/typescript/lib/web/RNFBFirestoreModule.d.ts.map +1 -0
  246. package/dist/typescript/lib/web/RNFBFirestoreModule.ios.d.ts +3 -0
  247. package/dist/typescript/lib/web/RNFBFirestoreModule.ios.d.ts.map +1 -0
  248. package/dist/typescript/lib/web/convert.d.ts +14 -0
  249. package/dist/typescript/lib/web/convert.d.ts.map +1 -0
  250. package/dist/typescript/lib/web/pipelines/pipeline.d.ts +4 -0
  251. package/dist/typescript/lib/web/pipelines/pipeline.d.ts.map +1 -0
  252. package/dist/typescript/lib/web/pipelines/pipeline_bridge_factory.d.ts +5 -0
  253. package/dist/typescript/lib/web/pipelines/pipeline_bridge_factory.d.ts.map +1 -0
  254. package/dist/typescript/lib/web/pipelines/pipeline_node_builder.d.ts +5 -0
  255. package/dist/typescript/lib/web/pipelines/pipeline_node_builder.d.ts.map +1 -0
  256. package/dist/typescript/lib/web/pipelines/pipeline_parser.d.ts +3 -0
  257. package/dist/typescript/lib/web/pipelines/pipeline_parser.d.ts.map +1 -0
  258. package/dist/typescript/lib/web/pipelines/pipeline_snapshot_serializer.d.ts +4 -0
  259. package/dist/typescript/lib/web/pipelines/pipeline_snapshot_serializer.d.ts.map +1 -0
  260. package/dist/typescript/lib/web/query.d.ts +23 -0
  261. package/dist/typescript/lib/web/query.d.ts.map +1 -0
  262. package/dist/typescript/package.json +1 -0
  263. package/ios/RNFBFirestore/RNFBFirestoreCollectionModule.m +52 -2
  264. package/ios/RNFBFirestore/RNFBFirestorePipelineBridgeFactory.swift +384 -0
  265. package/ios/RNFBFirestore/RNFBFirestorePipelineCallHandler.swift +86 -0
  266. package/ios/RNFBFirestore/RNFBFirestorePipelineNodeBuilder.swift +1500 -0
  267. package/ios/RNFBFirestore/RNFBFirestorePipelineParser.swift +1352 -0
  268. package/ios/RNFBFirestore/RNFBFirestorePipelineSnapshotSerializer.swift +98 -0
  269. package/lib/{FirestoreFieldPath.js → FieldPath.ts} +10 -12
  270. package/lib/{FirestoreFieldValue.js → FieldValue.ts} +22 -19
  271. package/lib/FirestoreAggregate.ts +124 -0
  272. package/lib/FirestoreBlob.ts +73 -0
  273. package/lib/FirestoreCollectionReference.ts +99 -0
  274. package/lib/FirestoreDocumentChange.ts +71 -0
  275. package/lib/FirestoreDocumentReference.ts +310 -0
  276. package/lib/FirestoreDocumentSnapshot.ts +149 -0
  277. package/lib/FirestoreFilter.ts +232 -0
  278. package/lib/{FirestoreGeoPoint.js → FirestoreGeoPoint.ts} +48 -8
  279. package/lib/FirestorePath.ts +54 -0
  280. package/lib/FirestorePersistentCacheIndexManager.ts +46 -0
  281. package/lib/{FirestoreQuery.js → FirestoreQuery.ts} +208 -100
  282. package/lib/FirestoreQueryModifiers.ts +411 -0
  283. package/lib/{FirestoreQuerySnapshot.js → FirestoreQuerySnapshot.ts} +61 -32
  284. package/lib/{FirestoreSnapshotMetadata.js → FirestoreSnapshotMetadata.ts} +8 -6
  285. package/lib/{FirestoreStatics.js → FirestoreStatics.ts} +18 -11
  286. package/lib/FirestoreTimestamp.ts +161 -0
  287. package/lib/{FirestoreTransaction.js → FirestoreTransaction.ts} +64 -27
  288. package/lib/{FirestoreTransactionHandler.js → FirestoreTransactionHandler.ts} +54 -75
  289. package/lib/{FirestoreVectorValue.js → FirestoreVectorValue.ts} +36 -15
  290. package/lib/{FirestoreWriteBatch.js → FirestoreWriteBatch.ts} +45 -21
  291. package/lib/LoadBundleTask.ts +85 -0
  292. package/lib/index.ts +71 -0
  293. package/lib/modular/Bytes.ts +81 -0
  294. package/lib/modular/FieldPath.ts +24 -0
  295. package/lib/modular/FieldValue.ts +40 -0
  296. package/lib/modular/GeoPoint.ts +20 -0
  297. package/lib/modular/Timestamp.ts +20 -0
  298. package/lib/modular/VectorValue.ts +24 -0
  299. package/lib/modular/query.ts +368 -0
  300. package/lib/modular/snapshot.ts +137 -0
  301. package/lib/modular.ts +552 -0
  302. package/lib/{index.js → namespaced.ts} +170 -80
  303. package/lib/pipelines/expressions.ts +2321 -0
  304. package/lib/pipelines/index.ts +203 -0
  305. package/lib/pipelines/pipeline-result.ts +78 -0
  306. package/lib/pipelines/pipeline-source.ts +83 -0
  307. package/lib/pipelines/pipeline.ts +99 -0
  308. package/lib/pipelines/pipeline_impl.ts +46 -0
  309. package/lib/pipelines/pipeline_options.ts +32 -0
  310. package/lib/pipelines/pipeline_runtime.ts +863 -0
  311. package/lib/pipelines/pipeline_support.ts +134 -0
  312. package/lib/pipelines/pipeline_validate.ts +242 -0
  313. package/lib/pipelines/stage_options.ts +376 -0
  314. package/lib/pipelines/types.ts +26 -0
  315. package/lib/types/firestore.ts +477 -0
  316. package/lib/types/internal.ts +747 -0
  317. package/lib/{index.d.ts → types/namespaced.ts} +280 -79
  318. package/lib/utils/index.ts +244 -0
  319. package/lib/utils/serialize.ts +314 -0
  320. package/lib/utils/typemap.ts +65 -0
  321. package/lib/version.ts +2 -0
  322. package/lib/web/{RNFBFirestoreModule.js → RNFBFirestoreModule.ts} +222 -234
  323. package/lib/web/convert.ts +287 -0
  324. package/lib/web/pipelines/pipeline.ts +47 -0
  325. package/lib/web/pipelines/pipeline_bridge_factory.ts +377 -0
  326. package/lib/web/pipelines/pipeline_node_builder.ts +413 -0
  327. package/lib/web/pipelines/pipeline_parser.ts +23 -0
  328. package/lib/web/pipelines/pipeline_snapshot_serializer.ts +133 -0
  329. package/lib/web/query.ts +150 -0
  330. package/package.json +46 -7
  331. package/tsconfig.json +35 -0
  332. package/lib/FirestoreBlob.js +0 -107
  333. package/lib/FirestoreCollectionReference.js +0 -70
  334. package/lib/FirestoreDocumentReference.js +0 -222
  335. package/lib/FirestoreDocumentSnapshot.js +0 -132
  336. package/lib/FirestoreFilter.js +0 -156
  337. package/lib/modular/Bytes.d.ts +0 -11
  338. package/lib/modular/Bytes.js +0 -62
  339. package/lib/modular/FieldPath.d.ts +0 -20
  340. package/lib/modular/FieldPath.js +0 -7
  341. package/lib/modular/FieldValue.d.ts +0 -67
  342. package/lib/modular/FieldValue.js +0 -41
  343. package/lib/modular/GeoPoint.d.ts +0 -17
  344. package/lib/modular/GeoPoint.js +0 -3
  345. package/lib/modular/Timestamp.d.ts +0 -85
  346. package/lib/modular/Timestamp.js +0 -3
  347. package/lib/modular/VectorValue.d.ts +0 -30
  348. package/lib/modular/VectorValue.js +0 -11
  349. package/lib/modular/index.d.ts +0 -788
  350. package/lib/modular/index.js +0 -410
  351. package/lib/modular/query.d.ts +0 -370
  352. package/lib/modular/query.js +0 -233
  353. package/lib/modular/snapshot.d.ts +0 -256
  354. package/lib/modular/snapshot.js +0 -33
  355. package/lib/modular/utils/observer.js +0 -16
  356. package/lib/version.js +0 -2
  357. package/lib/web/query.js +0 -112
  358. /package/lib/web/{RNFBFirestoreModule.android.js → RNFBFirestoreModule.android.ts} +0 -0
  359. /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);
@@ -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
- }
@@ -1,11 +0,0 @@
1
- export declare class Bytes extends FirestoreBlob {
2
- static fromBase64String(base64: string): Bytes;
3
-
4
- static fromUint8Array(array: Uint8Array): Bytes;
5
-
6
- toBase64(): string;
7
-
8
- toUint8Array(): Uint8Array;
9
-
10
- isEqual(other: Bytes): boolean;
11
- }
@@ -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;
@@ -1,7 +0,0 @@
1
- import FirestoreFieldPath from '../FirestoreFieldPath';
2
-
3
- export const FieldPath = FirestoreFieldPath;
4
-
5
- export function documentId() {
6
- return FieldPath.documentId();
7
- }
@@ -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
- }
@@ -1,3 +0,0 @@
1
- import FirestoreGeoPoint from '../FirestoreGeoPoint';
2
-
3
- export const GeoPoint = FirestoreGeoPoint;
@@ -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
- }
@@ -1,3 +0,0 @@
1
- import FirestoreTimestamp from '../FirestoreTimestamp';
2
-
3
- export const Timestamp = FirestoreTimestamp;
@@ -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;
@@ -1,11 +0,0 @@
1
- import FirestoreVectorValue from '../FirestoreVectorValue';
2
-
3
- export const VectorValue = FirestoreVectorValue;
4
-
5
- /**
6
- * @param {number[]=} values
7
- * @returns {VectorValue}
8
- */
9
- export function vector(values) {
10
- return new VectorValue(values);
11
- }