@kingstinct/react-native-healthkit 9.0.0 → 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 (441) hide show
  1. package/README.md +192 -0
  2. package/app.plugin.js +0 -1
  3. package/ios/Helpers.swift +33 -37
  4. package/ios/WorkoutProxy.swift +7 -0
  5. package/lib/commonjs/hooks/useCategorySampleById.js +36 -0
  6. package/lib/commonjs/hooks/useHealthkitAuthorization.js +34 -0
  7. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +23 -0
  8. package/lib/commonjs/hooks/useMostRecentCategorySample.js +21 -0
  9. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +22 -0
  10. package/lib/commonjs/hooks/useMostRecentWorkout.js +31 -0
  11. package/lib/commonjs/hooks/useQuantitySampleById.js +34 -0
  12. package/lib/commonjs/hooks/useSources.js +17 -0
  13. package/lib/commonjs/hooks/useStatisticsForQuantity.js +26 -0
  14. package/lib/commonjs/hooks/useSubscribeToChanges.js +20 -0
  15. package/lib/commonjs/hooks/useWorkoutById.js +46 -0
  16. package/lib/commonjs/index.ios.js +144 -0
  17. package/lib/commonjs/index.js +210 -0
  18. package/lib/commonjs/modules.js +12 -0
  19. package/lib/commonjs/specs/CategoryTypeModule.nitro.js +5 -0
  20. package/lib/commonjs/specs/CharacteristicTypeModule.nitro.js +2 -0
  21. package/lib/commonjs/specs/CoreModule.nitro.js +2 -0
  22. package/lib/commonjs/specs/CorrelationTypeModule.nitro.js +2 -0
  23. package/lib/commonjs/specs/HeartbeatSeriesModule.nitro.js +2 -0
  24. package/lib/commonjs/specs/QuantityTypeModule.nitro.js +2 -0
  25. package/lib/commonjs/specs/SourceProxy.nitro.js +2 -0
  26. package/lib/commonjs/specs/StateOfMindModule.nitro.js +2 -0
  27. package/lib/commonjs/specs/WorkoutProxy.nitro.js +2 -0
  28. package/lib/commonjs/specs/WorkoutSessionModule.nitro.js +19 -0
  29. package/lib/commonjs/specs/WorkoutsModule.nitro.js +2 -0
  30. package/lib/commonjs/types/Auth.js +21 -0
  31. package/lib/commonjs/types/Background.js +13 -0
  32. package/lib/commonjs/types/CategoryType.js +101 -0
  33. package/lib/commonjs/types/CategoryTypeIdentifier.js +2 -0
  34. package/lib/commonjs/types/Characteristics.js +48 -0
  35. package/lib/commonjs/types/Constants.js +23 -0
  36. package/lib/commonjs/types/CorrelationType.js +2 -0
  37. package/lib/commonjs/types/Device.js +2 -0
  38. package/lib/commonjs/types/HeartbeatSeries.js +2 -0
  39. package/lib/commonjs/types/InterfaceVerification.js +24 -0
  40. package/lib/commonjs/types/InterfaceVerificationExample.js +33 -0
  41. package/lib/commonjs/types/QuantitySample.js +2 -0
  42. package/lib/commonjs/types/QuantityType.js +17 -0
  43. package/lib/commonjs/types/QuantityTypeIdentifier.js +2 -0
  44. package/lib/commonjs/types/QueryOptions.js +2 -0
  45. package/lib/commonjs/types/Shared.js +13 -0
  46. package/lib/commonjs/types/Source.js +2 -0
  47. package/lib/commonjs/types/StateOfMind.js +90 -0
  48. package/lib/commonjs/types/Subscriptons.js +2 -0
  49. package/lib/commonjs/types/Units.js +2 -0
  50. package/lib/commonjs/types/WeatherCondition.js +35 -0
  51. package/lib/commonjs/types/WorkoutKit.js +12 -0
  52. package/lib/commonjs/types/Workouts.js +150 -0
  53. package/lib/commonjs/utils/getCategorySampleById.js +12 -0
  54. package/lib/commonjs/utils/getMostRecentCategorySample.js +12 -0
  55. package/lib/commonjs/utils/getMostRecentQuantitySample.js +11 -0
  56. package/lib/commonjs/utils/getMostRecentWorkout.js +13 -0
  57. package/lib/commonjs/utils/getPreferredUnit.js +12 -0
  58. package/lib/commonjs/utils/getQuantitySampleById.js +14 -0
  59. package/lib/commonjs/utils/getWorkoutById.js +15 -0
  60. package/lib/commonjs/utils/subscribeToChanges.js +11 -0
  61. package/lib/module/hooks/useCategorySampleById.js +30 -0
  62. package/lib/module/hooks/useHealthkitAuthorization.js +30 -0
  63. package/lib/module/hooks/useIsHealthDataAvailable.js +19 -0
  64. package/lib/module/hooks/useMostRecentCategorySample.js +15 -0
  65. package/lib/module/hooks/useMostRecentQuantitySample.js +16 -0
  66. package/lib/module/hooks/useMostRecentWorkout.js +25 -0
  67. package/lib/module/hooks/useQuantitySampleById.js +28 -0
  68. package/lib/module/hooks/useSources.js +14 -0
  69. package/lib/module/hooks/useStatisticsForQuantity.js +20 -0
  70. package/lib/module/hooks/useSubscribeToChanges.js +17 -0
  71. package/lib/module/hooks/useWorkoutById.js +40 -0
  72. package/lib/module/index.ios.js +126 -0
  73. package/lib/module/index.js +202 -0
  74. package/lib/module/modules.js +9 -0
  75. package/lib/module/specs/CategoryTypeModule.nitro.js +4 -0
  76. package/lib/module/specs/CharacteristicTypeModule.nitro.js +1 -0
  77. package/lib/module/specs/CoreModule.nitro.js +1 -0
  78. package/lib/module/specs/CorrelationTypeModule.nitro.js +1 -0
  79. package/lib/module/specs/HeartbeatSeriesModule.nitro.js +1 -0
  80. package/lib/module/specs/QuantityTypeModule.nitro.js +1 -0
  81. package/lib/module/specs/SourceProxy.nitro.js +1 -0
  82. package/lib/module/specs/StateOfMindModule.nitro.js +1 -0
  83. package/lib/module/specs/WorkoutProxy.nitro.js +1 -0
  84. package/lib/module/specs/WorkoutSessionModule.nitro.js +16 -0
  85. package/lib/module/specs/WorkoutsModule.nitro.js +1 -0
  86. package/lib/module/types/Auth.js +18 -0
  87. package/lib/module/types/Background.js +10 -0
  88. package/lib/module/types/CategoryType.js +98 -0
  89. package/lib/module/types/CategoryTypeIdentifier.js +1 -0
  90. package/lib/module/types/Characteristics.js +45 -0
  91. package/lib/module/types/Constants.js +20 -0
  92. package/lib/module/types/CorrelationType.js +1 -0
  93. package/lib/module/types/Device.js +1 -0
  94. package/lib/module/types/HeartbeatSeries.js +1 -0
  95. package/lib/module/types/InterfaceVerification.js +23 -0
  96. package/lib/module/types/InterfaceVerificationExample.js +32 -0
  97. package/lib/module/types/QuantitySample.js +1 -0
  98. package/lib/module/types/QuantityType.js +14 -0
  99. package/lib/module/types/QuantityTypeIdentifier.js +1 -0
  100. package/lib/module/types/QueryOptions.js +1 -0
  101. package/lib/module/types/Shared.js +10 -0
  102. package/lib/module/types/Source.js +1 -0
  103. package/lib/module/types/StateOfMind.js +87 -0
  104. package/lib/module/types/Subscriptons.js +1 -0
  105. package/lib/module/types/Units.js +1 -0
  106. package/lib/module/types/WeatherCondition.js +32 -0
  107. package/lib/module/types/WorkoutKit.js +9 -0
  108. package/lib/module/types/Workouts.js +147 -0
  109. package/lib/module/utils/getCategorySampleById.js +9 -0
  110. package/lib/module/utils/getMostRecentCategorySample.js +9 -0
  111. package/lib/module/utils/getMostRecentQuantitySample.js +9 -0
  112. package/lib/module/utils/getMostRecentWorkout.js +11 -0
  113. package/lib/module/utils/getPreferredUnit.js +10 -0
  114. package/lib/module/utils/getQuantitySampleById.js +12 -0
  115. package/lib/module/utils/getWorkoutById.js +13 -0
  116. package/lib/module/utils/subscribeToChanges.js +7 -0
  117. package/lib/typescript/hooks/useCategorySampleById.d.ts +11 -0
  118. package/lib/typescript/hooks/useHealthkitAuthorization.d.ts +9 -0
  119. package/lib/typescript/hooks/useIsHealthDataAvailable.d.ts +7 -0
  120. package/lib/typescript/hooks/useMostRecentCategorySample.d.ts +7 -0
  121. package/lib/typescript/hooks/useMostRecentQuantitySample.d.ts +7 -0
  122. package/lib/typescript/hooks/useMostRecentWorkout.d.ts +9 -0
  123. package/lib/typescript/hooks/useQuantitySampleById.d.ts +14 -0
  124. package/lib/typescript/hooks/useSources.d.ts +4 -0
  125. package/lib/typescript/hooks/useStatisticsForQuantity.d.ts +4 -0
  126. package/lib/typescript/hooks/useSubscribeToChanges.d.ts +4 -0
  127. package/lib/typescript/hooks/useWorkoutById.d.ts +13 -0
  128. package/lib/typescript/index.d.ts +74 -0
  129. package/lib/typescript/index.ios.d.ts +142 -0
  130. package/lib/typescript/modules.d.ts +16 -0
  131. package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +16 -0
  132. package/lib/typescript/specs/CharacteristicTypeModule.nitro.d.ts +16 -0
  133. package/lib/typescript/specs/CoreModule.nitro.d.ts +60 -0
  134. package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +8 -0
  135. package/lib/typescript/specs/HeartbeatSeriesModule.nitro.d.ts +9 -0
  136. package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +16 -0
  137. package/lib/typescript/specs/SourceProxy.nitro.d.ts +14 -0
  138. package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +9 -0
  139. package/lib/typescript/specs/WorkoutProxy.nitro.d.ts +10 -0
  140. package/lib/typescript/specs/WorkoutSessionModule.nitro.d.ts +47 -0
  141. package/lib/typescript/specs/WorkoutsModule.nitro.d.ts +13 -0
  142. package/lib/typescript/types/Auth.d.ts +16 -0
  143. package/lib/typescript/types/Background.d.ts +9 -0
  144. package/lib/typescript/types/CategoryType.d.ts +144 -0
  145. package/lib/typescript/types/CategoryTypeIdentifier.d.ts +31 -0
  146. package/lib/typescript/types/Characteristics.d.ts +41 -0
  147. package/lib/typescript/types/Constants.d.ts +20 -0
  148. package/lib/typescript/types/CorrelationType.d.ts +21 -0
  149. package/lib/typescript/types/Device.d.ts +13 -0
  150. package/lib/typescript/types/HeartbeatSeries.d.ts +25 -0
  151. package/lib/typescript/types/InterfaceVerification.d.ts +73 -0
  152. package/lib/typescript/types/InterfaceVerificationExample.d.ts +58 -0
  153. package/lib/typescript/types/QuantitySample.d.ts +27 -0
  154. package/lib/typescript/types/QuantityType.d.ts +63 -0
  155. package/lib/typescript/types/QuantityTypeIdentifier.d.ts +659 -0
  156. package/lib/typescript/types/QueryOptions.d.ts +47 -0
  157. package/lib/typescript/types/Shared.d.ts +39 -0
  158. package/lib/typescript/types/Source.d.ts +10 -0
  159. package/lib/typescript/types/StateOfMind.d.ts +103 -0
  160. package/lib/typescript/types/Subscriptons.d.ts +8 -0
  161. package/lib/typescript/types/Units.d.ts +97 -0
  162. package/lib/typescript/types/WeatherCondition.d.ts +30 -0
  163. package/lib/typescript/types/WorkoutKit.d.ts +16 -0
  164. package/lib/typescript/types/Workouts.d.ts +254 -0
  165. package/lib/typescript/utils/getCategorySampleById.d.ts +3 -0
  166. package/lib/typescript/utils/getMostRecentCategorySample.d.ts +3 -0
  167. package/lib/typescript/utils/getMostRecentQuantitySample.d.ts +3 -0
  168. package/lib/typescript/utils/getMostRecentWorkout.d.ts +3 -0
  169. package/lib/typescript/utils/getPreferredUnit.d.ts +3 -0
  170. package/lib/typescript/utils/getQuantitySampleById.d.ts +3 -0
  171. package/lib/typescript/utils/getWorkoutById.d.ts +3 -0
  172. package/lib/typescript/utils/subscribeToChanges.d.ts +5 -0
  173. package/nitrogen/generated/.gitattributes +1 -0
  174. package/nitrogen/generated/ios/ReactNativeHealthkit+autolinking.rb +60 -0
  175. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +450 -0
  176. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +2570 -0
  177. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +326 -0
  178. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +89 -0
  179. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +130 -0
  180. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.cpp +11 -0
  181. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +146 -0
  182. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.cpp +11 -0
  183. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +155 -0
  184. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.cpp +11 -0
  185. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +300 -0
  186. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.cpp +11 -0
  187. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +120 -0
  188. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.cpp +11 -0
  189. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +138 -0
  190. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.cpp +11 -0
  191. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +196 -0
  192. package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.cpp +11 -0
  193. package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.hpp +77 -0
  194. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.cpp +11 -0
  195. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +138 -0
  196. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.cpp +11 -0
  197. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +196 -0
  198. package/nitrogen/generated/ios/c++/HybridWorkoutSessionModuleSpecSwift.cpp +11 -0
  199. package/nitrogen/generated/ios/c++/HybridWorkoutSessionModuleSpecSwift.hpp +107 -0
  200. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.cpp +11 -0
  201. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +172 -0
  202. package/nitrogen/generated/ios/swift/AuthorizationRequestStatus.swift +44 -0
  203. package/nitrogen/generated/ios/swift/AuthorizationStatus.swift +44 -0
  204. package/nitrogen/generated/ios/swift/BiologicalSex.swift +48 -0
  205. package/nitrogen/generated/ios/swift/BloodType.swift +68 -0
  206. package/nitrogen/generated/ios/swift/CategorySample.swift +148 -0
  207. package/nitrogen/generated/ios/swift/CategorySampleForSaving.swift +108 -0
  208. package/nitrogen/generated/ios/swift/CategorySamplesWithAnchorResponse.swift +81 -0
  209. package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +288 -0
  210. package/nitrogen/generated/ios/swift/ComparisonPredicateOperator.swift +88 -0
  211. package/nitrogen/generated/ios/swift/CorrelationObject.swift +16 -0
  212. package/nitrogen/generated/ios/swift/CorrelationSample.swift +117 -0
  213. package/nitrogen/generated/ios/swift/CorrelationTypeIdentifier.swift +40 -0
  214. package/nitrogen/generated/ios/swift/DeletedSample.swift +64 -0
  215. package/nitrogen/generated/ios/swift/Device.swift +256 -0
  216. package/nitrogen/generated/ios/swift/FilterForSamples.swift +21 -0
  217. package/nitrogen/generated/ios/swift/FilterForSamplesAnd.swift +94 -0
  218. package/nitrogen/generated/ios/swift/FilterForSamplesOr.swift +94 -0
  219. package/nitrogen/generated/ios/swift/FitzpatrickSkinType.swift +60 -0
  220. package/nitrogen/generated/ios/swift/Func_void_AuthorizationRequestStatus.swift +46 -0
  221. package/nitrogen/generated/ios/swift/Func_void_BiologicalSex.swift +46 -0
  222. package/nitrogen/generated/ios/swift/Func_void_BloodType.swift +46 -0
  223. package/nitrogen/generated/ios/swift/Func_void_CategorySamplesWithAnchorResponse.swift +46 -0
  224. package/nitrogen/generated/ios/swift/Func_void_FitzpatrickSkinType.swift +46 -0
  225. package/nitrogen/generated/ios/swift/Func_void_HeartbeatSeriesSamplesWithAnchorResponse.swift +46 -0
  226. package/nitrogen/generated/ios/swift/Func_void_OnChangeCallbackArgs.swift +46 -0
  227. package/nitrogen/generated/ios/swift/Func_void_QuantitySamplesWithAnchorResponse.swift +46 -0
  228. package/nitrogen/generated/ios/swift/Func_void_QueryStatisticsResponse.swift +46 -0
  229. package/nitrogen/generated/ios/swift/Func_void_QueryWorkoutSamplesWithAnchorResponse.swift +46 -0
  230. package/nitrogen/generated/ios/swift/Func_void_WheelchairUse.swift +46 -0
  231. package/nitrogen/generated/ios/swift/Func_void_WorkoutEventType.swift +46 -0
  232. package/nitrogen/generated/ios/swift/Func_void_WorkoutSessionState_WorkoutSessionState_std__chrono__system_clock__time_point.swift +46 -0
  233. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  234. package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
  235. package/nitrogen/generated/ios/swift/Func_void_std__chrono__system_clock__time_point.swift +46 -0
  236. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  237. package/nitrogen/generated/ios/swift/Func_void_std__optional_WorkoutPlan_.swift +52 -0
  238. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  239. package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__bool_.swift +54 -0
  240. package/nitrogen/generated/ios/swift/Func_void_std__vector_CategorySample_.swift +46 -0
  241. package/nitrogen/generated/ios/swift/Func_void_std__vector_CorrelationSample_.swift +46 -0
  242. package/nitrogen/generated/ios/swift/Func_void_std__vector_HeartbeatSeriesSample_.swift +46 -0
  243. package/nitrogen/generated/ios/swift/Func_void_std__vector_IdentifierWithUnit_.swift +46 -0
  244. package/nitrogen/generated/ios/swift/Func_void_std__vector_QuantitySample_.swift +46 -0
  245. package/nitrogen/generated/ios/swift/Func_void_std__vector_QueryStatisticsResponse_.swift +46 -0
  246. package/nitrogen/generated/ios/swift/Func_void_std__vector_RemoteSessionSharableData_.swift +46 -0
  247. package/nitrogen/generated/ios/swift/Func_void_std__vector_StateOfMindSample_.swift +46 -0
  248. package/nitrogen/generated/ios/swift/Func_void_std__vector_WorkoutRoute_.swift +46 -0
  249. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridSourceProxySpec__.swift +50 -0
  250. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec__.swift +50 -0
  251. package/nitrogen/generated/ios/swift/Heartbeat.swift +46 -0
  252. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +167 -0
  253. package/nitrogen/generated/ios/swift/HeartbeatSeriesSamplesWithAnchorResponse.swift +81 -0
  254. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +50 -0
  255. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +171 -0
  256. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +57 -0
  257. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +257 -0
  258. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +69 -0
  259. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +523 -0
  260. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +49 -0
  261. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +158 -0
  262. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +49 -0
  263. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +152 -0
  264. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +54 -0
  265. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +285 -0
  266. package/nitrogen/generated/ios/swift/HybridSourceProxySpec.swift +48 -0
  267. package/nitrogen/generated/ios/swift/HybridSourceProxySpec_cxx.swift +125 -0
  268. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +49 -0
  269. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +158 -0
  270. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +64 -0
  271. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +351 -0
  272. package/nitrogen/generated/ios/swift/HybridWorkoutSessionModuleSpec.swift +49 -0
  273. package/nitrogen/generated/ios/swift/HybridWorkoutSessionModuleSpec_cxx.swift +133 -0
  274. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec.swift +51 -0
  275. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec_cxx.swift +187 -0
  276. package/nitrogen/generated/ios/swift/IdentifierWithUnit.swift +46 -0
  277. package/nitrogen/generated/ios/swift/IntervalComponents.swift +139 -0
  278. package/nitrogen/generated/ios/swift/LocationForSaving.swift +112 -0
  279. package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +820 -0
  280. package/nitrogen/generated/ios/swift/OnChangeCallbackArgs.swift +64 -0
  281. package/nitrogen/generated/ios/swift/PredicateForSamples.swift +19 -0
  282. package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +21 -0
  283. package/nitrogen/generated/ios/swift/PredicateForWorkoutsAnd.swift +108 -0
  284. package/nitrogen/generated/ios/swift/PredicateForWorkoutsOr.swift +108 -0
  285. package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +45 -0
  286. package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +35 -0
  287. package/nitrogen/generated/ios/swift/PredicateWithStartAndEnd.swift +128 -0
  288. package/nitrogen/generated/ios/swift/PredicateWithUUID.swift +35 -0
  289. package/nitrogen/generated/ios/swift/PredicateWithUUIDs.swift +47 -0
  290. package/nitrogen/generated/ios/swift/Quantity.swift +46 -0
  291. package/nitrogen/generated/ios/swift/QuantityDateInterval.swift +46 -0
  292. package/nitrogen/generated/ios/swift/QuantitySample.swift +159 -0
  293. package/nitrogen/generated/ios/swift/QuantitySampleForSaving.swift +119 -0
  294. package/nitrogen/generated/ios/swift/QuantitySamplesWithAnchorResponse.swift +81 -0
  295. package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +508 -0
  296. package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +166 -0
  297. package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +195 -0
  298. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +160 -0
  299. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +189 -0
  300. package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +227 -0
  301. package/nitrogen/generated/ios/swift/QueryWorkoutSamplesWithAnchorResponse.swift +91 -0
  302. package/nitrogen/generated/ios/swift/RemoteSessionSharableData.swift +46 -0
  303. package/nitrogen/generated/ios/swift/SampleForSaving.swift +16 -0
  304. package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +792 -0
  305. package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +772 -0
  306. package/nitrogen/generated/ios/swift/Source.swift +46 -0
  307. package/nitrogen/generated/ios/swift/SourceRevision.swift +150 -0
  308. package/nitrogen/generated/ios/swift/StateOfMindAssociation.swift +104 -0
  309. package/nitrogen/generated/ios/swift/StateOfMindKind.swift +40 -0
  310. package/nitrogen/generated/ios/swift/StateOfMindLabel.swift +184 -0
  311. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +223 -0
  312. package/nitrogen/generated/ios/swift/StateOfMindValenceClassification.swift +60 -0
  313. package/nitrogen/generated/ios/swift/StatisticsOptions.swift +60 -0
  314. package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +129 -0
  315. package/nitrogen/generated/ios/swift/UpdateFrequency.swift +48 -0
  316. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout.swift +19 -0
  317. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +21 -0
  318. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +23 -0
  319. package/nitrogen/generated/ios/swift/WheelchairUse.swift +44 -0
  320. package/nitrogen/generated/ios/swift/WorkoutActivity.swift +68 -0
  321. package/nitrogen/generated/ios/swift/WorkoutActivityType.swift +368 -0
  322. package/nitrogen/generated/ios/swift/WorkoutActivityTypePredicate.swift +35 -0
  323. package/nitrogen/generated/ios/swift/WorkoutConfiguration.swift +58 -0
  324. package/nitrogen/generated/ios/swift/WorkoutDurationPredicate.swift +46 -0
  325. package/nitrogen/generated/ios/swift/WorkoutEvent.swift +57 -0
  326. package/nitrogen/generated/ios/swift/WorkoutEventType.swift +64 -0
  327. package/nitrogen/generated/ios/swift/WorkoutPlan.swift +46 -0
  328. package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +232 -0
  329. package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +238 -0
  330. package/nitrogen/generated/ios/swift/WorkoutRoute.swift +99 -0
  331. package/nitrogen/generated/ios/swift/WorkoutRouteLocation.swift +146 -0
  332. package/nitrogen/generated/ios/swift/WorkoutSample.swift +364 -0
  333. package/nitrogen/generated/ios/swift/WorkoutSessionLocationType.swift +44 -0
  334. package/nitrogen/generated/ios/swift/WorkoutSessionMirroringStartHandlerOptions.swift +118 -0
  335. package/nitrogen/generated/ios/swift/WorkoutSessionState.swift +56 -0
  336. package/nitrogen/generated/ios/swift/WorkoutTotals.swift +70 -0
  337. package/nitrogen/generated/shared/c++/AuthorizationRequestStatus.hpp +65 -0
  338. package/nitrogen/generated/shared/c++/AuthorizationStatus.hpp +65 -0
  339. package/nitrogen/generated/shared/c++/BiologicalSex.hpp +66 -0
  340. package/nitrogen/generated/shared/c++/BloodType.hpp +71 -0
  341. package/nitrogen/generated/shared/c++/CategorySample.hpp +110 -0
  342. package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +98 -0
  343. package/nitrogen/generated/shared/c++/CategorySamplesWithAnchorResponse.hpp +83 -0
  344. package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +326 -0
  345. package/nitrogen/generated/shared/c++/ComparisonPredicateOperator.hpp +76 -0
  346. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +98 -0
  347. package/nitrogen/generated/shared/c++/CorrelationTypeIdentifier.hpp +78 -0
  348. package/nitrogen/generated/shared/c++/DeletedSample.hpp +76 -0
  349. package/nitrogen/generated/shared/c++/Device.hpp +98 -0
  350. package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +84 -0
  351. package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +84 -0
  352. package/nitrogen/generated/shared/c++/FitzpatrickSkinType.hpp +69 -0
  353. package/nitrogen/generated/shared/c++/Heartbeat.hpp +73 -0
  354. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +107 -0
  355. package/nitrogen/generated/shared/c++/HeartbeatSeriesSamplesWithAnchorResponse.hpp +83 -0
  356. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.cpp +23 -0
  357. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +84 -0
  358. package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.cpp +30 -0
  359. package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.hpp +83 -0
  360. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +42 -0
  361. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +140 -0
  362. package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.cpp +22 -0
  363. package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +80 -0
  364. package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.cpp +22 -0
  365. package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +76 -0
  366. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.cpp +27 -0
  367. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +123 -0
  368. package/nitrogen/generated/shared/c++/HybridSourceProxySpec.cpp +22 -0
  369. package/nitrogen/generated/shared/c++/HybridSourceProxySpec.hpp +65 -0
  370. package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.cpp +22 -0
  371. package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +83 -0
  372. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +38 -0
  373. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +114 -0
  374. package/nitrogen/generated/shared/c++/HybridWorkoutSessionModuleSpec.cpp +22 -0
  375. package/nitrogen/generated/shared/c++/HybridWorkoutSessionModuleSpec.hpp +68 -0
  376. package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.cpp +24 -0
  377. package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.hpp +95 -0
  378. package/nitrogen/generated/shared/c++/IdentifierWithUnit.hpp +73 -0
  379. package/nitrogen/generated/shared/c++/IntervalComponents.hpp +85 -0
  380. package/nitrogen/generated/shared/c++/LocationForSaving.hpp +97 -0
  381. package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +858 -0
  382. package/nitrogen/generated/shared/c++/OnChangeCallbackArgs.hpp +76 -0
  383. package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +90 -0
  384. package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +90 -0
  385. package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +71 -0
  386. package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +69 -0
  387. package/nitrogen/generated/shared/c++/PredicateWithStartAndEnd.hpp +82 -0
  388. package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +69 -0
  389. package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +70 -0
  390. package/nitrogen/generated/shared/c++/Quantity.hpp +73 -0
  391. package/nitrogen/generated/shared/c++/QuantityDateInterval.hpp +73 -0
  392. package/nitrogen/generated/shared/c++/QuantitySample.hpp +114 -0
  393. package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +103 -0
  394. package/nitrogen/generated/shared/c++/QuantitySamplesWithAnchorResponse.hpp +83 -0
  395. package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +546 -0
  396. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +99 -0
  397. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +103 -0
  398. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +98 -0
  399. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +103 -0
  400. package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +98 -0
  401. package/nitrogen/generated/shared/c++/QueryWorkoutSamplesWithAnchorResponse.hpp +84 -0
  402. package/nitrogen/generated/shared/c++/RemoteSessionSharableData.hpp +75 -0
  403. package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +830 -0
  404. package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +810 -0
  405. package/nitrogen/generated/shared/c++/Source.hpp +73 -0
  406. package/nitrogen/generated/shared/c++/SourceRevision.hpp +85 -0
  407. package/nitrogen/generated/shared/c++/StateOfMindAssociation.hpp +80 -0
  408. package/nitrogen/generated/shared/c++/StateOfMindKind.hpp +64 -0
  409. package/nitrogen/generated/shared/c++/StateOfMindLabel.hpp +100 -0
  410. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +132 -0
  411. package/nitrogen/generated/shared/c++/StateOfMindValenceClassification.hpp +69 -0
  412. package/nitrogen/generated/shared/c++/StatisticsOptions.hpp +98 -0
  413. package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +89 -0
  414. package/nitrogen/generated/shared/c++/UpdateFrequency.hpp +66 -0
  415. package/nitrogen/generated/shared/c++/WheelchairUse.hpp +65 -0
  416. package/nitrogen/generated/shared/c++/WorkoutActivity.hpp +82 -0
  417. package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +146 -0
  418. package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +70 -0
  419. package/nitrogen/generated/shared/c++/WorkoutConfiguration.hpp +78 -0
  420. package/nitrogen/generated/shared/c++/WorkoutDurationPredicate.hpp +74 -0
  421. package/nitrogen/generated/shared/c++/WorkoutEvent.hpp +79 -0
  422. package/nitrogen/generated/shared/c++/WorkoutEventType.hpp +70 -0
  423. package/nitrogen/generated/shared/c++/WorkoutPlan.hpp +75 -0
  424. package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +113 -0
  425. package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +113 -0
  426. package/nitrogen/generated/shared/c++/WorkoutRoute.hpp +81 -0
  427. package/nitrogen/generated/shared/c++/WorkoutRouteLocation.hpp +106 -0
  428. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +144 -0
  429. package/nitrogen/generated/shared/c++/WorkoutSessionLocationType.hpp +65 -0
  430. package/nitrogen/generated/shared/c++/WorkoutSessionMirroringStartHandlerOptions.hpp +92 -0
  431. package/nitrogen/generated/shared/c++/WorkoutSessionState.hpp +68 -0
  432. package/nitrogen/generated/shared/c++/WorkoutTotals.hpp +73 -0
  433. package/package.json +35 -12
  434. package/src/hooks/useCategorySampleById.ts +41 -0
  435. package/src/hooks/useQuantitySampleById.ts +44 -0
  436. package/src/hooks/useWorkoutById.ts +55 -0
  437. package/src/index.ios.ts +1 -9
  438. package/src/index.ts +4 -16
  439. package/src/utils/getCategorySampleById.ts +16 -0
  440. package/src/utils/getQuantitySampleById.ts +20 -0
  441. package/src/utils/getWorkoutById.ts +20 -0
@@ -0,0 +1,47 @@
1
+ import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro';
2
+ type PredicateWithUUID = {
3
+ readonly uuid: string;
4
+ };
5
+ type PredicateWithUUIDs = {
6
+ readonly uuids: readonly string[];
7
+ };
8
+ type PredicateWithStartAndEnd = {
9
+ readonly startDate?: Date;
10
+ readonly endDate?: Date;
11
+ readonly strictEndDate?: boolean;
12
+ readonly strictStartDate?: boolean;
13
+ };
14
+ type PredicateWithMetadataKey = {
15
+ readonly withMetadataKey: string;
16
+ };
17
+ export type FilterForSamplesAnd = {
18
+ AND: PredicateForSamples[];
19
+ };
20
+ export type FilterForSamplesOr = {
21
+ OR: PredicateForSamples[];
22
+ };
23
+ export type PredicateFromWorkout = {
24
+ workout: WorkoutProxy;
25
+ };
26
+ export type FilterForSamples = PredicateForSamples | FilterForSamplesAnd | FilterForSamplesOr;
27
+ export type PredicateForSamples = PredicateWithUUID | PredicateWithUUIDs | PredicateWithMetadataKey | PredicateWithStartAndEnd | PredicateFromWorkout;
28
+ /**
29
+ * Generic options for querying.
30
+ */
31
+ export interface GenericQueryOptions {
32
+ filter?: FilterForSamples;
33
+ readonly limit?: number;
34
+ }
35
+ export interface QueryOptionsWithAnchor extends GenericQueryOptions {
36
+ readonly anchor?: string;
37
+ }
38
+ export interface QueryOptionsWithSortOrder extends GenericQueryOptions {
39
+ readonly ascending?: boolean;
40
+ }
41
+ export interface QueryOptionsWithSortOrderAndUnit extends QueryOptionsWithSortOrder {
42
+ readonly unit?: string;
43
+ }
44
+ export interface QueryOptionsWithAnchorAndUnit extends QueryOptionsWithAnchor {
45
+ readonly unit?: string;
46
+ }
47
+ export {};
@@ -0,0 +1,39 @@
1
+ import type { CategoryTypeIdentifier, CategoryTypeIdentifierWriteable } from './CategoryTypeIdentifier';
2
+ import type { QuantityTypeIdentifier, QuantityTypeIdentifierWriteable } from './QuantityTypeIdentifier';
3
+ import type { HeartbeatSeriesTypeIdentifier, StateOfMindTypeIdentifier, WorkoutRouteTypeIdentifier, WorkoutTypeIdentifier } from './Constants';
4
+ import type { AnyMap } from 'react-native-nitro-modules';
5
+ import type { CharacteristicTypeIdentifier } from './Characteristics';
6
+ import type { CorrelationTypeIdentifier } from './CorrelationType';
7
+ export interface GenericMetadata {
8
+ readonly HKExternalUUID?: string;
9
+ readonly HKTimeZone?: string;
10
+ readonly HKWasUserEntered?: boolean;
11
+ readonly HKDeviceSerialNumber?: string;
12
+ readonly HKUDIDeviceIdentifier?: string;
13
+ readonly HKUDIProductionIdentifier?: string;
14
+ readonly HKDigitalSignature?: string;
15
+ readonly HKDeviceName?: string;
16
+ readonly HKDeviceManufacturerName?: string;
17
+ readonly HKSyncIdentifier?: string;
18
+ readonly HKSyncVersion?: number;
19
+ readonly HKWasTakenInLab?: boolean;
20
+ readonly HKReferenceRangeLowerLimit?: number;
21
+ readonly HKReferenceRangeUpperLimit?: number;
22
+ }
23
+ export interface DeletedSample {
24
+ readonly uuid: string;
25
+ readonly metadata?: AnyMap;
26
+ }
27
+ export type ObjectTypeIdentifier = CharacteristicTypeIdentifier | SampleTypeIdentifier | typeof ActivitySummaryTypeIdentifier;
28
+ export type SampleTypeIdentifier = CategoryTypeIdentifier | CorrelationTypeIdentifier | QuantityTypeIdentifier | typeof StateOfMindTypeIdentifier | typeof AudiogramTypeIdentifier | typeof HeartbeatSeriesTypeIdentifier | typeof WorkoutRouteTypeIdentifier | typeof WorkoutTypeIdentifier;
29
+ export type SampleTypeIdentifierWriteable = CategoryTypeIdentifierWriteable | CorrelationTypeIdentifier | QuantityTypeIdentifierWriteable | typeof StateOfMindTypeIdentifier | typeof AudiogramTypeIdentifier | typeof HeartbeatSeriesTypeIdentifier | typeof WorkoutRouteTypeIdentifier | typeof WorkoutTypeIdentifier;
30
+ /**
31
+ * Represents a type that identifies activity summary objects.
32
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkactivitysummarytype Apple Docs HKActivitySummaryType}
33
+ */
34
+ export declare const ActivitySummaryTypeIdentifier: "ActivitySummaryTypeIdentifier";
35
+ /**
36
+ * Represents an audiogram type identifier.
37
+ * @see {@link https://developer.apple.com/documentation/healthkit/HKAudiogramSampleType Apple Docs HKAudiogramSampleType}
38
+ */
39
+ export declare const AudiogramTypeIdentifier: "HKAudiogramSampleType";
@@ -0,0 +1,10 @@
1
+ import type { SourceProxy } from '../specs/SourceProxy.nitro';
2
+ /**
3
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615483-sourcerevision Apple Docs }
4
+ */
5
+ export interface SourceRevision {
6
+ readonly source?: SourceProxy;
7
+ readonly version?: string;
8
+ readonly operatingSystemVersion?: string | null;
9
+ readonly productType?: string | null;
10
+ }
@@ -0,0 +1,103 @@
1
+ import type { AnyMap } from 'react-native-nitro-modules';
2
+ import type { Device } from './Device';
3
+ import type { SourceRevision } from './Source';
4
+ export declare enum StateOfMindValenceClassification {
5
+ veryUnpleasant = 1,
6
+ unpleasant = 2,
7
+ slightlyUnpleasant = 3,
8
+ neutral = 4,
9
+ slightlyPleasant = 5,
10
+ pleasant = 6,
11
+ veryPleasant = 7
12
+ }
13
+ export interface StateOfMindSample {
14
+ readonly uuid: string;
15
+ readonly device?: Device;
16
+ readonly startDate: Date;
17
+ readonly endDate: Date;
18
+ readonly metadata?: AnyMap;
19
+ readonly sourceRevision?: SourceRevision;
20
+ /**
21
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/4337998-valence Apple Docs }
22
+ * Value between -1 and 1
23
+ */
24
+ readonly valence: number;
25
+ readonly kind: StateOfMindKind;
26
+ readonly valenceClassification: StateOfMindValenceClassification;
27
+ readonly associations: readonly StateOfMindAssociation[];
28
+ readonly labels: readonly StateOfMindLabel[];
29
+ }
30
+ /**
31
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/label Apple Docs}
32
+ */
33
+ export declare enum StateOfMindLabel {
34
+ amazed = 1,
35
+ amused = 2,
36
+ angry = 3,
37
+ anxious = 4,
38
+ ashamed = 5,
39
+ brave = 6,
40
+ calm = 7,
41
+ content = 8,
42
+ disappointed = 9,
43
+ discouraged = 10,
44
+ disgusted = 11,
45
+ embarrassed = 12,
46
+ excited = 13,
47
+ frustrated = 14,
48
+ grateful = 15,
49
+ guilty = 16,
50
+ happy = 17,
51
+ hopeless = 18,
52
+ irritated = 19,
53
+ jealous = 20,
54
+ joyful = 21,
55
+ lonely = 22,
56
+ passionate = 23,
57
+ peaceful = 24,
58
+ proud = 25,
59
+ relieved = 26,
60
+ sad = 27,
61
+ scared = 28,
62
+ stressed = 29,
63
+ surprised = 30,
64
+ worried = 31,
65
+ annoyed = 32,
66
+ confident = 33,
67
+ drained = 34,
68
+ hopeful = 35,
69
+ indifferent = 36,
70
+ overwhelmed = 37,
71
+ satisfied = 38
72
+ }
73
+ /**
74
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/kind Apple Docs}
75
+ */
76
+ export declare enum StateOfMindKind {
77
+ dailyMood = 2,
78
+ momentaryEmotion = 1
79
+ }
80
+ /**
81
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmind/association Apple Docs}
82
+ * @since iOS 17.0+
83
+ */
84
+ export declare enum StateOfMindAssociation {
85
+ community = 1,
86
+ currentEvents = 2,
87
+ dating = 3,
88
+ education = 4,
89
+ family = 5,
90
+ fitness = 6,
91
+ friends = 7,
92
+ health = 8,
93
+ hobbies = 9,
94
+ identity = 10,
95
+ money = 11,
96
+ partner = 12,
97
+ selfCare = 13,
98
+ spirituality = 14,
99
+ tasks = 15,
100
+ travel = 16,
101
+ work = 17,
102
+ weather = 18
103
+ }
@@ -0,0 +1,8 @@
1
+ import type { SampleTypeIdentifier } from './Shared';
2
+ export interface EmitterSubscription {
3
+ remove: () => void;
4
+ }
5
+ export interface OnChangeCallbackArgs {
6
+ readonly typeIdentifier: SampleTypeIdentifier;
7
+ readonly errorMessage?: string;
8
+ }
@@ -0,0 +1,97 @@
1
+ export type MetricPrefix = '' | 'p' | 'n' | 'mc' | 'm' | 'c' | 'd' | 'da' | 'h' | 'k' | 'M' | 'G' | 'T' | 'f';
2
+ export type UnitMetric = 'g' | 'J' | 'K' | 'l' | 'm' | 'Pa' | 's' | 'S' | 'Hz' | 'V';
3
+ export type Units = 'dBHL' | 'dBASPL' | '%' | 'count' | 'IU' | 'appleEffortScore';
4
+ export type MeterUnit<Prefix extends MetricPrefix> = `${Prefix}m`;
5
+ export type LiterUnit<Prefix extends MetricPrefix> = `${Prefix}l`;
6
+ export type GramUnit<Prefix extends MetricPrefix> = `${Prefix}g`;
7
+ export type PascalUnit<Prefix extends MetricPrefix> = `${Prefix}Pa`;
8
+ export type SecondUnit<Prefix extends MetricPrefix> = `${Prefix}s`;
9
+ export type JouleUnit<Prefix extends MetricPrefix> = `${Prefix}J`;
10
+ export type HertzUnit<Prefix extends MetricPrefix> = `${Prefix}Hz`;
11
+ export type VoltUnit<Prefix extends MetricPrefix> = `${Prefix}V`;
12
+ export type SiemenUnit<Prefix extends MetricPrefix> = `${Prefix}S`;
13
+ export type MoleUnit<MolarMass extends number> = `mol<${MolarMass}>`;
14
+ export type MoleUnitWith<MolarMass extends number, Prefix extends MetricPrefix> = `${Prefix}mol<${MolarMass}>`;
15
+ export type FrequencyUnit = HertzUnit<MetricPrefix>;
16
+ /**
17
+ * More SI prefixes also available as literals, just type the string
18
+ * @example 'cm', 'km'
19
+ */
20
+ export type UnitOfLength = 'ft'
21
+ /**
22
+ * More SI prefixes also available as literals, just type the string
23
+ * @example 'cm', 'km'
24
+ */
25
+ | 'm' | 'in' | 'yd' | 'mi';
26
+ export type LengthUnit = MeterUnit<MetricPrefix> | UnitOfLength;
27
+ /**
28
+ * More SI prefixes also available as literals, just type the string
29
+ * @example 'ml', 'cl'
30
+ */
31
+ export type UnitOfVolume = 'cup_imp' | 'fl_oz_imp' | 'pt_imp' | 'cup_us' | 'fl_oz_us' | 'pt_us'
32
+ /**
33
+ * More SI prefixes also available as literals, just type the string
34
+ * @example 'ml', 'cl'
35
+ */
36
+ | 'l';
37
+ export type VolumeUnit = LiterUnit<MetricPrefix> | UnitOfVolume;
38
+ /**
39
+ * More SI prefixes also available as literals, just type the string
40
+ * @example 'mg', 'kg'
41
+ */
42
+ export type UnitOfMass = 'oz' | 'st' | 'lb'
43
+ /**
44
+ * More SI prefixes also available as literals, just type the string
45
+ * @example 'mg', 'kg'
46
+ */
47
+ | 'g';
48
+ /**
49
+ * More SI prefixes also available as literals, just type the string
50
+ * @example 'mg', 'kg'
51
+ */
52
+ export type MassUnit = GramUnit<MetricPrefix> | UnitOfMass;
53
+ /**
54
+ * More SI prefixes also available as literals, just type the string
55
+ * @example 'kPa', 'hPa'
56
+ */
57
+ export type UnitOfPressure = 'atm' | 'cmAq' | 'mmHg' | 'inHg' | 'dBASPL'
58
+ /**
59
+ * More SI prefixes also available as literals, just type the string
60
+ * @example 'kPa', 'hPa'
61
+ */
62
+ | 'Pa';
63
+ /**
64
+ * More SI prefixes also available as literals, just type the string
65
+ * @example 'kPa', 'hPa'
66
+ */
67
+ export type PressureUnit = PascalUnit<MetricPrefix> | UnitOfPressure;
68
+ /**
69
+ * More SI prefixes also available as literals, just type the string
70
+ * @example 'ms'
71
+ */
72
+ export type UnitOfTime = 'd' | 'min' | 'hr'
73
+ /**
74
+ * More SI prefixes also available as literals, just type the string
75
+ * @example 'ms'
76
+ */
77
+ | 's';
78
+ /**
79
+ * More SI prefixes also available as literals, just type the string
80
+ * @example 'ms'
81
+ */
82
+ export type TimeUnit = SecondUnit<MetricPrefix> | UnitOfTime;
83
+ export type TemperatureUnit = 'degC' | 'degF' | 'K';
84
+ /**
85
+ * More SI prefixes also available as literals, just type the string
86
+ * @example 'kJ'
87
+ */
88
+ export type UnitOfEnergy = 'kcal' | 'Cal' | 'cal' | 'J';
89
+ export type EnergyUnit = JouleUnit<MetricPrefix> | UnitOfEnergy;
90
+ export type BloodGlucoseUnit = 'mmol<180.15588000005408>/l' | 'mg/dL';
91
+ export type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> = `${TLength}/${TTime}`;
92
+ export type CountPerTime<TTime extends TimeUnit> = `count/${TTime}`;
93
+ export type Unit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | Units | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit;
94
+ export interface IdentifierWithUnit {
95
+ typeIdentifier: string;
96
+ unit: string;
97
+ }
@@ -0,0 +1,30 @@
1
+ export declare enum HKWeatherCondition {
2
+ none = 0,
3
+ clear = 1,
4
+ fair = 2,
5
+ partlyCloudy = 3,
6
+ mostlyCloudy = 4,
7
+ cloudy = 5,
8
+ foggy = 6,
9
+ haze = 7,
10
+ windy = 8,
11
+ blustery = 9,
12
+ smoky = 10,
13
+ dust = 11,
14
+ snow = 12,
15
+ hail = 13,
16
+ sleet = 14,
17
+ freezingDrizzle = 15,
18
+ freezingRain = 16,
19
+ mixedRainAndHail = 17,
20
+ mixedRainAndSnow = 18,
21
+ mixedRainAndSleet = 19,
22
+ mixedSnowAndSleet = 20,
23
+ drizzle = 21,
24
+ scatteredShowers = 22,
25
+ showers = 23,
26
+ thunderstorms = 24,
27
+ tropicalStorm = 25,
28
+ hurricane = 26,
29
+ tornado = 27
30
+ }
@@ -0,0 +1,16 @@
1
+ import type { WorkoutActivityType } from './Workouts';
2
+ /**
3
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutconfiguration Apple Docs }
4
+ */
5
+ export interface WorkoutConfiguration {
6
+ readonly activityType: WorkoutActivityType;
7
+ readonly locationType?: WorkoutSessionLocationType;
8
+ }
9
+ /**
10
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutsessionlocationtype Apple Docs }
11
+ */
12
+ export declare enum WorkoutSessionLocationType {
13
+ unknown = 1,
14
+ indoor = 2,
15
+ outdoor = 3
16
+ }
@@ -0,0 +1,254 @@
1
+ import type { AnyMap } from 'react-native-nitro-modules';
2
+ import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro';
3
+ import type { Device } from './Device';
4
+ import type { Quantity } from './QuantityType';
5
+ import type { PredicateForSamples } from './QueryOptions';
6
+ import type { DeletedSample, GenericMetadata } from './Shared';
7
+ import type { SourceRevision } from './Source';
8
+ export declare enum WorkoutActivityType {
9
+ americanFootball = 1,
10
+ archery = 2,
11
+ australianFootball = 3,
12
+ badminton = 4,
13
+ baseball = 5,
14
+ basketball = 6,
15
+ bowling = 7,
16
+ boxing = 8,// See also HKWorkoutActivityTypeKickboxing.,
17
+ climbing = 9,
18
+ cricket = 10,
19
+ crossTraining = 11,// Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,
20
+ curling = 12,
21
+ cycling = 13,
22
+ dance = 14,
23
+ danceInspiredTraining = 15,// This enum remains available to access older data.,
24
+ elliptical = 16,
25
+ equestrianSports = 17,// Polo, Horse Racing, Horse Riding, etc.,
26
+ fencing = 18,
27
+ fishing = 19,
28
+ functionalStrengthTraining = 20,// Primarily free weights and/or body weight and/or accessories,
29
+ golf = 21,
30
+ gymnastics = 22,
31
+ handball = 23,
32
+ hiking = 24,
33
+ hockey = 25,// Ice Hockey, Field Hockey, etc.,
34
+ hunting = 26,
35
+ lacrosse = 27,
36
+ martialArts = 28,
37
+ mindAndBody = 29,// Qigong, meditation, etc.,
38
+ mixedMetabolicCardioTraining = 30,// This enum remains available to access older data.,
39
+ paddleSports = 31,// Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,
40
+ play = 32,// Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,
41
+ preparationAndRecovery = 33,// Foam rolling, stretching, etc.,
42
+ racquetball = 34,
43
+ rowing = 35,
44
+ rugby = 36,
45
+ running = 37,
46
+ sailing = 38,
47
+ skatingSports = 39,// Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,
48
+ snowSports = 40,// Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,
49
+ soccer = 41,
50
+ softball = 42,
51
+ squash = 43,
52
+ stairClimbing = 44,// See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,
53
+ surfingSports = 45,// Traditional Surfing, Kite Surfing, Wind Surfing, etc.,
54
+ swimming = 46,
55
+ tableTennis = 47,
56
+ tennis = 48,
57
+ trackAndField = 49,// Shot Put, Javelin, Pole Vaulting, etc.,
58
+ traditionalStrengthTraining = 50,// Primarily machines and/or free weights,
59
+ volleyball = 51,
60
+ walking = 52,
61
+ waterFitness = 53,
62
+ waterPolo = 54,
63
+ waterSports = 55,// Water Skiing, Wake Boarding, etc.,
64
+ wrestling = 56,
65
+ yoga = 57,
66
+ barre = 58,// HKWorkoutActivityTypeDanceInspiredTraining,
67
+ coreTraining = 59,
68
+ crossCountrySkiing = 60,
69
+ downhillSkiing = 61,
70
+ flexibility = 62,
71
+ highIntensityIntervalTraining = 63,
72
+ jumpRope = 64,
73
+ kickboxing = 65,
74
+ pilates = 66,// HKWorkoutActivityTypeDanceInspiredTraining,
75
+ snowboarding = 67,
76
+ stairs = 68,
77
+ stepTraining = 69,
78
+ wheelchairWalkPace = 70,
79
+ wheelchairRunPace = 71,
80
+ taiChi = 72,
81
+ mixedCardio = 73,// HKWorkoutActivityTypeMixedMetabolicCardioTraining,
82
+ handCycling = 74,
83
+ discSports = 75,
84
+ fitnessGaming = 76,
85
+ cardioDance = 77,
86
+ socialDance = 78,
87
+ pickleball = 79,
88
+ cooldown = 80,
89
+ swimBikeRun = 82,
90
+ transition = 83,
91
+ underwaterDiving = 84,
92
+ other = 3000
93
+ }
94
+ export declare enum WeatherCondition {
95
+ none = 0,
96
+ clear = 1,
97
+ fair = 2,
98
+ partlyCloudy = 3,
99
+ mostlyCloudy = 4,
100
+ cloudy = 5,
101
+ foggy = 6,
102
+ haze = 7,
103
+ windy = 8,
104
+ blustery = 9,
105
+ smoky = 10,
106
+ dust = 11,
107
+ snow = 12,
108
+ hail = 13,
109
+ sleet = 14,
110
+ freezingDrizzle = 15,
111
+ freezingRain = 16,
112
+ mixedRainAndHail = 17,
113
+ mixedRainAndSnow = 18,
114
+ mixedRainAndSleet = 19,
115
+ mixedSnowAndSleet = 20,
116
+ drizzle = 21,
117
+ scatteredShowers = 22,
118
+ showers = 23,
119
+ thunderstorms = 24,
120
+ tropicalStorm = 25,
121
+ hurricane = 26,
122
+ tornado = 27
123
+ }
124
+ export interface WorkoutMetadata extends GenericMetadata {
125
+ readonly HKWeatherCondition?: WeatherCondition;
126
+ readonly HKWeatherHumidity?: Quantity;
127
+ readonly HKWeatherTemperature?: Quantity;
128
+ readonly HKAverageMETs?: Quantity;
129
+ readonly HKElevationAscended?: Quantity;
130
+ readonly HKIndoorWorkout?: boolean;
131
+ }
132
+ export interface WorkoutEvent {
133
+ readonly type: WorkoutEventType;
134
+ readonly startDate: Date;
135
+ readonly endDate: Date;
136
+ }
137
+ export declare enum WorkoutEventType {
138
+ pause = 1,
139
+ resume = 2,
140
+ lap = 3,
141
+ marker = 4,
142
+ motionPaused = 5,
143
+ motionResumed = 6,
144
+ segment = 7,
145
+ pauseOrResumeRequest = 8
146
+ }
147
+ export interface WorkoutActivity {
148
+ readonly startDate: Date;
149
+ readonly endDate: Date;
150
+ readonly uuid: string;
151
+ readonly duration: number;
152
+ }
153
+ export interface WorkoutRoute {
154
+ readonly locations: readonly WorkoutRouteLocation[];
155
+ readonly HKMetadataKeySyncIdentifier?: string;
156
+ readonly HKMetadataKeySyncVersion?: number;
157
+ }
158
+ export interface QueryWorkoutSamplesWithAnchorResponse {
159
+ readonly workouts: readonly WorkoutProxy[];
160
+ readonly deletedSamples: readonly DeletedSample[];
161
+ readonly newAnchor: string;
162
+ }
163
+ type WorkoutActivityTypePredicate = {
164
+ readonly workoutActivityType: WorkoutActivityType;
165
+ };
166
+ declare enum ComparisonPredicateOperator {
167
+ lessThan = 0,
168
+ lessThanOrEqualTo = 1,
169
+ greaterThan = 2,
170
+ greaterThanOrEqualTo = 3,
171
+ equalTo = 4,
172
+ notEqualTo = 5,
173
+ matches = 6,
174
+ like = 7,
175
+ beginsWith = 8,
176
+ endsWith = 9,
177
+ in = 10,
178
+ customSelector = 11,
179
+ contains = 99,
180
+ between = 100
181
+ }
182
+ type WorkoutDurationPredicate = {
183
+ readonly predicateOperator: ComparisonPredicateOperator;
184
+ readonly durationInSeconds: number;
185
+ };
186
+ export type PredicateForWorkouts = PredicateForSamples | WorkoutActivityTypePredicate | WorkoutDurationPredicate;
187
+ export type PredicateForWorkoutsOr = {
188
+ readonly OR: readonly PredicateForWorkouts[];
189
+ };
190
+ export type PredicateForWorkoutsAnd = {
191
+ readonly AND: readonly PredicateForWorkouts[];
192
+ };
193
+ export type FilterForWorkouts = PredicateForWorkouts | PredicateForWorkoutsOr | PredicateForWorkoutsAnd;
194
+ export interface WorkoutQueryOptionsWithAnchor {
195
+ energyUnit?: string;
196
+ distanceUnit?: string;
197
+ filter?: FilterForWorkouts;
198
+ limit?: number;
199
+ anchor?: string;
200
+ }
201
+ export interface WorkoutQueryOptions {
202
+ energyUnit?: string;
203
+ distanceUnit?: string;
204
+ filter?: FilterForWorkouts;
205
+ limit?: number;
206
+ ascending?: boolean;
207
+ }
208
+ export interface WorkoutRouteLocation {
209
+ readonly altitude: number;
210
+ readonly course: number;
211
+ readonly date: Date;
212
+ readonly distance: number | null;
213
+ readonly horizontalAccuracy: number;
214
+ readonly latitude: number;
215
+ readonly longitude: number;
216
+ readonly speed: number;
217
+ readonly speedAccuracy: number;
218
+ readonly verticalAccuracy: number;
219
+ }
220
+ export interface LocationForSaving {
221
+ readonly altitude: number;
222
+ readonly course: number;
223
+ readonly date: Date;
224
+ readonly horizontalAccuracy: number;
225
+ readonly latitude: number;
226
+ readonly longitude: number;
227
+ readonly speed: number;
228
+ readonly verticalAccuracy: number;
229
+ }
230
+ export interface WorkoutPlan {
231
+ readonly id: string;
232
+ readonly activityType: WorkoutActivityType;
233
+ }
234
+ export interface WorkoutTotals {
235
+ readonly distance?: number;
236
+ readonly energyBurned?: number;
237
+ }
238
+ export interface WorkoutSample {
239
+ readonly uuid: string;
240
+ readonly device?: Device;
241
+ readonly workoutActivityType: WorkoutActivityType;
242
+ readonly duration: Quantity;
243
+ readonly totalDistance?: Quantity;
244
+ readonly totalEnergyBurned?: Quantity;
245
+ readonly totalSwimmingStrokeCount?: Quantity;
246
+ readonly totalFlightsClimbed?: Quantity;
247
+ readonly startDate: Date;
248
+ readonly endDate: Date;
249
+ readonly metadata?: AnyMap;
250
+ readonly sourceRevision?: SourceRevision;
251
+ readonly events?: readonly WorkoutEvent[];
252
+ readonly activities?: readonly WorkoutActivity[];
253
+ }
254
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { CategoryTypeIdentifier } from '../types/CategoryTypeIdentifier';
2
+ export declare function getCategorySampleById<T extends CategoryTypeIdentifier>(identifier: T, uuid: string): Promise<import("../types/CategoryType").CategorySampleTyped<T> | undefined>;
3
+ export default getCategorySampleById;
@@ -0,0 +1,3 @@
1
+ import type { CategoryTypeIdentifier } from '../types/CategoryTypeIdentifier';
2
+ export declare function getMostRecentCategorySample<T extends CategoryTypeIdentifier>(identifier: T): Promise<import("../types/CategoryType").CategorySampleTyped<T> | undefined>;
3
+ export default getMostRecentCategorySample;
@@ -0,0 +1,3 @@
1
+ import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
2
+ declare function getMostRecentQuantitySample(identifier: QuantityTypeIdentifier, unit?: string): Promise<import("../types/QuantitySample").QuantitySample | undefined>;
3
+ export default getMostRecentQuantitySample;
@@ -0,0 +1,3 @@
1
+ import type { WorkoutQueryOptions } from '../types/Workouts';
2
+ declare const getMostRecentWorkout: (options: Pick<WorkoutQueryOptions, "distanceUnit" | "energyUnit">) => Promise<import("../specs/WorkoutProxy.nitro").WorkoutProxy | undefined>;
3
+ export default getMostRecentWorkout;
@@ -0,0 +1,3 @@
1
+ import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
2
+ declare const getPreferredUnit: (quantityType: QuantityTypeIdentifier) => Promise<string>;
3
+ export default getPreferredUnit;
@@ -0,0 +1,3 @@
1
+ import type { QuantityTypeIdentifier } from '../types/QuantityTypeIdentifier';
2
+ declare function getQuantitySampleById(identifier: QuantityTypeIdentifier, uuid: string, unit?: string): Promise<import("../types/QuantitySample").QuantitySample | undefined>;
3
+ export default getQuantitySampleById;
@@ -0,0 +1,3 @@
1
+ import type { WorkoutQueryOptions } from '../types/Workouts';
2
+ declare const getWorkoutById: (uuid: string, options: Pick<WorkoutQueryOptions, "distanceUnit" | "energyUnit">) => Promise<import("../specs/WorkoutProxy.nitro").WorkoutProxy | undefined>;
3
+ export default getWorkoutById;
@@ -0,0 +1,5 @@
1
+ import type { SampleTypeIdentifier } from '../types/Shared';
2
+ import type { OnChangeCallbackArgs } from '../types/Subscriptons';
3
+ export declare const subscribeToChanges: (identifier: SampleTypeIdentifier, callback: (args: OnChangeCallbackArgs) => void) => {
4
+ remove: () => boolean;
5
+ };
@@ -0,0 +1 @@
1
+ ** linguist-generated=true