@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,28 +0,0 @@
1
- import ensureMetadata from './ensureMetadata';
2
- import Native from '../native-types';
3
- async function saveCorrelationSample(typeIdentifier, samples, options) {
4
- const start = ((options === null || options === void 0 ? void 0 : options.start) || new Date()).toISOString();
5
- const end = ((options === null || options === void 0 ? void 0 : options.end) || new Date()).toISOString();
6
- return Native.saveCorrelationSample(typeIdentifier, samples.map(sample => {
7
- const {
8
- startDate,
9
- endDate,
10
- ...rest
11
- } = sample;
12
- const updatedSample = {
13
- ...rest,
14
- ...(startDate && {
15
- startDate: new Date(startDate).toISOString()
16
- }),
17
- ...(endDate && {
18
- endDate: new Date(endDate).toISOString()
19
- })
20
- };
21
- return {
22
- ...updatedSample,
23
- metadata: ensureMetadata(sample.metadata)
24
- };
25
- }), start, end, ensureMetadata(options === null || options === void 0 ? void 0 : options.metadata));
26
- }
27
- export default saveCorrelationSample;
28
- //# sourceMappingURL=saveCorrelationSample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ensureMetadata","Native","saveCorrelationSample","typeIdentifier","samples","options","start","Date","toISOString","end","map","sample","startDate","endDate","rest","updatedSample","metadata"],"sources":["saveCorrelationSample.ts"],"sourcesContent":["import ensureMetadata from './ensureMetadata'\nimport Native from '../native-types'\n\nimport type { MetadataMapperForCorrelationIdentifier, HKCorrelationTypeIdentifier } from '../native-types'\nimport type { HKCategorySampleForSaving, HKQuantitySampleForSaving } from '../types'\n\nasync function saveCorrelationSample<\n TIdentifier extends HKCorrelationTypeIdentifier,\n TSamples extends readonly(\n | HKCategorySampleForSaving\n | HKQuantitySampleForSaving\n )[]\n>(\n typeIdentifier: TIdentifier,\n samples: TSamples,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n },\n) {\n const start = (options?.start || new Date()).toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveCorrelationSample(\n typeIdentifier,\n samples.map((sample) => {\n const { startDate, endDate, ...rest } = sample\n const updatedSample = {\n ...rest,\n ...(startDate && { startDate: new Date(startDate).toISOString() }),\n ...(endDate && { endDate: new Date(endDate).toISOString() }),\n }\n\n return { ...updatedSample, metadata: ensureMetadata(sample.metadata) }\n }),\n start,\n end,\n ensureMetadata(options?.metadata),\n )\n}\n\nexport default saveCorrelationSample\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAKpC,eAAeC,qBAAqBA,CAOlCC,cAA2B,EAC3BC,OAAiB,EACjBC,OAIC,EACD;EACA,MAAMC,KAAK,GAAG,CAAC,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,KAAI,IAAIC,IAAI,CAAC,CAAC,EAAEC,WAAW,CAAC,CAAC;EAC1D,MAAMC,GAAG,GAAG,CAAC,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,GAAG,KAAI,IAAIF,IAAI,CAAC,CAAC,EAAEC,WAAW,CAAC,CAAC;EAEtD,OAAOP,MAAM,CAACC,qBAAqB,CACjCC,cAAc,EACdC,OAAO,CAACM,GAAG,CAAEC,MAAM,IAAK;IACtB,MAAM;MAAEC,SAAS;MAAEC,OAAO;MAAE,GAAGC;IAAK,CAAC,GAAGH,MAAM;IAC9C,MAAMI,aAAa,GAAG;MACpB,GAAGD,IAAI;MACP,IAAIF,SAAS,IAAI;QAAEA,SAAS,EAAE,IAAIL,IAAI,CAACK,SAAS,CAAC,CAACJ,WAAW,CAAC;MAAE,CAAC,CAAC;MAClE,IAAIK,OAAO,IAAI;QAAEA,OAAO,EAAE,IAAIN,IAAI,CAACM,OAAO,CAAC,CAACL,WAAW,CAAC;MAAE,CAAC;IAC7D,CAAC;IAED,OAAO;MAAE,GAAGO,aAAa;MAAEC,QAAQ,EAAEhB,cAAc,CAACW,MAAM,CAACK,QAAQ;IAAE,CAAC;EACxE,CAAC,CAAC,EACFV,KAAK,EACLG,GAAG,EACHT,cAAc,CAACK,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEW,QAAQ,CAClC,CAAC;AACH;AAEA,eAAed,qBAAqB","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import Native from '../native-types';
2
- async function saveQuantitySample(identifier, unit, value, options) {
3
- const start = (options === null || options === void 0 ? void 0 : options.start) || (options === null || options === void 0 ? void 0 : options.end) || new Date();
4
- const end = (options === null || options === void 0 ? void 0 : options.end) || (options === null || options === void 0 ? void 0 : options.start) || new Date();
5
- const metadata = (options === null || options === void 0 ? void 0 : options.metadata) || {};
6
- return Native.saveQuantitySample(identifier, unit, value, start.toISOString(), end.toISOString(), metadata);
7
- }
8
- export default saveQuantitySample;
9
- //# sourceMappingURL=saveQuantitySample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Native","saveQuantitySample","identifier","unit","value","options","start","end","Date","metadata","toISOString"],"sources":["saveQuantitySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { MetadataMapperForQuantityIdentifier, HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types'\n\nasync function saveQuantitySample<TType extends HKQuantityTypeIdentifier>(\n identifier: TType,\n unit: UnitForIdentifier<TType>,\n value: number,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForQuantityIdentifier<TType>;\n },\n) {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveQuantitySample(\n identifier,\n unit,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata,\n )\n}\n\nexport default saveQuantitySample\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,eAAeC,kBAAkBA,CAC/BC,UAAiB,EACjBC,IAA8B,EAC9BC,KAAa,EACbC,OAIC,EACD;EACA,MAAMC,KAAK,GAAG,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,MAAID,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,KAAI,IAAIC,IAAI,CAAC,CAAC;EAC1D,MAAMD,GAAG,GAAG,CAAAF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,MAAIF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,KAAI,IAAIE,IAAI,CAAC,CAAC;EACxD,MAAMC,QAAQ,GAAG,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,QAAQ,KAAI,CAAC,CAAC;EAExC,OAAOT,MAAM,CAACC,kBAAkB,CAC9BC,UAAU,EACVC,IAAI,EACJC,KAAK,EACLE,KAAK,CAACI,WAAW,CAAC,CAAC,EACnBH,GAAG,CAACG,WAAW,CAAC,CAAC,EACjBD,QACF,CAAC;AACH;AAEA,eAAeR,kBAAkB","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import Native from '../native-types';
2
- /**
3
- * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind Saving state of mind samples (Apple Docs)}
4
- * @description Saves a state of mind sample to HealthKit, including kind, mood, valence, labels (optional), and associations (optional).
5
- */
6
- async function saveStateOfMindSample(options) {
7
- return Native.saveStateOfMindSample(options.date.toISOString(), options.kind, options.valence, options.labels || [], options.associations || [], options.metadata || {});
8
- }
9
- export default saveStateOfMindSample;
10
- //# sourceMappingURL=saveStateOfMindSample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Native","saveStateOfMindSample","options","date","toISOString","kind","valence","labels","associations","metadata"],"sources":["saveStateOfMindSample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKStateOfMindSampleRaw } from '../native-types'\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind Saving state of mind samples (Apple Docs)}\n * @description Saves a state of mind sample to HealthKit, including kind, mood, valence, labels (optional), and associations (optional).\n */\nasync function saveStateOfMindSample(\n options: Omit<\n HKStateOfMindSampleRaw,\n | 'uuid'\n | 'valenceClassification'\n | 'startDate'\n | 'endDate'\n | 'labels'\n | 'associations'\n | 'device'\n | 'sourceRevision'\n > & {\n // allow the user to provide a Date instead of expecting them to provide date.toISOString()\n readonly date: Date\n // omitting then redeclaring these in order to make them optional\n readonly associations?: HKStateOfMindSampleRaw['associations']\n readonly labels?: HKStateOfMindSampleRaw['labels']\n },\n) {\n return Native.saveStateOfMindSample(\n options.date.toISOString(),\n options.kind,\n options.valence,\n options.labels || [],\n options.associations || [],\n options.metadata || {},\n )\n}\n\nexport default saveStateOfMindSample\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC;AACA;AACA;AACA;AACA,eAAeC,qBAAqBA,CAClCC,OAgBC,EACD;EACA,OAAOF,MAAM,CAACC,qBAAqB,CACjCC,OAAO,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,EAC1BF,OAAO,CAACG,IAAI,EACZH,OAAO,CAACI,OAAO,EACfJ,OAAO,CAACK,MAAM,IAAI,EAAE,EACpBL,OAAO,CAACM,YAAY,IAAI,EAAE,EAC1BN,OAAO,CAACO,QAAQ,IAAI,CAAC,CACvB,CAAC;AACH;AAEA,eAAeR,qBAAqB","ignoreList":[]}
@@ -1,19 +0,0 @@
1
- import Native from '../native-types';
2
- async function saveWorkoutRoute(workoutUUID, locations) {
3
- return Native.saveWorkoutRoute(workoutUUID, locations.map(location => {
4
- const {
5
- timestamp,
6
- ...rest
7
- } = location;
8
- return {
9
- ...rest,
10
- ...(timestamp ? {
11
- timestamp: new Date(timestamp).toISOString()
12
- } : {
13
- timestamp: ''
14
- })
15
- };
16
- }));
17
- }
18
- export default saveWorkoutRoute;
19
- //# sourceMappingURL=saveWorkoutRoute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Native","saveWorkoutRoute","workoutUUID","locations","map","location","timestamp","rest","Date","toISOString"],"sources":["saveWorkoutRoute.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { CLLocationForSaving } from '../types'\n\nasync function saveWorkoutRoute(\n workoutUUID: string,\n locations: readonly CLLocationForSaving[],\n) {\n return Native.saveWorkoutRoute(\n workoutUUID,\n locations.map((location) => {\n const { timestamp, ...rest } = location\n return {\n ...rest,\n ...(timestamp ? { timestamp: new Date(timestamp).toISOString() } : { timestamp: '' }),\n }\n }),\n )\n}\n\nexport default saveWorkoutRoute\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,eAAeC,gBAAgBA,CAC7BC,WAAmB,EACnBC,SAAyC,EACzC;EACA,OAAOH,MAAM,CAACC,gBAAgB,CAC5BC,WAAW,EACXC,SAAS,CAACC,GAAG,CAAEC,QAAQ,IAAK;IAC1B,MAAM;MAAEC,SAAS;MAAE,GAAGC;IAAK,CAAC,GAAGF,QAAQ;IACvC,OAAO;MACL,GAAGE,IAAI;MACP,IAAID,SAAS,GAAG;QAAEA,SAAS,EAAE,IAAIE,IAAI,CAACF,SAAS,CAAC,CAACG,WAAW,CAAC;MAAE,CAAC,GAAG;QAAEH,SAAS,EAAE;MAAG,CAAC;IACtF,CAAC;EACH,CAAC,CACH,CAAC;AACH;AAEA,eAAeL,gBAAgB","ignoreList":[]}
@@ -1,29 +0,0 @@
1
- import ensureMetadata from './ensureMetadata';
2
- import ensureTotals from './ensureTotals';
3
- import Native from '../native-types';
4
- async function saveWorkoutSample(typeIdentifier, quantities, _start, options) {
5
- const start = _start.toISOString();
6
- const end = ((options === null || options === void 0 ? void 0 : options.end) || new Date()).toISOString();
7
- return Native.saveWorkoutSample(typeIdentifier, quantities.map(quantity => {
8
- const {
9
- startDate,
10
- endDate,
11
- ...rest
12
- } = quantity;
13
- const updatedQuantity = {
14
- ...rest,
15
- ...(startDate && {
16
- startDate: startDate.toISOString()
17
- }),
18
- ...(endDate && {
19
- endDate: endDate.toISOString()
20
- })
21
- };
22
- return {
23
- ...updatedQuantity,
24
- metadata: ensureMetadata(quantity.metadata)
25
- };
26
- }), start, end, ensureTotals(options === null || options === void 0 ? void 0 : options.totals), ensureMetadata(options === null || options === void 0 ? void 0 : options.metadata));
27
- }
28
- export default saveWorkoutSample;
29
- //# sourceMappingURL=saveWorkoutSample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ensureMetadata","ensureTotals","Native","saveWorkoutSample","typeIdentifier","quantities","_start","options","start","toISOString","end","Date","map","quantity","startDate","endDate","rest","updatedQuantity","metadata","totals"],"sources":["saveWorkoutSample.ts"],"sourcesContent":["import ensureMetadata from './ensureMetadata'\nimport ensureTotals from './ensureTotals'\nimport Native from '../native-types'\n\nimport type { HKWorkoutActivityType, HKWorkoutMetadata } from '../native-types'\nimport type { HKQuantitySampleForSaving } from '../types'\n\nasync function saveWorkoutSample<TIdentifier extends HKWorkoutActivityType>(\n typeIdentifier: TIdentifier,\n quantities: readonly HKQuantitySampleForSaving[],\n _start: Date,\n options?: {\n readonly end?: Date;\n readonly totals?: {\n readonly distance?: number;\n readonly energyBurned?: number;\n }\n readonly metadata?: HKWorkoutMetadata;\n },\n) {\n const start = _start.toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveWorkoutSample(\n typeIdentifier,\n quantities.map((quantity) => {\n const { startDate, endDate, ...rest } = quantity\n const updatedQuantity = {\n ...rest,\n ...(startDate && { startDate: startDate.toISOString() }),\n ...(endDate && { endDate: endDate.toISOString() }),\n }\n return { ...updatedQuantity, metadata: ensureMetadata(quantity.metadata) }\n }),\n start,\n end,\n ensureTotals(options?.totals),\n ensureMetadata(options?.metadata),\n )\n}\n\nexport default saveWorkoutSample\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,MAAM,MAAM,iBAAiB;AAKpC,eAAeC,iBAAiBA,CAC9BC,cAA2B,EAC3BC,UAAgD,EAChDC,MAAY,EACZC,OAOC,EACD;EACA,MAAMC,KAAK,GAAGF,MAAM,CAACG,WAAW,CAAC,CAAC;EAClC,MAAMC,GAAG,GAAG,CAAC,CAAAH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG,KAAI,IAAIC,IAAI,CAAC,CAAC,EAAEF,WAAW,CAAC,CAAC;EAEtD,OAAOP,MAAM,CAACC,iBAAiB,CAC7BC,cAAc,EACdC,UAAU,CAACO,GAAG,CAAEC,QAAQ,IAAK;IAC3B,MAAM;MAAEC,SAAS;MAAEC,OAAO;MAAE,GAAGC;IAAK,CAAC,GAAGH,QAAQ;IAChD,MAAMI,eAAe,GAAG;MACtB,GAAGD,IAAI;MACP,IAAIF,SAAS,IAAI;QAAEA,SAAS,EAAEA,SAAS,CAACL,WAAW,CAAC;MAAE,CAAC,CAAC;MACxD,IAAIM,OAAO,IAAI;QAAEA,OAAO,EAAEA,OAAO,CAACN,WAAW,CAAC;MAAE,CAAC;IACnD,CAAC;IACD,OAAO;MAAE,GAAGQ,eAAe;MAAEC,QAAQ,EAAElB,cAAc,CAACa,QAAQ,CAACK,QAAQ;IAAE,CAAC;EAC5E,CAAC,CAAC,EACFV,KAAK,EACLE,GAAG,EACHT,YAAY,CAACM,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEY,MAAM,CAAC,EAC7BnB,cAAc,CAACO,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEW,QAAQ,CAClC,CAAC;AACH;AAEA,eAAef,iBAAiB","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- const serializeDate = date => (date || new Date(-1)).toISOString();
2
- export default serializeDate;
3
- //# sourceMappingURL=serializeDate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["serializeDate","date","Date","toISOString"],"sources":["serializeDate.ts"],"sourcesContent":["const serializeDate = (date?: Date | null): string => (\n (date || new Date(-1)).toISOString()\n)\n\nexport default serializeDate\n"],"mappings":"AAAA,MAAMA,aAAa,GAAIC,IAAkB,IACvC,CAACA,IAAI,IAAI,IAAIC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAEC,WAAW,CAAC,CACpC;AAED,eAAeH,aAAa","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- import serializeDate from './serializeDate';
2
- describe('serializeDate', () => {
3
- it('should serialize zero date', () => {
4
- expect(serializeDate(new Date(0))).toBe('1970-01-01T00:00:00.000Z');
5
- });
6
- it('should serialize date', () => {
7
- const date = new Date();
8
- expect(serializeDate(date)).toBe(date.toISOString());
9
- });
10
- it('should serialize null date', () => {
11
- expect(serializeDate(null)).toBe('1969-12-31T23:59:59.999Z');
12
- });
13
- });
14
- //# sourceMappingURL=serializeDate.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["serializeDate","describe","it","expect","Date","toBe","date","toISOString"],"sources":["serializeDate.test.ts"],"sourcesContent":["import serializeDate from './serializeDate'\n\ndescribe('serializeDate', () => {\n it('should serialize zero date', () => {\n expect(serializeDate(new Date(0))).toBe('1970-01-01T00:00:00.000Z')\n })\n\n it('should serialize date', () => {\n const date = new Date()\n expect(serializeDate(date)).toBe(date.toISOString())\n })\n\n it('should serialize null date', () => {\n expect(serializeDate(null)).toBe('1969-12-31T23:59:59.999Z')\n })\n})\n"],"mappings":"AAAA,OAAOA,aAAa,MAAM,iBAAiB;AAE3CC,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9BC,EAAE,CAAC,4BAA4B,EAAE,MAAM;IACrCC,MAAM,CAACH,aAAa,CAAC,IAAII,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,0BAA0B,CAAC;EACrE,CAAC,CAAC;EAEFH,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAChC,MAAMI,IAAI,GAAG,IAAIF,IAAI,CAAC,CAAC;IACvBD,MAAM,CAACH,aAAa,CAACM,IAAI,CAAC,CAAC,CAACD,IAAI,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,CAAC;EACtD,CAAC,CAAC;EAEFL,EAAE,CAAC,4BAA4B,EAAE,MAAM;IACrCC,MAAM,CAACH,aAAa,CAAC,IAAI,CAAC,CAAC,CAACK,IAAI,CAAC,0BAA0B,CAAC;EAC9D,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import Native from '../native-types';
2
- const startWatchApp = configuration => async () => Native.startWatchAppWithWorkoutConfiguration(configuration);
3
- export default startWatchApp;
4
- //# sourceMappingURL=startWatchApp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Native","startWatchApp","configuration","startWatchAppWithWorkoutConfiguration"],"sources":["startWatchApp.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKWorkoutConfiguration } from '..'\n\nconst startWatchApp = (configuration: HKWorkoutConfiguration) => async () => Native.startWatchAppWithWorkoutConfiguration(configuration)\n\nexport default startWatchApp\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,MAAMC,aAAa,GAAIC,aAAqC,IAAK,YAAYF,MAAM,CAACG,qCAAqC,CAACD,aAAa,CAAC;AAExI,eAAeD,aAAa","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- import Native, { EventEmitter } from '../native-types';
2
- const subscribeToChanges = async (identifier, callback) => {
3
- const subscription = EventEmitter.addListener('onChange', ({
4
- typeIdentifier
5
- }) => {
6
- if (typeIdentifier === identifier) {
7
- callback();
8
- }
9
- });
10
- const queryId = await Native.subscribeToObserverQuery(identifier).catch(async error => {
11
- subscription.remove();
12
- return Promise.reject(error);
13
- });
14
- return async () => {
15
- subscription.remove();
16
- return Native.unsubscribeQuery(queryId);
17
- };
18
- };
19
- export default subscribeToChanges;
20
- //# sourceMappingURL=subscribeToChanges.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Native","EventEmitter","subscribeToChanges","identifier","callback","subscription","addListener","typeIdentifier","queryId","subscribeToObserverQuery","catch","error","remove","Promise","reject","unsubscribeQuery"],"sources":["subscribeToChanges.ts"],"sourcesContent":["import Native, { EventEmitter } from '../native-types'\n\nimport type { HKSampleTypeIdentifier } from '..'\n\nconst subscribeToChanges = async (\n identifier: HKSampleTypeIdentifier,\n callback: () => void,\n) => {\n const subscription = EventEmitter.addListener(\n 'onChange',\n ({ typeIdentifier }: { readonly typeIdentifier: HKSampleTypeIdentifier }) => {\n if (typeIdentifier === identifier) {\n callback()\n }\n },\n )\n\n const queryId = await Native.subscribeToObserverQuery(identifier).catch(\n async (error) => {\n subscription.remove()\n return Promise.reject(error)\n },\n )\n\n return async () => {\n subscription.remove()\n return Native.unsubscribeQuery(queryId)\n }\n}\n\nexport default subscribeToChanges\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,YAAY,QAAQ,iBAAiB;AAItD,MAAMC,kBAAkB,GAAG,MAAAA,CACzBC,UAAkC,EAClCC,QAAoB,KACjB;EACH,MAAMC,YAAY,GAAGJ,YAAY,CAACK,WAAW,CAC3C,UAAU,EACV,CAAC;IAAEC;EAAoE,CAAC,KAAK;IAC3E,IAAIA,cAAc,KAAKJ,UAAU,EAAE;MACjCC,QAAQ,CAAC,CAAC;IACZ;EACF,CACF,CAAC;EAED,MAAMI,OAAO,GAAG,MAAMR,MAAM,CAACS,wBAAwB,CAACN,UAAU,CAAC,CAACO,KAAK,CACrE,MAAOC,KAAK,IAAK;IACfN,YAAY,CAACO,MAAM,CAAC,CAAC;IACrB,OAAOC,OAAO,CAACC,MAAM,CAACH,KAAK,CAAC;EAC9B,CACF,CAAC;EAED,OAAO,YAAY;IACjBN,YAAY,CAACO,MAAM,CAAC,CAAC;IACrB,OAAOZ,MAAM,CAACe,gBAAgB,CAACP,OAAO,CAAC;EACzC,CAAC;AACH,CAAC;AAED,eAAeN,kBAAkB","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import App from '../example/src/App';
2
- export default App;
@@ -1,8 +0,0 @@
1
- import type { HealthkitReadAuthorization, HealthkitWriteAuthorization, HKAuthorizationRequestStatus } from '../native-types';
2
- /**
3
- * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
4
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
5
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
6
- */
7
- declare const useHealthkitAuthorization: (read: readonly HealthkitReadAuthorization[], write?: readonly HealthkitWriteAuthorization[]) => readonly [HKAuthorizationRequestStatus | null, () => Promise<HKAuthorizationRequestStatus>];
8
- export default useHealthkitAuthorization;
@@ -1,7 +0,0 @@
1
- /**
2
- * @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.
3
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple HealthKit isHealthDataAvailable}
4
- * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
5
- */
6
- declare const useIsHealthDataAvailable: () => boolean | null;
7
- export default useIsHealthDataAvailable;
@@ -1,7 +0,0 @@
1
- import type { HKCategoryTypeIdentifier } from '../native-types';
2
- import type { HKCategorySample } from '../types';
3
- /**
4
- * @returns the most recent sample for the given category type.
5
- */
6
- declare function useMostRecentCategorySample<TCategory extends HKCategoryTypeIdentifier>(identifier: TCategory): HKCategorySample<TCategory> | null;
7
- export default useMostRecentCategorySample;
@@ -1,7 +0,0 @@
1
- import type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types';
2
- import type { HKQuantitySample } from '../types';
3
- /**
4
- * @returns the most recent sample for the given quantity type.
5
- */
6
- declare function useMostRecentQuantitySample<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(identifier: TIdentifier, unit?: TUnit): HKQuantitySample<TIdentifier, UnitForIdentifier<TIdentifier>> | null;
7
- export default useMostRecentQuantitySample;
@@ -1,10 +0,0 @@
1
- import type { EnergyUnit, LengthUnit } from '../native-types';
2
- import type { HKWorkout } from '../types';
3
- /**
4
- * @returns the most recent workout sample.
5
- */
6
- declare function useMostRecentWorkout<TEnergy extends EnergyUnit, TDistance extends LengthUnit>(options?: {
7
- readonly energyUnit?: TEnergy;
8
- readonly distanceUnit?: TDistance;
9
- }): HKWorkout<TEnergy, TDistance> | null;
10
- export default useMostRecentWorkout;
@@ -1,3 +0,0 @@
1
- import type { HKCategoryTypeIdentifier, HKQuantityTypeIdentifier, HKSource } from '../native-types';
2
- declare function useSources<TIdentifier extends HKCategoryTypeIdentifier | HKQuantityTypeIdentifier>(identifier: TIdentifier): readonly HKSource[] | null;
3
- export default useSources;
@@ -1,4 +0,0 @@
1
- import type { HKQuantityTypeIdentifier, HKStatisticsOptions, UnitForIdentifier } from '../native-types';
2
- import type { QueryStatisticsResponse } from '../types';
3
- declare function useStatisticsForQuantity<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>>(identifier: TIdentifier, options: readonly HKStatisticsOptions[], from: Date, to?: Date, unit?: TUnit): QueryStatisticsResponse<TIdentifier, TUnit> | null;
4
- export default useStatisticsForQuantity;
@@ -1,3 +0,0 @@
1
- import type { HKSampleTypeIdentifier } from '..';
2
- declare function useSubscribeToChanges<TIdentifier extends HKSampleTypeIdentifier>(identifier: TIdentifier, onChange: () => void): void;
3
- export default useSubscribeToChanges;
@@ -1,3 +0,0 @@
1
- import Healthkit from './index.ios';
2
- export * from './index.ios';
3
- export default Healthkit;
@@ -1,198 +0,0 @@
1
- import useHealthkitAuthorization from './hooks/useHealthkitAuthorization';
2
- import useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable';
3
- import useMostRecentCategorySample from './hooks/useMostRecentCategorySample';
4
- import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
5
- import useMostRecentWorkout from './hooks/useMostRecentWorkout';
6
- import useSources from './hooks/useSources';
7
- import useStatisticsForQuantity from './hooks/useStatisticsForQuantity';
8
- import useSubscribeToChanges from './hooks/useSubscribeToChanges';
9
- import { HKQuantityTypeIdentifier } from './native-types';
10
- import deleteQuantitySample from './utils/deleteQuantitySample';
11
- import deleteSamples from './utils/deleteSamples';
12
- import deleteWorkoutSample from './utils/deleteWorkoutSample';
13
- import getDateOfBirth from './utils/getDateOfBirth';
14
- import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
15
- import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
16
- import getMostRecentWorkout from './utils/getMostRecentWorkout';
17
- import getPreferredUnit from './utils/getPreferredUnit';
18
- import getPreferredUnits from './utils/getPreferredUnits';
19
- import getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization';
20
- import getWorkoutPlanById from './utils/getWorkoutPlanById';
21
- import queryCategorySamples from './utils/queryCategorySamples';
22
- import queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor';
23
- import queryCorrelationSamples from './utils/queryCorrelationSamples';
24
- import queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples';
25
- import queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor';
26
- import queryQuantitySamples from './utils/queryQuantitySamples';
27
- import queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor';
28
- import querySources from './utils/querySources';
29
- import { queryStateOfMindSamples } from './utils/queryStateOfMindSamples';
30
- import queryStatisticsCollectionForQuantity from './utils/queryStatisticsCollectionForQuantity';
31
- import queryStatisticsForQuantity from './utils/queryStatisticsForQuantity';
32
- import queryWorkoutSamples from './utils/queryWorkouts';
33
- import queryWorkoutSamplesWithAnchor from './utils/queryWorkoutSamplesWithAnchor';
34
- import requestAuthorization from './utils/requestAuthorization';
35
- import saveCategorySample from './utils/saveCategorySample';
36
- import saveCorrelationSample from './utils/saveCorrelationSample';
37
- import saveQuantitySample from './utils/saveQuantitySample';
38
- import saveStateOfMindSample from './utils/saveStateOfMindSample';
39
- import saveWorkoutRoute from './utils/saveWorkoutRoute';
40
- import saveWorkoutSample from './utils/saveWorkoutSample';
41
- import startWatchApp from './utils/startWatchApp';
42
- import subscribeToChanges from './utils/subscribeToChanges';
43
- declare const availableQuantityTypes: (majorVersionIOS?: number) => HKQuantityTypeIdentifier[];
44
- declare const authorizationStatusFor: (type: import("./native-types").HealthkitReadAuthorization) => Promise<import("./native-types").HKAuthorizationStatus>;
45
- declare const isHealthDataAvailable: () => Promise<boolean>;
46
- declare const isProtectedDataAvailable: () => Promise<boolean>;
47
- declare const disableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier) => Promise<boolean>;
48
- declare const disableAllBackgroundDelivery: () => Promise<boolean>;
49
- declare const enableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier, updateFrequency: import("./native-types").HKUpdateFrequency) => Promise<boolean>;
50
- declare const getBiologicalSex: () => Promise<import("./native-types").HKBiologicalSex>;
51
- declare const getFitzpatrickSkinType: () => Promise<import("./native-types").HKFitzpatrickSkinType>;
52
- declare const getWheelchairUse: () => Promise<import("./native-types").HKWheelchairUse>;
53
- declare const getBloodType: () => Promise<import("./native-types").HKBloodType>;
54
- declare const getWorkoutRoutes: (workoutUUID: string) => Promise<readonly import("./native-types").WorkoutRoute[]>;
55
- /**
56
- * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
57
- */
58
- declare const _default: {
59
- /**
60
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
61
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
62
- */
63
- authorizationStatusFor: (type: import("./native-types").HealthkitReadAuthorization) => Promise<import("./native-types").HKAuthorizationStatus>;
64
- /**
65
- *
66
- * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
67
- */
68
- availableQuantityTypes: (majorVersionIOS?: number) => HKQuantityTypeIdentifier[];
69
- /**
70
- * @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.
71
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
72
- * @returns {boolean} true if HealthKit is available; otherwise, false.
73
- */
74
- isHealthDataAvailable: () => Promise<boolean>;
75
- /**
76
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
77
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
78
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
79
- */
80
- isProtectedDataAvailable: () => Promise<boolean>;
81
- /**
82
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
83
- */
84
- disableAllBackgroundDelivery: () => Promise<boolean>;
85
- /**
86
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
87
- */
88
- disableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier) => Promise<boolean>;
89
- /**
90
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
91
- */
92
- enableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier, updateFrequency: import("./native-types").HKUpdateFrequency) => Promise<boolean>;
93
- /**
94
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
95
- */
96
- getBiologicalSex: () => Promise<import("./native-types").HKBiologicalSex>;
97
- /**
98
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
99
- */
100
- getFitzpatrickSkinType: () => Promise<import("./native-types").HKFitzpatrickSkinType>;
101
- /**
102
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
103
- */
104
- getWheelchairUse: () => Promise<import("./native-types").HKWheelchairUse>;
105
- /**
106
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
107
- */
108
- getBloodType: () => Promise<import("./native-types").HKBloodType>;
109
- /**
110
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
111
- */
112
- getDateOfBirth: () => Promise<Date>;
113
- getMostRecentQuantitySample: typeof getMostRecentQuantitySample;
114
- getMostRecentCategorySample: typeof getMostRecentCategorySample;
115
- getMostRecentWorkout: import("./utils/getMostRecentWorkout").GetMostRecentWorkoutFn;
116
- /**
117
- * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
118
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
119
- */
120
- getWorkoutRoutes: (workoutUUID: string) => Promise<readonly import("./native-types").WorkoutRoute[]>;
121
- getWorkoutPlanById: typeof getWorkoutPlanById;
122
- getPreferredUnit: import("./utils/getPreferredUnit").GetPreferredUnitFn;
123
- getPreferredUnits: import("./utils/getPreferredUnits").GetPreferredUnitsFn;
124
- getRequestStatusForAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HealthkitWriteAuthorization[]) => Promise<import("./native-types").HKAuthorizationRequestStatus>;
125
- queryCategorySamples: import("./utils/queryCategorySamples").QueryCategorySamplesFn;
126
- queryCategorySamplesWithAnchor: import("./utils/queryCategorySamplesWithAnchor").QueryCategorySamplesWithAnchorFn;
127
- queryCorrelationSamples: import("./utils/queryCorrelationSamples").QueryCorrelationSamplesFn;
128
- queryHeartbeatSeriesSamples: import("./utils/queryHeartbeatSeriesSamples").QueryHeartbeatSeriesSamplesFn;
129
- queryHeartbeatSeriesSamplesWithAnchor: import("./utils/queryHeartbeatSeriesSamplesWithAnchor").QueryHeartbeatSeriesSamplesFn;
130
- queryQuantitySamples: import("./utils/queryQuantitySamples").QueryQuantitySamplesFn;
131
- queryQuantitySamplesWithAnchor: import("./utils/queryQuantitySamplesWithAnchor").QueryQuantitySamplesWithAnchorFn;
132
- queryStatisticsForQuantity: typeof queryStatisticsForQuantity;
133
- queryStatisticsCollectionForQuantity: typeof queryStatisticsCollectionForQuantity;
134
- /**
135
- * @deprecated Use queryWorkoutSamples instead
136
- */
137
- queryWorkouts: typeof queryWorkoutSamples;
138
- queryWorkoutSamples: typeof queryWorkoutSamples;
139
- queryWorkoutSamplesWithAnchor: typeof queryWorkoutSamplesWithAnchor;
140
- querySources: import("./utils/querySources").QuerySourcesFn;
141
- requestAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HealthkitWriteAuthorization[]) => Promise<boolean>;
142
- deleteQuantitySample: import("./utils/deleteQuantitySample").DeleteQuantitySampleFn;
143
- deleteSamples: import("./utils/deleteSamples").DeleteSamplesFn;
144
- deleteWorkoutSample: import("./utils/deleteWorkoutSample").DeleteWorkoutSampleFn;
145
- /**
146
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
147
- * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
148
- */
149
- saveCategorySample: typeof saveCategorySample;
150
- saveCorrelationSample: typeof saveCorrelationSample;
151
- saveQuantitySample: typeof saveQuantitySample;
152
- saveWorkoutSample: typeof saveWorkoutSample;
153
- saveWorkoutRoute: typeof saveWorkoutRoute;
154
- saveStateOfMindSample: typeof saveStateOfMindSample;
155
- subscribeToChanges: (identifier: import("./native-types").HKSampleTypeIdentifier, callback: () => void) => Promise<() => Promise<boolean>>;
156
- startWatchApp: (configuration: import("./native-types").HKWorkoutConfiguration) => () => Promise<boolean>;
157
- /**
158
- * @returns the most recent sample for the given category type.
159
- */
160
- useMostRecentCategorySample: typeof useMostRecentCategorySample;
161
- /**
162
- * @returns the most recent sample for the given quantity type.
163
- */
164
- useMostRecentQuantitySample: typeof useMostRecentQuantitySample;
165
- /**
166
- * @returns the most recent workout sample.
167
- */
168
- useMostRecentWorkout: typeof useMostRecentWorkout;
169
- useSubscribeToChanges: typeof useSubscribeToChanges;
170
- /**
171
- * @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.
172
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
173
- * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
174
- */
175
- useIsHealthDataAvailable: () => boolean | null;
176
- /**
177
- * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
178
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
179
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
180
- */
181
- useHealthkitAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HealthkitWriteAuthorization[]) => readonly [import("./native-types").HKAuthorizationRequestStatus | null, () => Promise<import("./native-types").HKAuthorizationRequestStatus>];
182
- useSources: typeof useSources;
183
- useStatisticsForQuantity: typeof useStatisticsForQuantity;
184
- queryStateOfMindSamples: ({ from, to, limit, ascending, }?: {
185
- readonly from?: Date;
186
- readonly to?: Date;
187
- readonly limit?: number;
188
- readonly ascending?: boolean;
189
- }) => Promise<readonly import("./native-types").HKStateOfMindSampleRaw[]>;
190
- };
191
- export default _default;
192
- declare const queryWorkouts: typeof queryWorkoutSamples;
193
- 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,
194
- /**
195
- * @deprecated Use queryWorkoutSamples instead
196
- */
197
- 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, };
198
- export * from './types';
@@ -1,41 +0,0 @@
1
- import { HKAuthorizationRequestStatus, HKAuthorizationStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse } from './native-types';
2
- import type ReactNativeHealthkit from './index.ios';
3
- import type { QueryCategorySamplesFn } from './utils/queryCategorySamples';
4
- import type { QueryQuantitySamplesFn } from './utils/queryQuantitySamples';
5
- declare const authorizationStatusFor: () => Promise<HKAuthorizationStatus>, availableQuantityTypes: () => never[], disableAllBackgroundDelivery: () => Promise<boolean>, disableBackgroundDelivery: () => Promise<boolean>, enableBackgroundDelivery: () => Promise<boolean>, getBiologicalSex: () => Promise<HKBiologicalSex>, getBloodType: () => Promise<HKBloodType>, getDateOfBirth: () => Promise<Date>, getFitzpatrickSkinType: () => Promise<HKFitzpatrickSkinType>, getMostRecentCategorySample: () => Promise<null>, getMostRecentQuantitySample: () => Promise<null>, getMostRecentWorkout: () => Promise<null>, getPreferredUnit: () => Promise<HKUnits>, getPreferredUnits: () => Promise<never[]>, getRequestStatusForAuthorization: () => Promise<HKAuthorizationRequestStatus>, getWheelchairUse: () => Promise<HKWheelchairUse>, getWorkoutRoutes: () => Promise<never[]>, isHealthDataAvailable: () => Promise<boolean>, useSources: () => null, useStatisticsForQuantity: () => null, queryCategorySamples: QueryCategorySamplesFn, queryCategorySamplesWithAnchor: () => Promise<{
6
- samples: never[];
7
- deletedSamples: never[];
8
- newAnchor: string;
9
- }>, queryCorrelationSamples: () => Promise<never[]>, queryHeartbeatSeriesSamples: () => Promise<never[]>, queryHeartbeatSeriesSamplesWithAnchor: () => Promise<{
10
- samples: never[];
11
- deletedSamples: never[];
12
- newAnchor: string;
13
- }>, queryQuantitySamples: QueryQuantitySamplesFn, queryQuantitySamplesWithAnchor: () => Promise<{
14
- samples: never[];
15
- deletedSamples: never[];
16
- newAnchor: string;
17
- }>, queryStatisticsForQuantity: () => Promise<{
18
- averageQuantity: undefined;
19
- maximumQuantity: undefined;
20
- minimumQuantity: undefined;
21
- sumQuantity: undefined;
22
- mostRecentQuantity: undefined;
23
- mostRecentQuantityDateInterval: undefined;
24
- duration: undefined;
25
- }>, queryStatisticsCollectionForQuantity: () => Promise<{
26
- averageQuantity: undefined;
27
- maximumQuantity: undefined;
28
- minimumQuantity: undefined;
29
- sumQuantity: undefined;
30
- mostRecentQuantity: undefined;
31
- mostRecentQuantityDateInterval: undefined;
32
- duration: undefined;
33
- }[]>, queryWorkouts: () => Promise<never[]>, queryWorkoutSamples: () => Promise<never[]>, queryWorkoutSamplesWithAnchor: () => Promise<{
34
- samples: never[];
35
- deletedSamples: never[];
36
- newAnchor: string;
37
- }>, querySources: () => Promise<never[]>, requestAuthorization: () => Promise<boolean>, deleteQuantitySample: () => Promise<boolean>, deleteSamples: () => Promise<boolean>, deleteWorkoutSample: () => Promise<boolean>, getWorkoutPlanById: () => Promise<null>, saveCategorySample: () => Promise<boolean>, saveStateOfMindSample: () => Promise<boolean>, saveCorrelationSample: () => Promise<boolean>, saveQuantitySample: () => Promise<boolean>, saveWorkoutSample: () => Promise<null>, saveWorkoutRoute: () => Promise<boolean>, subscribeToChanges: () => Promise<() => Promise<boolean>>, startWatchApp: () => () => Promise<boolean>, useMostRecentCategorySample: () => null, useMostRecentQuantitySample: () => null, useMostRecentWorkout: () => null, useSubscribeToChanges: () => ((() => null) | null)[], useHealthkitAuthorization: () => readonly [null, () => Promise<HKAuthorizationRequestStatus>], useIsHealthDataAvailable: () => boolean, isProtectedDataAvailable: () => Promise<boolean>, queryStateOfMindSamples: () => Promise<never[]>;
38
- declare const Healthkit: typeof ReactNativeHealthkit;
39
- export { authorizationStatusFor, availableQuantityTypes, deleteQuantitySample, deleteSamples, deleteWorkoutSample, disableAllBackgroundDelivery, disableBackgroundDelivery, enableBackgroundDelivery, getBiologicalSex, getBloodType, getDateOfBirth, getFitzpatrickSkinType, getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, getPreferredUnits, getRequestStatusForAuthorization, getWheelchairUse, getWorkoutPlanById, getWorkoutRoutes, isHealthDataAvailable, isProtectedDataAvailable, queryCategorySamples, queryCategorySamplesWithAnchor, queryCorrelationSamples, queryHeartbeatSeriesSamples, queryHeartbeatSeriesSamplesWithAnchor, queryQuantitySamples, queryQuantitySamplesWithAnchor, querySources, queryStatisticsForQuantity, queryStatisticsCollectionForQuantity, queryWorkouts, queryWorkoutSamples, queryWorkoutSamplesWithAnchor, requestAuthorization, saveCategorySample, saveStateOfMindSample, saveCorrelationSample, saveQuantitySample, saveWorkoutRoute, saveWorkoutSample, subscribeToChanges, startWatchApp, useHealthkitAuthorization, useIsHealthDataAvailable, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSources, useStatisticsForQuantity, useSubscribeToChanges, queryStateOfMindSamples, };
40
- export * from './types';
41
- export default Healthkit;
@@ -1,3 +0,0 @@
1
- import Healthkit from './index.native';
2
- export * from './index.native';
3
- export default Healthkit;