@kingstinct/react-native-healthkit 9.0.1 → 9.0.2

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 (439) hide show
  1. package/README.md +10 -10
  2. package/app.plugin.js +0 -1
  3. package/lib/commonjs/hooks/useCategorySampleById.js +36 -0
  4. package/lib/commonjs/hooks/useHealthkitAuthorization.js +34 -0
  5. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +23 -0
  6. package/lib/commonjs/hooks/useMostRecentCategorySample.js +21 -0
  7. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +22 -0
  8. package/lib/commonjs/hooks/useMostRecentWorkout.js +31 -0
  9. package/lib/commonjs/hooks/useQuantitySampleById.js +34 -0
  10. package/lib/commonjs/hooks/useSources.js +17 -0
  11. package/lib/commonjs/hooks/useStatisticsForQuantity.js +26 -0
  12. package/lib/commonjs/hooks/useSubscribeToChanges.js +20 -0
  13. package/lib/commonjs/hooks/useWorkoutById.js +46 -0
  14. package/lib/commonjs/index.ios.js +144 -0
  15. package/lib/commonjs/index.js +210 -0
  16. package/lib/commonjs/modules.js +12 -0
  17. package/lib/commonjs/specs/CategoryTypeModule.nitro.js +5 -0
  18. package/lib/commonjs/specs/CharacteristicTypeModule.nitro.js +2 -0
  19. package/lib/commonjs/specs/CoreModule.nitro.js +2 -0
  20. package/lib/commonjs/specs/CorrelationTypeModule.nitro.js +2 -0
  21. package/lib/commonjs/specs/HeartbeatSeriesModule.nitro.js +2 -0
  22. package/lib/commonjs/specs/QuantityTypeModule.nitro.js +2 -0
  23. package/lib/commonjs/specs/SourceProxy.nitro.js +2 -0
  24. package/lib/commonjs/specs/StateOfMindModule.nitro.js +2 -0
  25. package/lib/commonjs/specs/WorkoutProxy.nitro.js +2 -0
  26. package/lib/commonjs/specs/WorkoutSessionModule.nitro.js +19 -0
  27. package/lib/commonjs/specs/WorkoutsModule.nitro.js +2 -0
  28. package/lib/commonjs/types/Auth.js +21 -0
  29. package/lib/commonjs/types/Background.js +13 -0
  30. package/lib/commonjs/types/CategoryType.js +101 -0
  31. package/lib/commonjs/types/CategoryTypeIdentifier.js +2 -0
  32. package/lib/commonjs/types/Characteristics.js +48 -0
  33. package/lib/commonjs/types/Constants.js +23 -0
  34. package/lib/commonjs/types/CorrelationType.js +2 -0
  35. package/lib/commonjs/types/Device.js +2 -0
  36. package/lib/commonjs/types/HeartbeatSeries.js +2 -0
  37. package/lib/commonjs/types/InterfaceVerification.js +24 -0
  38. package/lib/commonjs/types/InterfaceVerificationExample.js +33 -0
  39. package/lib/commonjs/types/QuantitySample.js +2 -0
  40. package/lib/commonjs/types/QuantityType.js +17 -0
  41. package/lib/commonjs/types/QuantityTypeIdentifier.js +2 -0
  42. package/lib/commonjs/types/QueryOptions.js +2 -0
  43. package/lib/commonjs/types/Shared.js +13 -0
  44. package/lib/commonjs/types/Source.js +2 -0
  45. package/lib/commonjs/types/StateOfMind.js +90 -0
  46. package/lib/commonjs/types/Subscriptons.js +2 -0
  47. package/lib/commonjs/types/Units.js +2 -0
  48. package/lib/commonjs/types/WeatherCondition.js +35 -0
  49. package/lib/commonjs/types/WorkoutKit.js +12 -0
  50. package/lib/commonjs/types/Workouts.js +150 -0
  51. package/lib/commonjs/utils/getCategorySampleById.js +12 -0
  52. package/lib/commonjs/utils/getMostRecentCategorySample.js +12 -0
  53. package/lib/commonjs/utils/getMostRecentQuantitySample.js +11 -0
  54. package/lib/commonjs/utils/getMostRecentWorkout.js +13 -0
  55. package/lib/commonjs/utils/getPreferredUnit.js +12 -0
  56. package/lib/commonjs/utils/getQuantitySampleById.js +14 -0
  57. package/lib/commonjs/utils/getWorkoutById.js +15 -0
  58. package/lib/commonjs/utils/subscribeToChanges.js +11 -0
  59. package/lib/module/hooks/useCategorySampleById.js +30 -0
  60. package/lib/module/hooks/useHealthkitAuthorization.js +30 -0
  61. package/lib/module/hooks/useIsHealthDataAvailable.js +19 -0
  62. package/lib/module/hooks/useMostRecentCategorySample.js +15 -0
  63. package/lib/module/hooks/useMostRecentQuantitySample.js +16 -0
  64. package/lib/module/hooks/useMostRecentWorkout.js +25 -0
  65. package/lib/module/hooks/useQuantitySampleById.js +28 -0
  66. package/lib/module/hooks/useSources.js +14 -0
  67. package/lib/module/hooks/useStatisticsForQuantity.js +20 -0
  68. package/lib/module/hooks/useSubscribeToChanges.js +17 -0
  69. package/lib/module/hooks/useWorkoutById.js +40 -0
  70. package/lib/module/index.ios.js +126 -0
  71. package/lib/module/index.js +202 -0
  72. package/lib/module/modules.js +9 -0
  73. package/lib/module/specs/CategoryTypeModule.nitro.js +4 -0
  74. package/lib/module/specs/CharacteristicTypeModule.nitro.js +1 -0
  75. package/lib/module/specs/CoreModule.nitro.js +1 -0
  76. package/lib/module/specs/CorrelationTypeModule.nitro.js +1 -0
  77. package/lib/module/specs/HeartbeatSeriesModule.nitro.js +1 -0
  78. package/lib/module/specs/QuantityTypeModule.nitro.js +1 -0
  79. package/lib/module/specs/SourceProxy.nitro.js +1 -0
  80. package/lib/module/specs/StateOfMindModule.nitro.js +1 -0
  81. package/lib/module/specs/WorkoutProxy.nitro.js +1 -0
  82. package/lib/module/specs/WorkoutSessionModule.nitro.js +16 -0
  83. package/lib/module/specs/WorkoutsModule.nitro.js +1 -0
  84. package/lib/module/types/Auth.js +18 -0
  85. package/lib/module/types/Background.js +10 -0
  86. package/lib/module/types/CategoryType.js +98 -0
  87. package/lib/module/types/CategoryTypeIdentifier.js +1 -0
  88. package/lib/module/types/Characteristics.js +45 -0
  89. package/lib/module/types/Constants.js +20 -0
  90. package/lib/module/types/CorrelationType.js +1 -0
  91. package/lib/module/types/Device.js +1 -0
  92. package/lib/module/types/HeartbeatSeries.js +1 -0
  93. package/lib/module/types/InterfaceVerification.js +23 -0
  94. package/lib/module/types/InterfaceVerificationExample.js +32 -0
  95. package/lib/module/types/QuantitySample.js +1 -0
  96. package/lib/module/types/QuantityType.js +14 -0
  97. package/lib/module/types/QuantityTypeIdentifier.js +1 -0
  98. package/lib/module/types/QueryOptions.js +1 -0
  99. package/lib/module/types/Shared.js +10 -0
  100. package/lib/module/types/Source.js +1 -0
  101. package/lib/module/types/StateOfMind.js +87 -0
  102. package/lib/module/types/Subscriptons.js +1 -0
  103. package/lib/module/types/Units.js +1 -0
  104. package/lib/module/types/WeatherCondition.js +32 -0
  105. package/lib/module/types/WorkoutKit.js +9 -0
  106. package/lib/module/types/Workouts.js +147 -0
  107. package/lib/module/utils/getCategorySampleById.js +9 -0
  108. package/lib/module/utils/getMostRecentCategorySample.js +9 -0
  109. package/lib/module/utils/getMostRecentQuantitySample.js +9 -0
  110. package/lib/module/utils/getMostRecentWorkout.js +11 -0
  111. package/lib/module/utils/getPreferredUnit.js +10 -0
  112. package/lib/module/utils/getQuantitySampleById.js +12 -0
  113. package/lib/module/utils/getWorkoutById.js +13 -0
  114. package/lib/module/utils/subscribeToChanges.js +7 -0
  115. package/lib/typescript/hooks/useCategorySampleById.d.ts +11 -0
  116. package/lib/typescript/hooks/useHealthkitAuthorization.d.ts +9 -0
  117. package/lib/typescript/hooks/useIsHealthDataAvailable.d.ts +7 -0
  118. package/lib/typescript/hooks/useMostRecentCategorySample.d.ts +7 -0
  119. package/lib/typescript/hooks/useMostRecentQuantitySample.d.ts +7 -0
  120. package/lib/typescript/hooks/useMostRecentWorkout.d.ts +9 -0
  121. package/lib/typescript/hooks/useQuantitySampleById.d.ts +14 -0
  122. package/lib/typescript/hooks/useSources.d.ts +4 -0
  123. package/lib/typescript/hooks/useStatisticsForQuantity.d.ts +4 -0
  124. package/lib/typescript/hooks/useSubscribeToChanges.d.ts +4 -0
  125. package/lib/typescript/hooks/useWorkoutById.d.ts +13 -0
  126. package/lib/typescript/index.d.ts +74 -0
  127. package/lib/typescript/index.ios.d.ts +142 -0
  128. package/lib/typescript/modules.d.ts +16 -0
  129. package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +16 -0
  130. package/lib/typescript/specs/CharacteristicTypeModule.nitro.d.ts +16 -0
  131. package/lib/typescript/specs/CoreModule.nitro.d.ts +60 -0
  132. package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +8 -0
  133. package/lib/typescript/specs/HeartbeatSeriesModule.nitro.d.ts +9 -0
  134. package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +16 -0
  135. package/lib/typescript/specs/SourceProxy.nitro.d.ts +14 -0
  136. package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +9 -0
  137. package/lib/typescript/specs/WorkoutProxy.nitro.d.ts +10 -0
  138. package/lib/typescript/specs/WorkoutSessionModule.nitro.d.ts +47 -0
  139. package/lib/typescript/specs/WorkoutsModule.nitro.d.ts +13 -0
  140. package/lib/typescript/types/Auth.d.ts +16 -0
  141. package/lib/typescript/types/Background.d.ts +9 -0
  142. package/lib/typescript/types/CategoryType.d.ts +144 -0
  143. package/lib/typescript/types/CategoryTypeIdentifier.d.ts +31 -0
  144. package/lib/typescript/types/Characteristics.d.ts +41 -0
  145. package/lib/typescript/types/Constants.d.ts +20 -0
  146. package/lib/typescript/types/CorrelationType.d.ts +21 -0
  147. package/lib/typescript/types/Device.d.ts +13 -0
  148. package/lib/typescript/types/HeartbeatSeries.d.ts +25 -0
  149. package/lib/typescript/types/InterfaceVerification.d.ts +73 -0
  150. package/lib/typescript/types/InterfaceVerificationExample.d.ts +58 -0
  151. package/lib/typescript/types/QuantitySample.d.ts +27 -0
  152. package/lib/typescript/types/QuantityType.d.ts +63 -0
  153. package/lib/typescript/types/QuantityTypeIdentifier.d.ts +659 -0
  154. package/lib/typescript/types/QueryOptions.d.ts +47 -0
  155. package/lib/typescript/types/Shared.d.ts +39 -0
  156. package/lib/typescript/types/Source.d.ts +10 -0
  157. package/lib/typescript/types/StateOfMind.d.ts +103 -0
  158. package/lib/typescript/types/Subscriptons.d.ts +8 -0
  159. package/lib/typescript/types/Units.d.ts +97 -0
  160. package/lib/typescript/types/WeatherCondition.d.ts +30 -0
  161. package/lib/typescript/types/WorkoutKit.d.ts +16 -0
  162. package/lib/typescript/types/Workouts.d.ts +254 -0
  163. package/lib/typescript/utils/getCategorySampleById.d.ts +3 -0
  164. package/lib/typescript/utils/getMostRecentCategorySample.d.ts +3 -0
  165. package/lib/typescript/utils/getMostRecentQuantitySample.d.ts +3 -0
  166. package/lib/typescript/utils/getMostRecentWorkout.d.ts +3 -0
  167. package/lib/typescript/utils/getPreferredUnit.d.ts +3 -0
  168. package/lib/typescript/utils/getQuantitySampleById.d.ts +3 -0
  169. package/lib/typescript/utils/getWorkoutById.d.ts +3 -0
  170. package/lib/typescript/utils/subscribeToChanges.d.ts +5 -0
  171. package/nitrogen/generated/.gitattributes +1 -0
  172. package/nitrogen/generated/ios/ReactNativeHealthkit+autolinking.rb +60 -0
  173. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +450 -0
  174. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +2570 -0
  175. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +326 -0
  176. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +89 -0
  177. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +130 -0
  178. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.cpp +11 -0
  179. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +146 -0
  180. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.cpp +11 -0
  181. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +155 -0
  182. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.cpp +11 -0
  183. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +300 -0
  184. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.cpp +11 -0
  185. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +120 -0
  186. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.cpp +11 -0
  187. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +138 -0
  188. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.cpp +11 -0
  189. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +196 -0
  190. package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.cpp +11 -0
  191. package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.hpp +77 -0
  192. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.cpp +11 -0
  193. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +138 -0
  194. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.cpp +11 -0
  195. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +196 -0
  196. package/nitrogen/generated/ios/c++/HybridWorkoutSessionModuleSpecSwift.cpp +11 -0
  197. package/nitrogen/generated/ios/c++/HybridWorkoutSessionModuleSpecSwift.hpp +107 -0
  198. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.cpp +11 -0
  199. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +172 -0
  200. package/nitrogen/generated/ios/swift/AuthorizationRequestStatus.swift +44 -0
  201. package/nitrogen/generated/ios/swift/AuthorizationStatus.swift +44 -0
  202. package/nitrogen/generated/ios/swift/BiologicalSex.swift +48 -0
  203. package/nitrogen/generated/ios/swift/BloodType.swift +68 -0
  204. package/nitrogen/generated/ios/swift/CategorySample.swift +148 -0
  205. package/nitrogen/generated/ios/swift/CategorySampleForSaving.swift +108 -0
  206. package/nitrogen/generated/ios/swift/CategorySamplesWithAnchorResponse.swift +81 -0
  207. package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +288 -0
  208. package/nitrogen/generated/ios/swift/ComparisonPredicateOperator.swift +88 -0
  209. package/nitrogen/generated/ios/swift/CorrelationObject.swift +16 -0
  210. package/nitrogen/generated/ios/swift/CorrelationSample.swift +117 -0
  211. package/nitrogen/generated/ios/swift/CorrelationTypeIdentifier.swift +40 -0
  212. package/nitrogen/generated/ios/swift/DeletedSample.swift +64 -0
  213. package/nitrogen/generated/ios/swift/Device.swift +256 -0
  214. package/nitrogen/generated/ios/swift/FilterForSamples.swift +21 -0
  215. package/nitrogen/generated/ios/swift/FilterForSamplesAnd.swift +94 -0
  216. package/nitrogen/generated/ios/swift/FilterForSamplesOr.swift +94 -0
  217. package/nitrogen/generated/ios/swift/FitzpatrickSkinType.swift +60 -0
  218. package/nitrogen/generated/ios/swift/Func_void_AuthorizationRequestStatus.swift +46 -0
  219. package/nitrogen/generated/ios/swift/Func_void_BiologicalSex.swift +46 -0
  220. package/nitrogen/generated/ios/swift/Func_void_BloodType.swift +46 -0
  221. package/nitrogen/generated/ios/swift/Func_void_CategorySamplesWithAnchorResponse.swift +46 -0
  222. package/nitrogen/generated/ios/swift/Func_void_FitzpatrickSkinType.swift +46 -0
  223. package/nitrogen/generated/ios/swift/Func_void_HeartbeatSeriesSamplesWithAnchorResponse.swift +46 -0
  224. package/nitrogen/generated/ios/swift/Func_void_OnChangeCallbackArgs.swift +46 -0
  225. package/nitrogen/generated/ios/swift/Func_void_QuantitySamplesWithAnchorResponse.swift +46 -0
  226. package/nitrogen/generated/ios/swift/Func_void_QueryStatisticsResponse.swift +46 -0
  227. package/nitrogen/generated/ios/swift/Func_void_QueryWorkoutSamplesWithAnchorResponse.swift +46 -0
  228. package/nitrogen/generated/ios/swift/Func_void_WheelchairUse.swift +46 -0
  229. package/nitrogen/generated/ios/swift/Func_void_WorkoutEventType.swift +46 -0
  230. package/nitrogen/generated/ios/swift/Func_void_WorkoutSessionState_WorkoutSessionState_std__chrono__system_clock__time_point.swift +46 -0
  231. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  232. package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
  233. package/nitrogen/generated/ios/swift/Func_void_std__chrono__system_clock__time_point.swift +46 -0
  234. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  235. package/nitrogen/generated/ios/swift/Func_void_std__optional_WorkoutPlan_.swift +52 -0
  236. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  237. package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__bool_.swift +54 -0
  238. package/nitrogen/generated/ios/swift/Func_void_std__vector_CategorySample_.swift +46 -0
  239. package/nitrogen/generated/ios/swift/Func_void_std__vector_CorrelationSample_.swift +46 -0
  240. package/nitrogen/generated/ios/swift/Func_void_std__vector_HeartbeatSeriesSample_.swift +46 -0
  241. package/nitrogen/generated/ios/swift/Func_void_std__vector_IdentifierWithUnit_.swift +46 -0
  242. package/nitrogen/generated/ios/swift/Func_void_std__vector_QuantitySample_.swift +46 -0
  243. package/nitrogen/generated/ios/swift/Func_void_std__vector_QueryStatisticsResponse_.swift +46 -0
  244. package/nitrogen/generated/ios/swift/Func_void_std__vector_RemoteSessionSharableData_.swift +46 -0
  245. package/nitrogen/generated/ios/swift/Func_void_std__vector_StateOfMindSample_.swift +46 -0
  246. package/nitrogen/generated/ios/swift/Func_void_std__vector_WorkoutRoute_.swift +46 -0
  247. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridSourceProxySpec__.swift +50 -0
  248. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec__.swift +50 -0
  249. package/nitrogen/generated/ios/swift/Heartbeat.swift +46 -0
  250. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +167 -0
  251. package/nitrogen/generated/ios/swift/HeartbeatSeriesSamplesWithAnchorResponse.swift +81 -0
  252. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +50 -0
  253. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +171 -0
  254. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +57 -0
  255. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +257 -0
  256. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +69 -0
  257. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +523 -0
  258. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +49 -0
  259. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +158 -0
  260. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +49 -0
  261. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +152 -0
  262. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +54 -0
  263. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +285 -0
  264. package/nitrogen/generated/ios/swift/HybridSourceProxySpec.swift +48 -0
  265. package/nitrogen/generated/ios/swift/HybridSourceProxySpec_cxx.swift +125 -0
  266. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +49 -0
  267. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +158 -0
  268. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +64 -0
  269. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +351 -0
  270. package/nitrogen/generated/ios/swift/HybridWorkoutSessionModuleSpec.swift +49 -0
  271. package/nitrogen/generated/ios/swift/HybridWorkoutSessionModuleSpec_cxx.swift +133 -0
  272. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec.swift +51 -0
  273. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec_cxx.swift +187 -0
  274. package/nitrogen/generated/ios/swift/IdentifierWithUnit.swift +46 -0
  275. package/nitrogen/generated/ios/swift/IntervalComponents.swift +139 -0
  276. package/nitrogen/generated/ios/swift/LocationForSaving.swift +112 -0
  277. package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +820 -0
  278. package/nitrogen/generated/ios/swift/OnChangeCallbackArgs.swift +64 -0
  279. package/nitrogen/generated/ios/swift/PredicateForSamples.swift +19 -0
  280. package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +21 -0
  281. package/nitrogen/generated/ios/swift/PredicateForWorkoutsAnd.swift +108 -0
  282. package/nitrogen/generated/ios/swift/PredicateForWorkoutsOr.swift +108 -0
  283. package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +45 -0
  284. package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +35 -0
  285. package/nitrogen/generated/ios/swift/PredicateWithStartAndEnd.swift +128 -0
  286. package/nitrogen/generated/ios/swift/PredicateWithUUID.swift +35 -0
  287. package/nitrogen/generated/ios/swift/PredicateWithUUIDs.swift +47 -0
  288. package/nitrogen/generated/ios/swift/Quantity.swift +46 -0
  289. package/nitrogen/generated/ios/swift/QuantityDateInterval.swift +46 -0
  290. package/nitrogen/generated/ios/swift/QuantitySample.swift +159 -0
  291. package/nitrogen/generated/ios/swift/QuantitySampleForSaving.swift +119 -0
  292. package/nitrogen/generated/ios/swift/QuantitySamplesWithAnchorResponse.swift +81 -0
  293. package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +508 -0
  294. package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +166 -0
  295. package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +195 -0
  296. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +160 -0
  297. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +189 -0
  298. package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +227 -0
  299. package/nitrogen/generated/ios/swift/QueryWorkoutSamplesWithAnchorResponse.swift +91 -0
  300. package/nitrogen/generated/ios/swift/RemoteSessionSharableData.swift +46 -0
  301. package/nitrogen/generated/ios/swift/SampleForSaving.swift +16 -0
  302. package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +792 -0
  303. package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +772 -0
  304. package/nitrogen/generated/ios/swift/Source.swift +46 -0
  305. package/nitrogen/generated/ios/swift/SourceRevision.swift +150 -0
  306. package/nitrogen/generated/ios/swift/StateOfMindAssociation.swift +104 -0
  307. package/nitrogen/generated/ios/swift/StateOfMindKind.swift +40 -0
  308. package/nitrogen/generated/ios/swift/StateOfMindLabel.swift +184 -0
  309. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +223 -0
  310. package/nitrogen/generated/ios/swift/StateOfMindValenceClassification.swift +60 -0
  311. package/nitrogen/generated/ios/swift/StatisticsOptions.swift +60 -0
  312. package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +129 -0
  313. package/nitrogen/generated/ios/swift/UpdateFrequency.swift +48 -0
  314. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout.swift +19 -0
  315. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +21 -0
  316. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +23 -0
  317. package/nitrogen/generated/ios/swift/WheelchairUse.swift +44 -0
  318. package/nitrogen/generated/ios/swift/WorkoutActivity.swift +68 -0
  319. package/nitrogen/generated/ios/swift/WorkoutActivityType.swift +368 -0
  320. package/nitrogen/generated/ios/swift/WorkoutActivityTypePredicate.swift +35 -0
  321. package/nitrogen/generated/ios/swift/WorkoutConfiguration.swift +58 -0
  322. package/nitrogen/generated/ios/swift/WorkoutDurationPredicate.swift +46 -0
  323. package/nitrogen/generated/ios/swift/WorkoutEvent.swift +57 -0
  324. package/nitrogen/generated/ios/swift/WorkoutEventType.swift +64 -0
  325. package/nitrogen/generated/ios/swift/WorkoutPlan.swift +46 -0
  326. package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +232 -0
  327. package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +238 -0
  328. package/nitrogen/generated/ios/swift/WorkoutRoute.swift +99 -0
  329. package/nitrogen/generated/ios/swift/WorkoutRouteLocation.swift +146 -0
  330. package/nitrogen/generated/ios/swift/WorkoutSample.swift +364 -0
  331. package/nitrogen/generated/ios/swift/WorkoutSessionLocationType.swift +44 -0
  332. package/nitrogen/generated/ios/swift/WorkoutSessionMirroringStartHandlerOptions.swift +118 -0
  333. package/nitrogen/generated/ios/swift/WorkoutSessionState.swift +56 -0
  334. package/nitrogen/generated/ios/swift/WorkoutTotals.swift +70 -0
  335. package/nitrogen/generated/shared/c++/AuthorizationRequestStatus.hpp +65 -0
  336. package/nitrogen/generated/shared/c++/AuthorizationStatus.hpp +65 -0
  337. package/nitrogen/generated/shared/c++/BiologicalSex.hpp +66 -0
  338. package/nitrogen/generated/shared/c++/BloodType.hpp +71 -0
  339. package/nitrogen/generated/shared/c++/CategorySample.hpp +110 -0
  340. package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +98 -0
  341. package/nitrogen/generated/shared/c++/CategorySamplesWithAnchorResponse.hpp +83 -0
  342. package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +326 -0
  343. package/nitrogen/generated/shared/c++/ComparisonPredicateOperator.hpp +76 -0
  344. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +98 -0
  345. package/nitrogen/generated/shared/c++/CorrelationTypeIdentifier.hpp +78 -0
  346. package/nitrogen/generated/shared/c++/DeletedSample.hpp +76 -0
  347. package/nitrogen/generated/shared/c++/Device.hpp +98 -0
  348. package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +84 -0
  349. package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +84 -0
  350. package/nitrogen/generated/shared/c++/FitzpatrickSkinType.hpp +69 -0
  351. package/nitrogen/generated/shared/c++/Heartbeat.hpp +73 -0
  352. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +107 -0
  353. package/nitrogen/generated/shared/c++/HeartbeatSeriesSamplesWithAnchorResponse.hpp +83 -0
  354. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.cpp +23 -0
  355. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +84 -0
  356. package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.cpp +30 -0
  357. package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.hpp +83 -0
  358. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +42 -0
  359. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +140 -0
  360. package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.cpp +22 -0
  361. package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +80 -0
  362. package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.cpp +22 -0
  363. package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +76 -0
  364. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.cpp +27 -0
  365. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +123 -0
  366. package/nitrogen/generated/shared/c++/HybridSourceProxySpec.cpp +22 -0
  367. package/nitrogen/generated/shared/c++/HybridSourceProxySpec.hpp +65 -0
  368. package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.cpp +22 -0
  369. package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +83 -0
  370. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +38 -0
  371. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +114 -0
  372. package/nitrogen/generated/shared/c++/HybridWorkoutSessionModuleSpec.cpp +22 -0
  373. package/nitrogen/generated/shared/c++/HybridWorkoutSessionModuleSpec.hpp +68 -0
  374. package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.cpp +24 -0
  375. package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.hpp +95 -0
  376. package/nitrogen/generated/shared/c++/IdentifierWithUnit.hpp +73 -0
  377. package/nitrogen/generated/shared/c++/IntervalComponents.hpp +85 -0
  378. package/nitrogen/generated/shared/c++/LocationForSaving.hpp +97 -0
  379. package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +858 -0
  380. package/nitrogen/generated/shared/c++/OnChangeCallbackArgs.hpp +76 -0
  381. package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +90 -0
  382. package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +90 -0
  383. package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +71 -0
  384. package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +69 -0
  385. package/nitrogen/generated/shared/c++/PredicateWithStartAndEnd.hpp +82 -0
  386. package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +69 -0
  387. package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +70 -0
  388. package/nitrogen/generated/shared/c++/Quantity.hpp +73 -0
  389. package/nitrogen/generated/shared/c++/QuantityDateInterval.hpp +73 -0
  390. package/nitrogen/generated/shared/c++/QuantitySample.hpp +114 -0
  391. package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +103 -0
  392. package/nitrogen/generated/shared/c++/QuantitySamplesWithAnchorResponse.hpp +83 -0
  393. package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +546 -0
  394. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +99 -0
  395. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +103 -0
  396. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +98 -0
  397. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +103 -0
  398. package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +98 -0
  399. package/nitrogen/generated/shared/c++/QueryWorkoutSamplesWithAnchorResponse.hpp +84 -0
  400. package/nitrogen/generated/shared/c++/RemoteSessionSharableData.hpp +75 -0
  401. package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +830 -0
  402. package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +810 -0
  403. package/nitrogen/generated/shared/c++/Source.hpp +73 -0
  404. package/nitrogen/generated/shared/c++/SourceRevision.hpp +85 -0
  405. package/nitrogen/generated/shared/c++/StateOfMindAssociation.hpp +80 -0
  406. package/nitrogen/generated/shared/c++/StateOfMindKind.hpp +64 -0
  407. package/nitrogen/generated/shared/c++/StateOfMindLabel.hpp +100 -0
  408. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +132 -0
  409. package/nitrogen/generated/shared/c++/StateOfMindValenceClassification.hpp +69 -0
  410. package/nitrogen/generated/shared/c++/StatisticsOptions.hpp +98 -0
  411. package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +89 -0
  412. package/nitrogen/generated/shared/c++/UpdateFrequency.hpp +66 -0
  413. package/nitrogen/generated/shared/c++/WheelchairUse.hpp +65 -0
  414. package/nitrogen/generated/shared/c++/WorkoutActivity.hpp +82 -0
  415. package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +146 -0
  416. package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +70 -0
  417. package/nitrogen/generated/shared/c++/WorkoutConfiguration.hpp +78 -0
  418. package/nitrogen/generated/shared/c++/WorkoutDurationPredicate.hpp +74 -0
  419. package/nitrogen/generated/shared/c++/WorkoutEvent.hpp +79 -0
  420. package/nitrogen/generated/shared/c++/WorkoutEventType.hpp +70 -0
  421. package/nitrogen/generated/shared/c++/WorkoutPlan.hpp +75 -0
  422. package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +113 -0
  423. package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +113 -0
  424. package/nitrogen/generated/shared/c++/WorkoutRoute.hpp +81 -0
  425. package/nitrogen/generated/shared/c++/WorkoutRouteLocation.hpp +106 -0
  426. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +144 -0
  427. package/nitrogen/generated/shared/c++/WorkoutSessionLocationType.hpp +65 -0
  428. package/nitrogen/generated/shared/c++/WorkoutSessionMirroringStartHandlerOptions.hpp +92 -0
  429. package/nitrogen/generated/shared/c++/WorkoutSessionState.hpp +68 -0
  430. package/nitrogen/generated/shared/c++/WorkoutTotals.hpp +73 -0
  431. package/package.json +35 -12
  432. package/src/hooks/useCategorySampleById.ts +41 -0
  433. package/src/hooks/useQuantitySampleById.ts +44 -0
  434. package/src/hooks/useWorkoutById.ts +55 -0
  435. package/src/index.ios.ts +1 -9
  436. package/src/index.ts +4 -16
  437. package/src/utils/getCategorySampleById.ts +16 -0
  438. package/src/utils/getQuantitySampleById.ts +20 -0
  439. package/src/utils/getWorkoutById.ts +20 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Represents a workout type identifier.
3
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkworkouttypeidentifier Apple Docs HKWorkoutTypeIdentifier}
4
+ */
5
+ export const WorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier';
6
+ /**
7
+ * Represents a workout route type identifier.
8
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKWorkoutRouteTypeIdentifier Apple Docs WorkoutRouteTypeIdentifier}
9
+ */
10
+ export const WorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier';
11
+ /**
12
+ * Represents a state of mind type identifier.
13
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmindtype Apple Docs HKStateOfMindType}
14
+ */
15
+ export const StateOfMindTypeIdentifier = 'HKStateOfMindTypeIdentifier';
16
+ /**
17
+ * Represents a series sample containing heartbeat data..
18
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKDataTypeIdentifierHeartbeatSeries Apple Docs DataTypeIdentifierHeartbeatSeries}
19
+ */
20
+ export const HeartbeatSeriesTypeIdentifier = 'HKDataTypeIdentifierHeartbeatSeries';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * TypeScript utility types for verifying that two interfaces have matching method signatures.
3
+ *
4
+ * This is particularly useful for ensuring that typed and untyped versions of interfaces
5
+ * stay in sync when one has generics and the other doesn't.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import type { InterfaceAssertion } from "./InterfaceVerification";
10
+ *
11
+ * interface BaseModule extends HybridObject<{ ios: "swift" }> {
12
+ * getData(id: string): Promise<string>;
13
+ * }
14
+ *
15
+ * interface BaseModuleTyped {
16
+ * getData<T extends string>(id: T): Promise<string>;
17
+ * }
18
+ *
19
+ * // This will cause a TypeScript error if the interfaces don't match
20
+ * const _verification: InterfaceAssertion<BaseModule, BaseModuleTyped, keyof HybridObject> = true;
21
+ * ```
22
+ */
23
+ export {};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Example usage of the InterfaceVerification utility
3
+ *
4
+ * This file demonstrates how to use the reusable interface verification utility
5
+ * to ensure that typed and untyped versions of interfaces stay in sync.
6
+ */
7
+ // Verification: This will cause a TypeScript error if the interfaces don't match
8
+ const _exampleVerification = true;
9
+ // Verification for optional parameters
10
+ const _configVerification = true;
11
+ export {};
12
+ // This will show a TypeScript error indicating the mismatch
13
+ // Uncomment to see the error:
14
+ // const _badVerification: InterfaceAssertion<BadModule, BadModuleTyped, keyof HybridObject> = true;
15
+ /**
16
+ * Usage Instructions:
17
+ *
18
+ * 1. Import the InterfaceAssertion type from InterfaceVerification
19
+ * 2. Create your base interface (extending HybridObject)
20
+ * 3. Create your typed interface (with generics)
21
+ * 4. Add a verification line:
22
+ * const _verification: InterfaceAssertion<BaseInterface, TypedInterface, keyof HybridObject> = true;
23
+ *
24
+ * The verification will:
25
+ * - Check that both interfaces have the same method names
26
+ * - Check that corresponding methods have the same number of parameters
27
+ * - Show descriptive TypeScript errors if there are mismatches
28
+ *
29
+ * Error Types:
30
+ * - "Interface mismatch detected" - method names don't match
31
+ * - "Parameter count mismatch detected" - parameter counts don't match
32
+ */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason Apple Docs }
3
+ */
4
+ export var InsulinDeliveryReason;
5
+ (function (InsulinDeliveryReason) {
6
+ InsulinDeliveryReason[InsulinDeliveryReason["basal"] = 1] = "basal";
7
+ InsulinDeliveryReason[InsulinDeliveryReason["bolus"] = 2] = "bolus";
8
+ })(InsulinDeliveryReason || (InsulinDeliveryReason = {}));
9
+ export var HeartRateMotionContext;
10
+ (function (HeartRateMotionContext) {
11
+ HeartRateMotionContext[HeartRateMotionContext["active"] = 2] = "active";
12
+ HeartRateMotionContext[HeartRateMotionContext["notSet"] = 0] = "notSet";
13
+ HeartRateMotionContext[HeartRateMotionContext["sedentary"] = 1] = "sedentary";
14
+ })(HeartRateMotionContext || (HeartRateMotionContext = {}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Represents a type that identifies activity summary objects.
3
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkactivitysummarytype Apple Docs HKActivitySummaryType}
4
+ */
5
+ export const ActivitySummaryTypeIdentifier = 'ActivitySummaryTypeIdentifier';
6
+ /**
7
+ * Represents an audiogram type identifier.
8
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKAudiogramSampleType Apple Docs HKAudiogramSampleType}
9
+ */
10
+ export const AudiogramTypeIdentifier = 'HKAudiogramSampleType';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,87 @@
1
+ export var StateOfMindValenceClassification;
2
+ (function (StateOfMindValenceClassification) {
3
+ StateOfMindValenceClassification[StateOfMindValenceClassification["veryUnpleasant"] = 1] = "veryUnpleasant";
4
+ StateOfMindValenceClassification[StateOfMindValenceClassification["unpleasant"] = 2] = "unpleasant";
5
+ StateOfMindValenceClassification[StateOfMindValenceClassification["slightlyUnpleasant"] = 3] = "slightlyUnpleasant";
6
+ StateOfMindValenceClassification[StateOfMindValenceClassification["neutral"] = 4] = "neutral";
7
+ StateOfMindValenceClassification[StateOfMindValenceClassification["slightlyPleasant"] = 5] = "slightlyPleasant";
8
+ StateOfMindValenceClassification[StateOfMindValenceClassification["pleasant"] = 6] = "pleasant";
9
+ StateOfMindValenceClassification[StateOfMindValenceClassification["veryPleasant"] = 7] = "veryPleasant";
10
+ })(StateOfMindValenceClassification || (StateOfMindValenceClassification = {}));
11
+ /**
12
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/label Apple Docs}
13
+ */
14
+ export var StateOfMindLabel;
15
+ (function (StateOfMindLabel) {
16
+ StateOfMindLabel[StateOfMindLabel["amazed"] = 1] = "amazed";
17
+ StateOfMindLabel[StateOfMindLabel["amused"] = 2] = "amused";
18
+ StateOfMindLabel[StateOfMindLabel["angry"] = 3] = "angry";
19
+ StateOfMindLabel[StateOfMindLabel["anxious"] = 4] = "anxious";
20
+ StateOfMindLabel[StateOfMindLabel["ashamed"] = 5] = "ashamed";
21
+ StateOfMindLabel[StateOfMindLabel["brave"] = 6] = "brave";
22
+ StateOfMindLabel[StateOfMindLabel["calm"] = 7] = "calm";
23
+ StateOfMindLabel[StateOfMindLabel["content"] = 8] = "content";
24
+ StateOfMindLabel[StateOfMindLabel["disappointed"] = 9] = "disappointed";
25
+ StateOfMindLabel[StateOfMindLabel["discouraged"] = 10] = "discouraged";
26
+ StateOfMindLabel[StateOfMindLabel["disgusted"] = 11] = "disgusted";
27
+ StateOfMindLabel[StateOfMindLabel["embarrassed"] = 12] = "embarrassed";
28
+ StateOfMindLabel[StateOfMindLabel["excited"] = 13] = "excited";
29
+ StateOfMindLabel[StateOfMindLabel["frustrated"] = 14] = "frustrated";
30
+ StateOfMindLabel[StateOfMindLabel["grateful"] = 15] = "grateful";
31
+ StateOfMindLabel[StateOfMindLabel["guilty"] = 16] = "guilty";
32
+ StateOfMindLabel[StateOfMindLabel["happy"] = 17] = "happy";
33
+ StateOfMindLabel[StateOfMindLabel["hopeless"] = 18] = "hopeless";
34
+ StateOfMindLabel[StateOfMindLabel["irritated"] = 19] = "irritated";
35
+ StateOfMindLabel[StateOfMindLabel["jealous"] = 20] = "jealous";
36
+ StateOfMindLabel[StateOfMindLabel["joyful"] = 21] = "joyful";
37
+ StateOfMindLabel[StateOfMindLabel["lonely"] = 22] = "lonely";
38
+ StateOfMindLabel[StateOfMindLabel["passionate"] = 23] = "passionate";
39
+ StateOfMindLabel[StateOfMindLabel["peaceful"] = 24] = "peaceful";
40
+ StateOfMindLabel[StateOfMindLabel["proud"] = 25] = "proud";
41
+ StateOfMindLabel[StateOfMindLabel["relieved"] = 26] = "relieved";
42
+ StateOfMindLabel[StateOfMindLabel["sad"] = 27] = "sad";
43
+ StateOfMindLabel[StateOfMindLabel["scared"] = 28] = "scared";
44
+ StateOfMindLabel[StateOfMindLabel["stressed"] = 29] = "stressed";
45
+ StateOfMindLabel[StateOfMindLabel["surprised"] = 30] = "surprised";
46
+ StateOfMindLabel[StateOfMindLabel["worried"] = 31] = "worried";
47
+ StateOfMindLabel[StateOfMindLabel["annoyed"] = 32] = "annoyed";
48
+ StateOfMindLabel[StateOfMindLabel["confident"] = 33] = "confident";
49
+ StateOfMindLabel[StateOfMindLabel["drained"] = 34] = "drained";
50
+ StateOfMindLabel[StateOfMindLabel["hopeful"] = 35] = "hopeful";
51
+ StateOfMindLabel[StateOfMindLabel["indifferent"] = 36] = "indifferent";
52
+ StateOfMindLabel[StateOfMindLabel["overwhelmed"] = 37] = "overwhelmed";
53
+ StateOfMindLabel[StateOfMindLabel["satisfied"] = 38] = "satisfied";
54
+ })(StateOfMindLabel || (StateOfMindLabel = {}));
55
+ /**
56
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/kind Apple Docs}
57
+ */
58
+ export var StateOfMindKind;
59
+ (function (StateOfMindKind) {
60
+ StateOfMindKind[StateOfMindKind["dailyMood"] = 2] = "dailyMood";
61
+ StateOfMindKind[StateOfMindKind["momentaryEmotion"] = 1] = "momentaryEmotion";
62
+ })(StateOfMindKind || (StateOfMindKind = {}));
63
+ /**
64
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/association Apple Docs}
65
+ * @since iOS 17.0+
66
+ */
67
+ export var StateOfMindAssociation;
68
+ (function (StateOfMindAssociation) {
69
+ StateOfMindAssociation[StateOfMindAssociation["community"] = 1] = "community";
70
+ StateOfMindAssociation[StateOfMindAssociation["currentEvents"] = 2] = "currentEvents";
71
+ StateOfMindAssociation[StateOfMindAssociation["dating"] = 3] = "dating";
72
+ StateOfMindAssociation[StateOfMindAssociation["education"] = 4] = "education";
73
+ StateOfMindAssociation[StateOfMindAssociation["family"] = 5] = "family";
74
+ StateOfMindAssociation[StateOfMindAssociation["fitness"] = 6] = "fitness";
75
+ StateOfMindAssociation[StateOfMindAssociation["friends"] = 7] = "friends";
76
+ StateOfMindAssociation[StateOfMindAssociation["health"] = 8] = "health";
77
+ StateOfMindAssociation[StateOfMindAssociation["hobbies"] = 9] = "hobbies";
78
+ StateOfMindAssociation[StateOfMindAssociation["identity"] = 10] = "identity";
79
+ StateOfMindAssociation[StateOfMindAssociation["money"] = 11] = "money";
80
+ StateOfMindAssociation[StateOfMindAssociation["partner"] = 12] = "partner";
81
+ StateOfMindAssociation[StateOfMindAssociation["selfCare"] = 13] = "selfCare";
82
+ StateOfMindAssociation[StateOfMindAssociation["spirituality"] = 14] = "spirituality";
83
+ StateOfMindAssociation[StateOfMindAssociation["tasks"] = 15] = "tasks";
84
+ StateOfMindAssociation[StateOfMindAssociation["travel"] = 16] = "travel";
85
+ StateOfMindAssociation[StateOfMindAssociation["work"] = 17] = "work";
86
+ StateOfMindAssociation[StateOfMindAssociation["weather"] = 18] = "weather";
87
+ })(StateOfMindAssociation || (StateOfMindAssociation = {}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ // documented at https://developer.apple.com/documentation/healthkit/hkweathercondition
2
+ export var HKWeatherCondition;
3
+ (function (HKWeatherCondition) {
4
+ HKWeatherCondition[HKWeatherCondition["none"] = 0] = "none";
5
+ HKWeatherCondition[HKWeatherCondition["clear"] = 1] = "clear";
6
+ HKWeatherCondition[HKWeatherCondition["fair"] = 2] = "fair";
7
+ HKWeatherCondition[HKWeatherCondition["partlyCloudy"] = 3] = "partlyCloudy";
8
+ HKWeatherCondition[HKWeatherCondition["mostlyCloudy"] = 4] = "mostlyCloudy";
9
+ HKWeatherCondition[HKWeatherCondition["cloudy"] = 5] = "cloudy";
10
+ HKWeatherCondition[HKWeatherCondition["foggy"] = 6] = "foggy";
11
+ HKWeatherCondition[HKWeatherCondition["haze"] = 7] = "haze";
12
+ HKWeatherCondition[HKWeatherCondition["windy"] = 8] = "windy";
13
+ HKWeatherCondition[HKWeatherCondition["blustery"] = 9] = "blustery";
14
+ HKWeatherCondition[HKWeatherCondition["smoky"] = 10] = "smoky";
15
+ HKWeatherCondition[HKWeatherCondition["dust"] = 11] = "dust";
16
+ HKWeatherCondition[HKWeatherCondition["snow"] = 12] = "snow";
17
+ HKWeatherCondition[HKWeatherCondition["hail"] = 13] = "hail";
18
+ HKWeatherCondition[HKWeatherCondition["sleet"] = 14] = "sleet";
19
+ HKWeatherCondition[HKWeatherCondition["freezingDrizzle"] = 15] = "freezingDrizzle";
20
+ HKWeatherCondition[HKWeatherCondition["freezingRain"] = 16] = "freezingRain";
21
+ HKWeatherCondition[HKWeatherCondition["mixedRainAndHail"] = 17] = "mixedRainAndHail";
22
+ HKWeatherCondition[HKWeatherCondition["mixedRainAndSnow"] = 18] = "mixedRainAndSnow";
23
+ HKWeatherCondition[HKWeatherCondition["mixedRainAndSleet"] = 19] = "mixedRainAndSleet";
24
+ HKWeatherCondition[HKWeatherCondition["mixedSnowAndSleet"] = 20] = "mixedSnowAndSleet";
25
+ HKWeatherCondition[HKWeatherCondition["drizzle"] = 21] = "drizzle";
26
+ HKWeatherCondition[HKWeatherCondition["scatteredShowers"] = 22] = "scatteredShowers";
27
+ HKWeatherCondition[HKWeatherCondition["showers"] = 23] = "showers";
28
+ HKWeatherCondition[HKWeatherCondition["thunderstorms"] = 24] = "thunderstorms";
29
+ HKWeatherCondition[HKWeatherCondition["tropicalStorm"] = 25] = "tropicalStorm";
30
+ HKWeatherCondition[HKWeatherCondition["hurricane"] = 26] = "hurricane";
31
+ HKWeatherCondition[HKWeatherCondition["tornado"] = 27] = "tornado";
32
+ })(HKWeatherCondition || (HKWeatherCondition = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutsessionlocationtype Apple Docs }
3
+ */
4
+ export var WorkoutSessionLocationType;
5
+ (function (WorkoutSessionLocationType) {
6
+ WorkoutSessionLocationType[WorkoutSessionLocationType["unknown"] = 1] = "unknown";
7
+ WorkoutSessionLocationType[WorkoutSessionLocationType["indoor"] = 2] = "indoor";
8
+ WorkoutSessionLocationType[WorkoutSessionLocationType["outdoor"] = 3] = "outdoor";
9
+ })(WorkoutSessionLocationType || (WorkoutSessionLocationType = {}));
@@ -0,0 +1,147 @@
1
+ export var WorkoutActivityType;
2
+ (function (WorkoutActivityType) {
3
+ WorkoutActivityType[WorkoutActivityType["americanFootball"] = 1] = "americanFootball";
4
+ WorkoutActivityType[WorkoutActivityType["archery"] = 2] = "archery";
5
+ WorkoutActivityType[WorkoutActivityType["australianFootball"] = 3] = "australianFootball";
6
+ WorkoutActivityType[WorkoutActivityType["badminton"] = 4] = "badminton";
7
+ WorkoutActivityType[WorkoutActivityType["baseball"] = 5] = "baseball";
8
+ WorkoutActivityType[WorkoutActivityType["basketball"] = 6] = "basketball";
9
+ WorkoutActivityType[WorkoutActivityType["bowling"] = 7] = "bowling";
10
+ WorkoutActivityType[WorkoutActivityType["boxing"] = 8] = "boxing";
11
+ WorkoutActivityType[WorkoutActivityType["climbing"] = 9] = "climbing";
12
+ WorkoutActivityType[WorkoutActivityType["cricket"] = 10] = "cricket";
13
+ WorkoutActivityType[WorkoutActivityType["crossTraining"] = 11] = "crossTraining";
14
+ WorkoutActivityType[WorkoutActivityType["curling"] = 12] = "curling";
15
+ WorkoutActivityType[WorkoutActivityType["cycling"] = 13] = "cycling";
16
+ WorkoutActivityType[WorkoutActivityType["dance"] = 14] = "dance";
17
+ WorkoutActivityType[WorkoutActivityType["danceInspiredTraining"] = 15] = "danceInspiredTraining";
18
+ WorkoutActivityType[WorkoutActivityType["elliptical"] = 16] = "elliptical";
19
+ WorkoutActivityType[WorkoutActivityType["equestrianSports"] = 17] = "equestrianSports";
20
+ WorkoutActivityType[WorkoutActivityType["fencing"] = 18] = "fencing";
21
+ WorkoutActivityType[WorkoutActivityType["fishing"] = 19] = "fishing";
22
+ WorkoutActivityType[WorkoutActivityType["functionalStrengthTraining"] = 20] = "functionalStrengthTraining";
23
+ WorkoutActivityType[WorkoutActivityType["golf"] = 21] = "golf";
24
+ WorkoutActivityType[WorkoutActivityType["gymnastics"] = 22] = "gymnastics";
25
+ WorkoutActivityType[WorkoutActivityType["handball"] = 23] = "handball";
26
+ WorkoutActivityType[WorkoutActivityType["hiking"] = 24] = "hiking";
27
+ WorkoutActivityType[WorkoutActivityType["hockey"] = 25] = "hockey";
28
+ WorkoutActivityType[WorkoutActivityType["hunting"] = 26] = "hunting";
29
+ WorkoutActivityType[WorkoutActivityType["lacrosse"] = 27] = "lacrosse";
30
+ WorkoutActivityType[WorkoutActivityType["martialArts"] = 28] = "martialArts";
31
+ WorkoutActivityType[WorkoutActivityType["mindAndBody"] = 29] = "mindAndBody";
32
+ WorkoutActivityType[WorkoutActivityType["mixedMetabolicCardioTraining"] = 30] = "mixedMetabolicCardioTraining";
33
+ WorkoutActivityType[WorkoutActivityType["paddleSports"] = 31] = "paddleSports";
34
+ WorkoutActivityType[WorkoutActivityType["play"] = 32] = "play";
35
+ WorkoutActivityType[WorkoutActivityType["preparationAndRecovery"] = 33] = "preparationAndRecovery";
36
+ WorkoutActivityType[WorkoutActivityType["racquetball"] = 34] = "racquetball";
37
+ WorkoutActivityType[WorkoutActivityType["rowing"] = 35] = "rowing";
38
+ WorkoutActivityType[WorkoutActivityType["rugby"] = 36] = "rugby";
39
+ WorkoutActivityType[WorkoutActivityType["running"] = 37] = "running";
40
+ WorkoutActivityType[WorkoutActivityType["sailing"] = 38] = "sailing";
41
+ WorkoutActivityType[WorkoutActivityType["skatingSports"] = 39] = "skatingSports";
42
+ WorkoutActivityType[WorkoutActivityType["snowSports"] = 40] = "snowSports";
43
+ WorkoutActivityType[WorkoutActivityType["soccer"] = 41] = "soccer";
44
+ WorkoutActivityType[WorkoutActivityType["softball"] = 42] = "softball";
45
+ WorkoutActivityType[WorkoutActivityType["squash"] = 43] = "squash";
46
+ WorkoutActivityType[WorkoutActivityType["stairClimbing"] = 44] = "stairClimbing";
47
+ WorkoutActivityType[WorkoutActivityType["surfingSports"] = 45] = "surfingSports";
48
+ WorkoutActivityType[WorkoutActivityType["swimming"] = 46] = "swimming";
49
+ WorkoutActivityType[WorkoutActivityType["tableTennis"] = 47] = "tableTennis";
50
+ WorkoutActivityType[WorkoutActivityType["tennis"] = 48] = "tennis";
51
+ WorkoutActivityType[WorkoutActivityType["trackAndField"] = 49] = "trackAndField";
52
+ WorkoutActivityType[WorkoutActivityType["traditionalStrengthTraining"] = 50] = "traditionalStrengthTraining";
53
+ WorkoutActivityType[WorkoutActivityType["volleyball"] = 51] = "volleyball";
54
+ WorkoutActivityType[WorkoutActivityType["walking"] = 52] = "walking";
55
+ WorkoutActivityType[WorkoutActivityType["waterFitness"] = 53] = "waterFitness";
56
+ WorkoutActivityType[WorkoutActivityType["waterPolo"] = 54] = "waterPolo";
57
+ WorkoutActivityType[WorkoutActivityType["waterSports"] = 55] = "waterSports";
58
+ WorkoutActivityType[WorkoutActivityType["wrestling"] = 56] = "wrestling";
59
+ WorkoutActivityType[WorkoutActivityType["yoga"] = 57] = "yoga";
60
+ WorkoutActivityType[WorkoutActivityType["barre"] = 58] = "barre";
61
+ WorkoutActivityType[WorkoutActivityType["coreTraining"] = 59] = "coreTraining";
62
+ WorkoutActivityType[WorkoutActivityType["crossCountrySkiing"] = 60] = "crossCountrySkiing";
63
+ WorkoutActivityType[WorkoutActivityType["downhillSkiing"] = 61] = "downhillSkiing";
64
+ WorkoutActivityType[WorkoutActivityType["flexibility"] = 62] = "flexibility";
65
+ WorkoutActivityType[WorkoutActivityType["highIntensityIntervalTraining"] = 63] = "highIntensityIntervalTraining";
66
+ WorkoutActivityType[WorkoutActivityType["jumpRope"] = 64] = "jumpRope";
67
+ WorkoutActivityType[WorkoutActivityType["kickboxing"] = 65] = "kickboxing";
68
+ WorkoutActivityType[WorkoutActivityType["pilates"] = 66] = "pilates";
69
+ WorkoutActivityType[WorkoutActivityType["snowboarding"] = 67] = "snowboarding";
70
+ WorkoutActivityType[WorkoutActivityType["stairs"] = 68] = "stairs";
71
+ WorkoutActivityType[WorkoutActivityType["stepTraining"] = 69] = "stepTraining";
72
+ WorkoutActivityType[WorkoutActivityType["wheelchairWalkPace"] = 70] = "wheelchairWalkPace";
73
+ WorkoutActivityType[WorkoutActivityType["wheelchairRunPace"] = 71] = "wheelchairRunPace";
74
+ WorkoutActivityType[WorkoutActivityType["taiChi"] = 72] = "taiChi";
75
+ WorkoutActivityType[WorkoutActivityType["mixedCardio"] = 73] = "mixedCardio";
76
+ WorkoutActivityType[WorkoutActivityType["handCycling"] = 74] = "handCycling";
77
+ WorkoutActivityType[WorkoutActivityType["discSports"] = 75] = "discSports";
78
+ WorkoutActivityType[WorkoutActivityType["fitnessGaming"] = 76] = "fitnessGaming";
79
+ WorkoutActivityType[WorkoutActivityType["cardioDance"] = 77] = "cardioDance";
80
+ WorkoutActivityType[WorkoutActivityType["socialDance"] = 78] = "socialDance";
81
+ WorkoutActivityType[WorkoutActivityType["pickleball"] = 79] = "pickleball";
82
+ WorkoutActivityType[WorkoutActivityType["cooldown"] = 80] = "cooldown";
83
+ WorkoutActivityType[WorkoutActivityType["swimBikeRun"] = 82] = "swimBikeRun";
84
+ WorkoutActivityType[WorkoutActivityType["transition"] = 83] = "transition";
85
+ WorkoutActivityType[WorkoutActivityType["underwaterDiving"] = 84] = "underwaterDiving";
86
+ WorkoutActivityType[WorkoutActivityType["other"] = 3000] = "other";
87
+ })(WorkoutActivityType || (WorkoutActivityType = {}));
88
+ // documented at https://developer.apple.com/documentation/healthkit/hkweathercondition
89
+ export var WeatherCondition;
90
+ (function (WeatherCondition) {
91
+ WeatherCondition[WeatherCondition["none"] = 0] = "none";
92
+ WeatherCondition[WeatherCondition["clear"] = 1] = "clear";
93
+ WeatherCondition[WeatherCondition["fair"] = 2] = "fair";
94
+ WeatherCondition[WeatherCondition["partlyCloudy"] = 3] = "partlyCloudy";
95
+ WeatherCondition[WeatherCondition["mostlyCloudy"] = 4] = "mostlyCloudy";
96
+ WeatherCondition[WeatherCondition["cloudy"] = 5] = "cloudy";
97
+ WeatherCondition[WeatherCondition["foggy"] = 6] = "foggy";
98
+ WeatherCondition[WeatherCondition["haze"] = 7] = "haze";
99
+ WeatherCondition[WeatherCondition["windy"] = 8] = "windy";
100
+ WeatherCondition[WeatherCondition["blustery"] = 9] = "blustery";
101
+ WeatherCondition[WeatherCondition["smoky"] = 10] = "smoky";
102
+ WeatherCondition[WeatherCondition["dust"] = 11] = "dust";
103
+ WeatherCondition[WeatherCondition["snow"] = 12] = "snow";
104
+ WeatherCondition[WeatherCondition["hail"] = 13] = "hail";
105
+ WeatherCondition[WeatherCondition["sleet"] = 14] = "sleet";
106
+ WeatherCondition[WeatherCondition["freezingDrizzle"] = 15] = "freezingDrizzle";
107
+ WeatherCondition[WeatherCondition["freezingRain"] = 16] = "freezingRain";
108
+ WeatherCondition[WeatherCondition["mixedRainAndHail"] = 17] = "mixedRainAndHail";
109
+ WeatherCondition[WeatherCondition["mixedRainAndSnow"] = 18] = "mixedRainAndSnow";
110
+ WeatherCondition[WeatherCondition["mixedRainAndSleet"] = 19] = "mixedRainAndSleet";
111
+ WeatherCondition[WeatherCondition["mixedSnowAndSleet"] = 20] = "mixedSnowAndSleet";
112
+ WeatherCondition[WeatherCondition["drizzle"] = 21] = "drizzle";
113
+ WeatherCondition[WeatherCondition["scatteredShowers"] = 22] = "scatteredShowers";
114
+ WeatherCondition[WeatherCondition["showers"] = 23] = "showers";
115
+ WeatherCondition[WeatherCondition["thunderstorms"] = 24] = "thunderstorms";
116
+ WeatherCondition[WeatherCondition["tropicalStorm"] = 25] = "tropicalStorm";
117
+ WeatherCondition[WeatherCondition["hurricane"] = 26] = "hurricane";
118
+ WeatherCondition[WeatherCondition["tornado"] = 27] = "tornado";
119
+ })(WeatherCondition || (WeatherCondition = {}));
120
+ export var WorkoutEventType;
121
+ (function (WorkoutEventType) {
122
+ WorkoutEventType[WorkoutEventType["pause"] = 1] = "pause";
123
+ WorkoutEventType[WorkoutEventType["resume"] = 2] = "resume";
124
+ WorkoutEventType[WorkoutEventType["lap"] = 3] = "lap";
125
+ WorkoutEventType[WorkoutEventType["marker"] = 4] = "marker";
126
+ WorkoutEventType[WorkoutEventType["motionPaused"] = 5] = "motionPaused";
127
+ WorkoutEventType[WorkoutEventType["motionResumed"] = 6] = "motionResumed";
128
+ WorkoutEventType[WorkoutEventType["segment"] = 7] = "segment";
129
+ WorkoutEventType[WorkoutEventType["pauseOrResumeRequest"] = 8] = "pauseOrResumeRequest";
130
+ })(WorkoutEventType || (WorkoutEventType = {}));
131
+ var ComparisonPredicateOperator;
132
+ (function (ComparisonPredicateOperator) {
133
+ ComparisonPredicateOperator[ComparisonPredicateOperator["lessThan"] = 0] = "lessThan";
134
+ ComparisonPredicateOperator[ComparisonPredicateOperator["lessThanOrEqualTo"] = 1] = "lessThanOrEqualTo";
135
+ ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThan"] = 2] = "greaterThan";
136
+ ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThanOrEqualTo"] = 3] = "greaterThanOrEqualTo";
137
+ ComparisonPredicateOperator[ComparisonPredicateOperator["equalTo"] = 4] = "equalTo";
138
+ ComparisonPredicateOperator[ComparisonPredicateOperator["notEqualTo"] = 5] = "notEqualTo";
139
+ ComparisonPredicateOperator[ComparisonPredicateOperator["matches"] = 6] = "matches";
140
+ ComparisonPredicateOperator[ComparisonPredicateOperator["like"] = 7] = "like";
141
+ ComparisonPredicateOperator[ComparisonPredicateOperator["beginsWith"] = 8] = "beginsWith";
142
+ ComparisonPredicateOperator[ComparisonPredicateOperator["endsWith"] = 9] = "endsWith";
143
+ ComparisonPredicateOperator[ComparisonPredicateOperator["in"] = 10] = "in";
144
+ ComparisonPredicateOperator[ComparisonPredicateOperator["customSelector"] = 11] = "customSelector";
145
+ ComparisonPredicateOperator[ComparisonPredicateOperator["contains"] = 99] = "contains";
146
+ ComparisonPredicateOperator[ComparisonPredicateOperator["between"] = 100] = "between";
147
+ })(ComparisonPredicateOperator || (ComparisonPredicateOperator = {}));
@@ -0,0 +1,9 @@
1
+ import { CategoryTypes } from '../modules';
2
+ export async function getCategorySampleById(identifier, uuid) {
3
+ const samples = await CategoryTypes.queryCategorySamples(identifier, {
4
+ limit: 1,
5
+ filter: { uuid: uuid },
6
+ });
7
+ return samples[0];
8
+ }
9
+ export default getCategorySampleById;
@@ -0,0 +1,9 @@
1
+ import { CategoryTypes } from '../modules';
2
+ export async function getMostRecentCategorySample(identifier) {
3
+ const samples = await CategoryTypes.queryCategorySamples(identifier, {
4
+ limit: 1,
5
+ ascending: false,
6
+ });
7
+ return samples[0];
8
+ }
9
+ export default getMostRecentCategorySample;
@@ -0,0 +1,9 @@
1
+ import { QuantityTypes } from '../modules';
2
+ async function getMostRecentQuantitySample(identifier, unit) {
3
+ const samples = await QuantityTypes.queryQuantitySamples(identifier, {
4
+ limit: 1,
5
+ unit,
6
+ });
7
+ return samples[0];
8
+ }
9
+ export default getMostRecentQuantitySample;
@@ -0,0 +1,11 @@
1
+ import { Workouts } from '../modules';
2
+ const getMostRecentWorkout = async (options) => {
3
+ const workouts = await Workouts.queryWorkoutSamples({
4
+ limit: 1,
5
+ ascending: false,
6
+ energyUnit: options?.energyUnit,
7
+ distanceUnit: options?.distanceUnit,
8
+ });
9
+ return workouts[0];
10
+ };
11
+ export default getMostRecentWorkout;
@@ -0,0 +1,10 @@
1
+ import { Core } from '../modules';
2
+ const getPreferredUnit = async (quantityType) => {
3
+ const units = await Core.getPreferredUnits([quantityType]);
4
+ const unit = units[0]?.unit;
5
+ if (!unit) {
6
+ throw new Error(`No preferred unit found for quantity type: ${quantityType}`);
7
+ }
8
+ return unit;
9
+ };
10
+ export default getPreferredUnit;
@@ -0,0 +1,12 @@
1
+ import { QuantityTypes } from '../modules';
2
+ async function getQuantitySampleById(identifier, uuid, unit) {
3
+ const samples = await QuantityTypes.queryQuantitySamples(identifier, {
4
+ limit: 1,
5
+ unit,
6
+ filter: {
7
+ uuid: uuid,
8
+ },
9
+ });
10
+ return samples[0];
11
+ }
12
+ export default getQuantitySampleById;
@@ -0,0 +1,13 @@
1
+ import { Workouts } from '../modules';
2
+ const getWorkoutById = async (uuid, options) => {
3
+ const workouts = await Workouts.queryWorkoutSamples({
4
+ limit: 1,
5
+ filter: {
6
+ uuid: uuid,
7
+ },
8
+ energyUnit: options?.energyUnit,
9
+ distanceUnit: options?.distanceUnit,
10
+ });
11
+ return workouts[0];
12
+ };
13
+ export default getWorkoutById;
@@ -0,0 +1,7 @@
1
+ import { Core } from '../modules';
2
+ export const subscribeToChanges = (identifier, callback) => {
3
+ const queryId = Core.subscribeToObserverQuery(identifier, callback);
4
+ return {
5
+ remove: () => Core.unsubscribeQuery(queryId),
6
+ };
7
+ };
@@ -0,0 +1,11 @@
1
+ import type { CategorySampleTyped } from '../types/CategoryType';
2
+ import type { CategoryTypeIdentifier } from '../types/CategoryTypeIdentifier';
3
+ /**
4
+ * @returns the most recent sample for the given category type.
5
+ */
6
+ export declare function useCategorySampleById<T extends CategoryTypeIdentifier>(identifier: T, uuid: string): {
7
+ sample: CategorySampleTyped<T> | undefined;
8
+ isLoading: boolean;
9
+ error: Error | null;
10
+ };
11
+ export default useCategorySampleById;
@@ -0,0 +1,9 @@
1
+ import type { AuthorizationRequestStatus } from '../types/Auth';
2
+ import type { ObjectTypeIdentifier, SampleTypeIdentifierWriteable } from '../types/Shared';
3
+ /**
4
+ * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
5
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
6
+ * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
7
+ */
8
+ export declare const useHealthkitAuthorization: (read: ObjectTypeIdentifier[], write?: SampleTypeIdentifierWriteable[]) => readonly [AuthorizationRequestStatus | null, () => Promise<AuthorizationRequestStatus>];
9
+ export default useHealthkitAuthorization;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @description Now there is a Core.isHealthDataAvailable() that can be called synchronously. By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
3
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple HealthKit isHealthDataAvailable}
4
+ * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
5
+ */
6
+ export declare const useIsHealthDataAvailable: () => boolean | null;
7
+ export default useIsHealthDataAvailable;
@@ -0,0 +1,7 @@
1
+ import type { CategorySampleTyped } from '../types/CategoryType';
2
+ import type { CategoryTypeIdentifier } from '../types/CategoryTypeIdentifier';
3
+ /**
4
+ * @returns the most recent sample for the given category type.
5
+ */
6
+ export declare function useMostRecentCategorySample<T extends CategoryTypeIdentifier>(identifier: T): CategorySampleTyped<T> | undefined;
7
+ export default useMostRecentCategorySample;
@@ -0,0 +1,7 @@
1
+ import type { QuantitySample } from '../types/QuantitySample';
2
+ import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
3
+ /**
4
+ * @returns the most recent sample for the given quantity type.
5
+ */
6
+ export declare function useMostRecentQuantitySample(identifier: QuantityTypeIdentifier, unit?: string): QuantitySample | undefined;
7
+ export default useMostRecentQuantitySample;
@@ -0,0 +1,9 @@
1
+ import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro';
2
+ /**
3
+ * @returns the most recent workout sample.
4
+ */
5
+ export declare function useMostRecentWorkout(options?: {
6
+ readonly energyUnit?: string;
7
+ readonly distanceUnit?: string;
8
+ }): WorkoutProxy | undefined;
9
+ export default useMostRecentWorkout;
@@ -0,0 +1,14 @@
1
+ import type { QuantitySample } from '../types/QuantitySample';
2
+ import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
3
+ /**
4
+ * @returns the most recent sample for the given quantity type.
5
+ */
6
+ export declare function useQuantitySampleById(identifier: QuantityTypeIdentifier, uuid: string, options?: {
7
+ /** The unit to use for the sample. */
8
+ unit?: string;
9
+ }): {
10
+ sample: QuantitySample | undefined;
11
+ isLoading: boolean;
12
+ error: Error | null;
13
+ };
14
+ export default useQuantitySampleById;
@@ -0,0 +1,4 @@
1
+ import type { SourceProxy } from '../specs/SourceProxy.nitro';
2
+ import type { SampleTypeIdentifier } from '../types/Shared';
3
+ export declare function useSources<TIdentifier extends SampleTypeIdentifier>(identifier: TIdentifier): readonly SourceProxy[] | null;
4
+ export default useSources;
@@ -0,0 +1,4 @@
1
+ import type { QueryStatisticsResponse, StatisticsOptions } from '../types/QuantityType';
2
+ import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
3
+ export declare function useStatisticsForQuantity<TIdentifier extends QuantityTypeIdentifier>(identifier: TIdentifier, options: readonly StatisticsOptions[], from: Date, to?: Date, unit?: string): QueryStatisticsResponse | null;
4
+ export default useStatisticsForQuantity;
@@ -0,0 +1,4 @@
1
+ import type { SampleTypeIdentifier } from '../types/Shared';
2
+ import type { OnChangeCallbackArgs } from '../types/Subscriptons';
3
+ export declare function useSubscribeToChanges<TIdentifier extends SampleTypeIdentifier>(identifier: TIdentifier, onChange: (args: OnChangeCallbackArgs) => void): void;
4
+ export default useSubscribeToChanges;
@@ -0,0 +1,13 @@
1
+ import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro';
2
+ /**
3
+ * @returns the most recent workout sample.
4
+ */
5
+ export declare function useWorkoutById(uuid: string, options?: {
6
+ readonly energyUnit?: string;
7
+ readonly distanceUnit?: string;
8
+ }): {
9
+ workout: WorkoutProxy | undefined;
10
+ isLoading: boolean;
11
+ error: Error | null;
12
+ };
13
+ export default useWorkoutById;