@kingstinct/react-native-healthkit 8.7.2 → 9.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 (449) hide show
  1. package/ReactNativeHealthkit.podspec +36 -0
  2. package/app.plugin.js +43 -33
  3. package/ios/Bridge.h +8 -0
  4. package/ios/CategoryTypeModule.swift +128 -0
  5. package/ios/CharacteristicTypeModule.swift +78 -0
  6. package/ios/Constants.swift +2 -0
  7. package/ios/CoreModule.swift +376 -0
  8. package/ios/CorrelationTypeModule.swift +153 -0
  9. package/ios/HeartbeatSeriesModule.swift +189 -0
  10. package/ios/Helpers.swift +529 -251
  11. package/ios/QuantityTypeModule.swift +461 -0
  12. package/ios/Serializers.swift +211 -124
  13. package/ios/SourceProxy.swift +35 -0
  14. package/ios/StateOfMindModule.swift +160 -0
  15. package/ios/WorkoutProxy.swift +405 -0
  16. package/ios/WorkoutSessionModule.swift +182 -0
  17. package/ios/WorkoutsModule.swift +357 -0
  18. package/package.json +43 -127
  19. package/react-native.config.js +16 -0
  20. package/src/hooks/useHealthkitAuthorization.test.ts +47 -29
  21. package/src/hooks/useHealthkitAuthorization.ts +21 -15
  22. package/src/hooks/useIsHealthDataAvailable.test.ts +17 -7
  23. package/src/hooks/useIsHealthDataAvailable.ts +7 -7
  24. package/src/hooks/useMostRecentCategorySample.ts +10 -12
  25. package/src/hooks/useMostRecentQuantitySample.ts +17 -36
  26. package/src/hooks/useMostRecentWorkout.ts +16 -38
  27. package/src/hooks/useSources.ts +8 -12
  28. package/src/hooks/useStatisticsForQuantity.ts +19 -14
  29. package/src/hooks/useSubscribeToChanges.ts +9 -13
  30. package/src/index.ios.ts +232 -0
  31. package/src/index.ts +444 -0
  32. package/src/modules.ts +43 -0
  33. package/src/specs/CategoryTypeModule.nitro.ts +64 -0
  34. package/src/specs/CharacteristicTypeModule.nitro.ts +22 -0
  35. package/src/specs/CoreModule.nitro.ts +107 -0
  36. package/src/specs/CorrelationTypeModule.nitro.ts +23 -0
  37. package/src/specs/HeartbeatSeriesModule.nitro.ts +19 -0
  38. package/src/specs/QuantityTypeModule.nitro.ts +60 -0
  39. package/src/specs/SourceProxy.nitro.ts +13 -0
  40. package/src/specs/StateOfMindModule.nitro.ts +23 -0
  41. package/src/specs/WorkoutProxy.nitro.ts +18 -0
  42. package/src/specs/WorkoutSessionModule.nitro.ts +71 -0
  43. package/src/specs/WorkoutsModule.nitro.ts +32 -0
  44. package/src/test-setup.ts +68 -54
  45. package/src/test-utils.ts +3 -2
  46. package/src/types/Auth.ts +17 -0
  47. package/src/types/Background.ts +9 -0
  48. package/src/types/CategoryType.ts +249 -0
  49. package/src/types/CategoryTypeIdentifier.ts +99 -0
  50. package/src/types/Characteristics.ts +53 -0
  51. package/src/types/Constants.ts +25 -0
  52. package/src/types/CorrelationType.ts +31 -0
  53. package/src/types/Device.ts +13 -0
  54. package/src/types/HeartbeatSeries.ts +29 -0
  55. package/src/types/InterfaceVerification.ts +164 -0
  56. package/src/types/InterfaceVerificationExample.ts +89 -0
  57. package/src/types/QuantitySample.ts +30 -0
  58. package/src/types/QuantityType.ts +192 -0
  59. package/src/types/QuantityTypeIdentifier.ts +758 -0
  60. package/src/types/QueryOptions.ts +69 -0
  61. package/src/types/README-InterfaceVerification.md +103 -0
  62. package/src/types/Shared.ts +79 -0
  63. package/src/types/Source.ts +11 -0
  64. package/src/types/StateOfMind.ts +110 -0
  65. package/src/types/Subscriptons.ts +10 -0
  66. package/src/types/Units.ts +190 -0
  67. package/src/types/WeatherCondition.ts +31 -0
  68. package/src/types/WorkoutKit.ts +18 -0
  69. package/src/types/Workouts.ts +282 -0
  70. package/src/utils/getMostRecentCategorySample.ts +7 -11
  71. package/src/utils/getMostRecentQuantitySample.ts +8 -18
  72. package/src/utils/getMostRecentWorkout.ts +7 -17
  73. package/src/utils/getPreferredUnit.ts +12 -8
  74. package/src/utils/subscribeToChanges.ts +9 -26
  75. package/LICENSE +0 -21
  76. package/README.md +0 -179
  77. package/ios/ReactNativeHealthkit-Bridging-Header.h +0 -2
  78. package/ios/ReactNativeHealthkit.m +0 -271
  79. package/ios/ReactNativeHealthkit.swift +0 -2333
  80. package/ios/ReactNativeHealthkit.xcodeproj/project.pbxproj +0 -279
  81. package/kingstinct-react-native-healthkit.podspec +0 -21
  82. package/lib/commonjs/hooks/useHealthkitAuthorization.js +0 -39
  83. package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +0 -1
  84. package/lib/commonjs/hooks/useHealthkitAuthorization.test.js +0 -72
  85. package/lib/commonjs/hooks/useHealthkitAuthorization.test.js.map +0 -1
  86. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +0 -27
  87. package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +0 -1
  88. package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js +0 -41
  89. package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js.map +0 -1
  90. package/lib/commonjs/hooks/useMostRecentCategorySample.js +0 -23
  91. package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +0 -1
  92. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +0 -37
  93. package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +0 -1
  94. package/lib/commonjs/hooks/useMostRecentWorkout.js +0 -48
  95. package/lib/commonjs/hooks/useMostRecentWorkout.js.map +0 -1
  96. package/lib/commonjs/hooks/useSources.js +0 -22
  97. package/lib/commonjs/hooks/useSources.js.map +0 -1
  98. package/lib/commonjs/hooks/useStatisticsForQuantity.js +0 -28
  99. package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +0 -1
  100. package/lib/commonjs/hooks/useSubscribeToChanges.js +0 -28
  101. package/lib/commonjs/hooks/useSubscribeToChanges.js.map +0 -1
  102. package/lib/commonjs/index.ios.js +0 -531
  103. package/lib/commonjs/index.ios.js.map +0 -1
  104. package/lib/commonjs/index.js +0 -22
  105. package/lib/commonjs/index.js.map +0 -1
  106. package/lib/commonjs/index.native.js +0 -235
  107. package/lib/commonjs/index.native.js.map +0 -1
  108. package/lib/commonjs/index.web.js +0 -22
  109. package/lib/commonjs/index.web.js.map +0 -1
  110. package/lib/commonjs/native-types.js +0 -1575
  111. package/lib/commonjs/native-types.js.map +0 -1
  112. package/lib/commonjs/test-setup.js +0 -57
  113. package/lib/commonjs/test-setup.js.map +0 -1
  114. package/lib/commonjs/test-utils.js +0 -18
  115. package/lib/commonjs/test-utils.js.map +0 -1
  116. package/lib/commonjs/types.js +0 -17
  117. package/lib/commonjs/types.js.map +0 -1
  118. package/lib/commonjs/utils/deleteQuantitySample.js +0 -11
  119. package/lib/commonjs/utils/deleteQuantitySample.js.map +0 -1
  120. package/lib/commonjs/utils/deleteSamples.js +0 -18
  121. package/lib/commonjs/utils/deleteSamples.js.map +0 -1
  122. package/lib/commonjs/utils/deleteWorkoutSample.js +0 -11
  123. package/lib/commonjs/utils/deleteWorkoutSample.js.map +0 -1
  124. package/lib/commonjs/utils/deserializeCategorySample.js +0 -13
  125. package/lib/commonjs/utils/deserializeCategorySample.js.map +0 -1
  126. package/lib/commonjs/utils/deserializeCategorySample.test.js +0 -26
  127. package/lib/commonjs/utils/deserializeCategorySample.test.js.map +0 -1
  128. package/lib/commonjs/utils/deserializeCorrelation.js +0 -26
  129. package/lib/commonjs/utils/deserializeCorrelation.js.map +0 -1
  130. package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js +0 -15
  131. package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js.map +0 -1
  132. package/lib/commonjs/utils/deserializeSample.js +0 -15
  133. package/lib/commonjs/utils/deserializeSample.js.map +0 -1
  134. package/lib/commonjs/utils/deserializeWorkout.js +0 -15
  135. package/lib/commonjs/utils/deserializeWorkout.js.map +0 -1
  136. package/lib/commonjs/utils/ensureMetadata.js +0 -11
  137. package/lib/commonjs/utils/ensureMetadata.js.map +0 -1
  138. package/lib/commonjs/utils/ensureTotals.js +0 -11
  139. package/lib/commonjs/utils/ensureTotals.js.map +0 -1
  140. package/lib/commonjs/utils/ensureUnit.js +0 -17
  141. package/lib/commonjs/utils/ensureUnit.js.map +0 -1
  142. package/lib/commonjs/utils/getDateOfBirth.js +0 -14
  143. package/lib/commonjs/utils/getDateOfBirth.js.map +0 -1
  144. package/lib/commonjs/utils/getMostRecentCategorySample.js +0 -17
  145. package/lib/commonjs/utils/getMostRecentCategorySample.js.map +0 -1
  146. package/lib/commonjs/utils/getMostRecentQuantitySample.js +0 -21
  147. package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +0 -1
  148. package/lib/commonjs/utils/getMostRecentWorkout.js +0 -19
  149. package/lib/commonjs/utils/getMostRecentWorkout.js.map +0 -1
  150. package/lib/commonjs/utils/getPreferredUnit.js +0 -14
  151. package/lib/commonjs/utils/getPreferredUnit.js.map +0 -1
  152. package/lib/commonjs/utils/getPreferredUnits.js +0 -14
  153. package/lib/commonjs/utils/getPreferredUnits.js.map +0 -1
  154. package/lib/commonjs/utils/getPreferredUnitsTyped.js +0 -33
  155. package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +0 -1
  156. package/lib/commonjs/utils/getRequestStatusForAuthorization.js +0 -21
  157. package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +0 -1
  158. package/lib/commonjs/utils/getWorkoutPlanById.js +0 -13
  159. package/lib/commonjs/utils/getWorkoutPlanById.js.map +0 -1
  160. package/lib/commonjs/utils/prepareOptions.js +0 -25
  161. package/lib/commonjs/utils/prepareOptions.js.map +0 -1
  162. package/lib/commonjs/utils/queryCategorySamples.js +0 -17
  163. package/lib/commonjs/utils/queryCategorySamples.js.map +0 -1
  164. package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js +0 -21
  165. package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js.map +0 -1
  166. package/lib/commonjs/utils/queryCorrelationSamples.js +0 -17
  167. package/lib/commonjs/utils/queryCorrelationSamples.js.map +0 -1
  168. package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js +0 -17
  169. package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js.map +0 -1
  170. package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js +0 -21
  171. package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +0 -1
  172. package/lib/commonjs/utils/queryQuantitySamples.js +0 -19
  173. package/lib/commonjs/utils/queryQuantitySamples.js.map +0 -1
  174. package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js +0 -23
  175. package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js.map +0 -1
  176. package/lib/commonjs/utils/querySources.js +0 -14
  177. package/lib/commonjs/utils/querySources.js.map +0 -1
  178. package/lib/commonjs/utils/queryStateOfMindSamples.js +0 -22
  179. package/lib/commonjs/utils/queryStateOfMindSamples.js.map +0 -1
  180. package/lib/commonjs/utils/queryStatisticsCollectionForQuantity.js +0 -16
  181. package/lib/commonjs/utils/queryStatisticsCollectionForQuantity.js.map +0 -1
  182. package/lib/commonjs/utils/queryStatisticsForQuantity.js +0 -29
  183. package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +0 -1
  184. package/lib/commonjs/utils/queryWorkoutSamplesWithAnchor.js +0 -26
  185. package/lib/commonjs/utils/queryWorkoutSamplesWithAnchor.js.map +0 -1
  186. package/lib/commonjs/utils/queryWorkouts.js +0 -22
  187. package/lib/commonjs/utils/queryWorkouts.js.map +0 -1
  188. package/lib/commonjs/utils/requestAuthorization.js +0 -22
  189. package/lib/commonjs/utils/requestAuthorization.js.map +0 -1
  190. package/lib/commonjs/utils/saveCategorySample.js +0 -20
  191. package/lib/commonjs/utils/saveCategorySample.js.map +0 -1
  192. package/lib/commonjs/utils/saveCorrelationSample.js +0 -35
  193. package/lib/commonjs/utils/saveCorrelationSample.js.map +0 -1
  194. package/lib/commonjs/utils/saveQuantitySample.js +0 -16
  195. package/lib/commonjs/utils/saveQuantitySample.js.map +0 -1
  196. package/lib/commonjs/utils/saveStateOfMindSample.js +0 -17
  197. package/lib/commonjs/utils/saveStateOfMindSample.js.map +0 -1
  198. package/lib/commonjs/utils/saveWorkoutRoute.js +0 -26
  199. package/lib/commonjs/utils/saveWorkoutRoute.js.map +0 -1
  200. package/lib/commonjs/utils/saveWorkoutSample.js +0 -36
  201. package/lib/commonjs/utils/saveWorkoutSample.js.map +0 -1
  202. package/lib/commonjs/utils/serializeDate.js +0 -9
  203. package/lib/commonjs/utils/serializeDate.js.map +0 -1
  204. package/lib/commonjs/utils/serializeDate.test.js +0 -17
  205. package/lib/commonjs/utils/serializeDate.test.js.map +0 -1
  206. package/lib/commonjs/utils/startWatchApp.js +0 -11
  207. package/lib/commonjs/utils/startWatchApp.js.map +0 -1
  208. package/lib/commonjs/utils/subscribeToChanges.js +0 -27
  209. package/lib/commonjs/utils/subscribeToChanges.js.map +0 -1
  210. package/lib/module/hooks/useHealthkitAuthorization.js +0 -32
  211. package/lib/module/hooks/useHealthkitAuthorization.js.map +0 -1
  212. package/lib/module/hooks/useHealthkitAuthorization.test.js +0 -68
  213. package/lib/module/hooks/useHealthkitAuthorization.test.js.map +0 -1
  214. package/lib/module/hooks/useIsHealthDataAvailable.js +0 -21
  215. package/lib/module/hooks/useIsHealthDataAvailable.js.map +0 -1
  216. package/lib/module/hooks/useIsHealthDataAvailable.test.js +0 -37
  217. package/lib/module/hooks/useIsHealthDataAvailable.test.js.map +0 -1
  218. package/lib/module/hooks/useMostRecentCategorySample.js +0 -16
  219. package/lib/module/hooks/useMostRecentCategorySample.js.map +0 -1
  220. package/lib/module/hooks/useMostRecentQuantitySample.js +0 -30
  221. package/lib/module/hooks/useMostRecentQuantitySample.js.map +0 -1
  222. package/lib/module/hooks/useMostRecentWorkout.js +0 -41
  223. package/lib/module/hooks/useMostRecentWorkout.js.map +0 -1
  224. package/lib/module/hooks/useSources.js +0 -15
  225. package/lib/module/hooks/useSources.js.map +0 -1
  226. package/lib/module/hooks/useStatisticsForQuantity.js +0 -21
  227. package/lib/module/hooks/useStatisticsForQuantity.js.map +0 -1
  228. package/lib/module/hooks/useSubscribeToChanges.js +0 -21
  229. package/lib/module/hooks/useSubscribeToChanges.js.map +0 -1
  230. package/lib/module/index.ios.js +0 -209
  231. package/lib/module/index.ios.js.map +0 -1
  232. package/lib/module/index.js +0 -4
  233. package/lib/module/index.js.map +0 -1
  234. package/lib/module/index.native.js +0 -160
  235. package/lib/module/index.native.js.map +0 -1
  236. package/lib/module/index.web.js +0 -4
  237. package/lib/module/index.web.js.map +0 -1
  238. package/lib/module/native-types.js +0 -1606
  239. package/lib/module/native-types.js.map +0 -1
  240. package/lib/module/test-setup.js +0 -54
  241. package/lib/module/test-setup.js.map +0 -1
  242. package/lib/module/test-utils.js +0 -11
  243. package/lib/module/test-utils.js.map +0 -1
  244. package/lib/module/types.js +0 -67
  245. package/lib/module/types.js.map +0 -1
  246. package/lib/module/utils/deleteQuantitySample.js +0 -4
  247. package/lib/module/utils/deleteQuantitySample.js.map +0 -1
  248. package/lib/module/utils/deleteSamples.js +0 -11
  249. package/lib/module/utils/deleteSamples.js.map +0 -1
  250. package/lib/module/utils/deleteWorkoutSample.js +0 -4
  251. package/lib/module/utils/deleteWorkoutSample.js.map +0 -1
  252. package/lib/module/utils/deserializeCategorySample.js +0 -7
  253. package/lib/module/utils/deserializeCategorySample.js.map +0 -1
  254. package/lib/module/utils/deserializeCategorySample.test.js +0 -22
  255. package/lib/module/utils/deserializeCategorySample.test.js.map +0 -1
  256. package/lib/module/utils/deserializeCorrelation.js +0 -19
  257. package/lib/module/utils/deserializeCorrelation.js.map +0 -1
  258. package/lib/module/utils/deserializeHeartbeatSeriesSample.js +0 -9
  259. package/lib/module/utils/deserializeHeartbeatSeriesSample.js.map +0 -1
  260. package/lib/module/utils/deserializeSample.js +0 -9
  261. package/lib/module/utils/deserializeSample.js.map +0 -1
  262. package/lib/module/utils/deserializeWorkout.js +0 -9
  263. package/lib/module/utils/deserializeWorkout.js.map +0 -1
  264. package/lib/module/utils/ensureMetadata.js +0 -5
  265. package/lib/module/utils/ensureMetadata.js.map +0 -1
  266. package/lib/module/utils/ensureTotals.js +0 -5
  267. package/lib/module/utils/ensureTotals.js.map +0 -1
  268. package/lib/module/utils/ensureUnit.js +0 -10
  269. package/lib/module/utils/ensureUnit.js.map +0 -1
  270. package/lib/module/utils/getDateOfBirth.js +0 -7
  271. package/lib/module/utils/getDateOfBirth.js.map +0 -1
  272. package/lib/module/utils/getMostRecentCategorySample.js +0 -10
  273. package/lib/module/utils/getMostRecentCategorySample.js.map +0 -1
  274. package/lib/module/utils/getMostRecentQuantitySample.js +0 -14
  275. package/lib/module/utils/getMostRecentQuantitySample.js.map +0 -1
  276. package/lib/module/utils/getMostRecentWorkout.js +0 -12
  277. package/lib/module/utils/getMostRecentWorkout.js.map +0 -1
  278. package/lib/module/utils/getPreferredUnit.js +0 -7
  279. package/lib/module/utils/getPreferredUnit.js.map +0 -1
  280. package/lib/module/utils/getPreferredUnits.js +0 -7
  281. package/lib/module/utils/getPreferredUnits.js.map +0 -1
  282. package/lib/module/utils/getPreferredUnitsTyped.js +0 -26
  283. package/lib/module/utils/getPreferredUnitsTyped.js.map +0 -1
  284. package/lib/module/utils/getRequestStatusForAuthorization.js +0 -14
  285. package/lib/module/utils/getRequestStatusForAuthorization.js.map +0 -1
  286. package/lib/module/utils/getWorkoutPlanById.js +0 -6
  287. package/lib/module/utils/getWorkoutPlanById.js.map +0 -1
  288. package/lib/module/utils/prepareOptions.js +0 -18
  289. package/lib/module/utils/prepareOptions.js.map +0 -1
  290. package/lib/module/utils/queryCategorySamples.js +0 -10
  291. package/lib/module/utils/queryCategorySamples.js.map +0 -1
  292. package/lib/module/utils/queryCategorySamplesWithAnchor.js +0 -14
  293. package/lib/module/utils/queryCategorySamplesWithAnchor.js.map +0 -1
  294. package/lib/module/utils/queryCorrelationSamples.js +0 -10
  295. package/lib/module/utils/queryCorrelationSamples.js.map +0 -1
  296. package/lib/module/utils/queryHeartbeatSeriesSamples.js +0 -10
  297. package/lib/module/utils/queryHeartbeatSeriesSamples.js.map +0 -1
  298. package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js +0 -14
  299. package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +0 -1
  300. package/lib/module/utils/queryQuantitySamples.js +0 -12
  301. package/lib/module/utils/queryQuantitySamples.js.map +0 -1
  302. package/lib/module/utils/queryQuantitySamplesWithAnchor.js +0 -16
  303. package/lib/module/utils/queryQuantitySamplesWithAnchor.js.map +0 -1
  304. package/lib/module/utils/querySources.js +0 -7
  305. package/lib/module/utils/querySources.js.map +0 -1
  306. package/lib/module/utils/queryStateOfMindSamples.js +0 -14
  307. package/lib/module/utils/queryStateOfMindSamples.js.map +0 -1
  308. package/lib/module/utils/queryStatisticsCollectionForQuantity.js +0 -9
  309. package/lib/module/utils/queryStatisticsCollectionForQuantity.js.map +0 -1
  310. package/lib/module/utils/queryStatisticsForQuantity.js +0 -22
  311. package/lib/module/utils/queryStatisticsForQuantity.js.map +0 -1
  312. package/lib/module/utils/queryWorkoutSamplesWithAnchor.js +0 -19
  313. package/lib/module/utils/queryWorkoutSamplesWithAnchor.js.map +0 -1
  314. package/lib/module/utils/queryWorkouts.js +0 -15
  315. package/lib/module/utils/queryWorkouts.js.map +0 -1
  316. package/lib/module/utils/requestAuthorization.js +0 -15
  317. package/lib/module/utils/requestAuthorization.js.map +0 -1
  318. package/lib/module/utils/saveCategorySample.js +0 -13
  319. package/lib/module/utils/saveCategorySample.js.map +0 -1
  320. package/lib/module/utils/saveCorrelationSample.js +0 -28
  321. package/lib/module/utils/saveCorrelationSample.js.map +0 -1
  322. package/lib/module/utils/saveQuantitySample.js +0 -9
  323. package/lib/module/utils/saveQuantitySample.js.map +0 -1
  324. package/lib/module/utils/saveStateOfMindSample.js +0 -10
  325. package/lib/module/utils/saveStateOfMindSample.js.map +0 -1
  326. package/lib/module/utils/saveWorkoutRoute.js +0 -19
  327. package/lib/module/utils/saveWorkoutRoute.js.map +0 -1
  328. package/lib/module/utils/saveWorkoutSample.js +0 -29
  329. package/lib/module/utils/saveWorkoutSample.js.map +0 -1
  330. package/lib/module/utils/serializeDate.js +0 -3
  331. package/lib/module/utils/serializeDate.js.map +0 -1
  332. package/lib/module/utils/serializeDate.test.js +0 -14
  333. package/lib/module/utils/serializeDate.test.js.map +0 -1
  334. package/lib/module/utils/startWatchApp.js +0 -4
  335. package/lib/module/utils/startWatchApp.js.map +0 -1
  336. package/lib/module/utils/subscribeToChanges.js +0 -20
  337. package/lib/module/utils/subscribeToChanges.js.map +0 -1
  338. package/lib/typescript/example-expo/App.d.ts +0 -2
  339. package/lib/typescript/src/hooks/useHealthkitAuthorization.d.ts +0 -8
  340. package/lib/typescript/src/hooks/useHealthkitAuthorization.test.d.ts +0 -1
  341. package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +0 -7
  342. package/lib/typescript/src/hooks/useIsHealthDataAvailable.test.d.ts +0 -1
  343. package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +0 -7
  344. package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +0 -7
  345. package/lib/typescript/src/hooks/useMostRecentWorkout.d.ts +0 -10
  346. package/lib/typescript/src/hooks/useSources.d.ts +0 -3
  347. package/lib/typescript/src/hooks/useStatisticsForQuantity.d.ts +0 -4
  348. package/lib/typescript/src/hooks/useSubscribeToChanges.d.ts +0 -3
  349. package/lib/typescript/src/index.d.ts +0 -3
  350. package/lib/typescript/src/index.ios.d.ts +0 -198
  351. package/lib/typescript/src/index.native.d.ts +0 -41
  352. package/lib/typescript/src/index.web.d.ts +0 -3
  353. package/lib/typescript/src/native-types.d.ts +0 -1764
  354. package/lib/typescript/src/test-setup.d.ts +0 -1
  355. package/lib/typescript/src/test-utils.d.ts +0 -2
  356. package/lib/typescript/src/types.d.ts +0 -111
  357. package/lib/typescript/src/utils/deleteQuantitySample.d.ts +0 -4
  358. package/lib/typescript/src/utils/deleteSamples.d.ts +0 -8
  359. package/lib/typescript/src/utils/deleteWorkoutSample.d.ts +0 -3
  360. package/lib/typescript/src/utils/deserializeCategorySample.d.ts +0 -4
  361. package/lib/typescript/src/utils/deserializeCategorySample.test.d.ts +0 -1
  362. package/lib/typescript/src/utils/deserializeCorrelation.d.ts +0 -4
  363. package/lib/typescript/src/utils/deserializeHeartbeatSeriesSample.d.ts +0 -4
  364. package/lib/typescript/src/utils/deserializeSample.d.ts +0 -4
  365. package/lib/typescript/src/utils/deserializeWorkout.d.ts +0 -4
  366. package/lib/typescript/src/utils/ensureMetadata.d.ts +0 -2
  367. package/lib/typescript/src/utils/ensureTotals.d.ts +0 -2
  368. package/lib/typescript/src/utils/ensureUnit.d.ts +0 -3
  369. package/lib/typescript/src/utils/getDateOfBirth.d.ts +0 -2
  370. package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +0 -4
  371. package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +0 -4
  372. package/lib/typescript/src/utils/getMostRecentWorkout.d.ts +0 -5
  373. package/lib/typescript/src/utils/getPreferredUnit.d.ts +0 -4
  374. package/lib/typescript/src/utils/getPreferredUnits.d.ts +0 -4
  375. package/lib/typescript/src/utils/getPreferredUnitsTyped.d.ts +0 -9
  376. package/lib/typescript/src/utils/getRequestStatusForAuthorization.d.ts +0 -3
  377. package/lib/typescript/src/utils/getWorkoutPlanById.d.ts +0 -5
  378. package/lib/typescript/src/utils/prepareOptions.d.ts +0 -9
  379. package/lib/typescript/src/utils/queryCategorySamples.d.ts +0 -5
  380. package/lib/typescript/src/utils/queryCategorySamplesWithAnchor.d.ts +0 -10
  381. package/lib/typescript/src/utils/queryCorrelationSamples.d.ts +0 -5
  382. package/lib/typescript/src/utils/queryHeartbeatSeriesSamples.d.ts +0 -10
  383. package/lib/typescript/src/utils/queryHeartbeatSeriesSamplesWithAnchor.d.ts +0 -10
  384. package/lib/typescript/src/utils/queryQuantitySamples.d.ts +0 -7
  385. package/lib/typescript/src/utils/queryQuantitySamplesWithAnchor.d.ts +0 -12
  386. package/lib/typescript/src/utils/querySources.d.ts +0 -4
  387. package/lib/typescript/src/utils/queryStateOfMindSamples.d.ts +0 -7
  388. package/lib/typescript/src/utils/queryStatisticsCollectionForQuantity.d.ts +0 -3
  389. package/lib/typescript/src/utils/queryStatisticsForQuantity.d.ts +0 -14
  390. package/lib/typescript/src/utils/queryWorkoutSamplesWithAnchor.d.ts +0 -9
  391. package/lib/typescript/src/utils/queryWorkouts.d.ts +0 -4
  392. package/lib/typescript/src/utils/requestAuthorization.d.ts +0 -4
  393. package/lib/typescript/src/utils/saveCategorySample.d.ts +0 -11
  394. package/lib/typescript/src/utils/saveCorrelationSample.d.ts +0 -8
  395. package/lib/typescript/src/utils/saveQuantitySample.d.ts +0 -7
  396. package/lib/typescript/src/utils/saveStateOfMindSample.d.ts +0 -11
  397. package/lib/typescript/src/utils/saveWorkoutRoute.d.ts +0 -3
  398. package/lib/typescript/src/utils/saveWorkoutSample.d.ts +0 -11
  399. package/lib/typescript/src/utils/serializeDate.d.ts +0 -2
  400. package/lib/typescript/src/utils/serializeDate.test.d.ts +0 -1
  401. package/lib/typescript/src/utils/startWatchApp.d.ts +0 -3
  402. package/lib/typescript/src/utils/subscribeToChanges.d.ts +0 -3
  403. package/src/index.ios.tsx +0 -292
  404. package/src/index.native.tsx +0 -233
  405. package/src/index.tsx +0 -5
  406. package/src/index.web.tsx +0 -5
  407. package/src/native-types.ts +0 -2471
  408. package/src/types.ts +0 -156
  409. package/src/utils/deleteQuantitySample.ts +0 -14
  410. package/src/utils/deleteSamples.ts +0 -23
  411. package/src/utils/deleteWorkoutSample.ts +0 -7
  412. package/src/utils/deserializeCategorySample.test.ts +0 -24
  413. package/src/utils/deserializeCategorySample.ts +0 -12
  414. package/src/utils/deserializeCorrelation.ts +0 -28
  415. package/src/utils/deserializeHeartbeatSeriesSample.ts +0 -12
  416. package/src/utils/deserializeSample.ts +0 -17
  417. package/src/utils/deserializeWorkout.ts +0 -14
  418. package/src/utils/ensureMetadata.ts +0 -5
  419. package/src/utils/ensureTotals.ts +0 -5
  420. package/src/utils/ensureUnit.ts +0 -19
  421. package/src/utils/getDateOfBirth.ts +0 -8
  422. package/src/utils/getPreferredUnits.ts +0 -14
  423. package/src/utils/getPreferredUnitsTyped.ts +0 -38
  424. package/src/utils/getRequestStatusForAuthorization.ts +0 -21
  425. package/src/utils/getWorkoutPlanById.ts +0 -7
  426. package/src/utils/prepareOptions.ts +0 -19
  427. package/src/utils/queryCategorySamples.ts +0 -29
  428. package/src/utils/queryCategorySamplesWithAnchor.ts +0 -39
  429. package/src/utils/queryCorrelationSamples.ts +0 -29
  430. package/src/utils/queryHeartbeatSeriesSamples.ts +0 -29
  431. package/src/utils/queryHeartbeatSeriesSamplesWithAnchor.ts +0 -33
  432. package/src/utils/queryQuantitySamples.ts +0 -38
  433. package/src/utils/queryQuantitySamplesWithAnchor.ts +0 -46
  434. package/src/utils/querySources.ts +0 -21
  435. package/src/utils/queryStateOfMindSamples.ts +0 -14
  436. package/src/utils/queryStatisticsCollectionForQuantity.ts +0 -38
  437. package/src/utils/queryStatisticsForQuantity.ts +0 -38
  438. package/src/utils/queryWorkoutSamplesWithAnchor.ts +0 -46
  439. package/src/utils/queryWorkouts.ts +0 -28
  440. package/src/utils/requestAuthorization.ts +0 -19
  441. package/src/utils/saveCategorySample.ts +0 -31
  442. package/src/utils/saveCorrelationSample.ts +0 -43
  443. package/src/utils/saveQuantitySample.ts +0 -29
  444. package/src/utils/saveStateOfMindSample.ts +0 -38
  445. package/src/utils/saveWorkoutRoute.ts +0 -21
  446. package/src/utils/saveWorkoutSample.ts +0 -42
  447. package/src/utils/serializeDate.test.ts +0 -16
  448. package/src/utils/serializeDate.ts +0 -5
  449. package/src/utils/startWatchApp.ts +0 -7
@@ -1 +0,0 @@
1
- {"version":3,"names":["renderHook","act","waitForNextUpdate","describe","NativeTypes","useHealthkitAuthorization","beforeAll","default","test","HKAuthorizationRequestStatus","HKCategoryTypeIdentifier","Native","jest","spyOn","mockReturnValue","Promise","resolve","shouldRequest","result","abdominalCramps","expect","current","toBe","spy","unnecessary","retVal","r"],"sources":["useHealthkitAuthorization.test.ts"],"sourcesContent":["import { renderHook, act } from '@testing-library/react-native'\n\nimport waitForNextUpdate from '../test-utils'\n\ndescribe('useHealthkitAuthorization', () => {\n let NativeTypes: typeof import('../native-types')\n let useHealthkitAuthorization: typeof import('./useHealthkitAuthorization').default\n beforeAll(async () => {\n NativeTypes = await import('../native-types')\n useHealthkitAuthorization = (await import('./useHealthkitAuthorization')).default\n })\n\n test('should return shouldRequest', async () => {\n const { HKAuthorizationRequestStatus, HKCategoryTypeIdentifier, default: Native } = NativeTypes\n\n jest.spyOn(Native, 'getRequestStatusForAuthorization').mockReturnValue(Promise.resolve(HKAuthorizationRequestStatus.shouldRequest))\n\n const { result } = renderHook(() => useHealthkitAuthorization([HKCategoryTypeIdentifier.abdominalCramps]))\n\n await waitForNextUpdate()\n\n expect(result.current[0]).toBe(HKAuthorizationRequestStatus.shouldRequest)\n })\n\n test('should request permissions', async () => {\n const { HKAuthorizationRequestStatus, HKCategoryTypeIdentifier, default: Native } = NativeTypes\n\n const spy = jest.spyOn(Native, 'getRequestStatusForAuthorization').mockReturnValue(Promise.resolve(HKAuthorizationRequestStatus.shouldRequest))\n jest.spyOn(Native, 'requestAuthorization').mockReturnValue(Promise.resolve(true))\n\n const { result } = renderHook(() => useHealthkitAuthorization([HKCategoryTypeIdentifier.abdominalCramps]))\n\n await waitForNextUpdate()\n\n spy.mockReturnValue(Promise.resolve(HKAuthorizationRequestStatus.unnecessary))\n\n let retVal: typeof HKAuthorizationRequestStatus | undefined\n await act(async () => {\n const r = await result.current[1]() as unknown as typeof HKAuthorizationRequestStatus\n retVal = r\n })\n\n expect(result.current[0]).toBe(HKAuthorizationRequestStatus.unnecessary)\n expect(retVal).toBe(HKAuthorizationRequestStatus.unnecessary)\n })\n\n test('should return unnecessary', async () => {\n const { HKAuthorizationRequestStatus, HKCategoryTypeIdentifier, default: Native } = NativeTypes\n\n jest.spyOn(Native, 'getRequestStatusForAuthorization').mockReturnValue(Promise.resolve(HKAuthorizationRequestStatus.unnecessary))\n\n const { result } = renderHook(() => useHealthkitAuthorization([HKCategoryTypeIdentifier.abdominalCramps]))\n\n await waitForNextUpdate()\n\n expect(result.current[0]).toBe(HKAuthorizationRequestStatus.unnecessary)\n })\n\n test('should return null before initalizing', async () => {\n const { HKCategoryTypeIdentifier } = NativeTypes\n\n const { result } = renderHook(() => useHealthkitAuthorization([HKCategoryTypeIdentifier.abdominalCramps]))\n\n expect(result.current[0]).toBe(null)\n\n await waitForNextUpdate()\n })\n})\n"],"mappings":"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","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import Native from '../native-types';
3
-
4
- /**
5
- * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
6
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple HealthKit isHealthDataAvailable}
7
- * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
8
- */
9
- const useIsHealthDataAvailable = () => {
10
- const [isAvailable, setIsAvailable] = useState(null);
11
- useEffect(() => {
12
- const init = async () => {
13
- const res = await Native.isHealthDataAvailable();
14
- setIsAvailable(res);
15
- };
16
- void init();
17
- }, []);
18
- return isAvailable;
19
- };
20
- export default useIsHealthDataAvailable;
21
- //# sourceMappingURL=useIsHealthDataAvailable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useState","Native","useIsHealthDataAvailable","isAvailable","setIsAvailable","init","res","isHealthDataAvailable"],"sources":["useIsHealthDataAvailable.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport Native from '../native-types'\n\n/**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple HealthKit isHealthDataAvailable}\n* @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.\n*/\nconst useIsHealthDataAvailable = (): boolean | null => {\n const [isAvailable, setIsAvailable] = useState<boolean | null>(null)\n\n useEffect(() => {\n const init = async () => {\n const res = await Native.isHealthDataAvailable()\n setIsAvailable(res)\n }\n void init()\n }, [])\n\n return isAvailable\n}\n\nexport default useIsHealthDataAvailable\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,OAAOC,MAAM,MAAM,iBAAiB;;AAEpC;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAGA,CAAA,KAAsB;EACrD,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGJ,QAAQ,CAAiB,IAAI,CAAC;EAEpED,SAAS,CAAC,MAAM;IACd,MAAMM,IAAI,GAAG,MAAAA,CAAA,KAAY;MACvB,MAAMC,GAAG,GAAG,MAAML,MAAM,CAACM,qBAAqB,CAAC,CAAC;MAChDH,cAAc,CAACE,GAAG,CAAC;IACrB,CAAC;IACD,KAAKD,IAAI,CAAC,CAAC;EACb,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,WAAW;AACpB,CAAC;AAED,eAAeD,wBAAwB","ignoreList":[]}
@@ -1,37 +0,0 @@
1
- import { renderHook } from '@testing-library/react-native';
2
- import waitForNextUpdate from '../test-utils';
3
- describe('useIsHealthDataAvailable', () => {
4
- test('should return false', async () => {
5
- const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default;
6
- const {
7
- default: Native
8
- } = await import('../native-types');
9
- jest.spyOn(Native, 'isHealthDataAvailable').mockReturnValue(Promise.resolve(false));
10
- const {
11
- result
12
- } = renderHook(useIsHealthDataAvailable);
13
- await waitForNextUpdate();
14
- expect(result.current).toBe(false);
15
- });
16
- test('should return true', async () => {
17
- const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default;
18
- const {
19
- default: Native
20
- } = await import('../native-types');
21
- jest.spyOn(Native, 'isHealthDataAvailable').mockReturnValue(Promise.resolve(true));
22
- const {
23
- result
24
- } = renderHook(useIsHealthDataAvailable);
25
- await waitForNextUpdate();
26
- expect(result.current).toBe(true);
27
- });
28
- test('should return null before initalizing', async () => {
29
- const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default;
30
- const {
31
- result
32
- } = renderHook(useIsHealthDataAvailable);
33
- expect(result.current).toBe(null);
34
- await waitForNextUpdate();
35
- });
36
- });
37
- //# sourceMappingURL=useIsHealthDataAvailable.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["renderHook","waitForNextUpdate","describe","test","useIsHealthDataAvailable","default","Native","jest","spyOn","mockReturnValue","Promise","resolve","result","expect","current","toBe"],"sources":["useIsHealthDataAvailable.test.ts"],"sourcesContent":["import { renderHook } from '@testing-library/react-native'\n\nimport waitForNextUpdate from '../test-utils'\n\ndescribe('useIsHealthDataAvailable', () => {\n test('should return false', async () => {\n const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default\n const { default: Native } = await import('../native-types')\n jest.spyOn(Native, 'isHealthDataAvailable').mockReturnValue(Promise.resolve(false))\n\n const { result } = renderHook(useIsHealthDataAvailable)\n\n await waitForNextUpdate()\n\n expect(result.current).toBe(false)\n })\n\n test('should return true', async () => {\n const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default\n const { default: Native } = await import('../native-types')\n jest.spyOn(Native, 'isHealthDataAvailable').mockReturnValue(Promise.resolve(true))\n\n const { result } = renderHook(useIsHealthDataAvailable)\n\n await waitForNextUpdate()\n\n expect(result.current).toBe(true)\n })\n\n test('should return null before initalizing', async () => {\n const useIsHealthDataAvailable = (await import('./useIsHealthDataAvailable')).default\n const { result } = renderHook(useIsHealthDataAvailable)\n\n expect(result.current).toBe(null)\n\n await waitForNextUpdate()\n })\n})\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,+BAA+B;AAE1D,OAAOC,iBAAiB,MAAM,eAAe;AAE7CC,QAAQ,CAAC,0BAA0B,EAAE,MAAM;EACzCC,IAAI,CAAC,qBAAqB,EAAE,YAAY;IACtC,MAAMC,wBAAwB,GAAG,CAAC,MAAM,MAAM,CAAC,4BAA4B,CAAC,EAAEC,OAAO;IACrF,MAAM;MAAEA,OAAO,EAAEC;IAAO,CAAC,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;IAC3DC,IAAI,CAACC,KAAK,CAACF,MAAM,EAAE,uBAAuB,CAAC,CAACG,eAAe,CAACC,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEnF,MAAM;MAAEC;IAAO,CAAC,GAAGZ,UAAU,CAACI,wBAAwB,CAAC;IAEvD,MAAMH,iBAAiB,CAAC,CAAC;IAEzBY,MAAM,CAACD,MAAM,CAACE,OAAO,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;EACpC,CAAC,CAAC;EAEFZ,IAAI,CAAC,oBAAoB,EAAE,YAAY;IACrC,MAAMC,wBAAwB,GAAG,CAAC,MAAM,MAAM,CAAC,4BAA4B,CAAC,EAAEC,OAAO;IACrF,MAAM;MAAEA,OAAO,EAAEC;IAAO,CAAC,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;IAC3DC,IAAI,CAACC,KAAK,CAACF,MAAM,EAAE,uBAAuB,CAAC,CAACG,eAAe,CAACC,OAAO,CAACC,OAAO,CAAC,IAAI,CAAC,CAAC;IAElF,MAAM;MAAEC;IAAO,CAAC,GAAGZ,UAAU,CAACI,wBAAwB,CAAC;IAEvD,MAAMH,iBAAiB,CAAC,CAAC;IAEzBY,MAAM,CAACD,MAAM,CAACE,OAAO,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;EACnC,CAAC,CAAC;EAEFZ,IAAI,CAAC,uCAAuC,EAAE,YAAY;IACxD,MAAMC,wBAAwB,GAAG,CAAC,MAAM,MAAM,CAAC,4BAA4B,CAAC,EAAEC,OAAO;IACrF,MAAM;MAAEO;IAAO,CAAC,GAAGZ,UAAU,CAACI,wBAAwB,CAAC;IAEvDS,MAAM,CAACD,MAAM,CAACE,OAAO,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;IAEjC,MAAMd,iBAAiB,CAAC,CAAC;EAC3B,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- import { useCallback, useState } from 'react';
2
- import useSubscribeToChanges from './useSubscribeToChanges';
3
- import getMostRecentCategorySample from '../utils/getMostRecentCategorySample';
4
- /**
5
- * @returns the most recent sample for the given category type.
6
- */
7
- function useMostRecentCategorySample(identifier) {
8
- const [category, setCategory] = useState(null);
9
- const updater = useCallback(() => {
10
- void getMostRecentCategorySample(identifier).then(setCategory);
11
- }, [identifier]);
12
- useSubscribeToChanges(identifier, updater);
13
- return category;
14
- }
15
- export default useMostRecentCategorySample;
16
- //# sourceMappingURL=useMostRecentCategorySample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useState","useSubscribeToChanges","getMostRecentCategorySample","useMostRecentCategorySample","identifier","category","setCategory","updater","then"],"sources":["useMostRecentCategorySample.ts"],"sourcesContent":["import { useCallback, useState } from 'react'\n\nimport useSubscribeToChanges from './useSubscribeToChanges'\nimport getMostRecentCategorySample from '../utils/getMostRecentCategorySample'\n\nimport type { HKCategoryTypeIdentifier } from '../native-types'\nimport type { HKCategorySample } from '../types'\n\n/**\n * @returns the most recent sample for the given category type.\n */\nfunction useMostRecentCategorySample<\n TCategory extends HKCategoryTypeIdentifier\n>(identifier: TCategory) {\n const [category, setCategory] = useState<HKCategorySample<TCategory> | null>(\n null,\n )\n const updater = useCallback(() => {\n void getMostRecentCategorySample(identifier).then(setCategory)\n }, [identifier])\n\n useSubscribeToChanges(identifier, updater)\n\n return category\n}\n\nexport default useMostRecentCategorySample\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAE7C,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,OAAOC,2BAA2B,MAAM,sCAAsC;AAK9E;AACA;AACA;AACA,SAASC,2BAA2BA,CAElCC,UAAqB,EAAE;EACvB,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGN,QAAQ,CACtC,IACF,CAAC;EACD,MAAMO,OAAO,GAAGR,WAAW,CAAC,MAAM;IAChC,KAAKG,2BAA2B,CAACE,UAAU,CAAC,CAACI,IAAI,CAACF,WAAW,CAAC;EAChE,CAAC,EAAE,CAACF,UAAU,CAAC,CAAC;EAEhBH,qBAAqB,CAACG,UAAU,EAAEG,OAAO,CAAC;EAE1C,OAAOF,QAAQ;AACjB;AAEA,eAAeF,2BAA2B","ignoreList":[]}
@@ -1,30 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import ensureUnit from '../utils/ensureUnit';
3
- import getMostRecentQuantitySample from '../utils/getMostRecentQuantitySample';
4
- import subscribeToChanges from '../utils/subscribeToChanges';
5
- /**
6
- * @returns the most recent sample for the given quantity type.
7
- */
8
- function useMostRecentQuantitySample(identifier, unit) {
9
- const [lastSample, setLastSample] = useState(null);
10
- useEffect(() => {
11
- let cancelSubscription;
12
- const init = async () => {
13
- const actualUnit = await ensureUnit(identifier, unit);
14
- const value = await getMostRecentQuantitySample(identifier, actualUnit);
15
- setLastSample(value);
16
- cancelSubscription = await subscribeToChanges(identifier, async () => {
17
- const value = await getMostRecentQuantitySample(identifier, actualUnit);
18
- setLastSample(value);
19
- });
20
- };
21
- void init();
22
- return () => {
23
- var _cancelSubscription;
24
- void ((_cancelSubscription = cancelSubscription) === null || _cancelSubscription === void 0 ? void 0 : _cancelSubscription());
25
- };
26
- }, [identifier, unit]);
27
- return lastSample;
28
- }
29
- export default useMostRecentQuantitySample;
30
- //# sourceMappingURL=useMostRecentQuantitySample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useState","ensureUnit","getMostRecentQuantitySample","subscribeToChanges","useMostRecentQuantitySample","identifier","unit","lastSample","setLastSample","cancelSubscription","init","actualUnit","value","_cancelSubscription"],"sources":["useMostRecentQuantitySample.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport ensureUnit from '../utils/ensureUnit'\nimport getMostRecentQuantitySample from '../utils/getMostRecentQuantitySample'\nimport subscribeToChanges from '../utils/subscribeToChanges'\n\nimport type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types'\nimport type { HKQuantitySample } from '../types'\n\n/**\n * @returns the most recent sample for the given quantity type.\n */\nfunction useMostRecentQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(identifier: TIdentifier, unit?: TUnit) {\n const [lastSample, setLastSample] = useState<HKQuantitySample<\n TIdentifier\n > | null>(null)\n\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n const actualUnit = await ensureUnit(identifier, unit)\n\n const value = await getMostRecentQuantitySample(identifier, actualUnit)\n setLastSample(value)\n\n cancelSubscription = await subscribeToChanges(identifier, async () => {\n const value = await getMostRecentQuantitySample(identifier, actualUnit)\n setLastSample(value)\n })\n }\n void init()\n\n return () => {\n void cancelSubscription?.()\n }\n }, [identifier, unit])\n\n return lastSample\n}\n\nexport default useMostRecentQuantitySample\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,2BAA2B,MAAM,sCAAsC;AAC9E,OAAOC,kBAAkB,MAAM,6BAA6B;AAK5D;AACA;AACA;AACA,SAASC,2BAA2BA,CAGlCC,UAAuB,EAAEC,IAAY,EAAE;EACvC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGR,QAAQ,CAElC,IAAI,CAAC;EAEfD,SAAS,CAAC,MAAM;IACd,IAAIU,kBAAwD;IAE5D,MAAMC,IAAI,GAAG,MAAAA,CAAA,KAAY;MACvB,MAAMC,UAAU,GAAG,MAAMV,UAAU,CAACI,UAAU,EAAEC,IAAI,CAAC;MAErD,MAAMM,KAAK,GAAG,MAAMV,2BAA2B,CAACG,UAAU,EAAEM,UAAU,CAAC;MACvEH,aAAa,CAACI,KAAK,CAAC;MAEpBH,kBAAkB,GAAG,MAAMN,kBAAkB,CAACE,UAAU,EAAE,YAAY;QACpE,MAAMO,KAAK,GAAG,MAAMV,2BAA2B,CAACG,UAAU,EAAEM,UAAU,CAAC;QACvEH,aAAa,CAACI,KAAK,CAAC;MACtB,CAAC,CAAC;IACJ,CAAC;IACD,KAAKF,IAAI,CAAC,CAAC;IAEX,OAAO,MAAM;MAAA,IAAAG,mBAAA;MACX,OAAAA,mBAAA,GAAKJ,kBAAkB,cAAAI,mBAAA,uBAAlBA,mBAAA,CAAqB,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,CAACR,UAAU,EAAEC,IAAI,CAAC,CAAC;EAEtB,OAAOC,UAAU;AACnB;AAEA,eAAeH,2BAA2B","ignoreList":[]}
@@ -1,41 +0,0 @@
1
- import { useEffect, useState, useRef, useCallback } from 'react';
2
- import getMostRecentWorkout from '../utils/getMostRecentWorkout';
3
- import getPreferredUnitsTyped from '../utils/getPreferredUnitsTyped';
4
- import subscribeToChanges from '../utils/subscribeToChanges';
5
- /**
6
- * @returns the most recent workout sample.
7
- */
8
- function useMostRecentWorkout(options) {
9
- const [workout, setWorkout] = useState(null);
10
- const optionsRef = useRef(options);
11
- useEffect(() => {
12
- optionsRef.current = options;
13
- }, [options]);
14
- const update = useCallback(async () => {
15
- const {
16
- energyUnit,
17
- distanceUnit
18
- } = await getPreferredUnitsTyped(optionsRef.current);
19
- setWorkout(await getMostRecentWorkout({
20
- energyUnit,
21
- distanceUnit
22
- }));
23
- }, []);
24
- useEffect(() => {
25
- void update();
26
- }, [update]);
27
- useEffect(() => {
28
- let cancelSubscription;
29
- const init = async () => {
30
- cancelSubscription = await subscribeToChanges('HKWorkoutTypeIdentifier', update);
31
- };
32
- void init();
33
- return () => {
34
- var _cancelSubscription;
35
- void ((_cancelSubscription = cancelSubscription) === null || _cancelSubscription === void 0 ? void 0 : _cancelSubscription());
36
- };
37
- }, [update]);
38
- return workout;
39
- }
40
- export default useMostRecentWorkout;
41
- //# sourceMappingURL=useMostRecentWorkout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useState","useRef","useCallback","getMostRecentWorkout","getPreferredUnitsTyped","subscribeToChanges","useMostRecentWorkout","options","workout","setWorkout","optionsRef","current","update","energyUnit","distanceUnit","cancelSubscription","init","_cancelSubscription"],"sources":["useMostRecentWorkout.ts"],"sourcesContent":["import {\n useEffect, useState, useRef, useCallback,\n} from 'react'\n\nimport getMostRecentWorkout from '../utils/getMostRecentWorkout'\nimport getPreferredUnitsTyped from '../utils/getPreferredUnitsTyped'\nimport subscribeToChanges from '../utils/subscribeToChanges'\n\nimport type { EnergyUnit, LengthUnit } from '../native-types'\nimport type { HKWorkout } from '../types'\n\n/**\n * @returns the most recent workout sample.\n */\nfunction useMostRecentWorkout<\n TEnergy extends EnergyUnit,\n TDistance extends LengthUnit\n>(options?: { readonly energyUnit?: TEnergy; readonly distanceUnit?: TDistance }) {\n const [workout, setWorkout] = useState<HKWorkout<TEnergy, TDistance> | null>(null)\n\n const optionsRef = useRef(options)\n\n useEffect(() => {\n optionsRef.current = options\n }, [options])\n\n const update = useCallback(async () => {\n const { energyUnit, distanceUnit } = await getPreferredUnitsTyped(\n optionsRef.current,\n )\n\n setWorkout(await getMostRecentWorkout({\n energyUnit,\n distanceUnit,\n }))\n }, [])\n\n useEffect(() => {\n void update()\n }, [update])\n\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n cancelSubscription = await subscribeToChanges(\n 'HKWorkoutTypeIdentifier',\n update,\n )\n }\n void init()\n\n return () => {\n void cancelSubscription?.()\n }\n }, [update])\n\n return workout\n}\n\nexport default useMostRecentWorkout\n"],"mappings":"AAAA,SACEA,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,QACnC,OAAO;AAEd,OAAOC,oBAAoB,MAAM,+BAA+B;AAChE,OAAOC,sBAAsB,MAAM,iCAAiC;AACpE,OAAOC,kBAAkB,MAAM,6BAA6B;AAK5D;AACA;AACA;AACA,SAASC,oBAAoBA,CAG3BC,OAA8E,EAAE;EAChF,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGT,QAAQ,CAAuC,IAAI,CAAC;EAElF,MAAMU,UAAU,GAAGT,MAAM,CAACM,OAAO,CAAC;EAElCR,SAAS,CAAC,MAAM;IACdW,UAAU,CAACC,OAAO,GAAGJ,OAAO;EAC9B,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,MAAMK,MAAM,GAAGV,WAAW,CAAC,YAAY;IACrC,MAAM;MAAEW,UAAU;MAAEC;IAAa,CAAC,GAAG,MAAMV,sBAAsB,CAC/DM,UAAU,CAACC,OACb,CAAC;IAEDF,UAAU,CAAC,MAAMN,oBAAoB,CAAC;MACpCU,UAAU;MACVC;IACF,CAAC,CAAC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAENf,SAAS,CAAC,MAAM;IACd,KAAKa,MAAM,CAAC,CAAC;EACf,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZb,SAAS,CAAC,MAAM;IACd,IAAIgB,kBAAwD;IAE5D,MAAMC,IAAI,GAAG,MAAAA,CAAA,KAAY;MACvBD,kBAAkB,GAAG,MAAMV,kBAAkB,CAC3C,yBAAyB,EACzBO,MACF,CAAC;IACH,CAAC;IACD,KAAKI,IAAI,CAAC,CAAC;IAEX,OAAO,MAAM;MAAA,IAAAC,mBAAA;MACX,OAAAA,mBAAA,GAAKF,kBAAkB,cAAAE,mBAAA,uBAAlBA,mBAAA,CAAqB,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,CAACL,MAAM,CAAC,CAAC;EAEZ,OAAOJ,OAAO;AAChB;AAEA,eAAeF,oBAAoB","ignoreList":[]}
@@ -1,15 +0,0 @@
1
- import { useCallback, useEffect, useState } from 'react';
2
- import querySources from '../utils/querySources';
3
- function useSources(identifier) {
4
- const [result, setResult] = useState(null);
5
- const update = useCallback(async () => {
6
- const res = await querySources(identifier);
7
- setResult(res);
8
- }, [identifier]);
9
- useEffect(() => {
10
- void update();
11
- }, [update]);
12
- return result;
13
- }
14
- export default useSources;
15
- //# sourceMappingURL=useSources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useEffect","useState","querySources","useSources","identifier","result","setResult","update","res"],"sources":["useSources.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\n\nimport querySources from '../utils/querySources'\n\nimport type {\n HKCategoryTypeIdentifier,\n HKQuantityTypeIdentifier,\n HKSource,\n} from '../native-types'\n\nfunction useSources<\n TIdentifier extends HKCategoryTypeIdentifier | HKQuantityTypeIdentifier\n>(identifier: TIdentifier) {\n const [result, setResult] = useState<readonly HKSource[] | null>(null)\n\n const update = useCallback(async () => {\n const res = await querySources(identifier)\n setResult(res)\n }, [identifier])\n\n useEffect(() => {\n void update()\n }, [update])\n\n return result\n}\n\nexport default useSources\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAExD,OAAOC,YAAY,MAAM,uBAAuB;AAQhD,SAASC,UAAUA,CAEjBC,UAAuB,EAAE;EACzB,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGL,QAAQ,CAA6B,IAAI,CAAC;EAEtE,MAAMM,MAAM,GAAGR,WAAW,CAAC,YAAY;IACrC,MAAMS,GAAG,GAAG,MAAMN,YAAY,CAACE,UAAU,CAAC;IAC1CE,SAAS,CAACE,GAAG,CAAC;EAChB,CAAC,EAAE,CAACJ,UAAU,CAAC,CAAC;EAEhBJ,SAAS,CAAC,MAAM;IACd,KAAKO,MAAM,CAAC,CAAC;EACf,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,OAAOF,MAAM;AACf;AAEA,eAAeF,UAAU","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- import { useState, useEffect, useCallback, useRef } from 'react';
2
- import useSubscribeToChanges from './useSubscribeToChanges';
3
- import queryStatisticsForQuantity from '../utils/queryStatisticsForQuantity';
4
- function useStatisticsForQuantity(identifier, options, from, to, unit) {
5
- const [result, setResult] = useState(null);
6
- const optionsRef = useRef(options);
7
- useEffect(() => {
8
- optionsRef.current = options;
9
- }, [options]);
10
- const update = useCallback(async () => {
11
- const res = await queryStatisticsForQuantity(identifier, optionsRef.current, from, to, unit);
12
- setResult(res);
13
- }, [identifier, from, to, unit]);
14
- useEffect(() => {
15
- void update();
16
- }, [update]);
17
- useSubscribeToChanges(identifier, update);
18
- return result;
19
- }
20
- export default useStatisticsForQuantity;
21
- //# sourceMappingURL=useStatisticsForQuantity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useState","useEffect","useCallback","useRef","useSubscribeToChanges","queryStatisticsForQuantity","useStatisticsForQuantity","identifier","options","from","to","unit","result","setResult","optionsRef","current","update","res"],"sources":["useStatisticsForQuantity.ts"],"sourcesContent":["import {\n useState, useEffect, useCallback, useRef,\n} from 'react'\n\nimport useSubscribeToChanges from './useSubscribeToChanges'\nimport queryStatisticsForQuantity from '../utils/queryStatisticsForQuantity'\n\nimport type { HKQuantityTypeIdentifier, HKStatisticsOptions, UnitForIdentifier } from '../native-types'\nimport type { QueryStatisticsResponse } from '../types'\n\nfunction useStatisticsForQuantity<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>>(\n identifier: TIdentifier,\n options: readonly HKStatisticsOptions[],\n from: Date,\n to?: Date,\n unit?: TUnit,\n) {\n const [result, setResult] = useState<QueryStatisticsResponse<TIdentifier, TUnit> | null>(null)\n\n const optionsRef = useRef(options)\n\n useEffect(() => {\n optionsRef.current = options\n }, [options])\n\n const update = useCallback(async () => {\n const res = await queryStatisticsForQuantity(identifier, optionsRef.current, from, to, unit)\n setResult(res)\n }, [\n identifier, from, to, unit,\n ])\n\n useEffect(() => {\n void update()\n }, [update])\n\n useSubscribeToChanges(identifier, update)\n\n return result\n}\n\nexport default useStatisticsForQuantity\n"],"mappings":"AAAA,SACEA,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,MAAM,QACnC,OAAO;AAEd,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,OAAOC,0BAA0B,MAAM,qCAAqC;AAK5E,SAASC,wBAAwBA,CAC/BC,UAAuB,EACvBC,OAAuC,EACvCC,IAAU,EACVC,EAAS,EACTC,IAAY,EACZ;EACA,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGb,QAAQ,CAAqD,IAAI,CAAC;EAE9F,MAAMc,UAAU,GAAGX,MAAM,CAACK,OAAO,CAAC;EAElCP,SAAS,CAAC,MAAM;IACda,UAAU,CAACC,OAAO,GAAGP,OAAO;EAC9B,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,MAAMQ,MAAM,GAAGd,WAAW,CAAC,YAAY;IACrC,MAAMe,GAAG,GAAG,MAAMZ,0BAA0B,CAACE,UAAU,EAAEO,UAAU,CAACC,OAAO,EAAEN,IAAI,EAAEC,EAAE,EAAEC,IAAI,CAAC;IAC5FE,SAAS,CAACI,GAAG,CAAC;EAChB,CAAC,EAAE,CACDV,UAAU,EAAEE,IAAI,EAAEC,EAAE,EAAEC,IAAI,CAC3B,CAAC;EAEFV,SAAS,CAAC,MAAM;IACd,KAAKe,MAAM,CAAC,CAAC;EACf,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZZ,qBAAqB,CAACG,UAAU,EAAES,MAAM,CAAC;EAEzC,OAAOJ,MAAM;AACf;AAEA,eAAeN,wBAAwB","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- import subscribeToChanges from '../utils/subscribeToChanges';
3
- function useSubscribeToChanges(identifier, onChange) {
4
- const onChangeRef = useRef(onChange);
5
- useEffect(() => {
6
- onChangeRef.current = onChange;
7
- }, [onChange]);
8
- useEffect(() => {
9
- let cancelSubscription;
10
- const init = async () => {
11
- cancelSubscription = await subscribeToChanges(identifier, onChangeRef.current);
12
- };
13
- void init();
14
- return () => {
15
- var _cancelSubscription;
16
- void ((_cancelSubscription = cancelSubscription) === null || _cancelSubscription === void 0 ? void 0 : _cancelSubscription());
17
- };
18
- }, [identifier]);
19
- }
20
- export default useSubscribeToChanges;
21
- //# sourceMappingURL=useSubscribeToChanges.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useRef","subscribeToChanges","useSubscribeToChanges","identifier","onChange","onChangeRef","current","cancelSubscription","init","_cancelSubscription"],"sources":["useSubscribeToChanges.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\n\nimport subscribeToChanges from '../utils/subscribeToChanges'\n\nimport type { HKSampleTypeIdentifier } from '..'\n\nfunction useSubscribeToChanges<TIdentifier extends HKSampleTypeIdentifier>(\n identifier: TIdentifier,\n onChange: () => void,\n): void {\n const onChangeRef = useRef(onChange)\n\n useEffect(() => {\n onChangeRef.current = onChange\n }, [onChange])\n\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n cancelSubscription = await subscribeToChanges(identifier, onChangeRef.current)\n }\n void init()\n\n return () => {\n void cancelSubscription?.()\n }\n }, [identifier])\n}\n\nexport default useSubscribeToChanges\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,OAAOC,kBAAkB,MAAM,6BAA6B;AAI5D,SAASC,qBAAqBA,CAC5BC,UAAuB,EACvBC,QAAoB,EACd;EACN,MAAMC,WAAW,GAAGL,MAAM,CAACI,QAAQ,CAAC;EAEpCL,SAAS,CAAC,MAAM;IACdM,WAAW,CAACC,OAAO,GAAGF,QAAQ;EAChC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEdL,SAAS,CAAC,MAAM;IACd,IAAIQ,kBAAwD;IAE5D,MAAMC,IAAI,GAAG,MAAAA,CAAA,KAAY;MACvBD,kBAAkB,GAAG,MAAMN,kBAAkB,CAACE,UAAU,EAAEE,WAAW,CAACC,OAAO,CAAC;IAChF,CAAC;IACD,KAAKE,IAAI,CAAC,CAAC;IAEX,OAAO,MAAM;MAAA,IAAAC,mBAAA;MACX,OAAAA,mBAAA,GAAKF,kBAAkB,cAAAE,mBAAA,uBAAlBA,mBAAA,CAAqB,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,CAACN,UAAU,CAAC,CAAC;AAClB;AAEA,eAAeD,qBAAqB","ignoreList":[]}
@@ -1,209 +0,0 @@
1
- import { Platform } from 'react-native';
2
- import useHealthkitAuthorization from './hooks/useHealthkitAuthorization';
3
- import useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable';
4
- import useMostRecentCategorySample from './hooks/useMostRecentCategorySample';
5
- import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
6
- import useMostRecentWorkout from './hooks/useMostRecentWorkout';
7
- import useSources from './hooks/useSources';
8
- import useStatisticsForQuantity from './hooks/useStatisticsForQuantity';
9
- import useSubscribeToChanges from './hooks/useSubscribeToChanges';
10
- import Native, { HKQuantityTypeIdentifier } from './native-types';
11
- import deleteQuantitySample from './utils/deleteQuantitySample';
12
- import deleteSamples from './utils/deleteSamples';
13
- import deleteWorkoutSample from './utils/deleteWorkoutSample';
14
- import getDateOfBirth from './utils/getDateOfBirth';
15
- import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
16
- import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
17
- import getMostRecentWorkout from './utils/getMostRecentWorkout';
18
- import getPreferredUnit from './utils/getPreferredUnit';
19
- import getPreferredUnits from './utils/getPreferredUnits';
20
- import getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization';
21
- import getWorkoutPlanById from './utils/getWorkoutPlanById';
22
- import queryCategorySamples from './utils/queryCategorySamples';
23
- import queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor';
24
- import queryCorrelationSamples from './utils/queryCorrelationSamples';
25
- import queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples';
26
- import queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor';
27
- import queryQuantitySamples from './utils/queryQuantitySamples';
28
- import queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor';
29
- import querySources from './utils/querySources';
30
- import { queryStateOfMindSamples } from './utils/queryStateOfMindSamples';
31
- import queryStatisticsCollectionForQuantity from './utils/queryStatisticsCollectionForQuantity';
32
- import queryStatisticsForQuantity from './utils/queryStatisticsForQuantity';
33
- import queryWorkoutSamples from './utils/queryWorkouts';
34
- import queryWorkoutSamplesWithAnchor from './utils/queryWorkoutSamplesWithAnchor';
35
- import requestAuthorization from './utils/requestAuthorization';
36
- import saveCategorySample from './utils/saveCategorySample';
37
- import saveCorrelationSample from './utils/saveCorrelationSample';
38
- import saveQuantitySample from './utils/saveQuantitySample';
39
- import saveStateOfMindSample from './utils/saveStateOfMindSample';
40
- import saveWorkoutRoute from './utils/saveWorkoutRoute';
41
- import saveWorkoutSample from './utils/saveWorkoutSample';
42
- import startWatchApp from './utils/startWatchApp';
43
- import subscribeToChanges from './utils/subscribeToChanges';
44
- const currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0;
45
- const allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)];
46
- const availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {
47
- if (majorVersionIOS >= 17) {
48
- return allQuantityTypesList;
49
- }
50
-
51
- // remove types that are not available before iOS 17
52
- return allQuantityTypesList.filter(type => ![HKQuantityTypeIdentifier.cyclingCadence, HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower, HKQuantityTypeIdentifier.cyclingPower, HKQuantityTypeIdentifier.cyclingSpeed, HKQuantityTypeIdentifier.physicalEffort, HKQuantityTypeIdentifier.timeInDaylight].includes(type));
53
- };
54
- const authorizationStatusFor = Native.authorizationStatusFor.bind(Native);
55
- const isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native);
56
- const isProtectedDataAvailable = Native.isProtectedDataAvailable.bind(Native);
57
- const disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native);
58
- const disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native);
59
- const enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native);
60
- const getBiologicalSex = Native.getBiologicalSex.bind(Native);
61
- const getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native);
62
- const getWheelchairUse = Native.getWheelchairUse.bind(Native);
63
- const getBloodType = Native.getBloodType.bind(Native);
64
- const getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native);
65
-
66
- /**
67
- * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
68
- */
69
- export default {
70
- /**
71
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
72
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
73
- */
74
- authorizationStatusFor,
75
- /**
76
- *
77
- * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
78
- */
79
- availableQuantityTypes,
80
- /**
81
- * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
82
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
83
- * @returns {boolean} true if HealthKit is available; otherwise, false.
84
- */
85
- isHealthDataAvailable,
86
- /**
87
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
88
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
89
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
90
- */
91
- isProtectedDataAvailable,
92
- /**
93
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
94
- */
95
- disableAllBackgroundDelivery,
96
- /**
97
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
98
- */
99
- disableBackgroundDelivery,
100
- /**
101
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
102
- */
103
- enableBackgroundDelivery,
104
- // simple convenience getters
105
- /**
106
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
107
- */
108
- getBiologicalSex,
109
- /**
110
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
111
- */
112
- getFitzpatrickSkinType,
113
- /**
114
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
115
- */
116
- getWheelchairUse,
117
- /**
118
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
119
- */
120
- getBloodType,
121
- /**
122
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
123
- */
124
- getDateOfBirth,
125
- getMostRecentQuantitySample,
126
- getMostRecentCategorySample,
127
- getMostRecentWorkout,
128
- /**
129
- * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
130
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
131
- */
132
- getWorkoutRoutes,
133
- getWorkoutPlanById,
134
- getPreferredUnit,
135
- getPreferredUnits,
136
- getRequestStatusForAuthorization,
137
- // query methods
138
- queryCategorySamples,
139
- queryCategorySamplesWithAnchor,
140
- queryCorrelationSamples,
141
- queryHeartbeatSeriesSamples,
142
- queryHeartbeatSeriesSamplesWithAnchor,
143
- queryQuantitySamples,
144
- queryQuantitySamplesWithAnchor,
145
- queryStatisticsForQuantity,
146
- queryStatisticsCollectionForQuantity,
147
- /**
148
- * @deprecated Use queryWorkoutSamples instead
149
- */
150
- queryWorkouts: queryWorkoutSamples,
151
- queryWorkoutSamples,
152
- queryWorkoutSamplesWithAnchor,
153
- querySources,
154
- requestAuthorization,
155
- // delete methods
156
- deleteQuantitySample,
157
- deleteSamples,
158
- deleteWorkoutSample,
159
- // save methods
160
- /**
161
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
162
- * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
163
- */
164
- saveCategorySample,
165
- saveCorrelationSample,
166
- saveQuantitySample,
167
- saveWorkoutSample,
168
- saveWorkoutRoute,
169
- saveStateOfMindSample,
170
- // subscriptions
171
- subscribeToChanges,
172
- startWatchApp,
173
- /**
174
- * @returns the most recent sample for the given category type.
175
- */
176
- useMostRecentCategorySample,
177
- /**
178
- * @returns the most recent sample for the given quantity type.
179
- */
180
- useMostRecentQuantitySample,
181
- /**
182
- * @returns the most recent workout sample.
183
- */
184
- useMostRecentWorkout,
185
- useSubscribeToChanges,
186
- /**
187
- * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
188
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
189
- * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
190
- */
191
- useIsHealthDataAvailable,
192
- /**
193
- * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
194
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
195
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
196
- */
197
- useHealthkitAuthorization,
198
- useSources,
199
- useStatisticsForQuantity,
200
- queryStateOfMindSamples
201
- };
202
- const queryWorkouts = queryWorkoutSamples;
203
- export { authorizationStatusFor, availableQuantityTypes, disableAllBackgroundDelivery, disableBackgroundDelivery, enableBackgroundDelivery, getBiologicalSex, getBloodType, getDateOfBirth, getFitzpatrickSkinType, getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, getPreferredUnits, getRequestStatusForAuthorization, getWheelchairUse, getWorkoutRoutes, isHealthDataAvailable, queryCategorySamples, queryCategorySamplesWithAnchor, queryCorrelationSamples, queryHeartbeatSeriesSamples, queryHeartbeatSeriesSamplesWithAnchor, queryQuantitySamples, queryQuantitySamplesWithAnchor, queryStatisticsForQuantity, queryStatisticsCollectionForQuantity,
204
- /**
205
- * @deprecated Use queryWorkoutSamples instead
206
- */
207
- queryWorkouts, queryWorkoutSamples, queryWorkoutSamplesWithAnchor, querySources, requestAuthorization, deleteQuantitySample, deleteSamples, deleteWorkoutSample, getWorkoutPlanById, saveCategorySample, saveStateOfMindSample, saveCorrelationSample, saveQuantitySample, saveWorkoutSample, saveWorkoutRoute, subscribeToChanges, startWatchApp, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSubscribeToChanges, useHealthkitAuthorization, useIsHealthDataAvailable, useSources, useStatisticsForQuantity, isProtectedDataAvailable, queryStateOfMindSamples };
208
- export * from './types';
209
- //# sourceMappingURL=index.ios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Platform","useHealthkitAuthorization","useIsHealthDataAvailable","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSources","useStatisticsForQuantity","useSubscribeToChanges","Native","HKQuantityTypeIdentifier","deleteQuantitySample","deleteSamples","deleteWorkoutSample","getDateOfBirth","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","getWorkoutPlanById","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","querySources","queryStateOfMindSamples","queryStatisticsCollectionForQuantity","queryStatisticsForQuantity","queryWorkoutSamples","queryWorkoutSamplesWithAnchor","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveStateOfMindSample","saveWorkoutRoute","saveWorkoutSample","startWatchApp","subscribeToChanges","currentMajorVersionIOS","OS","parseInt","Version","allQuantityTypesList","Object","values","availableQuantityTypes","majorVersionIOS","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","bind","isHealthDataAvailable","isProtectedDataAvailable","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","queryWorkouts"],"sources":["index.ios.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSources from './hooks/useSources'\nimport useStatisticsForQuantity from './hooks/useStatisticsForQuantity'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native, { HKQuantityTypeIdentifier } from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport deleteSamples from './utils/deleteSamples'\nimport deleteWorkoutSample from './utils/deleteWorkoutSample'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport getWorkoutPlanById from './utils/getWorkoutPlanById'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'\nimport queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor'\nimport querySources from './utils/querySources'\nimport { queryStateOfMindSamples } from './utils/queryStateOfMindSamples'\nimport queryStatisticsCollectionForQuantity from './utils/queryStatisticsCollectionForQuantity'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkoutSamples from './utils/queryWorkouts'\nimport queryWorkoutSamplesWithAnchor from './utils/queryWorkoutSamplesWithAnchor'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveStateOfMindSample from './utils/saveStateOfMindSample'\nimport saveWorkoutRoute from './utils/saveWorkoutRoute'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport startWatchApp from './utils/startWatchApp'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0\n\nconst allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)]\n\nconst availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {\n if (majorVersionIOS >= 17) {\n return allQuantityTypesList\n }\n\n // remove types that are not available before iOS 17\n return allQuantityTypesList.filter((type) => ![\n HKQuantityTypeIdentifier.cyclingCadence,\n HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower,\n HKQuantityTypeIdentifier.cyclingPower,\n HKQuantityTypeIdentifier.cyclingSpeed,\n HKQuantityTypeIdentifier.physicalEffort,\n HKQuantityTypeIdentifier.timeInDaylight,\n ].includes(type))\n}\n\nconst authorizationStatusFor = Native.authorizationStatusFor.bind(Native)\nconst isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native)\nconst isProtectedDataAvailable = Native.isProtectedDataAvailable.bind(Native)\nconst disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native)\nconst disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native)\nconst enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native)\nconst getBiologicalSex = Native.getBiologicalSex.bind(Native)\nconst getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native)\nconst getWheelchairUse = Native.getWheelchairUse.bind(Native)\nconst getBloodType = Native.getBloodType.bind(Native)\nconst getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native)\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}\n */\nexport default {\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }\n */\n authorizationStatusFor,\n\n /**\n *\n * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)\n */\n availableQuantityTypes,\n\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}\n * @returns {boolean} true if HealthKit is available; otherwise, false.\n */\n isHealthDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n isProtectedDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}\n */\n disableAllBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}\n */\n disableBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}\n */\n enableBackgroundDelivery,\n\n // simple convenience getters\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}\n */\n getBiologicalSex,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}\n */\n getFitzpatrickSkinType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}\n */\n getWheelchairUse,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}\n */\n getBloodType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}\n */\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}\n */\n getWorkoutRoutes,\n getWorkoutPlanById,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryStatisticsCollectionForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts: queryWorkoutSamples,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n deleteWorkoutSample,\n\n // save methods\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n saveStateOfMindSample,\n\n // subscriptions\n subscribeToChanges,\n\n startWatchApp,\n\n /**\n * @returns the most recent sample for the given category type.\n */\n useMostRecentCategorySample,\n /**\n * @returns the most recent sample for the given quantity type.\n */\n useMostRecentQuantitySample,\n /**\n * @returns the most recent workout sample.\n */\n useMostRecentWorkout,\n useSubscribeToChanges,\n /**\n * @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}\n * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.\n */\n useIsHealthDataAvailable,\n /**\n * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}\n */\n useHealthkitAuthorization,\n useSources,\n useStatisticsForQuantity,\n queryStateOfMindSamples,\n}\n\nconst queryWorkouts = queryWorkoutSamples\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryStatisticsCollectionForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n deleteWorkoutSample,\n getWorkoutPlanById,\n saveCategorySample,\n saveStateOfMindSample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n startWatchApp,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useSources,\n useStatisticsForQuantity,\n isProtectedDataAvailable,\n queryStateOfMindSamples,\n}\n\nexport * from './types'\n"],"mappings":"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","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import Healthkit from './index.ios';
2
- export * from './index.ios';
3
- export default Healthkit;
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Healthkit"],"sources":["index.tsx"],"sourcesContent":["import Healthkit from './index.ios'\n\nexport * from './index.ios'\n\nexport default Healthkit\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AAEnC,cAAc,aAAa;AAE3B,eAAeA,SAAS","ignoreList":[]}