@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,2471 +0,0 @@
1
- import { NativeEventEmitter, NativeModules } from 'react-native'
2
-
3
- import type { EmitterSubscription, NativeModule } from 'react-native'
4
-
5
- /**
6
- * Represents a workout type identifier.
7
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkouttypeidentifier Apple Docs HKWorkoutTypeIdentifier}
8
- */
9
- export const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier' as const
10
-
11
- /**
12
- * Represents a type that identifies activity summary objects.
13
- * @see {@link https://developer.apple.com/documentation/healthkit/hkactivitysummarytype Apple Docs HKActivitySummaryType}
14
- */
15
- export const HKActivitySummaryTypeIdentifier = 'HKActivitySummaryTypeIdentifier' as const
16
-
17
- /**
18
- * Represents an audiogram type identifier.
19
- * @see {@link https://developer.apple.com/documentation/healthkit/HKAudiogramSampleType Apple Docs HKAudiogramSampleType}
20
- */
21
- export const HKAudiogramTypeIdentifier = 'HKAudiogramSampleType' as const
22
-
23
- /**
24
- * Represents a workout route type identifier.
25
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutetypeidentifier Apple Docs HKWorkoutRouteTypeIdentifier}
26
- */
27
- export const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier' as const
28
-
29
- /**
30
- * Represents a state of mind type identifier.
31
- * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmindtype Apple Docs HKStateOfMindType}
32
- */
33
- export const HKStateOfMindTypeIdentifier = 'HKStateOfMindTypeIdentifier' as const
34
-
35
- /**
36
- * Represents a series sample containing heartbeat data..
37
- * @see {@link https://developer.apple.com/documentation/healthkit/HKDataTypeIdentifierHeartbeatSeries Apple Docs HKDataTypeIdentifierHeartbeatSeries}
38
- */
39
- export declare const HKDataTypeIdentifierHeartbeatSeries: 'HKDataTypeIdentifierHeartbeatSeries'
40
-
41
- /**
42
- * Represents a quantity type identifier.
43
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier Apple Docs HKQuantityTypeIdentifier}
44
- */
45
- export enum HKQuantityTypeIdentifier {
46
- /**
47
- * Body Mass Index
48
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbodymassindex Apple Docs HKQuantityTypeIdentifierBodyMassIndex}
49
- */
50
- bodyMassIndex = 'HKQuantityTypeIdentifierBodyMassIndex',
51
-
52
- /**
53
- * Body Fat Percentage
54
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbodyfatpercentage Apple Docs HKQuantityTypeIdentifierBodyFatPercentage}
55
- */
56
- bodyFatPercentage = 'HKQuantityTypeIdentifierBodyFatPercentage',
57
-
58
- /**
59
- * Height
60
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierheight Apple Docs HKQuantityTypeIdentifierHeight}
61
- */
62
- height = 'HKQuantityTypeIdentifierHeight',
63
-
64
- /**
65
- * Body Mass
66
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbodymass Apple Docs HKQuantityTypeIdentifierBodyMass}
67
- */
68
- bodyMass = 'HKQuantityTypeIdentifierBodyMass',
69
-
70
- /**
71
- * Lean Body Mass
72
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierleanbodymass Apple Docs HKQuantityTypeIdentifierLeanBodyMass}
73
- */
74
- leanBodyMass = 'HKQuantityTypeIdentifierLeanBodyMass',
75
-
76
- /**
77
- * Waist Circumference
78
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierwaistcircumference Apple Docs HKQuantityTypeIdentifierWaistCircumference}
79
- */
80
- waistCircumference = 'HKQuantityTypeIdentifierWaistCircumference',
81
-
82
- /**
83
- * Step Count
84
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierstepcount Apple Docs HKQuantityTypeIdentifierStepCount}
85
- */
86
- stepCount = 'HKQuantityTypeIdentifierStepCount',
87
-
88
- /**
89
- * Distance Walking Running
90
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdistancewalkingrunning Apple Docs HKQuantityTypeIdentifierDistanceWalkingRunning}
91
- */
92
- distanceWalkingRunning = 'HKQuantityTypeIdentifierDistanceWalkingRunning',
93
-
94
- /**
95
- * Distance Cycling
96
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdistancecycling Apple Docs HKQuantityTypeIdentifierDistanceCycling}
97
- */
98
- distanceCycling = 'HKQuantityTypeIdentifierDistanceCycling',
99
-
100
- /**
101
- * Distance Wheelchair
102
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdistancewheelchair Apple Docs HKQuantityTypeIdentifierDistanceWheelchair}
103
- */
104
- distanceWheelchair = 'HKQuantityTypeIdentifierDistanceWheelchair',
105
- /**
106
- * Basal Energy Burned
107
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbasalenergyburned Apple Docs HKQuantityTypeIdentifierBasalEnergyBurned}
108
- */
109
- basalEnergyBurned = 'HKQuantityTypeIdentifierBasalEnergyBurned', // Energy, Cumulative
110
- /**
111
- * Active Energy Burned
112
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifieractiveenergyburned Apple Docs HKQuantityTypeIdentifierActiveEnergyBurned}
113
- */
114
- activeEnergyBurned = 'HKQuantityTypeIdentifierActiveEnergyBurned', // Energy, Cumulative
115
- /**
116
- * Flights Climbed
117
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierflightsclimbed Apple Docs HKQuantityTypeIdentifierFlightsClimbed}
118
- */
119
- flightsClimbed = 'HKQuantityTypeIdentifierFlightsClimbed', // Scalar(Count), Cumulative
120
- /**
121
- * Nike Fuel
122
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiernikefuel Apple Docs HKQuantityTypeIdentifierNikeFuel}
123
- */
124
- nikeFuel = 'HKQuantityTypeIdentifierNikeFuel', // Scalar(Count), Cumulative
125
- /**
126
- * Apple Exercise Time
127
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierappleexercisetime Apple Docs HKQuantityTypeIdentifierAppleExerciseTime}
128
- */
129
- appleExerciseTime = 'HKQuantityTypeIdentifierAppleExerciseTime', // Time Cumulative
130
- /**
131
- * Push Count
132
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierpushcount Apple Docs HKQuantityTypeIdentifierPushCount}
133
- */
134
- pushCount = 'HKQuantityTypeIdentifierPushCount', // Scalar(Count), Cumulative
135
- /**
136
- * Distance Swimming
137
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdistanceswimming Apple Docs HKQuantityTypeIdentifierDistanceSwimming}
138
- */
139
- distanceSwimming = 'HKQuantityTypeIdentifierDistanceSwimming', // Length, Cumulative
140
- /**
141
- * Swimming Stroke Count
142
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierswimmingstrokecount Apple Docs HKQuantityTypeIdentifierSwimmingStrokeCount}
143
- */
144
- swimmingStrokeCount = 'HKQuantityTypeIdentifierSwimmingStrokeCount', // Scalar(Count), Cumulative
145
- /**
146
- * VO2 Max
147
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiervo2max Apple Docs HKQuantityTypeIdentifierVO2Max}
148
- */
149
- vo2Max = 'HKQuantityTypeIdentifierVO2Max', // ml/(kg*min) Discrete
150
- /**
151
- * Distance Downhill Snow Sports
152
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdistancedownhillsnowsports Apple Docs HKQuantityTypeIdentifierDistanceDownhillSnowSports}
153
- */
154
- distanceDownhillSnowSports = 'HKQuantityTypeIdentifierDistanceDownhillSnowSports', // Length, Cumulative
155
-
156
- /**
157
- * Apple Stand Time
158
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierapplestandtime Apple Docs HKQuantityTypeIdentifierAppleStandTime}
159
- */
160
- appleStandTime = 'HKQuantityTypeIdentifierAppleStandTime', // Time, Cumulative
161
- // Vitals
162
- /**
163
- * Heart Rate
164
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierheartrate Apple Docs HKQuantityTypeIdentifierHeartRate}
165
- */
166
- heartRate = 'HKQuantityTypeIdentifierHeartRate', // Scalar(Count)/Time, Discrete
167
- /**
168
- * Body Temperature
169
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbodytemperature Apple Docs HKQuantityTypeIdentifierBodyTemperature}
170
- */
171
- bodyTemperature = 'HKQuantityTypeIdentifierBodyTemperature', // Temperature, Discrete
172
- /**
173
- * Basal Body Temperature
174
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbasalbodytemperature Apple Docs HKQuantityTypeIdentifierBasalBodyTemperature}
175
- */
176
- basalBodyTemperature = 'HKQuantityTypeIdentifierBasalBodyTemperature', // Basal Body Temperature, Discrete
177
- /**
178
- * Blood Pressure Systolic
179
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbloodpressuresystolic Apple Docs HKQuantityTypeIdentifierBloodPressureSystolic}
180
- */
181
- bloodPressureSystolic = 'HKQuantityTypeIdentifierBloodPressureSystolic', // Pressure, Discrete
182
- /**
183
- * Blood Pressure Diastolic
184
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbloodpressurediastolic Apple Docs HKQuantityTypeIdentifierBloodPressureDiastolic}
185
- */
186
- bloodPressureDiastolic = 'HKQuantityTypeIdentifierBloodPressureDiastolic', // Pressure, Discrete
187
- /**
188
- * Respiratory Rate
189
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierrespiratoryrate Apple Docs HKQuantityTypeIdentifierRespiratoryRate}
190
- */
191
- respiratoryRate = 'HKQuantityTypeIdentifierRespiratoryRate', // Scalar(Count)/Time, Discrete
192
- /**
193
- * Resting Heart Rate
194
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierrestingheartrate Apple Docs HKQuantityTypeIdentifierRestingHeartRate}
195
- */
196
- restingHeartRate = 'HKQuantityTypeIdentifierRestingHeartRate', // Scalar(Count)/Time, Discrete
197
- /**
198
- * Walking Heart Rate Average
199
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierwalkingheartrateaverage Apple Docs HKQuantityTypeIdentifierWalkingHeartRateAverage}
200
- * @since iOS 11.0
201
- */
202
- walkingHeartRateAverage = 'HKQuantityTypeIdentifierWalkingHeartRateAverage', // Scalar(Count)/Time, Discrete
203
- /**
204
- * Heart Rate Variability SDNN
205
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierheartratevariabilitysdnn Apple Docs HKQuantityTypeIdentifierHeartRateVariabilitySDNN}
206
- * @since iOS 11.0
207
- */
208
- heartRateVariabilitySDNN = 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN', // Time (ms), Discrete
209
- /**
210
- * Oxygen Saturation
211
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifieroxygensaturation Apple Docs HKQuantityTypeIdentifierOxygenSaturation}
212
- * @since iOS 8.0
213
- */
214
- oxygenSaturation = 'HKQuantityTypeIdentifierOxygenSaturation',
215
- /**
216
- * Peripheral Perfusion Index
217
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierperipheralperfusionindex Apple Docs HKQuantityTypeIdentifierPeripheralPerfusionIndex}
218
- * @since iOS 8.0
219
- */
220
- peripheralPerfusionIndex = 'HKQuantityTypeIdentifierPeripheralPerfusionIndex', // Scalar(Percent, 0.0 - 1.0), Discrete
221
- /**
222
- * Blood Glucose
223
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbloodglucose Apple Docs HKQuantityTypeIdentifierBloodGlucose}
224
- */
225
- bloodGlucose = 'HKQuantityTypeIdentifierBloodGlucose',
226
-
227
- /**
228
- * Number Of Times Fallen
229
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiernumberoftimesfallen Apple Docs HKQuantityTypeIdentifierNumberOfTimesFallen}
230
- */
231
- numberOfTimesFallen = 'HKQuantityTypeIdentifierNumberOfTimesFallen',
232
-
233
- /**
234
- * Electrodermal Activity
235
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierelectrodermalactivity Apple Docs HKQuantityTypeIdentifierElectrodermalActivity}
236
- */
237
- electrodermalActivity = 'HKQuantityTypeIdentifierElectrodermalActivity',
238
-
239
- /**
240
- * Inhaler Usage
241
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierinhalerusage Apple Docs HKQuantityTypeIdentifierInhalerUsage}
242
- * @since iOS 8
243
- */
244
- inhalerUsage = 'HKQuantityTypeIdentifierInhalerUsage',
245
-
246
- /**
247
- * Insulin Delivery
248
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierinsulindelivery Apple Docs HKQuantityTypeIdentifierInsulinDelivery}
249
- * @since iOS 11
250
- */
251
- insulinDelivery = 'HKQuantityTypeIdentifierInsulinDelivery',
252
-
253
- /**
254
- * Blood Alcohol Content
255
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierbloodalcoholcontent Apple Docs HKQuantityTypeIdentifierBloodAlcoholContent}
256
- * @since iOS 8
257
- */
258
- bloodAlcoholContent = 'HKQuantityTypeIdentifierBloodAlcoholContent',
259
-
260
- /**
261
- * Forced Vital Capacity
262
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierforcedvitalcapacity Apple Docs HKQuantityTypeIdentifierForcedVitalCapacity}
263
- */
264
- forcedVitalCapacity = 'HKQuantityTypeIdentifierForcedVitalCapacity',
265
-
266
- /**
267
- * Forced Expiratory Volume1
268
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierforcedexpiratoryvolume1 Apple Docs HKQuantityTypeIdentifierForcedExpiratoryVolume1}
269
- * @since iOS 8
270
- */
271
- forcedExpiratoryVolume1 = 'HKQuantityTypeIdentifierForcedExpiratoryVolume1',
272
-
273
- /**
274
- * Peak Expiratory Flow Rate
275
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierpeakexpiratoryflowrate Apple Docs HKQuantityTypeIdentifierPeakExpiratoryFlowRate}
276
- * @since iOS 8
277
- */
278
- peakExpiratoryFlowRate = 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate',
279
-
280
- /**
281
- * Environmental Audio Exposure
282
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierenvironmentalaudioexposure Apple Docs HKQuantityTypeIdentifierEnvironmentalAudioExposure}
283
- * @since iOS 13
284
- */
285
- environmentalAudioExposure = 'HKQuantityTypeIdentifierEnvironmentalAudioExposure',
286
-
287
- /**
288
- * Headphone Audio Exposure
289
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierheadphoneaudioexposure Apple Docs HKQuantityTypeIdentifierHeadphoneAudioExposure}
290
- * @since iOS 13
291
- */
292
- headphoneAudioExposure = 'HKQuantityTypeIdentifierHeadphoneAudioExposure', // Pressure, Cumulative
293
-
294
- // Nutrition
295
- /**
296
- * Dietary Fat Total
297
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryfattotal Apple Docs HKQuantityTypeIdentifierDietaryFatTotal}
298
- * @since iOS 8
299
- */
300
- dietaryFatTotal = 'HKQuantityTypeIdentifierDietaryFatTotal', // Mass, Cumulative
301
-
302
- /**
303
- * Dietary Fat Polyunsaturated
304
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryfatpolyunsaturated Apple Docs HKQuantityTypeIdentifierDietaryFatPolyunsaturated}
305
- */
306
- dietaryFatPolyunsaturated = 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated', // Mass, Cumulative
307
-
308
- /**
309
- * Dietary Fat Monounsaturated
310
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryfatmonounsaturated Apple Docs HKQuantityTypeIdentifierDietaryFatMonounsaturated}
311
- */
312
- dietaryFatMonounsaturated = 'HKQuantityTypeIdentifierDietaryFatMonounsaturated', // Mass, Cumulative
313
- /**
314
- * Dietary Fat Saturated
315
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryfatsaturated Apple Docs HKQuantityTypeIdentifierDietaryFatSaturated}
316
- */
317
- dietaryFatSaturated = 'HKQuantityTypeIdentifierDietaryFatSaturated', // Mass, Cumulative
318
-
319
- /**
320
- * Dietary Cholesterol
321
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarycholesterol Apple Docs HKQuantityTypeIdentifierDietaryCholesterol}
322
- */
323
- dietaryCholesterol = 'HKQuantityTypeIdentifierDietaryCholesterol', // Mass, Cumulative
324
-
325
- /**
326
- * Dietary Sodium
327
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarysodium Apple Docs HKQuantityTypeIdentifierDietarySodium}
328
- */
329
- dietarySodium = 'HKQuantityTypeIdentifierDietarySodium', // Mass, Cumulative
330
-
331
- /**
332
- * Dietary Carbohydrates
333
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarycarbohydrates Apple Docs HKQuantityTypeIdentifierDietaryCarbohydrates}
334
- */
335
- dietaryCarbohydrates = 'HKQuantityTypeIdentifierDietaryCarbohydrates', // Mass, Cumulative
336
-
337
- /**
338
- * Dietary Fiber
339
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryfiber Apple Docs HKQuantityTypeIdentifierDietaryFiber}
340
- */
341
- dietaryFiber = 'HKQuantityTypeIdentifierDietaryFiber', // Mass, Cumulative
342
- /**
343
- * Dietary Sugar
344
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarysugar Apple Docs HKQuantityTypeIdentifierDietarySugar}
345
- */
346
- dietarySugar = 'HKQuantityTypeIdentifierDietarySugar', // Mass, Cumulative
347
-
348
- /**
349
- * Dietary Energy Consumed
350
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryenergyconsumed Apple Docs HKQuantityTypeIdentifierDietaryEnergyConsumed}
351
- */
352
- dietaryEnergyConsumed = 'HKQuantityTypeIdentifierDietaryEnergyConsumed', // Energy, Cumulative
353
-
354
- /**
355
- * Dietary Protein
356
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryprotein Apple Docs HKQuantityTypeIdentifierDietaryProtein}
357
- */
358
- dietaryProtein = 'HKQuantityTypeIdentifierDietaryProtein', // Mass, Cumulative
359
-
360
- /**
361
- * Dietary Vitamin A
362
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryvitamina Apple Docs HKQuantityTypeIdentifierDietaryVitaminA}
363
- */
364
- dietaryVitaminA = 'HKQuantityTypeIdentifierDietaryVitaminA', // Mass, Cumulative
365
-
366
- /**
367
- * Dietary Vitamin B6
368
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryvitaminb6 Apple Docs HKQuantityTypeIdentifierDietaryVitaminB6}
369
- */
370
- dietaryVitaminB6 = 'HKQuantityTypeIdentifierDietaryVitaminB6', // Mass, Cumulative
371
-
372
- /**
373
- * Dietary Vitamin B12
374
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryvitaminb12 Apple Docs HKQuantityTypeIdentifierDietaryVitaminB12}
375
- */
376
- dietaryVitaminB12 = 'HKQuantityTypeIdentifierDietaryVitaminB12', // Mass, Cumulative
377
-
378
- /**
379
- * Dietary Vitamin C
380
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryvitaminc Apple Docs HKQuantityTypeIdentifierDietaryVitaminC}
381
- */
382
- dietaryVitaminC = 'HKQuantityTypeIdentifierDietaryVitaminC', // Mass, Cumulative
383
-
384
- /**
385
- * Dietary Vitamin D
386
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryvitamind Apple Docs HKQuantityTypeIdentifierDietaryVitaminD}
387
- */
388
- dietaryVitaminD = 'HKQuantityTypeIdentifierDietaryVitaminD', // Mass, Cumulative
389
-
390
- /**
391
- * Dietary Vitamin E
392
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryvitamine Apple Docs HKQuantityTypeIdentifierDietaryVitaminE}
393
- */
394
- dietaryVitaminE = 'HKQuantityTypeIdentifierDietaryVitaminE', // Mass, Cumulative
395
-
396
- /**
397
- * Dietary Vitamin K
398
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryvitamink Apple Docs HKQuantityTypeIdentifierDietaryVitaminK}
399
- */
400
- dietaryVitaminK = 'HKQuantityTypeIdentifierDietaryVitaminK', // Mass, Cumulative
401
- /**
402
- * Dietary Calcium
403
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarycalcium Apple Docs HKQuantityTypeIdentifierDietaryCalcium}
404
- */
405
- dietaryCalcium = 'HKQuantityTypeIdentifierDietaryCalcium', // Mass, Cumulative
406
-
407
- /**
408
- * Dietary Iron
409
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryiron Apple Docs HKQuantityTypeIdentifierDietaryIron}
410
- */
411
- dietaryIron = 'HKQuantityTypeIdentifierDietaryIron', // Mass, Cumulative
412
-
413
- /**
414
- * Dietary Thiamin
415
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarythiamin Apple Docs HKQuantityTypeIdentifierDietaryThiamin}
416
- */
417
- dietaryThiamin = 'HKQuantityTypeIdentifierDietaryThiamin', // Mass, Cumulative
418
-
419
- /**
420
- * Dietary Riboflavin
421
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryriboflavin Apple Docs HKQuantityTypeIdentifierDietaryRiboflavin}
422
- */
423
- dietaryRiboflavin = 'HKQuantityTypeIdentifierDietaryRiboflavin', // Mass, Cumulative
424
-
425
- /**
426
- * Dietary Niacin
427
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryniacin Apple Docs HKQuantityTypeIdentifierDietaryNiacin}
428
- */
429
- dietaryNiacin = 'HKQuantityTypeIdentifierDietaryNiacin', // Mass, Cumulative
430
-
431
- /**
432
- * Dietary Folate
433
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryfolate Apple Docs HKQuantityTypeIdentifierDietaryFolate}
434
- */
435
- dietaryFolate = 'HKQuantityTypeIdentifierDietaryFolate', // Mass, Cumulative
436
-
437
- /**
438
- * Dietary Biotin
439
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarybiotin Apple Docs HKQuantityTypeIdentifierDietaryBiotin}
440
- */
441
- dietaryBiotin = 'HKQuantityTypeIdentifierDietaryBiotin', // Mass, Cumulative
442
-
443
- /**
444
- * Dietary Pantothenic Acid
445
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarypantothenicacid Apple Docs HKQuantityTypeIdentifierDietaryPantothenicAcid}
446
- */
447
- dietaryPantothenicAcid = 'HKQuantityTypeIdentifierDietaryPantothenicAcid', // Mass, Cumulative
448
-
449
- /**
450
- * Dietary Phosphorus
451
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryphosphorus Apple Docs HKQuantityTypeIdentifierDietaryPhosphorus}
452
- */
453
- dietaryPhosphorus = 'HKQuantityTypeIdentifierDietaryPhosphorus', // Mass, Cumulative
454
-
455
- /**
456
- * Dietary Iodine
457
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryiodine Apple Docs HKQuantityTypeIdentifierDietaryIodine}
458
- */
459
- dietaryIodine = 'HKQuantityTypeIdentifierDietaryIodine', // Mass, Cumulative
460
- /**
461
- * Dietary Magnesium
462
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarymagnesium Apple Docs HKQuantityTypeIdentifierDietaryMagnesium}
463
- */
464
- dietaryMagnesium = 'HKQuantityTypeIdentifierDietaryMagnesium', // Mass, Cumulative
465
-
466
- /**
467
- * Dietary Zinc
468
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryzinc Apple Docs HKQuantityTypeIdentifierDietaryZinc}
469
- */
470
- dietaryZinc = 'HKQuantityTypeIdentifierDietaryZinc', // Mass, Cumulative
471
-
472
- /**
473
- * Dietary Selenium
474
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietaryselenium Apple Docs HKQuantityTypeIdentifierDietarySelenium}
475
- */
476
- dietarySelenium = 'HKQuantityTypeIdentifierDietarySelenium', // Mass, Cumulative
477
-
478
- /**
479
- * Dietary Copper
480
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarycopper Apple Docs HKQuantityTypeIdentifierDietaryCopper}
481
- */
482
- dietaryCopper = 'HKQuantityTypeIdentifierDietaryCopper', // Mass, Cumulative
483
-
484
- /**
485
- * Dietary Manganese
486
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarymanganese Apple Docs HKQuantityTypeIdentifierDietaryManganese}
487
- */
488
- dietaryManganese = 'HKQuantityTypeIdentifierDietaryManganese', // Mass, Cumulative
489
-
490
- /**
491
- * Dietary Chromium
492
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarychromium Apple Docs HKQuantityTypeIdentifierDietaryChromium}
493
- */
494
- dietaryChromium = 'HKQuantityTypeIdentifierDietaryChromium', // Mass, Cumulative
495
-
496
- /**
497
- * Dietary Molybdenum
498
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarymolybdenum Apple Docs HKQuantityTypeIdentifierDietaryMolybdenum}
499
- */
500
- dietaryMolybdenum = 'HKQuantityTypeIdentifierDietaryMolybdenum', // Mass, Cumulative
501
-
502
- /**
503
- * Dietary Chloride
504
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarychloride Apple Docs HKQuantityTypeIdentifierDietaryChloride}
505
- * @since iOS 8
506
- */
507
- dietaryChloride = 'HKQuantityTypeIdentifierDietaryChloride', // Mass, Cumulative
508
-
509
- /**
510
- * Dietary Potassium
511
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarypotassium Apple Docs HKQuantityTypeIdentifierDietaryPotassium}
512
- * @since iOS 8
513
- */
514
- dietaryPotassium = 'HKQuantityTypeIdentifierDietaryPotassium', // Mass, Cumulative
515
-
516
- /**
517
- * Dietary Caffeine
518
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarycaffeine Apple Docs HKQuantityTypeIdentifierDietaryCaffeine}
519
- * @since iOS 8
520
- */
521
- dietaryCaffeine = 'HKQuantityTypeIdentifierDietaryCaffeine', // Mass, Cumulative
522
-
523
- /**
524
- * Dietary Water
525
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierdietarywater Apple Docs HKQuantityTypeIdentifierDietaryWater}
526
- * @since iOS 9
527
- */
528
- dietaryWater = 'HKQuantityTypeIdentifierDietaryWater', // Volume, Cumulative
529
-
530
- // Mobility
531
- /**
532
- * Six Minute Walk Test Distance
533
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiersixminutewalktestdistance Apple Docs HKQuantityTypeIdentifierSixMinuteWalkTestDistance}
534
- * @since iOS 14
535
- */
536
- sixMinuteWalkTestDistance = 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance',
537
-
538
- /**
539
- * Walking Speed
540
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierwalkingspeed Apple Docs HKQuantityTypeIdentifierWalkingSpeed}
541
- * @since iOS 14
542
- */
543
- walkingSpeed = 'HKQuantityTypeIdentifierWalkingSpeed',
544
-
545
- /**
546
- * Walking Step Length
547
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierwalkingsteplength Apple Docs HKQuantityTypeIdentifierWalkingStepLength}
548
- * @since iOS 14
549
- */
550
- walkingStepLength = 'HKQuantityTypeIdentifierWalkingStepLength',
551
-
552
- /**
553
- * Walking Asymmetry Percentage
554
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierwalkingasymmetrypercentage Apple Docs HKQuantityTypeIdentifierWalkingAsymmetryPercentage}
555
- * @since iOS 14
556
- */
557
- walkingAsymmetryPercentage = 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage',
558
-
559
- /**
560
- * Walking Double Support Percentage
561
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierwalkingdoublesupportpercentage Apple Docs HKQuantityTypeIdentifierWalkingDoubleSupportPercentage}
562
- * @since iOS 14
563
- */
564
- walkingDoubleSupportPercentage = 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage',
565
-
566
- /**
567
- * Stair Ascent Speed
568
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierstairascentspeed Apple Docs HKQuantityTypeIdentifierStairAscentSpeed}
569
- * @since iOS 14
570
- */
571
- stairAscentSpeed = 'HKQuantityTypeIdentifierStairAscentSpeed',
572
-
573
- /**
574
- * Stair Descent Speed
575
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierstairdescentspeed Apple Docs HKQuantityTypeIdentifierStairDescentSpeed}
576
- * @since iOS 14
577
- */
578
- stairDescentSpeed = 'HKQuantityTypeIdentifierStairDescentSpeed',
579
-
580
- /**
581
- * UV Exposure
582
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifieruvexposure Apple Docs HKQuantityTypeIdentifierUVExposure}
583
- * @since iOS 9
584
- */
585
- uvExposure = 'HKQuantityTypeIdentifierUVExposure', // Scalar (Count), Discrete
586
-
587
- /**
588
- * Apple Move Time
589
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierapplemovetime Apple Docs HKQuantityTypeIdentifierAppleMoveTime}
590
- * @since iOS 14.5
591
- */
592
- appleMoveTime = 'HKQuantityTypeIdentifierAppleMoveTime', // Time, Cumulative
593
-
594
- /**
595
- * Apple Walking Steadiness
596
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierapplewalkingsteadiness Apple Docs HKQuantityTypeIdentifierAppleWalkingSteadiness}
597
- * @since iOS 15
598
- */
599
- appleWalkingSteadiness = 'HKQuantityTypeIdentifierAppleWalkingSteadiness', // Scalar(Percent, 0.0 - 1.0), Discrete
600
-
601
- /**
602
- * Number Of Alcoholic Beverages
603
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiernumberofalcoholicbeverages Apple Docs HKQuantityTypeIdentifierNumberOfAlcoholicBeverages}
604
- * @since iOS 15
605
- */
606
- numberOfAlcoholicBeverages = 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages', // Scalar(Count), Cumulative
607
-
608
- /**
609
- * Atrial Fibrillation Burden
610
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifieratrialfibrillationburden Apple Docs HKQuantityTypeIdentifierAtrialFibrillationBurden}
611
- * @since iOS 16
612
- */
613
- atrialFibrillationBurden = 'HKQuantityTypeIdentifierAtrialFibrillationBurden', // Scalar(Percent, 0.0 - 1.0), Discrete
614
-
615
- /**
616
- * Underwater Depth
617
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierunderwaterdepth Apple Docs HKQuantityTypeIdentifierUnderwaterDepth}
618
- * @since iOS 16
619
- */
620
- underwaterDepth = 'HKQuantityTypeIdentifierUnderwaterDepth', // Length, Discrete
621
-
622
- /**
623
- * Water Temperature
624
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierwatertemperature Apple Docs HKQuantityTypeIdentifierWaterTemperature}
625
- * @since iOS 16
626
- */
627
- waterTemperature = 'HKQuantityTypeIdentifierWaterTemperature', // Temperature, Discrete
628
-
629
- /**
630
- * Apple Sleeping Wrist Temperature
631
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierapplesleepingwristtemperature Apple Docs HKQuantityTypeIdentifierAppleSleepingWristTemperature}
632
- * @since iOS 17
633
- */
634
- appleSleepingWristTemperature = 'HKQuantityTypeIdentifierAppleSleepingWristTemperature', // Temperature, Discrete
635
-
636
- /**
637
- * Time In Daylight
638
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiertimeindaylight Apple Docs HKQuantityTypeIdentifierTimeInDaylight}
639
- * @since iOS 17
640
- */
641
- timeInDaylight = 'HKQuantityTypeIdentifierTimeInDaylight', // Time, Cumulative
642
-
643
- /**
644
- * Physical Effort
645
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierphysicaleffort Apple Docs HKQuantityTypeIdentifierPhysicalEffort}
646
- * @since iOS 17
647
- */
648
- physicalEffort = 'HKQuantityTypeIdentifierPhysicalEffort', // Scalar (Percent, 0.0 - 1.0), Discrete
649
-
650
- /**
651
- * Cycling Speed
652
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiercyclingspeed Apple Docs HKQuantityTypeIdentifierCyclingSpeed}
653
- * @since iOS 17
654
- */
655
- cyclingSpeed = 'HKQuantityTypeIdentifierCyclingSpeed',
656
-
657
- /**
658
- * Cycling Power
659
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiercyclingpower Apple Docs HKQuantityTypeIdentifierCyclingPower}
660
- * @since iOS 17
661
- */
662
- cyclingPower = 'HKQuantityTypeIdentifierCyclingPower',
663
-
664
- /**
665
- * Cycling Functional Threshold Power
666
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiercyclingfunctionalthresholdpower Apple Docs HKQuantityTypeIdentifierCyclingFunctionalThresholdPower}
667
- * @since iOS 17
668
- */
669
- cyclingFunctionalThresholdPower = 'HKQuantityTypeIdentifierCyclingFunctionalThresholdPower',
670
-
671
- /**
672
- * Cycling Cadence
673
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifiercyclingcadence Apple Docs HKQuantityTypeIdentifierCyclingCadence}
674
- * @since iOS 17
675
- */
676
- cyclingCadence = 'HKQuantityTypeIdentifierCyclingCadence',
677
-
678
- /**
679
- * Environmental Sound Reduction
680
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierenvironmentalsoundreduction Apple Docs HKQuantityTypeIdentifierEnvironmentalSoundReduction}
681
- * @since iOS 16
682
- */
683
- environmentalSoundReduction = 'HKQuantityTypeIdentifierEnvironmentalSoundReduction',
684
-
685
- /**
686
- * Heart Rate Recovery One Minute
687
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierheartraterecoveryoneminute Apple Docs HKQuantityTypeIdentifierHeartRateRecoveryOneMinute}
688
- * @since iOS 16
689
- */
690
- heartRateRecoveryOneMinute = 'HKQuantityTypeIdentifierHeartRateRecoveryOneMinute',
691
-
692
- /**
693
- * Running Ground Contact Time
694
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierrunninggroundcontacttime Apple Docs HKQuantityTypeIdentifierRunningGroundContactTime}
695
- * @since iOS 16
696
- */
697
- runningGroundContactTime = 'HKQuantityTypeIdentifierRunningGroundContactTime',
698
-
699
- /**
700
- * Running Stride Length
701
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierrunningstridelength Apple Docs HKQuantityTypeIdentifierRunningStrideLength}
702
- * @since iOS 16
703
- */
704
- runningStrideLength = 'HKQuantityTypeIdentifierRunningStrideLength',
705
-
706
- /**
707
- * Running Power
708
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierrunningpower Apple Docs HKQuantityTypeIdentifierRunningPower}
709
- * @since iOS 16
710
- */
711
- runningPower = 'HKQuantityTypeIdentifierRunningPower',
712
-
713
- /**
714
- * Running Vertical Oscillation
715
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierrunningverticaloscillation Apple Docs HKQuantityTypeIdentifierRunningVerticalOscillation}
716
- * @since iOS 16
717
- */
718
- runningVerticalOscillation = 'HKQuantityTypeIdentifierRunningVerticalOscillation',
719
-
720
- /**
721
- * Running Speed
722
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierrunningspeed Apple Docs HKQuantityTypeIdentifierRunningSpeed}
723
- * @since iOS 16
724
- */
725
- runningSpeed = 'HKQuantityTypeIdentifierRunningSpeed',
726
-
727
- /**
728
- * Cross Country Skiing Speed
729
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierCrossCountrySkiingSpeed Apple Docs HKQuantityTypeIdentifierCrossCountrySkiingSpeed}
730
- * @since iOS 18
731
- */
732
- crossCountrySkiingSpeed = 'HKQuantityTypeIdentifierCrossCountrySkiingSpeed',
733
-
734
- /**
735
- * Cross Country Skiing Distance
736
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceCrossCountrySkiing Apple Docs HKQuantityTypeIdentifierCrossCountrySkiingDistance}
737
- * @since iOS 18
738
- */
739
- distanceCrossCountrySkiing = 'HKQuantityTypeIdentifierDistanceCrossCountrySkiing',
740
-
741
- /**
742
- * Paddle Sports Distance
743
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistancePaddleSports Apple Docs HKQuantityTypeIdentifierDistancePaddleSports}
744
- * @since iOS 18
745
- */
746
- distancePaddleSports = 'HKQuantityTypeIdentifierDistancePaddleSports',
747
-
748
- /**
749
- * Rowing Distance
750
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceRowing Apple Docs HKQuantityTypeIdentifierDistanceRowing}
751
- * @since iOS 18
752
- */
753
- distanceRowing = 'HKQuantityTypeIdentifierDistanceRowing',
754
-
755
- /**
756
- * Skating Sports Distance
757
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceSkatingSports Apple Docs HKQuantityTypeIdentifierDistanceSkatingSports}
758
- * @since iOS 18
759
- */
760
- distanceSkatingSports = 'HKQuantityTypeIdentifierDistanceSkatingSports',
761
-
762
- /**
763
- * Estimated Workout Effort Score
764
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierEstimatedWorkoutEffortScore Apple Docs HKQuantityTypeIdentifierEstimatedWorkoutEffortScore}
765
- * @since iOS 18
766
- */
767
- estimatedWorkoutEffortScore = 'HKQuantityTypeIdentifierEstimatedWorkoutEffortScore',
768
-
769
- /**
770
- * Paddle Sports Speed
771
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierPaddleSportsSpeed Apple Docs HKQuantityTypeIdentifierPaddleSportsSpeed}
772
- * @since iOS 18
773
- */
774
- paddleSportsSpeed = 'HKQuantityTypeIdentifierPaddleSportsSpeed',
775
-
776
- /**
777
- * Rowing Speed
778
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierRowingSpeed Apple Docs HKQuantityTypeIdentifierRowingSpeed}
779
- * @since iOS 18
780
- */
781
- rowingSpeed = 'HKQuantityTypeIdentifierRowingSpeed',
782
-
783
- /**
784
- * Workout Effort Score
785
- * @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierWorkoutEffortScore Apple Docs HKQuantityTypeIdentifierWorkoutEffortScore}
786
- * @since iOS 18
787
- */
788
- workoutEffortScore = 'HKQuantityTypeIdentifierWorkoutEffortScore',
789
- }
790
-
791
- export type TypeToUnitMapping = {
792
- readonly [key in HKQuantityTypeIdentifier]: HKUnit;
793
- };
794
-
795
- export enum HKCategoryValueLowCardioFitnessEvent {
796
- lowFitness = 1,
797
- }
798
-
799
- export enum HKHeartRateMotionContext {
800
- active = 2,
801
- notSet = 0,
802
- sedentary = 1,
803
- }
804
-
805
- /**
806
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcorrelationtypeidentifier Apple Docs }
807
- */
808
- export enum HKCorrelationTypeIdentifier {
809
- bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',
810
- food = 'HKCorrelationTypeIdentifierFood',
811
- }
812
-
813
- /**
814
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifier Apple Docs }
815
- */
816
- export enum HKCategoryTypeIdentifier {
817
- sleepAnalysis = 'HKCategoryTypeIdentifierSleepAnalysis',
818
- appleStandHour = 'HKCategoryTypeIdentifierAppleStandHour',
819
- cervicalMucusQuality = 'HKCategoryTypeIdentifierCervicalMucusQuality',
820
- ovulationTestResult = 'HKCategoryTypeIdentifierOvulationTestResult',
821
- /**
822
- * @deprecated In iOS 18 beta
823
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifiermenstrualflow Apple Docs }
824
- */
825
- menstrualFlow = 'HKCategoryTypeIdentifierMenstrualFlow',
826
- intermenstrualBleeding = 'HKCategoryTypeIdentifierIntermenstrualBleeding',
827
- sexualActivity = 'HKCategoryTypeIdentifierSexualActivity',
828
- mindfulSession = 'HKCategoryTypeIdentifierMindfulSession',
829
- highHeartRateEvent = 'HKCategoryTypeIdentifierHighHeartRateEvent',
830
- lowHeartRateEvent = 'HKCategoryTypeIdentifierLowHeartRateEvent',
831
- irregularHeartRhythmEvent = 'HKCategoryTypeIdentifierIrregularHeartRhythmEvent',
832
- /**
833
- * @deprecated Use environmentalAudioExposureEvent instead.
834
- */
835
- audioExposureEvent = 'HKCategoryTypeIdentifierAudioExposureEvent',
836
- toothbrushingEvent = 'HKCategoryTypeIdentifierToothbrushingEvent',
837
- lowCardioFitnessEvent = 'HKCategoryTypeIdentifierLowCardioFitnessEvent',
838
- contraceptive = 'HKCategoryTypeIdentifierContraceptive',
839
- lactation = 'HKCategoryTypeIdentifierLactation',
840
- pregnancy = 'HKCategoryTypeIdentifierPregnancy',
841
- pregnancyTestResult = 'HKCategoryTypeIdentifierPregnancyTestResult',
842
- progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',
843
- environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',
844
- headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',
845
- appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',
846
- handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue
847
-
848
- // Symptoms
849
- abdominalCramps = 'HKCategoryTypeIdentifierAbdominalCramps', // HKCategoryValueSeverity
850
- acne = 'HKCategoryTypeIdentifierAcne', // HKCategoryValueSeverity
851
- appetiteChanges = 'HKCategoryTypeIdentifierAppetiteChanges', // HKCategoryValueAppetiteChanges
852
- bladderIncontinence = 'HKCategoryTypeIdentifierBladderIncontinence', // HKCategoryValueSeverity
853
- bloating = 'HKCategoryTypeIdentifierBloating', // HKCategoryValueSeverity
854
- breastPain = 'HKCategoryTypeIdentifierBreastPain', // HKCategoryValueSeverity
855
- chestTightnessOrPain = 'HKCategoryTypeIdentifierChestTightnessOrPain', // HKCategoryValueSeverity
856
- chills = 'HKCategoryTypeIdentifierChills', // HKCategoryValueSeverity
857
- constipation = 'HKCategoryTypeIdentifierConstipation', // HKCategoryValueSeverity
858
- coughing = 'HKCategoryTypeIdentifierCoughing', // HKCategoryValueSeverity
859
- diarrhea = 'HKCategoryTypeIdentifierDiarrhea', // HKCategoryValueSeverity
860
- dizziness = 'HKCategoryTypeIdentifierDizziness', // HKCategoryValueSeverity
861
- drySkin = 'HKCategoryTypeIdentifierDrySkin', // HKCategoryValueSeverity
862
- fainting = 'HKCategoryTypeIdentifierFainting', // HKCategoryValueSeverity
863
- fatigue = 'HKCategoryTypeIdentifierFatigue', // HKCategoryValueSeverity
864
- fever = 'HKCategoryTypeIdentifierFever', // HKCategoryValueSeverity
865
- generalizedBodyAche = 'HKCategoryTypeIdentifierGeneralizedBodyAche', // HKCategoryValueSeverity
866
- hairLoss = 'HKCategoryTypeIdentifierHairLoss', // HKCategoryValueSeverity
867
- headache = 'HKCategoryTypeIdentifierHeadache', // HKCategoryValueSeverity
868
- heartburn = 'HKCategoryTypeIdentifierHeartburn', // HKCategoryValueSeverity
869
- hotFlashes = 'HKCategoryTypeIdentifierHotFlashes', // HKCategoryValueSeverity
870
- lossOfSmell = 'HKCategoryTypeIdentifierLossOfSmell', // HKCategoryValueSeverity
871
- lossOfTaste = 'HKCategoryTypeIdentifierLossOfTaste', // HKCategoryValueSeverity
872
- lowerBackPain = 'HKCategoryTypeIdentifierLowerBackPain', // HKCategoryValueSeverity
873
- memoryLapse = 'HKCategoryTypeIdentifierMemoryLapse', // HKCategoryValueSeverity
874
- moodChanges = 'HKCategoryTypeIdentifierMoodChanges', // HKCategoryValuePresence
875
- nausea = 'HKCategoryTypeIdentifierNausea', // HKCategoryValueSeverity
876
- nightSweats = 'HKCategoryTypeIdentifierNightSweats', // HKCategoryValueSeverity
877
- pelvicPain = 'HKCategoryTypeIdentifierPelvicPain', // HKCategoryValueSeverity
878
- rapidPoundingOrFlutteringHeartbeat = 'HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat', // HKCategoryValueSeverity
879
- runnyNose = 'HKCategoryTypeIdentifierRunnyNose', // HKCategoryValueSeverity
880
- shortnessOfBreath = 'HKCategoryTypeIdentifierShortnessOfBreath', // HKCategoryValueSeverity
881
- sinusCongestion = 'HKCategoryTypeIdentifierSinusCongestion', // HKCategoryValueSeverity
882
- skippedHeartbeat = 'HKCategoryTypeIdentifierSkippedHeartbeat', // HKCategoryValueSeverity
883
- sleepChanges = 'HKCategoryTypeIdentifierSleepChanges', // HKCategoryValuePresence
884
- soreThroat = 'HKCategoryTypeIdentifierSoreThroat', // HKCategoryValueSeverity
885
- vaginalDryness = 'HKCategoryTypeIdentifierVaginalDryness', // HKCategoryValueSeverity
886
- vomiting = 'HKCategoryTypeIdentifierVomiting', // HKCategoryValueSeverity
887
- wheezing = 'HKCategoryTypeIdentifierWheezing', // HKCategoryValueSeverity
888
-
889
- /**
890
- * Bleeding After Pregnancy
891
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifierbleedingafterpregnancy Apple Docs }
892
- * @since iOS 18
893
- */
894
- bleedingAfterPregnancy = 'HKCategoryTypeIdentifierBleedingAfterPregnancy', // HKCategoryValueSeverity
895
-
896
- /**
897
- * Bleeding During Pregnancy
898
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifierbleedingduringpregnancy Apple Docs }
899
- * @since iOS 18
900
- */
901
- bleedingDuringPregnancy = 'HKCategoryTypeIdentifierBleedingDuringPregnancy', // HKCategoryValueSeverity
902
- }
903
-
904
- export type HKSampleTypeIdentifier =
905
- | HKCategoryTypeIdentifier
906
- | HKCorrelationTypeIdentifier
907
- | HKQuantityTypeIdentifier
908
- | typeof HKStateOfMindTypeIdentifier
909
- | typeof HKActivitySummaryTypeIdentifier
910
- | typeof HKAudiogramTypeIdentifier
911
- | typeof HKDataTypeIdentifierHeartbeatSeries
912
- | typeof HKWorkoutRouteTypeIdentifier
913
- | typeof HKWorkoutTypeIdentifier
914
- | `${HKCategoryTypeIdentifier}`
915
- | `${HKCorrelationTypeIdentifier}`
916
- | `${HKQuantityTypeIdentifier}`;
917
-
918
- export type HealthkitReadAuthorization =
919
- | HKCharacteristicTypeIdentifier
920
- | HKSampleTypeIdentifier
921
- | `${HKCharacteristicTypeIdentifier}`
922
- | `${HKSampleTypeIdentifier}`;
923
- export type HealthkitWriteAuthorization = HKSampleTypeIdentifier;
924
-
925
- export enum HKCategoryValueAppleStandHour {
926
- stood = 0,
927
- idle = 1,
928
- }
929
-
930
- export enum HKWorkoutActivityType {
931
- americanFootball = 1,
932
- archery = 2,
933
- australianFootball = 3,
934
- badminton = 4,
935
- baseball = 5,
936
- basketball = 6,
937
- bowling = 7,
938
- boxing = 8, // See also HKWorkoutActivityTypeKickboxing.,
939
- climbing = 9,
940
- cricket = 10,
941
- crossTraining = 11, // Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,
942
- curling = 12,
943
- cycling = 13,
944
- dance = 14,
945
- danceInspiredTraining = 15, // This enum remains available to access older data.,
946
- elliptical = 16,
947
- equestrianSports = 17, // Polo, Horse Racing, Horse Riding, etc.,
948
- fencing = 18,
949
- fishing = 19,
950
- functionalStrengthTraining = 20, // Primarily free weights and/or body weight and/or accessories,
951
- golf = 21,
952
- gymnastics = 22,
953
- handball = 23,
954
- hiking = 24,
955
- hockey = 25, // Ice Hockey, Field Hockey, etc.,
956
- hunting = 26,
957
- lacrosse = 27,
958
- martialArts = 28,
959
- mindAndBody = 29, // Qigong, meditation, etc.,
960
- mixedMetabolicCardioTraining = 30, // This enum remains available to access older data.,
961
- paddleSports = 31, // Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,
962
- play = 32, // Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,
963
- preparationAndRecovery = 33, // Foam rolling, stretching, etc.,
964
- racquetball = 34,
965
- rowing = 35,
966
- rugby = 36,
967
- running = 37,
968
- sailing = 38,
969
- skatingSports = 39, // Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,
970
- snowSports = 40, // Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,
971
- soccer = 41,
972
- softball = 42,
973
- squash = 43,
974
- stairClimbing = 44, // See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,
975
- surfingSports = 45, // Traditional Surfing, Kite Surfing, Wind Surfing, etc.,
976
- swimming = 46,
977
- tableTennis = 47,
978
- tennis = 48,
979
- trackAndField = 49, // Shot Put, Javelin, Pole Vaulting, etc.,
980
- traditionalStrengthTraining = 50, // Primarily machines and/or free weights,
981
- volleyball = 51,
982
- walking = 52,
983
- waterFitness = 53,
984
- waterPolo = 54,
985
- waterSports = 55, // Water Skiing, Wake Boarding, etc.,
986
- wrestling = 56,
987
- yoga = 57,
988
- barre = 58, // HKWorkoutActivityTypeDanceInspiredTraining,
989
- coreTraining = 59,
990
- crossCountrySkiing = 60,
991
- downhillSkiing = 61,
992
- flexibility = 62,
993
- highIntensityIntervalTraining = 63,
994
- jumpRope = 64,
995
- kickboxing = 65,
996
- pilates = 66, // HKWorkoutActivityTypeDanceInspiredTraining,
997
- snowboarding = 67,
998
- stairs = 68,
999
- stepTraining = 69,
1000
- wheelchairWalkPace = 70,
1001
- wheelchairRunPace = 71,
1002
- taiChi = 72,
1003
- mixedCardio = 73, // HKWorkoutActivityTypeMixedMetabolicCardioTraining,
1004
- handCycling = 74,
1005
- discSports = 75,
1006
- fitnessGaming = 76,
1007
- cardioDance = 77,
1008
- socialDance = 78,
1009
- pickleball = 79,
1010
- cooldown = 80,
1011
- swimBikeRun = 82,
1012
- transition = 83,
1013
- underwaterDiving = 84,
1014
- other = 3000,
1015
- }
1016
-
1017
- export type HKGenericMetadata = {
1018
- readonly [key: string]: HKQuantity | boolean | number | string | undefined;
1019
- readonly HKExternalUUID?: string;
1020
- readonly HKTimeZone?: string;
1021
- readonly HKWasUserEntered?: boolean;
1022
- readonly HKDeviceSerialNumber?: string;
1023
- readonly HKUDIDeviceIdentifier?: string;
1024
- readonly HKUDIProductionIdentifier?: string;
1025
- readonly HKDigitalSignature?: string;
1026
- readonly HKDeviceName?: string;
1027
- readonly HKDeviceManufacturerName?: string;
1028
- readonly HKSyncIdentifier?: string;
1029
- readonly HKSyncVersion?: number;
1030
- readonly HKWasTakenInLab?: boolean;
1031
- readonly HKReferenceRangeLowerLimit?: number;
1032
- readonly HKReferenceRangeUpperLimit?: number;
1033
- };
1034
-
1035
- // documented at https://developer.apple.com/documentation/healthkit/hkweathercondition
1036
- export enum HKWeatherCondition {
1037
- none = 0,
1038
- clear = 1,
1039
- fair = 2,
1040
- partlyCloudy = 3,
1041
- mostlyCloudy = 4,
1042
- cloudy = 5,
1043
- foggy = 6,
1044
- haze = 7,
1045
- windy = 8,
1046
- blustery = 9,
1047
- smoky = 10,
1048
- dust = 11,
1049
- snow = 12,
1050
- hail = 13,
1051
- sleet = 14,
1052
- freezingDrizzle = 15,
1053
- freezingRain = 16,
1054
- mixedRainAndHail = 17,
1055
- mixedRainAndSnow = 18,
1056
- mixedRainAndSleet = 19,
1057
- mixedSnowAndSleet = 20,
1058
- drizzle = 21,
1059
- scatteredShowers = 22,
1060
- showers = 23,
1061
- thunderstorms = 24,
1062
- tropicalStorm = 25,
1063
- hurricane = 26,
1064
- tornado = 27,
1065
- }
1066
-
1067
- enum HKIndoorWorkout {
1068
- false = 0,
1069
- true = 1,
1070
- }
1071
-
1072
- export interface HKWorkoutMetadata
1073
- extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {
1074
- readonly HKWeatherCondition?: HKWeatherCondition;
1075
- readonly HKWeatherHumidity?: HKQuantity<
1076
- HKQuantityTypeIdentifier,
1077
- HKUnits.Percent
1078
- >;
1079
- // HKWeatherTemperature: HKQuantity<TTemperatureUnit>
1080
- readonly HKAverageMETs?: HKQuantity<HKQuantityTypeIdentifier, HKUnit>;
1081
- readonly HKElevationAscended?: HKQuantity<
1082
- HKQuantityTypeIdentifier,
1083
- LengthUnit
1084
- >;
1085
- readonly HKIndoorWorkout?: HKIndoorWorkout;
1086
- }
1087
-
1088
- /**
1089
- * @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus Apple Docs }
1090
- */
1091
- export enum HKAuthorizationRequestStatus {
1092
- unknown = 0,
1093
- shouldRequest = 1,
1094
- unnecessary = 2,
1095
- }
1096
-
1097
- /**
1098
- * @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationstatus Apple Docs }
1099
- */
1100
- export enum HKAuthorizationStatus {
1101
- notDetermined = 0,
1102
- sharingDenied = 1,
1103
- sharingAuthorized = 2,
1104
- }
1105
-
1106
- export type HKQuantity<
1107
- TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,
1108
- TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>
1109
- > = {
1110
- readonly unit: TUnit;
1111
- readonly quantity: number;
1112
- };
1113
-
1114
- /**
1115
- * @see {@link https://developer.apple.com/documentation/healthkit/hkbloodtype Apple Docs }
1116
- */
1117
- export enum HKBloodType {
1118
- notSet = 0,
1119
- aPositive = 1,
1120
- aNegative = 2,
1121
- bPositive = 3,
1122
- bNegative = 4,
1123
- abPositive = 5,
1124
- abNegative = 6,
1125
- oPositive = 7,
1126
- oNegative = 8,
1127
- }
1128
-
1129
- /**
1130
- * @see {@link https://developer.apple.com/documentation/healthkit/hkbiologicalsex Apple Docs }
1131
- */
1132
- export enum HKBiologicalSex {
1133
- notSet = 0,
1134
- female = 1,
1135
- male = 2,
1136
- other = 3,
1137
- }
1138
-
1139
- /**
1140
- * @see {@link https://developer.apple.com/documentation/healthkit/hkfitzpatrickskintype Apple Docs }
1141
- */
1142
- export enum HKFitzpatrickSkinType {
1143
- notSet = 0,
1144
- I = 1,
1145
- II = 2,
1146
- III = 3,
1147
- IV = 4,
1148
- V = 5,
1149
- VI = 6,
1150
- }
1151
-
1152
- /**
1153
- * @see {@link https://developer.apple.com/documentation/healthkit/hkstatisticsoptions Apple Docs }
1154
- */
1155
- export enum HKStatisticsOptions {
1156
- cumulativeSum = 'cumulativeSum',
1157
- discreteAverage = 'discreteAverage',
1158
- discreteMax = 'discreteMax',
1159
- discreteMin = 'discreteMin',
1160
- discreteMostRecent = 'discreteMostRecent',
1161
- duration = 'duration',
1162
- mostRecent = 'mostRecent',
1163
- separateBySource = 'separateBySource',
1164
- }
1165
-
1166
- export type QueryStatisticsResponseRaw<
1167
- TIdentifier extends HKQuantityTypeIdentifier,
1168
- TUnit extends UnitForIdentifier<TIdentifier>
1169
- > = {
1170
- readonly averageQuantity?: HKQuantity<TIdentifier, TUnit>;
1171
- readonly maximumQuantity?: HKQuantity<TIdentifier, TUnit>;
1172
- readonly minimumQuantity?: HKQuantity<TIdentifier, TUnit>;
1173
- readonly sumQuantity?: HKQuantity<TIdentifier, TUnit>;
1174
- readonly mostRecentQuantity?: HKQuantity<TIdentifier, TUnit>;
1175
- readonly mostRecentQuantityDateInterval?: {
1176
- readonly from: string;
1177
- readonly to: string;
1178
- };
1179
- readonly duration?: HKQuantity<HKQuantityTypeIdentifier, TimeUnit>;
1180
- };
1181
-
1182
- export interface IntervalComponents {
1183
- readonly minute?: number;
1184
- readonly hour?: number;
1185
- readonly day?: number;
1186
- readonly month?: number;
1187
- readonly year?: number;
1188
- }
1189
-
1190
- /**
1191
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluecervicalmucusquality Apple Docs }
1192
- */
1193
- export enum HKCategoryValueCervicalMucusQuality {
1194
- dry = 1,
1195
- sticky = 2,
1196
- creamy = 3,
1197
- watery = 4,
1198
- eggWhite = 5,
1199
- }
1200
-
1201
- /**
1202
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluemenstrualflow Apple Docs }
1203
- * @deprecated In iOS 18 beta
1204
- */
1205
- export enum HKCategoryValueMenstrualFlow {
1206
- unspecified = 1,
1207
- none = 5,
1208
- light = 2,
1209
- medium = 3,
1210
- heavy = 4,
1211
- }
1212
-
1213
- /**
1214
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueovulationtestresult Apple Docs }
1215
- */
1216
- export enum HKCategoryValueOvulationTestResult {
1217
- negative = 1,
1218
- luteinizingHormoneSurge = 2,
1219
- indeterminate = 3,
1220
- estrogenSurge = 4,
1221
- }
1222
-
1223
- /**
1224
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluesleepanalysis Apple Docs }
1225
- */
1226
- export enum HKCategoryValueSleepAnalysis {
1227
- inBed = 0,
1228
- asleepUnspecified = 1,
1229
- awake = 2,
1230
- asleepCore = 3,
1231
- asleepDeep = 4,
1232
- asleepREM = 5,
1233
- }
1234
-
1235
- /**
1236
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges Apple Docs}
1237
- */
1238
- export enum HKCategoryValueAppetiteChanges {
1239
- decreased = 2,
1240
- increased = 3,
1241
- noChange = 1,
1242
- unspecified = 0,
1243
- }
1244
-
1245
- /**
1246
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence Apple Docs}
1247
- */
1248
- export enum HKCategoryValuePresence {
1249
- notPresent = 1,
1250
- present = 0,
1251
- }
1252
-
1253
- /**
1254
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueseverity Apple Docs }
1255
- */
1256
- export enum HKCategoryValueSeverity {
1257
- notPresent = 1,
1258
- mild = 2,
1259
- moderate = 3,
1260
- severe = 4,
1261
- unspecified = 0,
1262
- }
1263
-
1264
- /**
1265
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalue/notapplicable Apple Docs }
1266
- */
1267
- export enum HKCategoryValueNotApplicable {
1268
- notApplicable = 0,
1269
- }
1270
-
1271
- /**
1272
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalue Apple Docs }
1273
- */
1274
- export type HKCategoryValue =
1275
- | HKCategoryValueAppetiteChanges
1276
- | HKCategoryValueCervicalMucusQuality
1277
- | HKCategoryValueLowCardioFitnessEvent
1278
- | HKCategoryValueMenstrualFlow
1279
- | HKCategoryValueOvulationTestResult
1280
- | HKCategoryValuePresence
1281
- | HKCategoryValueSeverity
1282
- | HKCategoryValueSleepAnalysis
1283
- | number;
1284
-
1285
- /**
1286
- * @see {@link https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason Apple Docs }
1287
- */
1288
- export enum HKInsulinDeliveryReason {
1289
- basal = 1,
1290
- bolus = 2,
1291
- }
1292
-
1293
- export type MetadataMapperForQuantityIdentifier<
1294
- TQuantityTypeIdentifier = HKQuantityTypeIdentifier
1295
- > = TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.insulinDelivery
1296
- ? HKGenericMetadata & {
1297
- readonly HKInsulinDeliveryReason: HKInsulinDeliveryReason;
1298
- }
1299
- : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.bloodGlucose
1300
- ? HKGenericMetadata & {
1301
- readonly HKBloodGlucoseMealTime?: number;
1302
- }
1303
- : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.heartRate
1304
- ? HKGenericMetadata & {
1305
- readonly HKHeartRateMotionContext?: HKHeartRateMotionContext;
1306
- }
1307
- : HKGenericMetadata;
1308
-
1309
- export type MetadataMapperForCorrelationIdentifier<
1310
- TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier
1311
- > = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food
1312
- ? HKGenericMetadata & {
1313
- readonly HKFoodType?: string;
1314
- }
1315
- : HKGenericMetadata;
1316
-
1317
- export type UnitForIdentifier<T extends HKQuantityTypeIdentifier> =
1318
- T extends HKQuantityTypeIdentifier.bloodGlucose
1319
- ? BloodGlucoseUnit
1320
- : T extends
1321
- | HKQuantityTypeIdentifier.appleExerciseTime
1322
- | HKQuantityTypeIdentifier.appleMoveTime
1323
- | HKQuantityTypeIdentifier.appleStandTime
1324
- ? TimeUnit
1325
- : T extends
1326
- | HKQuantityTypeIdentifier.activeEnergyBurned
1327
- | HKQuantityTypeIdentifier.basalEnergyBurned
1328
- | HKQuantityTypeIdentifier.dietaryEnergyConsumed
1329
- ? EnergyUnit
1330
- : T extends
1331
- | HKQuantityTypeIdentifier.distanceCycling
1332
- | HKQuantityTypeIdentifier.distanceDownhillSnowSports
1333
- | HKQuantityTypeIdentifier.distanceSwimming
1334
- | HKQuantityTypeIdentifier.distanceWalkingRunning
1335
- | HKQuantityTypeIdentifier.distanceWheelchair
1336
- | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance
1337
- | HKQuantityTypeIdentifier.waistCircumference
1338
- ? LengthUnit
1339
- : T extends
1340
- | HKQuantityTypeIdentifier.bodyFatPercentage
1341
- | HKQuantityTypeIdentifier.oxygenSaturation
1342
- | HKQuantityTypeIdentifier.walkingAsymmetryPercentage
1343
- | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage
1344
- ? HKUnits.Percent
1345
- : T extends
1346
- | HKQuantityTypeIdentifier.basalBodyTemperature
1347
-
1348
- ? TemperatureUnit
1349
- : T extends
1350
- | HKQuantityTypeIdentifier.runningSpeed
1351
- | HKQuantityTypeIdentifier.stairAscentSpeed
1352
- | HKQuantityTypeIdentifier.stairDescentSpeed
1353
- | HKQuantityTypeIdentifier.walkingSpeed
1354
-
1355
- ? SpeedUnit<LengthUnit, TimeUnit>
1356
- : T extends
1357
- | HKQuantityTypeIdentifier.flightsClimbed
1358
- | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages
1359
- | HKQuantityTypeIdentifier.numberOfTimesFallen
1360
- | HKQuantityTypeIdentifier.pushCount
1361
- | HKQuantityTypeIdentifier.stepCount
1362
- | HKQuantityTypeIdentifier.swimmingStrokeCount
1363
- ? HKUnits.Count
1364
- : T extends
1365
- | HKQuantityTypeIdentifier.dietaryBiotin
1366
- | HKQuantityTypeIdentifier.dietaryCaffeine
1367
- | HKQuantityTypeIdentifier.dietaryCalcium
1368
- | HKQuantityTypeIdentifier.dietaryCarbohydrates
1369
- | HKQuantityTypeIdentifier.dietaryChloride
1370
- | HKQuantityTypeIdentifier.dietaryCholesterol
1371
- | HKQuantityTypeIdentifier.dietaryChromium
1372
- | HKQuantityTypeIdentifier.dietaryCopper
1373
- | HKQuantityTypeIdentifier.dietaryFatMonounsaturated
1374
- | HKQuantityTypeIdentifier.dietaryFatPolyunsaturated
1375
- | HKQuantityTypeIdentifier.dietaryFatSaturated
1376
- | HKQuantityTypeIdentifier.dietaryFatTotal
1377
- | HKQuantityTypeIdentifier.dietaryFiber
1378
- | HKQuantityTypeIdentifier.dietaryFolate
1379
- | HKQuantityTypeIdentifier.dietaryIodine
1380
-
1381
- | HKQuantityTypeIdentifier.dietaryIron
1382
- | HKQuantityTypeIdentifier.dietaryMagnesium
1383
- | HKQuantityTypeIdentifier.dietaryManganese
1384
- | HKQuantityTypeIdentifier.dietaryMolybdenum
1385
- | HKQuantityTypeIdentifier.dietaryNiacin
1386
- | HKQuantityTypeIdentifier.dietaryPantothenicAcid
1387
- | HKQuantityTypeIdentifier.dietaryPhosphorus
1388
- | HKQuantityTypeIdentifier.dietaryPotassium
1389
- | HKQuantityTypeIdentifier.dietaryProtein
1390
- | HKQuantityTypeIdentifier.dietaryRiboflavin
1391
- | HKQuantityTypeIdentifier.dietarySelenium
1392
- | HKQuantityTypeIdentifier.dietarySodium
1393
- | HKQuantityTypeIdentifier.dietarySugar
1394
- | HKQuantityTypeIdentifier.dietaryThiamin
1395
- | HKQuantityTypeIdentifier.dietaryVitaminA
1396
- | HKQuantityTypeIdentifier.dietaryVitaminB6
1397
- | HKQuantityTypeIdentifier.dietaryVitaminB12
1398
- | HKQuantityTypeIdentifier.dietaryVitaminC
1399
- | HKQuantityTypeIdentifier.dietaryVitaminD
1400
- | HKQuantityTypeIdentifier.dietaryVitaminE
1401
- | HKQuantityTypeIdentifier.dietaryVitaminK
1402
- | HKQuantityTypeIdentifier.dietaryZinc
1403
- ? MassUnit
1404
- : T extends HKQuantityTypeIdentifier.dietaryWater
1405
- ? VolumeUnit
1406
- : T extends HKQuantityTypeIdentifier.insulinDelivery
1407
- ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}`
1408
- : T extends
1409
- | HKQuantityTypeIdentifier.heartRate
1410
- | HKQuantityTypeIdentifier.restingHeartRate
1411
- | HKQuantityTypeIdentifier.walkingHeartRateAverage
1412
- ? CountPerTime<TimeUnit>
1413
- : HKUnit;
1414
-
1415
- export type HKCategoryTypeSeverityIdentifier = HKCategoryTypeIdentifier.abdominalCramps
1416
- | HKCategoryTypeIdentifier.acne
1417
- | HKCategoryTypeIdentifier.bladderIncontinence
1418
- | HKCategoryTypeIdentifier.bloating
1419
- | HKCategoryTypeIdentifier.breastPain
1420
- | HKCategoryTypeIdentifier.chestTightnessOrPain
1421
- | HKCategoryTypeIdentifier.chills
1422
- | HKCategoryTypeIdentifier.constipation
1423
- | HKCategoryTypeIdentifier.coughing
1424
- | HKCategoryTypeIdentifier.diarrhea
1425
- | HKCategoryTypeIdentifier.dizziness
1426
- | HKCategoryTypeIdentifier.drySkin
1427
- | HKCategoryTypeIdentifier.fainting
1428
- | HKCategoryTypeIdentifier.fatigue
1429
- | HKCategoryTypeIdentifier.fever
1430
- | HKCategoryTypeIdentifier.generalizedBodyAche
1431
- | HKCategoryTypeIdentifier.hairLoss
1432
- | HKCategoryTypeIdentifier.headache
1433
- | HKCategoryTypeIdentifier.heartburn
1434
- | HKCategoryTypeIdentifier.hotFlashes
1435
- | HKCategoryTypeIdentifier.lossOfSmell
1436
- | HKCategoryTypeIdentifier.lossOfTaste
1437
- | HKCategoryTypeIdentifier.lowerBackPain
1438
- | HKCategoryTypeIdentifier.memoryLapse
1439
- | HKCategoryTypeIdentifier.moodChanges
1440
- | HKCategoryTypeIdentifier.nausea
1441
- | HKCategoryTypeIdentifier.nightSweats
1442
- | HKCategoryTypeIdentifier.pelvicPain
1443
- | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat
1444
- | HKCategoryTypeIdentifier.runnyNose
1445
- | HKCategoryTypeIdentifier.shortnessOfBreath
1446
- | HKCategoryTypeIdentifier.sinusCongestion
1447
- | HKCategoryTypeIdentifier.skippedHeartbeat
1448
- | HKCategoryTypeIdentifier.soreThroat
1449
- | HKCategoryTypeIdentifier.vaginalDryness
1450
- | HKCategoryTypeIdentifier.vomiting
1451
- | HKCategoryTypeIdentifier.wheezing
1452
-
1453
- export type HKCategoryTypePresenceIdentifier = HKCategoryTypeIdentifier.appetiteChanges
1454
- | HKCategoryTypeIdentifier.sleepChanges
1455
-
1456
- export type HKCategoryTypeValueNotApplicableIdentifier = HKCategoryTypeIdentifier.highHeartRateEvent
1457
- | HKCategoryTypeIdentifier.intermenstrualBleeding
1458
- | HKCategoryTypeIdentifier.mindfulSession
1459
- | HKCategoryTypeIdentifier.sexualActivity
1460
-
1461
- export type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> =
1462
- T extends HKCategoryTypeIdentifier.cervicalMucusQuality
1463
- ? HKCategoryValueCervicalMucusQuality
1464
- : T extends HKCategoryTypeIdentifier.menstrualFlow
1465
- ? HKCategoryValueMenstrualFlow
1466
- : T extends HKCategoryTypeIdentifier.ovulationTestResult
1467
- ? HKCategoryValueOvulationTestResult
1468
- : T extends HKCategoryTypeIdentifier.sleepAnalysis
1469
- ? HKCategoryValueSleepAnalysis
1470
- : T extends HKCategoryTypeValueNotApplicableIdentifier
1471
- ? HKCategoryValueNotApplicable
1472
- : T extends HKCategoryTypeSeverityIdentifier
1473
- ? HKCategoryValueSeverity
1474
- : T extends HKCategoryTypePresenceIdentifier
1475
- ? HKCategoryValuePresence
1476
- : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent
1477
- ? HKCategoryValueLowCardioFitnessEvent
1478
- : T extends HKCategoryTypeIdentifier.pregnancyTestResult
1479
- ? HKCategoryValuePregnancyTestResult
1480
- : T extends HKCategoryTypeIdentifier.pregnancyTestResult
1481
- ? HKCategoryValuePregnancyTestResult
1482
- : T extends HKCategoryTypeIdentifier.appleStandHour
1483
- ? HKCategoryValueAppleStandHour
1484
- : number;
1485
-
1486
- /**
1487
- * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepregnancytestresult Apple Docs }
1488
- */
1489
- enum HKCategoryValuePregnancyTestResult {
1490
- positive = 2,
1491
- negative = 1,
1492
- indeterminate = 3,
1493
- }
1494
- /* needs further mapping
1495
-
1496
- contraceptive = 'HKCategoryTypeIdentifierContraceptive',
1497
- lactation = 'HKCategoryTypeIdentifierLactation',
1498
- pregnancy = 'HKCategoryTypeIdentifierPregnancy',
1499
-
1500
- progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',
1501
- environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',
1502
- headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',
1503
- appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',
1504
- handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue */
1505
-
1506
- export type HKHeartbeatSeriesSampleMetadata = HKGenericMetadata & {
1507
- readonly HKMetadataKeyAlgorithmVersion: string;
1508
- };
1509
-
1510
- export type MetadataMapperForCategoryIdentifier<
1511
- T extends HKCategoryTypeIdentifier
1512
- > = T extends HKCategoryTypeIdentifier.sexualActivity
1513
- ? HKGenericMetadata & {
1514
- readonly HKSexualActivityProtectionUsed: boolean;
1515
- }
1516
- : T extends HKCategoryTypeIdentifier.menstrualFlow
1517
- ? HKGenericMetadata & {
1518
- readonly HKMenstrualCycleStart: boolean;
1519
- }
1520
- : HKGenericMetadata;
1521
-
1522
- // Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse
1523
- export enum HKWheelchairUse {
1524
- notSet = 0,
1525
- no = 1,
1526
- yes = 2,
1527
- }
1528
-
1529
- // Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init
1530
- export enum HKMetricPrefix {
1531
- None = '',
1532
- Pico = 'p',
1533
- Nano = 'n',
1534
- Micro = 'mc',
1535
- Milli = 'm',
1536
- Centi = 'c',
1537
- Deci = 'd',
1538
- Deca = 'da',
1539
- Hecto = 'h',
1540
- Kilo = 'k',
1541
- Mega = 'M',
1542
- Giga = 'G',
1543
- Tera = 'T',
1544
- Femto = 'f',
1545
- }
1546
-
1547
- export enum HKUnitMetric {
1548
- Gram = 'g',
1549
- Joule = 'J',
1550
- Kelvin = 'K',
1551
- Liter = 'l',
1552
- Meter = 'm',
1553
- Pascal = 'Pa',
1554
- Second = 's',
1555
- Siemen = 'S',
1556
- Hertz = 'Hz',
1557
- Volt = 'V',
1558
- }
1559
-
1560
- export enum HKUnits {
1561
- DecibelHearingLevel = 'dBHL',
1562
- DecibelSoundPressureLevel = 'dBASPL',
1563
- Percent = '%',
1564
- Count = 'count',
1565
- InternationalUnit = 'IU',
1566
- AppleEffortScore = 'appleEffortScore'
1567
- }
1568
-
1569
- export type MeterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1570
- `${Prefix}${HKUnitMetric.Meter}`;
1571
- export type LiterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1572
- `${Prefix}${HKUnitMetric.Liter}`;
1573
- export type GramUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1574
- `${Prefix}${HKUnitMetric.Gram}`;
1575
- export type PascalUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1576
- `${Prefix}${HKUnitMetric.Pascal}`;
1577
- export type SecondUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1578
- `${Prefix}${HKUnitMetric.Second}`;
1579
- export type JouleUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1580
- `${Prefix}${HKUnitMetric.Joule}`;
1581
- export type HertzUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1582
- `${Prefix}${HKUnitMetric.Hertz}`;
1583
- export type VoltUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1584
- `${Prefix}${HKUnitMetric.Volt}`;
1585
- export type SiemenUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =
1586
- `${Prefix}${HKUnitMetric.Siemen}`;
1587
-
1588
- // not 100% sure about these
1589
- export type MoleUnit<MolarMass extends number> = `mol<${MolarMass}>`;
1590
- export type MoleUnitWith<
1591
- MolarMass extends number,
1592
- Prefix extends HKMetricPrefix = HKMetricPrefix.None
1593
- > = `${Prefix}mol<${MolarMass}>`;
1594
-
1595
- export type FrequencyUnit = HertzUnit<HKMetricPrefix>;
1596
-
1597
- /**
1598
- * More SI prefixes also available as literals, just type the string
1599
- * @example 'cm', 'km'
1600
- */
1601
- export enum UnitOfLength {
1602
- Feet = 'ft',
1603
- /**
1604
- * More SI prefixes also available as literals, just type the string
1605
- * @example 'cm', 'km'
1606
- */
1607
- Meter = 'm',
1608
- Inches = 'in',
1609
- Yards = 'yd',
1610
- Miles = 'mi',
1611
- }
1612
- export type LengthUnit = MeterUnit<HKMetricPrefix> | UnitOfLength;
1613
-
1614
- /**
1615
- * More SI prefixes also available as literals, just type the string
1616
- * @example 'ml', 'cl'
1617
- */
1618
- export enum UnitOfVolume {
1619
- ImperialCup = 'cup_imp',
1620
- ImperialFluidOunces = 'fl_oz_imp',
1621
- ImperialPint = 'pt_imp',
1622
- USCup = 'cup_us',
1623
- USFluidOunces = 'fl_oz_us',
1624
- USPint = 'pt_us',
1625
- /**
1626
- * More SI prefixes also available as literals, just type the string
1627
- * @example 'ml', 'cl'
1628
- */
1629
- Liter = 'l',
1630
- }
1631
- export type VolumeUnit = LiterUnit<HKMetricPrefix> | UnitOfVolume;
1632
-
1633
- /**
1634
- * More SI prefixes also available as literals, just type the string
1635
- * @example 'mg', 'kg'
1636
- */
1637
- export enum UnitOfMass {
1638
- Ounces = 'oz',
1639
- Stones = 'st',
1640
- Pounds = 'lb',
1641
- /**
1642
- * More SI prefixes also available as literals, just type the string
1643
- * @example 'mg', 'kg'
1644
- */
1645
- Gram = 'g',
1646
- }
1647
- /**
1648
- * More SI prefixes also available as literals, just type the string
1649
- * @example 'mg', 'kg'
1650
- */
1651
- export type MassUnit = GramUnit<HKMetricPrefix> | UnitOfMass;
1652
-
1653
- /**
1654
- * More SI prefixes also available as literals, just type the string
1655
- * @example 'kPa', 'hPa'
1656
- */
1657
- export enum UnitOfPressure {
1658
- Atmospheres = 'atm',
1659
- CentimetersOfWater = 'cmAq',
1660
- MillimetersOfMercury = 'mmHg',
1661
- InchesOfMercury = 'inHg',
1662
- DecibelAWeightedSoundPressureLevel = 'dBASPL',
1663
- /**
1664
- * More SI prefixes also available as literals, just type the string
1665
- * @example 'kPa', 'hPa'
1666
- */
1667
- Pascals = 'Pa',
1668
- }
1669
-
1670
- /**
1671
- * More SI prefixes also available as literals, just type the string
1672
- * @example 'kPa', 'hPa'
1673
- */
1674
- export type PressureUnit = PascalUnit<HKMetricPrefix> | UnitOfPressure;
1675
-
1676
- /**
1677
- * More SI prefixes also available as literals, just type the string
1678
- * @example 'ms'
1679
- */
1680
- export enum UnitOfTime {
1681
- Days = 'd',
1682
- Minutes = 'min',
1683
- Hours = 'hr',
1684
- /**
1685
- * More SI prefixes also available as literals, just type the string
1686
- * @example 'ms'
1687
- */
1688
- Seconds = 's',
1689
- }
1690
- /**
1691
- * More SI prefixes also available as literals, just type the string
1692
- * @example 'ms'
1693
- */
1694
- export type TimeUnit = SecondUnit<HKMetricPrefix> | UnitOfTime;
1695
- export enum TemperatureUnit {
1696
- DegreesCelsius = 'degC',
1697
- DegreesFahrenheit = 'degF',
1698
- Kelvin = 'K',
1699
- }
1700
-
1701
- /**
1702
- * More SI prefixes also available as literals, just type the string
1703
- * @example 'kJ'
1704
- */
1705
- export enum UnitOfEnergy {
1706
- Kilocalories = 'kcal',
1707
- LargeCalories = 'Cal',
1708
- SmallCalories = 'cal',
1709
- /**
1710
- * More SI prefixes also available as literals, just type the string
1711
- * @example 'kJ'
1712
- */
1713
- Joules = 'J',
1714
- }
1715
- export type EnergyUnit = JouleUnit<HKMetricPrefix> | UnitOfEnergy;
1716
- export enum BloodGlucoseUnit {
1717
- GlucoseMmolPerL = 'mmol<180.15588000005408>/l',
1718
- GlucoseMgPerDl = 'mg/dL',
1719
- }
1720
-
1721
- export type SpeedUnit<
1722
- TLength extends LengthUnit,
1723
- TTime extends TimeUnit
1724
- > = `${TLength}/${TTime}`;
1725
- export type CountPerTime<TTime extends TimeUnit> = `count/${TTime}`;
1726
-
1727
- export type HKUnit =
1728
- | BloodGlucoseUnit
1729
- | CountPerTime<TimeUnit>
1730
- | EnergyUnit
1731
- | FrequencyUnit
1732
- | HKUnits
1733
- | LengthUnit
1734
- | MassUnit
1735
- | PressureUnit
1736
- | SpeedUnit<LengthUnit, TimeUnit>
1737
- | TemperatureUnit
1738
- | TimeUnit
1739
- | VolumeUnit
1740
- | `${BloodGlucoseUnit}`
1741
- | `${EnergyUnit}`
1742
-
1743
- | `${HKUnits}`
1744
- | `${LengthUnit}`
1745
- | `${MassUnit}`
1746
- | `${PressureUnit}`
1747
- | `${TemperatureUnit}`
1748
- | `${TimeUnit}`
1749
- | `${VolumeUnit}`;
1750
-
1751
- /**
1752
- * @see {@link https://developer.apple.com/documentation/healthkit/hkdevice Apple Docs }
1753
- */
1754
- export type HKDevice = {
1755
- readonly name: string; // ex: "Apple Watch"
1756
- readonly firmwareVersion: string | null;
1757
- readonly hardwareVersion: string; // ex: "Watch6,2",
1758
- readonly localIdentifier: string | null;
1759
- readonly manufacturer: string; // ex: "Apple Inc."
1760
- readonly model: string; // ex: "Watch"
1761
- readonly softwareVersion: string; // ex: "9.0"
1762
- readonly udiDeviceIdentifier: string | null;
1763
- };
1764
-
1765
- /**
1766
- * @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615781-source Apple Docs }
1767
- */
1768
- export type HKSource = {
1769
- readonly name: string;
1770
- readonly bundleIdentifier: string;
1771
- };
1772
-
1773
- /**
1774
- * @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615483-sourcerevision Apple Docs }
1775
- */
1776
- export type HKSourceRevision = {
1777
- readonly source: HKSource;
1778
- readonly version: string;
1779
- readonly operatingSystemVersion?: string;
1780
- readonly productType?: string;
1781
- };
1782
-
1783
- /**
1784
- * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs }
1785
- */
1786
- export type HKQuantitySampleRaw<
1787
- TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,
1788
- TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>
1789
- > = {
1790
- readonly uuid: string;
1791
- readonly device?: HKDevice;
1792
- readonly quantityType: TQuantityIdentifier;
1793
- readonly startDate: string;
1794
- readonly endDate: string;
1795
- readonly quantity: number;
1796
- readonly unit: TUnit;
1797
- readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;
1798
- readonly sourceRevision?: HKSourceRevision;
1799
- };
1800
-
1801
- export type HKHeartbeatRaw = {
1802
- readonly timeSinceSeriesStart: number;
1803
- readonly precededByGap: boolean;
1804
- };
1805
-
1806
- export type HKHeartbeatSeriesSampleRaw = {
1807
- readonly uuid: string;
1808
- readonly device?: HKDevice;
1809
- readonly startDate: string;
1810
- readonly endDate: string;
1811
- readonly heartbeats: readonly HKHeartbeatRaw[];
1812
- readonly metadata?: HKHeartbeatSeriesSampleMetadata;
1813
- readonly sourceRevision?: HKSourceRevision;
1814
- };
1815
-
1816
- export type CLLocationRawForSaving = {
1817
- readonly latitude: number;
1818
- readonly longitude: number;
1819
- readonly altitude: number;
1820
- readonly horizontalAccuracy: number;
1821
- readonly verticalAccuracy: number;
1822
- readonly course: number;
1823
- readonly speed: number;
1824
- readonly timestamp: string; // unix timestamp in milliseconds
1825
- };
1826
-
1827
- export type HKQuantitySampleRawForSaving<
1828
- TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,
1829
- TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>
1830
- > = Omit<
1831
- HKQuantitySampleRaw<TQuantityIdentifier, TUnit>,
1832
- 'device' | 'endDate' | 'startDate' | 'uuid'
1833
- > & {
1834
- readonly startDate?: string;
1835
- readonly endDate?: string;
1836
- };
1837
-
1838
- export type HKCategorySampleRawForSaving<
1839
- TCategory extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier
1840
- > = Omit<
1841
- HKCategorySampleRaw<TCategory>,
1842
- 'device' | 'endDate' | 'startDate' | 'uuid'
1843
- > & {
1844
- readonly startDate?: string;
1845
- readonly endDate?: string;
1846
- };
1847
-
1848
- export interface HKWorkoutEvent {
1849
- readonly type: HKWorkoutEventType;
1850
- readonly startDate: string;
1851
- readonly endDate: string;
1852
- }
1853
-
1854
- /**
1855
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkouteventtype Apple Docs }
1856
- */
1857
- export enum HKWorkoutEventType {
1858
- pause = 1,
1859
- resume = 2,
1860
- lap = 3,
1861
- marker = 4,
1862
- motionPaused = 5,
1863
- motionResumed = 6,
1864
- segment = 7,
1865
- pauseOrResumeRequest = 8,
1866
- }
1867
-
1868
- export interface HKWorkoutActivity {
1869
- readonly startDate: string;
1870
- readonly endDate: string;
1871
- readonly uuid: string;
1872
- readonly duration: number;
1873
- }
1874
-
1875
- export type HKWorkoutRaw<
1876
- TEnergy extends EnergyUnit,
1877
- TDistance extends LengthUnit
1878
- > = {
1879
- readonly uuid: string;
1880
- readonly device?: HKDevice;
1881
- readonly workoutActivityType: HKWorkoutActivityType;
1882
- readonly duration: number;
1883
- readonly totalDistance?: HKQuantity<HKQuantityTypeIdentifier, TDistance>;
1884
- readonly totalEnergyBurned?: HKQuantity<HKQuantityTypeIdentifier, TEnergy>;
1885
- readonly totalSwimmingStrokeCount?: HKQuantity<
1886
- HKQuantityTypeIdentifier,
1887
- HKUnits.Count
1888
- >;
1889
- readonly totalFlightsClimbed?: HKQuantity<
1890
- HKQuantityTypeIdentifier,
1891
- HKUnits.Count
1892
- >;
1893
- readonly startDate: string;
1894
- readonly endDate: string;
1895
- readonly metadata?: HKWorkoutMetadata;
1896
- readonly sourceRevision?: HKSourceRevision;
1897
- readonly events?: readonly HKWorkoutEvent[];
1898
- readonly activities?: readonly HKWorkoutActivity[];
1899
- readonly workoutPlanId?: string;
1900
- };
1901
-
1902
- // Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier
1903
- export enum HKCharacteristicTypeIdentifier {
1904
- fitzpatrickSkinType = 'HKCharacteristicTypeIdentifierFitzpatrickSkinType',
1905
- biologicalSex = 'HKCharacteristicTypeIdentifierBiologicalSex',
1906
- bloodType = 'HKCharacteristicTypeIdentifierBloodType',
1907
- dateOfBirth = 'HKCharacteristicTypeIdentifierDateOfBirth',
1908
- wheelchairUse = 'HKCharacteristicTypeIdentifierWheelchairUse',
1909
- activityMoveMode = 'HKCharacteristicTypeIdentifierActivityMoveMode', // HKActivityMoveModeObject
1910
- }
1911
-
1912
- export type WritePermissions = {
1913
- readonly [key in
1914
- | HKCategoryTypeIdentifier
1915
- | HKCharacteristicTypeIdentifier
1916
- | HKQuantityTypeIdentifier]: boolean;
1917
- };
1918
-
1919
- export type ReadPermissions = {
1920
- readonly [key in
1921
- | HKCategoryTypeIdentifier
1922
- | HKCharacteristicTypeIdentifier
1923
- | HKQuantityTypeIdentifier]: boolean;
1924
- };
1925
-
1926
- export type HKCategorySampleRaw<
1927
- T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier
1928
- > = {
1929
- readonly uuid: string;
1930
- readonly device?: HKDevice;
1931
- readonly categoryType: T;
1932
- readonly startDate: string;
1933
- readonly endDate: string;
1934
- readonly value: HKCategoryValueForIdentifier<T>;
1935
- readonly metadata: MetadataMapperForCategoryIdentifier<T>;
1936
- readonly sourceRevision?: HKSourceRevision;
1937
- };
1938
-
1939
- export type DeletedCategorySampleRaw<T extends HKCategoryTypeIdentifier> = {
1940
- readonly uuid: string;
1941
- readonly metadata: MetadataMapperForCategoryIdentifier<T>;
1942
- };
1943
-
1944
- export type DeletedWorkoutSampleRaw = {
1945
- readonly uuid: string;
1946
- readonly metadata: HKWorkoutMetadata;
1947
- };
1948
-
1949
- export type DeletedHeartbeatSeriesSampleRaw = {
1950
- readonly uuid: string;
1951
- readonly metadata: HKHeartbeatSeriesSampleMetadata;
1952
- };
1953
-
1954
- export type DeletedQuantitySampleRaw<T extends HKQuantityTypeIdentifier> = {
1955
- readonly uuid: string;
1956
- readonly metadata: MetadataMapperForQuantityIdentifier<T>;
1957
- };
1958
-
1959
- export type QueryCategorySamplesResponseRaw<
1960
- T extends HKCategoryTypeIdentifier
1961
- > = {
1962
- readonly samples: readonly HKCategorySampleRaw<T>[];
1963
- readonly deletedSamples: readonly DeletedCategorySampleRaw<T>[];
1964
- readonly newAnchor: string;
1965
- };
1966
-
1967
- export type QueryHeartbeatSeriesSamplesResponseRaw = {
1968
- readonly samples: readonly HKHeartbeatSeriesSampleRaw[];
1969
- readonly deletedSamples: readonly DeletedHeartbeatSeriesSampleRaw[];
1970
- readonly newAnchor: string;
1971
- };
1972
-
1973
- export type QueryQuantitySamplesResponseRaw<
1974
- T extends HKQuantityTypeIdentifier
1975
- > = {
1976
- readonly samples: readonly HKQuantitySampleRaw<T>[];
1977
- readonly deletedSamples: readonly DeletedQuantitySampleRaw<T>[];
1978
- readonly newAnchor: string;
1979
- };
1980
-
1981
- export type HKCorrelationRaw<TIdentifier extends HKCorrelationTypeIdentifier> =
1982
- {
1983
- readonly correlationType: HKCorrelationTypeIdentifier;
1984
- readonly objects: readonly (HKCategorySampleRaw | HKQuantitySampleRaw)[];
1985
- readonly metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>;
1986
- readonly startDate: string;
1987
- readonly endDate: string;
1988
- };
1989
-
1990
- type QueryId = string;
1991
-
1992
- /**
1993
- * @see {@link https://developer.apple.com/documentation/healthkit/hkupdatefrequency Apple Docs }
1994
- */
1995
- export enum HKUpdateFrequency {
1996
- immediate = 1,
1997
- hourly = 2,
1998
- daily = 3,
1999
- weekly = 4,
2000
- }
2001
-
2002
- export type WorkoutLocation = {
2003
- readonly longitude: number;
2004
- readonly latitude: number;
2005
- readonly altitude: number;
2006
- readonly speed: number;
2007
- readonly timestamp: number;
2008
- readonly horizontalAccuracy: number;
2009
- readonly speedAccuracy: number;
2010
- readonly verticalAccuracy: number;
2011
- readonly distance: number | null;
2012
- };
2013
-
2014
- export type WorkoutRoute = {
2015
- readonly locations: readonly WorkoutLocation[];
2016
- readonly HKMetadataKeySyncIdentifier?: string;
2017
- readonly HKMetadataKeySyncVersion?: number;
2018
- };
2019
-
2020
- type QueryWorkoutSamplesWithAnchorResponseRaw<
2021
- TEnergy extends EnergyUnit,
2022
- TDistance extends LengthUnit
2023
- > = {
2024
- readonly samples: readonly HKWorkoutRaw<TEnergy, TDistance>[],
2025
- readonly deletedSamples: readonly DeletedWorkoutSampleRaw[],
2026
- readonly newAnchor: string
2027
- }
2028
-
2029
- /**
2030
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutconfiguration Apple Docs }
2031
- */
2032
- export type HKWorkoutConfiguration = {
2033
- readonly activityType: HKWorkoutActivityType;
2034
- readonly locationType?: HKWorkoutSessionLocationType;
2035
- };
2036
-
2037
- /**
2038
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutsessionlocationtype Apple Docs }
2039
- */
2040
- export enum HKWorkoutSessionLocationType {
2041
- unknown = 1,
2042
- indoor = 2,
2043
- outdoor = 3
2044
- }
2045
-
2046
- /**
2047
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutsessionstate Apple Docs }
2048
- */
2049
- export enum WorkoutSessionState {
2050
- NotStarted = 1,
2051
- Running = 2,
2052
- Ended = 3,
2053
- Paused = 4,
2054
- Prepared = 5,
2055
- Stopped = 6,
2056
- }
2057
-
2058
- export interface WorkoutStateChangeEvent {
2059
- readonly toState: WorkoutSessionState;
2060
- readonly fromState: WorkoutSessionState;
2061
- readonly date: string;
2062
- }
2063
-
2064
- export interface WorkoutErrorEvent {
2065
- readonly error: string;
2066
- }
2067
-
2068
- export type RemoteSessionSharableData = {
2069
- readonly type: string;
2070
- readonly payload: Record<string, unknown>;
2071
- }
2072
-
2073
- export type WorkoutDataReceivedEvent = {
2074
- readonly data: readonly RemoteSessionSharableData[];
2075
- };
2076
-
2077
- export type WorkoutEventReceivedEvent = {
2078
- readonly type: HKWorkoutEventType;
2079
- };
2080
-
2081
- type ReactNativeHealthkitTypeNative = {
2082
- /**
2083
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs }
2084
- */
2085
- isHealthDataAvailable(): Promise<boolean>;
2086
- isProtectedDataAvailable(): Promise<boolean>;
2087
- getBloodType(): Promise<HKBloodType>;
2088
- getDateOfBirth(): Promise<string>;
2089
- getBiologicalSex(): Promise<HKBiologicalSex>;
2090
- getFitzpatrickSkinType(): Promise<HKFitzpatrickSkinType>;
2091
- readonly getWheelchairUse: () => Promise<HKWheelchairUse>;
2092
- /**
2093
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery Apple Docs }
2094
- */
2095
- readonly enableBackgroundDelivery: (
2096
- typeIdentifier: HKSampleTypeIdentifier,
2097
- updateFrequency: HKUpdateFrequency
2098
- ) => Promise<boolean>;
2099
- /**
2100
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery Apple Docs }
2101
- */
2102
- readonly disableBackgroundDelivery: (
2103
- typeIdentifier: HKSampleTypeIdentifier
2104
- ) => Promise<boolean>;
2105
- /**
2106
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery Apple Docs }
2107
- */
2108
- readonly disableAllBackgroundDelivery: () => Promise<boolean>;
2109
-
2110
- readonly saveCorrelationSample: <
2111
- TIdentifier extends HKCorrelationTypeIdentifier,
2112
- TSamples extends readonly (
2113
- | HKCategorySampleRawForSaving
2114
- | HKQuantitySampleRawForSaving
2115
- )[]
2116
- >(
2117
- typeIdentifier: TIdentifier,
2118
- samples: TSamples,
2119
- start: string,
2120
- end: string,
2121
- metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>
2122
- ) => Promise<boolean>;
2123
-
2124
- readonly saveWorkoutSample: (
2125
- typeIdentifier: HKWorkoutActivityType,
2126
- quantities: readonly HKQuantitySampleRawForSaving[],
2127
- start: string,
2128
- end: string,
2129
- totals: {
2130
- readonly distance?: number;
2131
- readonly energyBurned?: number;
2132
- },
2133
- metadata: HKWorkoutMetadata
2134
- ) => Promise<string | null>;
2135
-
2136
- readonly saveWorkoutRoute: (
2137
- workoutUUID: string,
2138
- locations: readonly CLLocationRawForSaving[]
2139
- ) => Promise<boolean>;
2140
-
2141
- readonly queryCorrelationSamples: <
2142
- TIdentifier extends HKCorrelationTypeIdentifier
2143
- >(
2144
- typeIdentifier: TIdentifier,
2145
- from: string,
2146
- to: string
2147
- ) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;
2148
-
2149
- subscribeToObserverQuery(
2150
- identifier: HKSampleTypeIdentifier
2151
- ): Promise<QueryId>;
2152
- unsubscribeQuery(queryId: QueryId): Promise<boolean>;
2153
- /**
2154
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus Apple Docs }
2155
- */
2156
- authorizationStatusFor(
2157
- type: HealthkitReadAuthorization
2158
- ): Promise<HKAuthorizationStatus>;
2159
- /**
2160
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/2994346-getrequeststatusforauthorization Apple Docs }
2161
- */
2162
- getRequestStatusForAuthorization(
2163
- write: WritePermissions,
2164
- read: ReadPermissions
2165
- ): Promise<HKAuthorizationRequestStatus>;
2166
- /**
2167
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs }
2168
- */
2169
- requestAuthorization(
2170
- write: WritePermissions,
2171
- read: ReadPermissions
2172
- ): Promise<boolean>;
2173
- readonly saveQuantitySample: <
2174
- TType extends HKQuantityTypeIdentifier,
2175
- TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>
2176
- >(
2177
- identifier: TType,
2178
- unit: TUnit,
2179
- value: number,
2180
- start: string,
2181
- end: string,
2182
- metadata: unknown
2183
- ) => Promise<boolean>;
2184
- readonly deleteQuantitySample: <TIdentifier extends HKQuantityTypeIdentifier>(
2185
- typeIdentifier: TIdentifier,
2186
- uuid: string
2187
- ) => Promise<boolean>;
2188
- readonly deleteSamples: <TIdentifier extends HKQuantityTypeIdentifier>(
2189
- identifier: TIdentifier,
2190
- start: string,
2191
- end: string
2192
- ) => Promise<boolean>;
2193
- readonly deleteWorkoutSample: (
2194
- uuid: string
2195
- ) => Promise<boolean>;
2196
- readonly queryWorkoutSamples: <
2197
- TEnergy extends EnergyUnit,
2198
- TDistance extends LengthUnit
2199
- >(
2200
- energyUnit: TEnergy,
2201
- distanceUnit: TDistance,
2202
- from: string,
2203
- to: string,
2204
- limit: number,
2205
- ascending: boolean
2206
- ) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;
2207
- readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(
2208
- identifier: T,
2209
- from: string,
2210
- to: string,
2211
- limit: number,
2212
- ascending: boolean
2213
- ) => Promise<readonly HKCategorySampleRaw<T>[]>;
2214
- readonly queryQuantitySamples: <
2215
- TIdentifier extends HKQuantityTypeIdentifier,
2216
- TUnit extends UnitForIdentifier<TIdentifier>
2217
- >(
2218
- identifier: TIdentifier,
2219
- unit: TUnit,
2220
- from: string,
2221
- to: string,
2222
- limit: number,
2223
- ascending: boolean
2224
- ) => Promise<readonly HKQuantitySampleRaw<TIdentifier>[]>;
2225
- readonly queryCategorySamplesWithAnchor: <T extends HKCategoryTypeIdentifier>(
2226
- identifier: T,
2227
- from: string,
2228
- to: string,
2229
- limit: number,
2230
- anchor: string
2231
- ) => Promise<QueryCategorySamplesResponseRaw<T>>;
2232
- readonly queryWorkoutSamplesWithAnchor: <
2233
- TEnergy extends EnergyUnit,
2234
- TDistance extends LengthUnit
2235
- >(
2236
- energyUnit: TEnergy,
2237
- distanceUnit: TDistance,
2238
- from: string,
2239
- to: string,
2240
- limit: number,
2241
- anchor: string
2242
- ) => Promise<QueryWorkoutSamplesWithAnchorResponseRaw<TEnergy, TDistance>>;
2243
- readonly queryQuantitySamplesWithAnchor: <
2244
- TIdentifier extends HKQuantityTypeIdentifier,
2245
- TUnit extends UnitForIdentifier<TIdentifier>
2246
- >(
2247
- identifier: TIdentifier,
2248
- unit: TUnit,
2249
- from: string,
2250
- to: string,
2251
- limit: number,
2252
- anchor: string
2253
- ) => Promise<QueryQuantitySamplesResponseRaw<TIdentifier>>;
2254
- readonly queryHeartbeatSeriesSamples: (
2255
- from: string,
2256
- to: string,
2257
- limit: number,
2258
- ascending: boolean
2259
- ) => Promise<readonly HKHeartbeatSeriesSampleRaw[]>;
2260
- readonly queryHeartbeatSeriesSamplesWithAnchor: (
2261
- from: string,
2262
- to: string,
2263
- limit: number,
2264
- anchor: string
2265
- ) => Promise<QueryHeartbeatSeriesSamplesResponseRaw>;
2266
- readonly querySources: <
2267
- TIdentifier extends HKCategoryTypeIdentifier | HKQuantityTypeIdentifier
2268
- >(
2269
- identifier: TIdentifier
2270
- ) => Promise<readonly HKSource[]>;
2271
- readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(
2272
- identifier: T,
2273
- value: HKCategoryValueForIdentifier<T>,
2274
- start: string,
2275
- end: string,
2276
- metadata: unknown
2277
- ) => Promise<boolean>;
2278
- readonly saveStateOfMindSample: (
2279
- startDate: HKStateOfMindSampleRaw['startDate'],
2280
- kind: HKStateOfMindSampleRaw['kind'],
2281
- valence: HKStateOfMindSampleRaw['valence'],
2282
- labels: HKStateOfMindSampleRaw['labels'],
2283
- associations: HKStateOfMindSampleRaw['associations'],
2284
- metadata: HKStateOfMindSampleRaw['metadata']
2285
- ) => Promise<boolean>;
2286
- readonly queryStatisticsForQuantity: <
2287
- TIdentifier extends HKQuantityTypeIdentifier,
2288
- TUnit extends UnitForIdentifier<TIdentifier>
2289
- >(
2290
- identifier: HKQuantityTypeIdentifier,
2291
- unit: TUnit,
2292
- from: string,
2293
- to: string,
2294
- options: readonly HKStatisticsOptions[]
2295
- ) => Promise<QueryStatisticsResponseRaw<TIdentifier, TUnit>>;
2296
- readonly queryStatisticsCollectionForQuantity: <
2297
- TIdentifier extends HKQuantityTypeIdentifier,
2298
- TUnit extends UnitForIdentifier<TIdentifier>
2299
- >(
2300
- identifier: TIdentifier,
2301
- unit: TUnit,
2302
- options: readonly HKStatisticsOptions[],
2303
- anchorDate: string,
2304
- intervalComponents: IntervalComponents,
2305
- startDate: string,
2306
- endDate: string
2307
- ) => Promise<readonly QueryStatisticsResponseRaw<TIdentifier, TUnit>[]>;
2308
- readonly getPreferredUnits: (
2309
- identifiers: readonly HKQuantityTypeIdentifier[]
2310
- ) => Promise<TypeToUnitMapping>;
2311
- readonly getWorkoutRoutes: (
2312
- workoutUUID: string
2313
- ) => Promise<readonly WorkoutRoute[]>;
2314
- readonly getWorkoutPlanById: (workoutUUID: string) => Promise<{readonly id: string, readonly activityType: HKWorkoutActivityType} | null>;
2315
-
2316
- /**
2317
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648358-startwatchapp Apple Docs }
2318
- */
2319
- readonly startWatchAppWithWorkoutConfiguration: (
2320
- workoutConfiguration: HKWorkoutConfiguration
2321
- ) => Promise<boolean>;
2322
-
2323
- /**
2324
- * Query state of mind samples from HealthKit
2325
- * @param from Start date to query from
2326
- * @param to End date to query to
2327
- * @param limit Maximum number of samples to return
2328
- * @param ascending Sort order of samples
2329
- * @returns Promise resolving to array of state of mind samples
2330
- * @platform ios
2331
- * @requires iOS 17.0+
2332
- */
2333
- readonly queryStateOfMindSamples: (
2334
- from: string | null,
2335
- to: string | null,
2336
- limit: number,
2337
- ascending: boolean
2338
- ) => Promise<readonly HKStateOfMindSampleRaw[]>;
2339
- };
2340
-
2341
- export enum HKStateOfMindValenceClassification {
2342
- veryUnpleasant = 1,
2343
- unpleasant = 2,
2344
- slightlyUnpleasant = 3,
2345
- neutral = 4,
2346
- slightlyPleasant = 5,
2347
- pleasant = 6,
2348
- veryPleasant = 7,
2349
- }
2350
-
2351
- export type HKStateOfMindSampleRaw = {
2352
- readonly uuid: string;
2353
- readonly device?: HKDevice;
2354
- readonly startDate: string;
2355
- readonly endDate: string;
2356
- readonly metadata?: HKGenericMetadata;
2357
- readonly sourceRevision?: HKSourceRevision;
2358
- // State of mind sample properties
2359
- /**
2360
- * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/4337998-valence Apple Docs }
2361
- * Value between -1 and 1
2362
- */
2363
- readonly valence: number;
2364
- readonly kind: HKStateOfMindKind;
2365
- readonly valenceClassification: HKStateOfMindValenceClassification;
2366
- readonly associations: readonly HKStateOfMindAssociation[];
2367
- readonly labels: readonly HKStateOfMindLabel[];
2368
- }
2369
-
2370
- const Native = NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNative
2371
-
2372
- type OnChangeCallback = ({
2373
- typeIdentifier,
2374
- }: {
2375
- readonly typeIdentifier: HKSampleTypeIdentifier;
2376
- }) => void;
2377
- type OnRemoteWorkoutStateChangeCallback = (event: WorkoutStateChangeEvent) => void;
2378
- type OnRemoteWorkoutErrorCallback = (event: WorkoutErrorEvent) => void;
2379
- type OnRemoteWorkoutDataCallback = (event: WorkoutDataReceivedEvent) => void;
2380
- type OnRemoteWorkoutEventReceivedCallback = (event: WorkoutEventReceivedEvent) => void;
2381
-
2382
- interface HealthkitEventEmitter extends NativeEventEmitter {
2383
- readonly addListener: (
2384
- eventType: 'onChange' | 'onRemoteWorkoutStateChange' | 'onRemoteWorkoutError' | 'onRemoteWorkoutDataReceived' | 'onRemoteWorkoutEventReceived',
2385
- callback: OnChangeCallback | OnRemoteWorkoutStateChangeCallback | OnRemoteWorkoutErrorCallback | OnRemoteWorkoutDataCallback | OnRemoteWorkoutEventReceivedCallback
2386
- ) => EmitterSubscription;
2387
- }
2388
-
2389
- export const EventEmitter = new NativeEventEmitter(
2390
- NativeModules.ReactNativeHealthkit as NativeModule,
2391
- ) as HealthkitEventEmitter
2392
-
2393
- export default Native
2394
-
2395
- /**
2396
- * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/label Apple Docs}
2397
- */
2398
- export enum HKStateOfMindLabel {
2399
- amazed = 1,
2400
- amused = 2,
2401
- angry = 3,
2402
- anxious = 4,
2403
- ashamed = 5,
2404
- brave = 6,
2405
- calm = 7,
2406
- content = 8,
2407
- disappointed = 9,
2408
- discouraged = 10,
2409
- disgusted = 11,
2410
- embarrassed = 12,
2411
- excited = 13,
2412
- frustrated = 14,
2413
- grateful = 15,
2414
- guilty = 16,
2415
- happy = 17,
2416
- hopeless = 18,
2417
- irritated = 19,
2418
- jealous = 20,
2419
- joyful = 21,
2420
- lonely = 22,
2421
- passionate = 23,
2422
- peaceful = 24,
2423
- proud = 25,
2424
- relieved = 26,
2425
- sad = 27,
2426
- scared = 28,
2427
- stressed = 29,
2428
- surprised = 30,
2429
- worried = 31,
2430
-
2431
- annoyed = 32,
2432
- confident = 33,
2433
- drained = 34,
2434
- hopeful = 35,
2435
- indifferent = 36,
2436
- overwhelmed = 37,
2437
- satisfied = 38,
2438
- }
2439
-
2440
- /**
2441
- * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/kind Apple Docs}
2442
- */
2443
- export enum HKStateOfMindKind {
2444
- dailyMood = 2,
2445
- momentaryEmotion = 1
2446
- }
2447
-
2448
- /**
2449
- * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/association Apple Docs}
2450
- * @since iOS 17.0+
2451
- */
2452
- export enum HKStateOfMindAssociation {
2453
- community = 1,
2454
- currentEvents = 2,
2455
- dating = 3,
2456
- education = 4,
2457
- family = 5,
2458
- fitness = 6,
2459
- friends = 7,
2460
- health = 8,
2461
- hobbies = 9,
2462
- identity = 10,
2463
- money = 11,
2464
- partner = 12,
2465
- selfCare = 13,
2466
- spirituality = 14,
2467
- tasks = 15,
2468
- travel = 16,
2469
- work = 17,
2470
- weather = 18,
2471
- }