react-query-firebase 2.13.3 → 2.14.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 (377) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +4 -0
  3. package/dist/react-native/analytics/index.d.ts +3 -0
  4. package/dist/react-native/analytics/index.js +3 -0
  5. package/{react-native/analytics/useAnalytics.ts → dist/react-native/analytics/useAnalytics.js} +1 -3
  6. package/{react-native → dist/react-native}/analytics/useLogEvent.js +1 -1
  7. package/{react-native → dist/react-native}/analytics/useSetAnalyticsCollectionEnabled.js +1 -1
  8. package/dist/react-native/auth/index.d.ts +19 -0
  9. package/dist/react-native/auth/index.js +19 -0
  10. package/{react-native/auth/useAuth.ts → dist/react-native/auth/useAuth.js} +1 -3
  11. package/{react-native → dist/react-native}/auth/useAuthStateReady.js +1 -1
  12. package/{react-native → dist/react-native}/auth/useCreateUserWitEmailAndPasswordMutation.js +2 -2
  13. package/{react-native → dist/react-native}/auth/useCurrentUser.js +1 -1
  14. package/{react-native → dist/react-native}/auth/useIdToken.js +2 -2
  15. package/{react-native → dist/react-native}/auth/useLinkWithCredentialMutation.js +1 -1
  16. package/{react-native → dist/react-native}/auth/useReauthenticateWitCredentialMutation.js +1 -1
  17. package/{react-native → dist/react-native}/auth/useReauthenticateWitRedirectMutation.js +1 -1
  18. package/{react-native → dist/react-native}/auth/useSendEmailVerificationMutation.js +1 -1
  19. package/{react-native → dist/react-native}/auth/useSignInAnonymouslyMutation.js +2 -2
  20. package/{react-native → dist/react-native}/auth/useSignInWitEmailAndPasswordMutation.js +2 -2
  21. package/{react-native → dist/react-native}/auth/useSignInWitRedirectMutation.js +2 -2
  22. package/{react-native → dist/react-native}/auth/useSignInWithCredentialMutation.js +2 -2
  23. package/{react-native → dist/react-native}/auth/useSignOutMutation.js +2 -2
  24. package/{react-native → dist/react-native}/auth/useUpdateProfileMutation.js +1 -1
  25. package/{react-native → dist/react-native}/context/FirebaseContextProvider.js +1 -1
  26. package/dist/react-native/context/index.d.ts +1 -0
  27. package/dist/react-native/context/index.js +1 -0
  28. package/dist/react-native/firestore/index.d.ts +23 -0
  29. package/dist/react-native/firestore/index.js +23 -0
  30. package/{react-native → dist/react-native}/firestore/useAddDocMutation.d.ts +1 -1
  31. package/{react-native → dist/react-native}/firestore/useBatchWrite.js +1 -1
  32. package/{react-native → dist/react-native}/firestore/useCollectionReference.d.ts +1 -1
  33. package/{react-native → dist/react-native}/firestore/useCollectionReference.js +1 -1
  34. package/{react-native → dist/react-native}/firestore/useCompositeFilter.d.ts +2 -2
  35. package/{react-native → dist/react-native}/firestore/useCompositeFilter.js +1 -1
  36. package/{react-native → dist/react-native}/firestore/useCountQuery.d.ts +2 -2
  37. package/{react-native → dist/react-native}/firestore/useDeleteDocMutation.d.ts +1 -1
  38. package/{react-native → dist/react-native}/firestore/useDocReference.d.ts +2 -2
  39. package/{react-native → dist/react-native}/firestore/useDocReference.js +2 -2
  40. package/{react-native → dist/react-native}/firestore/useDocReferences.d.ts +2 -2
  41. package/{react-native → dist/react-native}/firestore/useDocReferences.js +2 -2
  42. package/{web → dist/react-native}/firestore/useEnsureDoc.d.ts +2 -2
  43. package/{react-native → dist/react-native}/firestore/useEnsureDoc.js +3 -3
  44. package/{react-native/firestore/useFirestore.ts → dist/react-native/firestore/useFirestore.js} +1 -2
  45. package/{react-native → dist/react-native}/firestore/useGetDocData.d.ts +2 -2
  46. package/{web → dist/react-native}/firestore/useGetDocData.js +2 -2
  47. package/{react-native → dist/react-native}/firestore/useGetRealtimeDocData.d.ts +1 -1
  48. package/{react-native → dist/react-native}/firestore/useGetRealtimeDocData.js +1 -1
  49. package/{react-native → dist/react-native}/firestore/useInfiniteQuery.d.ts +2 -2
  50. package/{react-native → dist/react-native}/firestore/useQuery.d.ts +2 -2
  51. package/{react-native → dist/react-native}/firestore/useQueryConstraints.d.ts +2 -2
  52. package/{react-native → dist/react-native}/firestore/useQueryConstraints.js +1 -1
  53. package/{react-native → dist/react-native}/firestore/useRunTransaction.js +1 -1
  54. package/{react-native → dist/react-native}/firestore/useSetDocMutation.d.ts +1 -1
  55. package/{react-native → dist/react-native}/firestore/useUpdateDocMutation.d.ts +1 -1
  56. package/{react-native → dist/react-native}/firestore/utils/buildCompositeFilter.d.ts +1 -1
  57. package/{react-native → dist/react-native}/firestore/utils/buildQueryConstraint.d.ts +1 -1
  58. package/{react-native → dist/react-native}/firestore/utils/getDocData.d.ts +2 -2
  59. package/{react-native → dist/react-native}/firestore/utils/getDocData.js +1 -1
  60. package/{react-native → dist/react-native}/firestore/utils/getDocRef.d.ts +1 -1
  61. package/{react-native → dist/react-native}/firestore/utils/getDocSnap.d.ts +2 -2
  62. package/{react-native → dist/react-native}/firestore/utils/getDocSnap.js +1 -1
  63. package/dist/react-native/index.d.ts +5 -0
  64. package/dist/react-native/index.js +5 -0
  65. package/dist/react-native/remoteConfig/index.d.ts +3 -0
  66. package/dist/react-native/remoteConfig/index.js +3 -0
  67. package/{react-native → dist/react-native}/remoteConfig/useFetchAndActivate.js +1 -1
  68. package/{react-native → dist/react-native}/remoteConfig/useGetValue.js +1 -1
  69. package/{react-native/remoteConfig/useRemoteConfig.ts → dist/react-native/remoteConfig/useRemoteConfig.js} +1 -2
  70. package/{types → dist/types}/QueryConstraints.d.ts +1 -1
  71. package/dist/types/index.d.ts +2 -0
  72. package/dist/types/index.js +2 -0
  73. package/dist/web/analytics/index.d.ts +3 -0
  74. package/dist/web/analytics/index.js +3 -0
  75. package/{web/analytics/useAnalytics.ts → dist/web/analytics/useAnalytics.js} +1 -3
  76. package/{web → dist/web}/analytics/useLogEvent.js +1 -1
  77. package/{web → dist/web}/analytics/useSetAnalyticsCollectionEnabled.js +1 -1
  78. package/dist/web/auth/index.d.ts +20 -0
  79. package/dist/web/auth/index.js +20 -0
  80. package/{web/auth/useAuth.ts → dist/web/auth/useAuth.js} +1 -3
  81. package/{web → dist/web}/auth/useAuthStateReady.js +1 -1
  82. package/{web → dist/web}/auth/useCreateUserWitEmailAndPasswordMutation.js +2 -2
  83. package/{web → dist/web}/auth/useCurrentUser.js +1 -1
  84. package/{web → dist/web}/auth/useGetRedirectResultMutation.js +2 -2
  85. package/{web → dist/web}/auth/useIdToken.js +2 -2
  86. package/{web → dist/web}/auth/useLinkWithCredentialMutation.js +1 -1
  87. package/{web → dist/web}/auth/useReauthenticateWitCredentialMutation.js +1 -1
  88. package/{web → dist/web}/auth/useReauthenticateWitRedirectMutation.js +1 -1
  89. package/{web → dist/web}/auth/useSendEmailVerificationMutation.js +1 -1
  90. package/{web → dist/web}/auth/useSignInAnonymouslyMutation.js +2 -2
  91. package/{web → dist/web}/auth/useSignInWitEmailAndPasswordMutation.js +2 -2
  92. package/{web → dist/web}/auth/useSignInWitRedirectMutation.js +2 -2
  93. package/{web → dist/web}/auth/useSignInWithCredentialMutation.js +2 -2
  94. package/{web → dist/web}/auth/useSignOutMutation.js +2 -2
  95. package/{web → dist/web}/auth/useUpdateProfileMutation.js +1 -1
  96. package/{web → dist/web}/context/FirebaseContextProvider.js +1 -1
  97. package/dist/web/context/index.d.ts +1 -0
  98. package/dist/web/context/index.js +1 -0
  99. package/dist/web/firestore/index.d.ts +23 -0
  100. package/dist/web/firestore/index.js +23 -0
  101. package/{web → dist/web}/firestore/useAddDocMutation.d.ts +1 -1
  102. package/{web → dist/web}/firestore/useBatchWrite.js +1 -1
  103. package/{web → dist/web}/firestore/useCollectionReference.d.ts +1 -1
  104. package/{web → dist/web}/firestore/useCollectionReference.js +1 -1
  105. package/{web → dist/web}/firestore/useCompositeFilter.d.ts +2 -2
  106. package/{web → dist/web}/firestore/useCompositeFilter.js +1 -1
  107. package/{web → dist/web}/firestore/useCountQuery.d.ts +2 -2
  108. package/{web → dist/web}/firestore/useDeleteDocMutation.d.ts +1 -1
  109. package/{web → dist/web}/firestore/useDocReference.d.ts +2 -2
  110. package/{web → dist/web}/firestore/useDocReference.js +2 -2
  111. package/{web → dist/web}/firestore/useDocReferences.d.ts +2 -2
  112. package/{web → dist/web}/firestore/useDocReferences.js +2 -2
  113. package/{react-native → dist/web}/firestore/useEnsureDoc.d.ts +2 -2
  114. package/{web → dist/web}/firestore/useEnsureDoc.js +3 -3
  115. package/{web/firestore/useFirestore.ts → dist/web/firestore/useFirestore.js} +1 -2
  116. package/{web → dist/web}/firestore/useGetDocData.d.ts +2 -2
  117. package/{react-native → dist/web}/firestore/useGetDocData.js +2 -2
  118. package/{web → dist/web}/firestore/useGetRealtimeDocData.d.ts +1 -1
  119. package/{web → dist/web}/firestore/useGetRealtimeDocData.js +1 -1
  120. package/{web → dist/web}/firestore/useInfiniteQuery.d.ts +2 -2
  121. package/{web → dist/web}/firestore/useQuery.d.ts +2 -2
  122. package/{web → dist/web}/firestore/useQueryConstraints.d.ts +2 -2
  123. package/{web → dist/web}/firestore/useQueryConstraints.js +1 -1
  124. package/{web → dist/web}/firestore/useRunTransaction.js +1 -1
  125. package/{web → dist/web}/firestore/useSetDocMutation.d.ts +1 -1
  126. package/{web → dist/web}/firestore/useUpdateDocMutation.d.ts +1 -1
  127. package/{web → dist/web}/firestore/utils/buildCompositeFilter.d.ts +1 -1
  128. package/{web → dist/web}/firestore/utils/buildQueryConstraint.d.ts +1 -1
  129. package/{web → dist/web}/firestore/utils/getDocData.d.ts +2 -2
  130. package/{web → dist/web}/firestore/utils/getDocData.js +1 -1
  131. package/{web → dist/web}/firestore/utils/getDocRef.d.ts +1 -1
  132. package/{web → dist/web}/firestore/utils/getDocSnap.d.ts +2 -2
  133. package/{web → dist/web}/firestore/utils/getDocSnap.js +1 -1
  134. package/dist/web/index.d.ts +5 -0
  135. package/dist/web/index.js +5 -0
  136. package/dist/web/remoteConfig/index.d.ts +3 -0
  137. package/dist/web/remoteConfig/index.js +3 -0
  138. package/{web → dist/web}/remoteConfig/useFetchAndActivate.js +1 -1
  139. package/{web → dist/web}/remoteConfig/useGetValue.js +1 -1
  140. package/{web/remoteConfig/useRemoteConfig.ts → dist/web/remoteConfig/useRemoteConfig.js} +1 -2
  141. package/package.json +37 -17
  142. package/react-native/analytics/index.d.ts +0 -3
  143. package/react-native/analytics/index.js +0 -3
  144. package/react-native/analytics/index.ts +0 -3
  145. package/react-native/analytics/useAnalytics.js +0 -10
  146. package/react-native/analytics/useLogEvent.ts +0 -34
  147. package/react-native/analytics/useSetAnalyticsCollectionEnabled.ts +0 -22
  148. package/react-native/auth/index.d.ts +0 -19
  149. package/react-native/auth/index.js +0 -19
  150. package/react-native/auth/index.ts +0 -19
  151. package/react-native/auth/mutation-keys.ts +0 -22
  152. package/react-native/auth/useAppleAuthProviderCredential.ts +0 -31
  153. package/react-native/auth/useAuth.js +0 -10
  154. package/react-native/auth/useAuthStateReady.ts +0 -39
  155. package/react-native/auth/useCreateUserWitEmailAndPasswordMutation.ts +0 -38
  156. package/react-native/auth/useCurrentUser.ts +0 -26
  157. package/react-native/auth/useEmailAuthProviderCredential.ts +0 -38
  158. package/react-native/auth/useFacebookAuthProviderCredential.ts +0 -31
  159. package/react-native/auth/useIdToken.ts +0 -83
  160. package/react-native/auth/useLinkWithCredentialMutation.ts +0 -35
  161. package/react-native/auth/useReauthenticateWitCredentialMutation.ts +0 -36
  162. package/react-native/auth/useReauthenticateWitRedirectMutation.ts +0 -42
  163. package/react-native/auth/useSendEmailVerificationMutation.ts +0 -33
  164. package/react-native/auth/useSignInAnonymouslyMutation.ts +0 -52
  165. package/react-native/auth/useSignInWitEmailAndPasswordMutation.ts +0 -39
  166. package/react-native/auth/useSignInWitRedirectMutation.ts +0 -38
  167. package/react-native/auth/useSignInWithCredentialMutation.ts +0 -36
  168. package/react-native/auth/useSignOutMutation.ts +0 -28
  169. package/react-native/auth/useUpdateProfileMutation.ts +0 -30
  170. package/react-native/context/FirebaseContext.ts +0 -25
  171. package/react-native/context/FirebaseContextProvider.tsx +0 -264
  172. package/react-native/context/index.d.ts +0 -1
  173. package/react-native/context/index.js +0 -1
  174. package/react-native/context/index.ts +0 -1
  175. package/react-native/firestore/index.d.ts +0 -23
  176. package/react-native/firestore/index.js +0 -23
  177. package/react-native/firestore/index.ts +0 -23
  178. package/react-native/firestore/useAddDocMutation.ts +0 -80
  179. package/react-native/firestore/useBatchWrite.ts +0 -58
  180. package/react-native/firestore/useCollectionReference.ts +0 -58
  181. package/react-native/firestore/useCompositeFilter.ts +0 -60
  182. package/react-native/firestore/useCountQuery.ts +0 -85
  183. package/react-native/firestore/useDeleteDocMutation.ts +0 -71
  184. package/react-native/firestore/useDocReference.ts +0 -42
  185. package/react-native/firestore/useDocReferences.ts +0 -40
  186. package/react-native/firestore/useEnsureDoc.ts +0 -79
  187. package/react-native/firestore/useFirestore.js +0 -13
  188. package/react-native/firestore/useGetDocData.ts +0 -52
  189. package/react-native/firestore/useGetRealtimeDocData.ts +0 -106
  190. package/react-native/firestore/useInfiniteQuery.ts +0 -115
  191. package/react-native/firestore/useQuery.ts +0 -89
  192. package/react-native/firestore/useQueryConstraints.ts +0 -44
  193. package/react-native/firestore/useRunTransaction.ts +0 -55
  194. package/react-native/firestore/useSetDocMutation.ts +0 -76
  195. package/react-native/firestore/useUpdateDocMutation.ts +0 -77
  196. package/react-native/firestore/utils/buildCompositeFilter.ts +0 -75
  197. package/react-native/firestore/utils/buildQueryConstraint.ts +0 -54
  198. package/react-native/firestore/utils/getDocData.ts +0 -33
  199. package/react-native/firestore/utils/getDocRef.ts +0 -41
  200. package/react-native/firestore/utils/getDocSnap.ts +0 -34
  201. package/react-native/index.d.ts +0 -1
  202. package/react-native/index.js +0 -1
  203. package/react-native/index.ts +0 -1
  204. package/react-native/remoteConfig/index.d.ts +0 -3
  205. package/react-native/remoteConfig/index.js +0 -3
  206. package/react-native/remoteConfig/index.ts +0 -3
  207. package/react-native/remoteConfig/useFetchAndActivate.ts +0 -36
  208. package/react-native/remoteConfig/useGetValue.ts +0 -16
  209. package/react-native/remoteConfig/useRemoteConfig.js +0 -10
  210. package/types/AppModel.ts +0 -10
  211. package/types/QueryConstraints.ts +0 -57
  212. package/types/index.d.ts +0 -2
  213. package/types/index.js +0 -2
  214. package/types/index.ts +0 -2
  215. package/web/analytics/index.d.ts +0 -3
  216. package/web/analytics/index.js +0 -3
  217. package/web/analytics/index.ts +0 -3
  218. package/web/analytics/useAnalytics.js +0 -10
  219. package/web/analytics/useLogEvent.ts +0 -34
  220. package/web/analytics/useSetAnalyticsCollectionEnabled.ts +0 -22
  221. package/web/auth/index.d.ts +0 -20
  222. package/web/auth/index.js +0 -20
  223. package/web/auth/index.ts +0 -20
  224. package/web/auth/mutation-keys.ts +0 -23
  225. package/web/auth/useAppleAuthProviderCredential.ts +0 -32
  226. package/web/auth/useAuth.js +0 -10
  227. package/web/auth/useAuthStateReady.ts +0 -30
  228. package/web/auth/useCreateUserWitEmailAndPasswordMutation.ts +0 -33
  229. package/web/auth/useCurrentUser.ts +0 -25
  230. package/web/auth/useEmailAuthProviderCredential.ts +0 -38
  231. package/web/auth/useFacebookAuthProviderCredential.ts +0 -31
  232. package/web/auth/useGetRedirectResultMutation.ts +0 -27
  233. package/web/auth/useIdToken.ts +0 -83
  234. package/web/auth/useLinkWithCredentialMutation.ts +0 -30
  235. package/web/auth/useReauthenticateWitCredentialMutation.ts +0 -31
  236. package/web/auth/useReauthenticateWitRedirectMutation.ts +0 -37
  237. package/web/auth/useSendEmailVerificationMutation.ts +0 -28
  238. package/web/auth/useSignInAnonymouslyMutation.ts +0 -49
  239. package/web/auth/useSignInWitEmailAndPasswordMutation.ts +0 -34
  240. package/web/auth/useSignInWitRedirectMutation.ts +0 -33
  241. package/web/auth/useSignInWithCredentialMutation.ts +0 -31
  242. package/web/auth/useSignOutMutation.ts +0 -25
  243. package/web/auth/useUpdateProfileMutation.ts +0 -30
  244. package/web/context/FirebaseContext.ts +0 -25
  245. package/web/context/FirebaseContextProvider.tsx +0 -263
  246. package/web/context/index.d.ts +0 -1
  247. package/web/context/index.js +0 -1
  248. package/web/context/index.ts +0 -1
  249. package/web/firestore/index.d.ts +0 -23
  250. package/web/firestore/index.js +0 -23
  251. package/web/firestore/index.ts +0 -23
  252. package/web/firestore/useAddDocMutation.ts +0 -74
  253. package/web/firestore/useBatchWrite.ts +0 -58
  254. package/web/firestore/useCollectionReference.ts +0 -58
  255. package/web/firestore/useCompositeFilter.ts +0 -55
  256. package/web/firestore/useCountQuery.ts +0 -90
  257. package/web/firestore/useDeleteDocMutation.ts +0 -69
  258. package/web/firestore/useDocReference.ts +0 -43
  259. package/web/firestore/useDocReferences.ts +0 -40
  260. package/web/firestore/useEnsureDoc.ts +0 -92
  261. package/web/firestore/useFirestore.js +0 -13
  262. package/web/firestore/useGetDocData.ts +0 -52
  263. package/web/firestore/useGetRealtimeDocData.ts +0 -105
  264. package/web/firestore/useInfiniteQuery.ts +0 -117
  265. package/web/firestore/useQuery.ts +0 -94
  266. package/web/firestore/useQueryConstraints.ts +0 -44
  267. package/web/firestore/useRunTransaction.ts +0 -56
  268. package/web/firestore/useSetDocMutation.ts +0 -77
  269. package/web/firestore/useUpdateDocMutation.ts +0 -78
  270. package/web/firestore/utils/buildCompositeFilter.ts +0 -73
  271. package/web/firestore/utils/buildQueryConstraint.ts +0 -55
  272. package/web/firestore/utils/getDocData.ts +0 -33
  273. package/web/firestore/utils/getDocRef.ts +0 -43
  274. package/web/firestore/utils/getDocSnap.ts +0 -34
  275. package/web/index.d.ts +0 -1
  276. package/web/index.js +0 -1
  277. package/web/index.ts +0 -1
  278. package/web/remoteConfig/index.d.ts +0 -3
  279. package/web/remoteConfig/index.js +0 -3
  280. package/web/remoteConfig/index.ts +0 -3
  281. package/web/remoteConfig/useFetchAndActivate.ts +0 -36
  282. package/web/remoteConfig/useGetValue.ts +0 -16
  283. package/web/remoteConfig/useRemoteConfig.js +0 -10
  284. /package/{react-native → dist/react-native}/analytics/useAnalytics.d.ts +0 -0
  285. /package/{react-native → dist/react-native}/analytics/useLogEvent.d.ts +0 -0
  286. /package/{react-native → dist/react-native}/analytics/useSetAnalyticsCollectionEnabled.d.ts +0 -0
  287. /package/{react-native → dist/react-native}/auth/mutation-keys.d.ts +0 -0
  288. /package/{react-native → dist/react-native}/auth/mutation-keys.js +0 -0
  289. /package/{react-native → dist/react-native}/auth/useAppleAuthProviderCredential.d.ts +0 -0
  290. /package/{react-native → dist/react-native}/auth/useAppleAuthProviderCredential.js +0 -0
  291. /package/{react-native → dist/react-native}/auth/useAuth.d.ts +0 -0
  292. /package/{react-native → dist/react-native}/auth/useAuthStateReady.d.ts +0 -0
  293. /package/{react-native → dist/react-native}/auth/useCreateUserWitEmailAndPasswordMutation.d.ts +0 -0
  294. /package/{react-native → dist/react-native}/auth/useCurrentUser.d.ts +0 -0
  295. /package/{react-native → dist/react-native}/auth/useEmailAuthProviderCredential.d.ts +0 -0
  296. /package/{react-native → dist/react-native}/auth/useEmailAuthProviderCredential.js +0 -0
  297. /package/{react-native → dist/react-native}/auth/useFacebookAuthProviderCredential.d.ts +0 -0
  298. /package/{react-native → dist/react-native}/auth/useFacebookAuthProviderCredential.js +0 -0
  299. /package/{react-native → dist/react-native}/auth/useIdToken.d.ts +0 -0
  300. /package/{react-native → dist/react-native}/auth/useLinkWithCredentialMutation.d.ts +0 -0
  301. /package/{react-native → dist/react-native}/auth/useReauthenticateWitCredentialMutation.d.ts +0 -0
  302. /package/{react-native → dist/react-native}/auth/useReauthenticateWitRedirectMutation.d.ts +0 -0
  303. /package/{react-native → dist/react-native}/auth/useSendEmailVerificationMutation.d.ts +0 -0
  304. /package/{react-native → dist/react-native}/auth/useSignInAnonymouslyMutation.d.ts +0 -0
  305. /package/{react-native → dist/react-native}/auth/useSignInWitEmailAndPasswordMutation.d.ts +0 -0
  306. /package/{react-native → dist/react-native}/auth/useSignInWitRedirectMutation.d.ts +0 -0
  307. /package/{react-native → dist/react-native}/auth/useSignInWithCredentialMutation.d.ts +0 -0
  308. /package/{react-native → dist/react-native}/auth/useSignOutMutation.d.ts +0 -0
  309. /package/{react-native → dist/react-native}/auth/useUpdateProfileMutation.d.ts +0 -0
  310. /package/{react-native → dist/react-native}/context/FirebaseContext.d.ts +0 -0
  311. /package/{react-native → dist/react-native}/context/FirebaseContext.js +0 -0
  312. /package/{react-native → dist/react-native}/context/FirebaseContextProvider.d.ts +0 -0
  313. /package/{react-native → dist/react-native}/firestore/useAddDocMutation.js +0 -0
  314. /package/{react-native → dist/react-native}/firestore/useBatchWrite.d.ts +0 -0
  315. /package/{react-native → dist/react-native}/firestore/useCountQuery.js +0 -0
  316. /package/{react-native → dist/react-native}/firestore/useDeleteDocMutation.js +0 -0
  317. /package/{react-native → dist/react-native}/firestore/useFirestore.d.ts +0 -0
  318. /package/{react-native → dist/react-native}/firestore/useInfiniteQuery.js +0 -0
  319. /package/{react-native → dist/react-native}/firestore/useQuery.js +0 -0
  320. /package/{react-native → dist/react-native}/firestore/useRunTransaction.d.ts +0 -0
  321. /package/{react-native → dist/react-native}/firestore/useSetDocMutation.js +0 -0
  322. /package/{react-native → dist/react-native}/firestore/useUpdateDocMutation.js +0 -0
  323. /package/{react-native → dist/react-native}/firestore/utils/buildCompositeFilter.js +0 -0
  324. /package/{react-native → dist/react-native}/firestore/utils/buildQueryConstraint.js +0 -0
  325. /package/{react-native → dist/react-native}/firestore/utils/getDocRef.js +0 -0
  326. /package/{react-native → dist/react-native}/remoteConfig/useFetchAndActivate.d.ts +0 -0
  327. /package/{react-native → dist/react-native}/remoteConfig/useGetValue.d.ts +0 -0
  328. /package/{react-native → dist/react-native}/remoteConfig/useRemoteConfig.d.ts +0 -0
  329. /package/{types → dist/types}/AppModel.d.ts +0 -0
  330. /package/{types → dist/types}/AppModel.js +0 -0
  331. /package/{types → dist/types}/QueryConstraints.js +0 -0
  332. /package/{web → dist/web}/analytics/useAnalytics.d.ts +0 -0
  333. /package/{web → dist/web}/analytics/useLogEvent.d.ts +0 -0
  334. /package/{web → dist/web}/analytics/useSetAnalyticsCollectionEnabled.d.ts +0 -0
  335. /package/{web → dist/web}/auth/mutation-keys.d.ts +0 -0
  336. /package/{web → dist/web}/auth/mutation-keys.js +0 -0
  337. /package/{web → dist/web}/auth/useAppleAuthProviderCredential.d.ts +0 -0
  338. /package/{web → dist/web}/auth/useAppleAuthProviderCredential.js +0 -0
  339. /package/{web → dist/web}/auth/useAuth.d.ts +0 -0
  340. /package/{web → dist/web}/auth/useAuthStateReady.d.ts +0 -0
  341. /package/{web → dist/web}/auth/useCreateUserWitEmailAndPasswordMutation.d.ts +0 -0
  342. /package/{web → dist/web}/auth/useCurrentUser.d.ts +0 -0
  343. /package/{web → dist/web}/auth/useEmailAuthProviderCredential.d.ts +0 -0
  344. /package/{web → dist/web}/auth/useEmailAuthProviderCredential.js +0 -0
  345. /package/{web → dist/web}/auth/useFacebookAuthProviderCredential.d.ts +0 -0
  346. /package/{web → dist/web}/auth/useFacebookAuthProviderCredential.js +0 -0
  347. /package/{web → dist/web}/auth/useGetRedirectResultMutation.d.ts +0 -0
  348. /package/{web → dist/web}/auth/useIdToken.d.ts +0 -0
  349. /package/{web → dist/web}/auth/useLinkWithCredentialMutation.d.ts +0 -0
  350. /package/{web → dist/web}/auth/useReauthenticateWitCredentialMutation.d.ts +0 -0
  351. /package/{web → dist/web}/auth/useReauthenticateWitRedirectMutation.d.ts +0 -0
  352. /package/{web → dist/web}/auth/useSendEmailVerificationMutation.d.ts +0 -0
  353. /package/{web → dist/web}/auth/useSignInAnonymouslyMutation.d.ts +0 -0
  354. /package/{web → dist/web}/auth/useSignInWitEmailAndPasswordMutation.d.ts +0 -0
  355. /package/{web → dist/web}/auth/useSignInWitRedirectMutation.d.ts +0 -0
  356. /package/{web → dist/web}/auth/useSignInWithCredentialMutation.d.ts +0 -0
  357. /package/{web → dist/web}/auth/useSignOutMutation.d.ts +0 -0
  358. /package/{web → dist/web}/auth/useUpdateProfileMutation.d.ts +0 -0
  359. /package/{web → dist/web}/context/FirebaseContext.d.ts +0 -0
  360. /package/{web → dist/web}/context/FirebaseContext.js +0 -0
  361. /package/{web → dist/web}/context/FirebaseContextProvider.d.ts +0 -0
  362. /package/{web → dist/web}/firestore/useAddDocMutation.js +0 -0
  363. /package/{web → dist/web}/firestore/useBatchWrite.d.ts +0 -0
  364. /package/{web → dist/web}/firestore/useCountQuery.js +0 -0
  365. /package/{web → dist/web}/firestore/useDeleteDocMutation.js +0 -0
  366. /package/{web → dist/web}/firestore/useFirestore.d.ts +0 -0
  367. /package/{web → dist/web}/firestore/useInfiniteQuery.js +0 -0
  368. /package/{web → dist/web}/firestore/useQuery.js +0 -0
  369. /package/{web → dist/web}/firestore/useRunTransaction.d.ts +0 -0
  370. /package/{web → dist/web}/firestore/useSetDocMutation.js +0 -0
  371. /package/{web → dist/web}/firestore/useUpdateDocMutation.js +0 -0
  372. /package/{web → dist/web}/firestore/utils/buildCompositeFilter.js +0 -0
  373. /package/{web → dist/web}/firestore/utils/buildQueryConstraint.js +0 -0
  374. /package/{web → dist/web}/firestore/utils/getDocRef.js +0 -0
  375. /package/{web → dist/web}/remoteConfig/useFetchAndActivate.d.ts +0 -0
  376. /package/{web → dist/web}/remoteConfig/useGetValue.d.ts +0 -0
  377. /package/{web → dist/web}/remoteConfig/useRemoteConfig.d.ts +0 -0
@@ -1,55 +0,0 @@
1
- import { useMutation, UseMutationOptions } from "@tanstack/react-query";
2
- import { runTransaction, FirebaseFirestoreTypes } from "@react-native-firebase/firestore";
3
-
4
- import { useFirestore } from "./useFirestore";
5
-
6
- /**
7
- * @inline
8
- */
9
- export type UseRunTransactionValues = <T = unknown>(transaction: FirebaseFirestoreTypes.Transaction) => T;
10
-
11
- /**
12
- * @inline
13
- */
14
- export type UseRunTransactionOptions<T = unknown, TContext = unknown> = {
15
- /**
16
- * Reqct-mutation options that shall omit mutationFn
17
- */
18
- options?: Omit<UseMutationOptions<T, Error, UseRunTransactionValues, TContext>, "mutationFn">;
19
- };
20
-
21
- /**
22
- * Executes a Firestore transaction
23
- *
24
- * @group Hook
25
- *
26
- * @param {UseRunTransactionOptions<T>} options - Configuration options for the mutation.
27
- *
28
- * @returns {UseMutationResult<T, Error>} An object representing mutation
29
- *
30
- * @example
31
- * ```jsx
32
- * export const MyComponent = () => {
33
- * const doc = useGetDocData({
34
- * options: {
35
- * queryKey: ['key']
36
- * },
37
- * reference: collection(),
38
- * path: 'id'
39
- * });
40
- * console.log(doc);
41
- * };
42
- * ```
43
- */
44
- export const useRunTransaction = <T = unknown, TContext = unknown>({
45
- options = {}
46
- }: UseRunTransactionOptions<T, TContext>) => {
47
- const db = useFirestore();
48
-
49
- return useMutation({
50
- ...options,
51
- mutationFn: async (transactionFn) => {
52
- return runTransaction<T>(db, transactionFn);
53
- }
54
- });
55
- };
@@ -1,76 +0,0 @@
1
- import { useMutation, UseMutationOptions } from "@tanstack/react-query";
2
- import { FirebaseFirestoreTypes, getDoc, setDoc, WithFieldValue } from "@react-native-firebase/firestore";
3
-
4
- import { useMemo } from "react";
5
- import { AppModel } from "../../types";
6
-
7
- /**
8
- * @inline
9
- */
10
- export type UseSetDocMutationValues<AppModelType extends AppModel = AppModel> = {
11
- /**
12
- * Data to write
13
- */
14
- data: WithFieldValue<AppModelType>;
15
- };
16
-
17
- /**
18
- * @inline
19
- */
20
- export type UseSetDocMutationOptions<AppModelType extends AppModel = AppModel, TContext = unknown> = {
21
- /**
22
- * Reference to a document that must be written
23
- */
24
- reference: FirebaseFirestoreTypes.DocumentReference<AppModelType> | null;
25
- /**
26
- * Options for useMutation hook excluding mutationFn.
27
- */
28
- options?: Omit<
29
- UseMutationOptions<AppModelType, Error, UseSetDocMutationValues<AppModelType>, TContext>,
30
- "mutationFn"
31
- >;
32
- };
33
-
34
- /**
35
- * Executes a mutation and returns added document
36
- *
37
- * @group Hook
38
- *
39
- * @param {UseSetDocMutationOptions<AppModelType>} options - Configuration options for mutation.
40
- *
41
- * @returns {UseMutationResult<AppModelType, Error, UseAddDocMutationValues<AppModelType>, TContext>} A mutation result
42
- *
43
- * @example
44
- * ```jsx
45
- * export const MyComponent = () => {
46
- * const {mutate} = useSetDocMutation({
47
- * options: {
48
- * },
49
- * reference: collection().doc(),
50
- * });
51
- *
52
- * // ....
53
- * mutate({data: {test: 'value'}});
54
- * // ....
55
- * };
56
- * ```
57
- */
58
- export const useSetDocMutation = <AppModelType extends AppModel = AppModel, TContext = unknown>({
59
- reference,
60
- options
61
- }: UseSetDocMutationOptions<AppModelType, TContext>) => {
62
- const mutationKey = useMemo(() => [reference?.path], [reference?.path]);
63
-
64
- return useMutation({
65
- ...options,
66
- mutationKey,
67
- mutationFn: async ({ data }) => {
68
- if (!reference) {
69
- throw new Error("Reference is undefined");
70
- }
71
- await setDoc<AppModelType>(reference, data);
72
- const docSnap = await getDoc(reference);
73
- return { ...(docSnap.data() as AppModelType), uid: docSnap.id };
74
- }
75
- });
76
- };
@@ -1,77 +0,0 @@
1
- import { useMutation, UseMutationOptions } from "@tanstack/react-query";
2
- import { FirebaseFirestoreTypes, updateDoc, getDoc, UpdateData } from "@react-native-firebase/firestore";
3
-
4
- import { useMemo } from "react";
5
- import { AppModel } from "../../types";
6
-
7
- /**
8
- * @inline
9
- */
10
- export type UseUpdateDocMutationValues<AppModelType extends AppModel = AppModel> = {
11
- /**
12
- * Data to write
13
- */
14
- data: UpdateData<AppModelType>;
15
- };
16
-
17
- /**
18
- * @inline
19
- */
20
- export type UseUpdateDocMutationOptions<AppModelType extends AppModel = AppModel, TContext = unknown> = {
21
- /**
22
- * Reference to a document that must be updated
23
- */
24
- reference: FirebaseFirestoreTypes.DocumentReference<AppModelType> | null;
25
- /**
26
- * Options for useMutation hook excluding mutationFn.
27
- */
28
- options?: Omit<
29
- UseMutationOptions<AppModelType, Error, UseUpdateDocMutationValues<AppModelType>, TContext>,
30
- "mutationFn"
31
- >;
32
- };
33
-
34
- /**
35
- * Executes a mutation and returns updated document
36
- *
37
- * @group Hook
38
- *
39
- * @param {UseUpdateDocMutationOptions<AppModelType>} options - Configuration options for mutation.
40
- *
41
- * @returns {UseMutationResult<AppModelType, Error, UseAddDocMutationValues<AppModelType>, TContext>} A mutation result
42
- *
43
- * @example
44
- * ```jsx
45
- * export const MyComponent = () => {
46
- * const {mutate} = useUpdateDocMutation({
47
- * options: {
48
- * },
49
- * reference: collection().doc(),
50
- * });
51
- *
52
- * // ....
53
- * mutate({data: {test: 'value'}});
54
- * // ....
55
- * };
56
- * ```
57
- */
58
- export const useUpdateDocMutation = <AppModelType extends AppModel = AppModel, TContext = unknown>({
59
- reference,
60
- options = {}
61
- }: UseUpdateDocMutationOptions<AppModelType, TContext>) => {
62
- const mutationKey = useMemo(() => [reference?.path], [reference?.path]);
63
-
64
- return useMutation({
65
- ...options,
66
- mutationFn: async ({ data }) => {
67
- if (!reference) {
68
- throw new Error("Reference is undefined");
69
- }
70
-
71
- await updateDoc<AppModelType>(reference, data);
72
- const docSnap = await getDoc(reference);
73
- return { ...(docSnap.data() as AppModelType), uid: docSnap.id };
74
- },
75
- mutationKey
76
- });
77
- };
@@ -1,75 +0,0 @@
1
- import { FirebaseFirestoreTypes, and, or, where, FieldPath } from "@react-native-firebase/firestore";
2
- import { AppModel } from "../../../types";
3
-
4
- export type QueryFilterConstraint =
5
- | FirebaseFirestoreTypes.QueryCompositeFilterConstraint
6
- | FirebaseFirestoreTypes.QueryFilterConstraint;
7
-
8
- export type QueryElement<AppModelType extends AppModel = AppModel> = {
9
- operator?: "OR" | "AND";
10
- children?: QueryElement[];
11
- field?: keyof (AppModelType & { documentId?: string[] });
12
- value?: AppModelType[keyof AppModelType];
13
- op?: FirebaseFirestoreTypes.WhereFilterOp;
14
- };
15
-
16
- export type CompositeFilter<AppModelType extends AppModel = AppModel> = {
17
- operator: "OR" | "AND";
18
- children: QueryElement<AppModelType & { documentId?: string[] }>[];
19
- };
20
-
21
- /**
22
- * Constructs a composite or where query filter based on the provided query structure.
23
- * It recursively builds query constraints using logical "or" or "and" operators.
24
- *
25
- * @group Utility
26
- *
27
- * @param {QueryElement<AppModelType>} query
28
- *
29
- * @returns {QueryFilterConstraint | null}
30
- *
31
- * @example
32
- * ```jsx
33
- * export const MyComponent = () => {
34
- * const filter = buildCompositeFilter({
35
- * operator: "AND",
36
- * children: [
37
- * {
38
- * field: "field",
39
- * value: "value",
40
- * op: "=="
41
- * },
42
- * ...(query ? [query] : [])
43
- * ]
44
- * });
45
- * console.log(filter);
46
- * };
47
- * ```
48
- */
49
- export const buildCompositeFilter = <AppModelType extends AppModel = AppModel>(
50
- query: QueryElement<AppModelType>
51
- ): QueryFilterConstraint | null => {
52
- if (query.children) {
53
- const queryConstraints = query.children.map(buildCompositeFilter).filter((constraint) => !!constraint);
54
-
55
- if (queryConstraints.length <= 0) {
56
- return null;
57
- }
58
-
59
- if (queryConstraints.length <= 1) {
60
- return queryConstraints[0];
61
- }
62
-
63
- return (query as CompositeFilter).operator === "OR" ? or(...queryConstraints) : and(...queryConstraints);
64
- }
65
-
66
- if (query.field && query.op) {
67
- return where(
68
- query.field === "documentId" ? new FieldPath("__name__") : (query.field as string),
69
- query.op,
70
- query.value
71
- ) as unknown as FirebaseFirestoreTypes.QueryFilterConstraint;
72
- }
73
-
74
- return null;
75
- };
@@ -1,54 +0,0 @@
1
- import {
2
- type QueryNonFilterConstraint,
3
- orderBy,
4
- startAt,
5
- startAfter,
6
- endAt,
7
- endBefore,
8
- limit,
9
- limitToLast
10
- } from "@react-native-firebase/firestore";
11
- import { AppModel, type NonFilterQueryConstraint } from "../../../types";
12
-
13
- /**
14
- * A generic mothod to build query constraints for firebase
15
- *
16
- * @group Utility
17
- *
18
- * @param {NonFilterQueryConstraint<AppModelType>} constraint
19
- *
20
- * @returns {FirebaseFirestoreTypes.QueryNonFilterConstraint}
21
- *
22
- * @example
23
- * ```jsx
24
- * const firebaseConfig = {};
25
- * export const constraint = useMemo(() => {
26
- * return buildQueryConstraint({
27
- * type: 'limit',
28
- * limit: 1
29
- * });
30
- * };
31
- * ```
32
- */
33
- export const buildQueryConstraint = <AppModelType extends AppModel = AppModel>(
34
- constraint: NonFilterQueryConstraint<AppModelType>
35
- ): QueryNonFilterConstraint => {
36
- switch (constraint.type) {
37
- case "orderBy":
38
- return orderBy(constraint.fieldPath as string, constraint.directionStr);
39
- case "startAt":
40
- return startAt(...constraint.arguments);
41
- case "startAfter":
42
- return startAfter(...constraint.arguments);
43
- case "endAt":
44
- return endAt(...constraint.arguments);
45
- case "endBefore":
46
- return endBefore(...constraint.arguments);
47
- case "limit":
48
- return limit(constraint.limit);
49
- case "limitToLast":
50
- return limitToLast(constraint.limit);
51
- default:
52
- throw new Error(`Unsupported constaint ${JSON.stringify(constraint)}`);
53
- }
54
- };
@@ -1,33 +0,0 @@
1
- import { AppModel } from "../../../types";
2
- import { getDocSnap, GetDocSnapOptions } from "./getDocSnap";
3
-
4
- /**
5
- * @inline
6
- */
7
- export type GetDocDataOptions<AppModelType extends AppModel = AppModel> = GetDocSnapOptions<AppModelType>;
8
-
9
- /**
10
- * Asynchronously retrieves document data from a specified database reference.
11
- * Utilizes the helper function `getDocSnap` to fetch the document snapshot and
12
- * checks if the document exists before returning its data.
13
- *
14
- * @group Utility
15
- *
16
- * @param {GetDocDataOptions<AppModelType>} options - The options for fetching document data.
17
- *
18
- * @returns {Promise<AppModelType | null>} Returns a promise that resolves to the document data if it exists, or null if the document does not exist.
19
- */
20
- export const getDocData = async <AppModelType extends AppModel = AppModel>({
21
- db,
22
- reference,
23
- path,
24
- pathSegments
25
- }: GetDocDataOptions<AppModelType>) => {
26
- const docSnap = await getDocSnap<AppModelType>({ db, reference, path, pathSegments });
27
-
28
- if (docSnap && docSnap?.exists()) {
29
- return { ...docSnap.data(), uid: docSnap.id } as AppModelType;
30
- }
31
-
32
- return null;
33
- };
@@ -1,41 +0,0 @@
1
- import { doc, FirebaseFirestoreTypes } from "@react-native-firebase/firestore";
2
- import { AppModel } from "../../../types";
3
-
4
- /**
5
- * @inline
6
- */
7
- export type GetDocRefOptions<AppModelType extends AppModel = AppModel> = {
8
- db: FirebaseFirestoreTypes.Module;
9
- reference?:
10
- | FirebaseFirestoreTypes.CollectionReference<AppModelType>
11
- | FirebaseFirestoreTypes.DocumentReference<AppModelType>;
12
- path?: string;
13
- pathSegments?: string[];
14
- };
15
-
16
- /**
17
- * Retrieves a document reference based on provided database options.
18
- * Either `reference` or `path`.
19
- *
20
- * @group Utility
21
- *
22
- * @param {GetDocRefOptions<AppModelType>} options - The options for building doc reference.
23
- *
24
- * @returns {DocumentReference<AppModelType, AppModelType>} Returns a document reference
25
- */
26
- export const getDocRef = <AppModelType extends AppModel = AppModel>({
27
- db,
28
- reference,
29
- path,
30
- pathSegments
31
- }: GetDocRefOptions<AppModelType>) => {
32
- if ((!reference && !path) || (reference && !path)) {
33
- return null;
34
- }
35
-
36
- const docRef = !reference
37
- ? doc(db, path as string, ...(pathSegments || []))
38
- : doc(reference, path, ...(pathSegments || []));
39
-
40
- return docRef as FirebaseFirestoreTypes.DocumentReference<AppModelType>;
41
- };
@@ -1,34 +0,0 @@
1
- import { getDoc as firestoreGetDoc } from "@react-native-firebase/firestore";
2
- import { AppModel } from "../../../types";
3
- import { getDocRef, GetDocRefOptions } from "./getDocRef";
4
-
5
- /**
6
- * @inline
7
- */
8
- export type GetDocSnapOptions<AppModelType extends AppModel = AppModel> = GetDocRefOptions<AppModelType>;
9
-
10
- /**
11
- * Asynchronously retrieves a document snapshot from Firestore using a specified document reference
12
- * or path information. This function handles getting the appropriate document reference based on
13
- * the parameters provided, and then fetches the document data from Firestore.
14
- *
15
- * @group Utility
16
- *
17
- * @param {GetDocSnapOptions<AppModelType>} options - The options for retrieving the document snapshot
18
- *
19
- * @returns {Promise<DocumentSnapshot<AppModelType, AppModelType> | null>} Returns a document reference
20
- */
21
- export const getDocSnap = async <AppModelType extends AppModel = AppModel>({
22
- db,
23
- reference,
24
- path,
25
- pathSegments
26
- }: GetDocSnapOptions<AppModelType>) => {
27
- const docRef = await getDocRef<AppModelType>({ db, reference, path, pathSegments });
28
-
29
- if (docRef) {
30
- return await firestoreGetDoc(docRef);
31
- }
32
-
33
- return null;
34
- };
@@ -1 +0,0 @@
1
- export * from "./context";
@@ -1 +0,0 @@
1
- export * from "./context";
@@ -1 +0,0 @@
1
- export * from "./context";
@@ -1,3 +0,0 @@
1
- export * from "./useFetchAndActivate";
2
- export * from "./useGetValue";
3
- export * from "./useRemoteConfig";
@@ -1,3 +0,0 @@
1
- export * from "./useFetchAndActivate";
2
- export * from "./useGetValue";
3
- export * from "./useRemoteConfig";
@@ -1,3 +0,0 @@
1
- export * from "./useFetchAndActivate";
2
- export * from "./useGetValue";
3
- export * from "./useRemoteConfig";
@@ -1,36 +0,0 @@
1
- import { ensureInitialized, fetchAndActivate } from "@react-native-firebase/remote-config";
2
- import { useCallback, useMemo, useState } from "react";
3
- import { useRemoteConfig } from "./useRemoteConfig";
4
-
5
- /**
6
- * Custom hook to fetch and activate remote configuration settings.
7
- * Initializes remote configuration, fetches, activates it, and tracks the fetch status.
8
- * @returns {Object} An object containing:
9
- * - {Function} fetchAndActivate - Callback function to fetch and activate remote configuration.
10
- * - {Boolean} isFetched - Boolean representing whether the fetch-and-activate process completed.
11
- */
12
- export const useFetchAndActivate = () => {
13
- const remoteConfig = useRemoteConfig();
14
- const [isFetched, setIsFetched] = useState(false);
15
-
16
- const fetchAndActivateCallback = useCallback(async () => {
17
- try {
18
- if (remoteConfig) {
19
- await ensureInitialized(remoteConfig);
20
- await fetchAndActivate(remoteConfig);
21
- setIsFetched(true);
22
- }
23
- } catch (e) {
24
- setIsFetched(true);
25
- console.log(`Cannot read remote config: ${(e as Error)?.message}`);
26
- }
27
- }, [remoteConfig]);
28
-
29
- return useMemo(
30
- () => ({
31
- fetchAndActivate: fetchAndActivateCallback,
32
- isFetched
33
- }),
34
- [isFetched, fetchAndActivateCallback]
35
- );
36
- };
@@ -1,16 +0,0 @@
1
- import { getValue } from "@react-native-firebase/remote-config";
2
- import { useMemo } from "react";
3
- import { useRemoteConfig } from "./useRemoteConfig";
4
-
5
- /**
6
- * Custom hook to retrieve a value associated with a specified key from remote configuration.
7
- * Utilizes memoization to optimize performance by recalculating the result only if dependencies change.
8
- * @param {string} key - The key for which the corresponding value is to be fetched from the remote configuration.
9
- * @returns {any | null} The value associated with the specified key if available, otherwise null.
10
- */
11
- export const useGetValue = (key: string) => {
12
- const remoteConfig = useRemoteConfig();
13
- return useMemo(() => {
14
- return remoteConfig ? getValue(remoteConfig, key) : null;
15
- }, [remoteConfig, key]);
16
- };
@@ -1,10 +0,0 @@
1
- import { useContext } from "react";
2
- import { FirebaseContext } from "../context/FirebaseContext";
3
- /**
4
- * Hook to access the Firebase Remote Config instance from the context.
5
- * @returns {RemoteConfig} The remoteConfig object from the Firebase context.
6
- */
7
- export const useRemoteConfig = () => {
8
- const { remoteConfig } = useContext(FirebaseContext);
9
- return remoteConfig;
10
- };
package/types/AppModel.ts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Generic definition for a data model
3
- */
4
- export type AppModel = {
5
- /**
6
- * Unique identifier equl to documentId() from Firestore
7
- */
8
- uid?: string;
9
- [key: string]: unknown;
10
- };
@@ -1,57 +0,0 @@
1
- import { AppModel } from "./AppModel";
2
-
3
- /**
4
- * Order by constraint
5
- * @group Query Constraints
6
- */
7
- export type OrderByConstraint<AppModelType extends AppModel = AppModel> = {
8
- /**
9
- * Type of a constraint
10
- */
11
- type: "orderBy";
12
- /**
13
- * Field path to use for ordering
14
- */
15
- fieldPath: keyof AppModelType;
16
- /**
17
- * Direction of ordering: asc or desc
18
- */
19
- directionStr: "asc" | "desc";
20
- };
21
-
22
- /**
23
- * Start from value constraint
24
- * @group Query Constraints
25
- */
26
- export type StartConstraint = {
27
- type: "startAt" | "startAfter";
28
- arguments: unknown[];
29
- };
30
-
31
- /**
32
- * End by value constraint
33
- * @group Query Constraints
34
- */
35
- export type EndConstraint = {
36
- type: "endAt" | "endBefore";
37
- arguments: unknown[];
38
- };
39
-
40
- /**
41
- * Limit constraint
42
- * @group Query Constraints
43
- */
44
- export type LimitConstraint = {
45
- type: "limitToLast" | "limit";
46
- limit: number;
47
- };
48
-
49
- /**
50
- * Non filtering query constaints
51
- * @group Query Constraints
52
- */
53
- export type NonFilterQueryConstraint<AppModelType extends AppModel = AppModel> =
54
- | OrderByConstraint<AppModelType>
55
- | StartConstraint
56
- | EndConstraint
57
- | LimitConstraint;
package/types/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./AppModel";
2
- export * from "./QueryConstraints";
package/types/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from "./AppModel";
2
- export * from "./QueryConstraints";
package/types/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./AppModel";
2
- export * from "./QueryConstraints";
@@ -1,3 +0,0 @@
1
- export * from "./useLogEvent";
2
- export * from "./useAnalytics";
3
- export * from "./useSetAnalyticsCollectionEnabled";
@@ -1,3 +0,0 @@
1
- export * from "./useLogEvent";
2
- export * from "./useAnalytics";
3
- export * from "./useSetAnalyticsCollectionEnabled";
@@ -1,3 +0,0 @@
1
- export * from "./useLogEvent";
2
- export * from "./useAnalytics";
3
- export * from "./useSetAnalyticsCollectionEnabled";
@@ -1,10 +0,0 @@
1
- import { useContext } from "react";
2
- import { FirebaseContext } from "../context/FirebaseContext";
3
- /**
4
- * Hook to access Firebase analytics from the Firebase context.
5
- * @returns {any} The analytics object from the Firebase context.
6
- */
7
- export const useAnalytics = () => {
8
- const { analytics } = useContext(FirebaseContext);
9
- return analytics;
10
- };