@kingstinct/react-native-healthkit 10.1.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/README.md +2 -2
  2. package/ios/CoreModule.swift +5 -15
  3. package/ios/CorrelationTypeModule.swift +7 -2
  4. package/ios/ElectrocardiogramModule.swift +210 -0
  5. package/ios/QuantityTypeModule.swift +113 -124
  6. package/ios/Serializers.swift +39 -66
  7. package/ios/WorkoutProxy.swift +38 -20
  8. package/ios/WorkoutsModule.swift +7 -18
  9. package/lib/commonjs/healthkit.ios.js +6 -2
  10. package/lib/commonjs/healthkit.js +10 -2
  11. package/lib/commonjs/hooks/useMostRecentWorkout.js +2 -9
  12. package/lib/commonjs/hooks/useWorkoutById.js +1 -4
  13. package/lib/commonjs/modules.js +2 -1
  14. package/lib/commonjs/specs/ElectrocardiogramModule.nitro.js +2 -0
  15. package/lib/commonjs/types/ElectrocardiogramSample.js +2 -0
  16. package/lib/commonjs/utils/getMostRecentWorkout.js +1 -3
  17. package/lib/commonjs/utils/getWorkoutById.js +1 -3
  18. package/lib/module/healthkit.ios.js +5 -1
  19. package/lib/module/healthkit.js +8 -0
  20. package/lib/module/hooks/useMostRecentWorkout.js +3 -10
  21. package/lib/module/hooks/useWorkoutById.js +1 -4
  22. package/lib/module/modules.js +1 -0
  23. package/lib/module/specs/ElectrocardiogramModule.nitro.js +1 -0
  24. package/lib/module/types/ElectrocardiogramSample.js +1 -0
  25. package/lib/module/utils/getMostRecentWorkout.js +1 -3
  26. package/lib/module/utils/getWorkoutById.js +1 -3
  27. package/lib/typescript/healthkit.d.ts +3 -1
  28. package/lib/typescript/healthkit.ios.d.ts +5 -1
  29. package/lib/typescript/hooks/useMostRecentWorkout.d.ts +1 -4
  30. package/lib/typescript/modules.d.ts +2 -0
  31. package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +8 -0
  32. package/lib/typescript/specs/WorkoutProxy.nitro.d.ts +11 -0
  33. package/lib/typescript/types/ElectrocardiogramSample.d.ts +39 -0
  34. package/lib/typescript/types/Workouts.d.ts +0 -8
  35. package/lib/typescript/utils/getMostRecentWorkout.d.ts +1 -2
  36. package/lib/typescript/utils/getWorkoutById.d.ts +1 -2
  37. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +136 -87
  38. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +924 -493
  39. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +29 -0
  40. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +16 -8
  41. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +31 -16
  42. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +6 -4
  43. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +4 -2
  44. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +7 -5
  45. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +6 -4
  46. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.cpp +11 -0
  47. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +152 -0
  48. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +7 -5
  49. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +5 -3
  50. package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.hpp +3 -1
  51. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +7 -5
  52. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +50 -22
  53. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +9 -7
  54. package/nitrogen/generated/ios/swift/CategorySample.swift +4 -2
  55. package/nitrogen/generated/ios/swift/CategorySampleForSaving.swift +2 -1
  56. package/nitrogen/generated/ios/swift/CorrelationObject.swift +2 -0
  57. package/nitrogen/generated/ios/swift/DeletedSample.swift +2 -1
  58. package/nitrogen/generated/ios/swift/Device.swift +16 -8
  59. package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +179 -0
  60. package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +184 -0
  61. package/nitrogen/generated/ios/swift/ElectrocardiogramClassification.swift +60 -0
  62. package/nitrogen/generated/ios/swift/ElectrocardiogramLead.swift +40 -0
  63. package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +298 -0
  64. package/nitrogen/generated/ios/swift/ElectrocardiogramSamplesWithAnchorResponse.swift +81 -0
  65. package/nitrogen/generated/ios/swift/ElectrocardiogramSymptomsStatus.swift +44 -0
  66. package/nitrogen/generated/ios/swift/ElectrocardiogramVoltage.swift +57 -0
  67. package/nitrogen/generated/ios/swift/FilterForSamples.swift +2 -0
  68. package/nitrogen/generated/ios/swift/Func_void_AuthorizationRequestStatus.swift +1 -0
  69. package/nitrogen/generated/ios/swift/Func_void_BiologicalSex.swift +1 -0
  70. package/nitrogen/generated/ios/swift/Func_void_BloodType.swift +1 -0
  71. package/nitrogen/generated/ios/swift/Func_void_CategorySamplesWithAnchorResponse.swift +1 -0
  72. package/nitrogen/generated/ios/swift/Func_void_ElectrocardiogramSamplesWithAnchorResponse.swift +47 -0
  73. package/nitrogen/generated/ios/swift/Func_void_FitzpatrickSkinType.swift +1 -0
  74. package/nitrogen/generated/ios/swift/Func_void_HeartbeatSeriesSamplesWithAnchorResponse.swift +1 -0
  75. package/nitrogen/generated/ios/swift/Func_void_OnChangeCallbackArgs.swift +1 -0
  76. package/nitrogen/generated/ios/swift/Func_void_QuantitySamplesWithAnchorResponse.swift +1 -0
  77. package/nitrogen/generated/ios/swift/Func_void_QueryStatisticsResponse.swift +1 -0
  78. package/nitrogen/generated/ios/swift/Func_void_QueryWorkoutSamplesWithAnchorResponse.swift +1 -0
  79. package/nitrogen/generated/ios/swift/Func_void_WheelchairUse.swift +1 -0
  80. package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -0
  81. package/nitrogen/generated/ios/swift/Func_void_double.swift +1 -0
  82. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -0
  83. package/nitrogen/generated/ios/swift/Func_void_std__optional_QueryStatisticsResponse_.swift +54 -0
  84. package/nitrogen/generated/ios/swift/Func_void_std__optional_WorkoutPlan_.swift +3 -1
  85. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__chrono__system_clock__time_point_.swift +3 -1
  86. package/nitrogen/generated/ios/swift/{Func_void_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec_.swift → Func_void_std__shared_ptr_HybridWorkoutProxySpec_.swift} +9 -8
  87. package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__QueryStatisticsResponse_.swift +55 -0
  88. package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__bool_.swift +2 -1
  89. package/nitrogen/generated/ios/swift/Func_void_std__vector_CategorySample_.swift +1 -0
  90. package/nitrogen/generated/ios/swift/Func_void_std__vector_CorrelationSample_.swift +1 -0
  91. package/nitrogen/generated/ios/swift/Func_void_std__vector_ElectrocardiogramSample_.swift +47 -0
  92. package/nitrogen/generated/ios/swift/Func_void_std__vector_HeartbeatSeriesSample_.swift +1 -0
  93. package/nitrogen/generated/ios/swift/Func_void_std__vector_IdentifierWithUnit_.swift +1 -0
  94. package/nitrogen/generated/ios/swift/Func_void_std__vector_QuantitySample_.swift +1 -0
  95. package/nitrogen/generated/ios/swift/Func_void_std__vector_QueryStatisticsResponse_.swift +1 -0
  96. package/nitrogen/generated/ios/swift/Func_void_std__vector_StateOfMindSample_.swift +1 -0
  97. package/nitrogen/generated/ios/swift/Func_void_std__vector_WorkoutRoute_.swift +1 -0
  98. package/nitrogen/generated/ios/swift/{Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridSourceProxySpec__.swift → Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__.swift} +9 -8
  99. package/nitrogen/generated/ios/swift/{Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec__.swift → Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__.swift} +9 -8
  100. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +6 -3
  101. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +2 -1
  102. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +17 -7
  103. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +2 -1
  104. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +15 -6
  105. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -1
  106. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +24 -15
  107. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +2 -1
  108. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +15 -6
  109. package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +50 -0
  110. package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +162 -0
  111. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +2 -1
  112. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +17 -7
  113. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +2 -1
  114. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +21 -9
  115. package/nitrogen/generated/ios/swift/HybridSourceProxySpec.swift +2 -1
  116. package/nitrogen/generated/ios/swift/HybridSourceProxySpec_cxx.swift +17 -7
  117. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +2 -1
  118. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +19 -8
  119. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +8 -5
  120. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +108 -41
  121. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec.swift +2 -1
  122. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec_cxx.swift +31 -22
  123. package/nitrogen/generated/ios/swift/OnChangeCallbackArgs.swift +2 -1
  124. package/nitrogen/generated/ios/swift/PredicateForSamples.swift +2 -0
  125. package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +2 -0
  126. package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +3 -3
  127. package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +2 -1
  128. package/nitrogen/generated/ios/swift/PredicateWithStartAndEnd.swift +4 -2
  129. package/nitrogen/generated/ios/swift/QuantitySample.swift +4 -2
  130. package/nitrogen/generated/ios/swift/QuantitySampleForSaving.swift +2 -1
  131. package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +4 -2
  132. package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +6 -3
  133. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +2 -1
  134. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +4 -2
  135. package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +18 -9
  136. package/nitrogen/generated/ios/swift/QueryWorkoutSamplesWithAnchorResponse.swift +7 -7
  137. package/nitrogen/generated/ios/swift/SampleForSaving.swift +2 -0
  138. package/nitrogen/generated/ios/swift/SourceRevision.swift +13 -9
  139. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +6 -3
  140. package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +4 -2
  141. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +2 -0
  142. package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +2 -0
  143. package/nitrogen/generated/ios/swift/Variant_String_Double_Bool_Date.swift +2 -0
  144. package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +4 -61
  145. package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +6 -62
  146. package/nitrogen/generated/ios/swift/WorkoutRoute.swift +2 -1
  147. package/nitrogen/generated/ios/swift/WorkoutSample.swift +12 -123
  148. package/nitrogen/generated/shared/c++/AuthorizationRequestStatus.hpp +9 -11
  149. package/nitrogen/generated/shared/c++/AuthorizationStatus.hpp +9 -11
  150. package/nitrogen/generated/shared/c++/BiologicalSex.hpp +9 -11
  151. package/nitrogen/generated/shared/c++/BloodType.hpp +9 -11
  152. package/nitrogen/generated/shared/c++/CategorySample.hpp +14 -16
  153. package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +11 -13
  154. package/nitrogen/generated/shared/c++/CategorySamplesWithAnchorResponse.hpp +11 -13
  155. package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +131 -133
  156. package/nitrogen/generated/shared/c++/ComparisonPredicateOperator.hpp +26 -13
  157. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +12 -14
  158. package/nitrogen/generated/shared/c++/CorrelationTypeIdentifier.hpp +7 -9
  159. package/nitrogen/generated/shared/c++/DeletedSample.hpp +5 -7
  160. package/nitrogen/generated/shared/c++/Device.hpp +5 -7
  161. package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +101 -0
  162. package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +100 -0
  163. package/nitrogen/generated/shared/c++/ElectrocardiogramClassification.hpp +96 -0
  164. package/nitrogen/generated/shared/c++/ElectrocardiogramLead.hpp +76 -0
  165. package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +135 -0
  166. package/nitrogen/generated/shared/c++/ElectrocardiogramSamplesWithAnchorResponse.hpp +81 -0
  167. package/nitrogen/generated/shared/c++/ElectrocardiogramSymptomsStatus.hpp +80 -0
  168. package/nitrogen/generated/shared/c++/ElectrocardiogramVoltage.hpp +76 -0
  169. package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +9 -11
  170. package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +9 -11
  171. package/nitrogen/generated/shared/c++/FitzpatrickSkinType.hpp +9 -11
  172. package/nitrogen/generated/shared/c++/Heartbeat.hpp +4 -6
  173. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +15 -17
  174. package/nitrogen/generated/shared/c++/HeartbeatSeriesSamplesWithAnchorResponse.hpp +11 -13
  175. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +2 -2
  176. package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.hpp +1 -1
  177. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +4 -4
  178. package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +2 -2
  179. package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.cpp +22 -0
  180. package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +76 -0
  181. package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +3 -3
  182. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +3 -3
  183. package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +3 -3
  184. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +6 -4
  185. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +18 -9
  186. package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.hpp +4 -4
  187. package/nitrogen/generated/shared/c++/IdentifierWithUnit.hpp +4 -6
  188. package/nitrogen/generated/shared/c++/IntervalComponents.hpp +4 -6
  189. package/nitrogen/generated/shared/c++/LocationForSaving.hpp +4 -6
  190. package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +397 -399
  191. package/nitrogen/generated/shared/c++/OnChangeCallbackArgs.hpp +8 -10
  192. package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +9 -11
  193. package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +9 -11
  194. package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +6 -8
  195. package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +9 -11
  196. package/nitrogen/generated/shared/c++/PredicateWithMetadataOperator.hpp +11 -13
  197. package/nitrogen/generated/shared/c++/PredicateWithStartAndEnd.hpp +5 -7
  198. package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +4 -6
  199. package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +5 -7
  200. package/nitrogen/generated/shared/c++/Quantity.hpp +4 -6
  201. package/nitrogen/generated/shared/c++/QuantityDateInterval.hpp +4 -6
  202. package/nitrogen/generated/shared/c++/QuantitySample.hpp +14 -16
  203. package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +11 -13
  204. package/nitrogen/generated/shared/c++/QuantitySamplesWithAnchorResponse.hpp +11 -13
  205. package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +241 -243
  206. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +9 -11
  207. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +9 -11
  208. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +8 -10
  209. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +9 -11
  210. package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +26 -28
  211. package/nitrogen/generated/shared/c++/QueryWorkoutSamplesWithAnchorResponse.hpp +10 -12
  212. package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +383 -385
  213. package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +373 -375
  214. package/nitrogen/generated/shared/c++/Source.hpp +4 -6
  215. package/nitrogen/generated/shared/c++/SourceRevision.hpp +7 -9
  216. package/nitrogen/generated/shared/c++/StateOfMindAssociation.hpp +10 -12
  217. package/nitrogen/generated/shared/c++/StateOfMindKind.hpp +14 -13
  218. package/nitrogen/generated/shared/c++/StateOfMindLabel.hpp +10 -12
  219. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +24 -26
  220. package/nitrogen/generated/shared/c++/StateOfMindValenceClassification.hpp +10 -12
  221. package/nitrogen/generated/shared/c++/StatisticsOptions.hpp +17 -19
  222. package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +9 -11
  223. package/nitrogen/generated/shared/c++/UpdateFrequency.hpp +10 -12
  224. package/nitrogen/generated/shared/c++/WheelchairUse.hpp +9 -11
  225. package/nitrogen/generated/shared/c++/WorkoutActivity.hpp +4 -6
  226. package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +96 -13
  227. package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +7 -9
  228. package/nitrogen/generated/shared/c++/WorkoutConfiguration.hpp +11 -13
  229. package/nitrogen/generated/shared/c++/WorkoutDurationPredicate.hpp +7 -9
  230. package/nitrogen/generated/shared/c++/WorkoutEvent.hpp +7 -9
  231. package/nitrogen/generated/shared/c++/WorkoutEventType.hpp +10 -12
  232. package/nitrogen/generated/shared/c++/WorkoutPlan.hpp +7 -9
  233. package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +10 -21
  234. package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +11 -21
  235. package/nitrogen/generated/shared/c++/WorkoutRoute.hpp +9 -11
  236. package/nitrogen/generated/shared/c++/WorkoutRouteLocation.hpp +4 -6
  237. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +25 -43
  238. package/nitrogen/generated/shared/c++/WorkoutSessionLocationType.hpp +10 -12
  239. package/nitrogen/generated/shared/c++/WorkoutTotals.hpp +4 -6
  240. package/package.json +11 -11
  241. package/src/healthkit.ios.ts +9 -0
  242. package/src/healthkit.ts +16 -0
  243. package/src/hooks/useMostRecentWorkout.ts +3 -17
  244. package/src/hooks/useWorkoutById.ts +1 -4
  245. package/src/modules.ts +6 -0
  246. package/src/specs/ElectrocardiogramModule.nitro.ts +18 -0
  247. package/src/specs/WorkoutProxy.nitro.ts +18 -1
  248. package/src/types/ElectrocardiogramSample.ts +60 -0
  249. package/src/types/Workouts.ts +0 -8
  250. package/src/utils/getMostRecentWorkout.ts +1 -6
  251. package/src/utils/getWorkoutById.ts +1 -6
@@ -22,8 +22,8 @@
22
22
  namespace margelo::nitro::healthkit { enum class SampleTypeIdentifier; }
23
23
 
24
24
  #include "SampleTypeIdentifier.hpp"
25
- #include <optional>
26
25
  #include <string>
26
+ #include <optional>
27
27
 
28
28
  namespace margelo::nitro::healthkit {
29
29
 
@@ -44,21 +44,19 @@ namespace margelo::nitro::healthkit {
44
44
 
45
45
  namespace margelo::nitro {
46
46
 
47
- using namespace margelo::nitro::healthkit;
48
-
49
47
  // C++ OnChangeCallbackArgs <> JS OnChangeCallbackArgs (object)
50
48
  template <>
51
- struct JSIConverter<OnChangeCallbackArgs> final {
52
- static inline OnChangeCallbackArgs fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ struct JSIConverter<margelo::nitro::healthkit::OnChangeCallbackArgs> final {
50
+ static inline margelo::nitro::healthkit::OnChangeCallbackArgs fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
51
  jsi::Object obj = arg.asObject(runtime);
54
- return OnChangeCallbackArgs(
55
- JSIConverter<SampleTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "typeIdentifier")),
52
+ return margelo::nitro::healthkit::OnChangeCallbackArgs(
53
+ JSIConverter<margelo::nitro::healthkit::SampleTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "typeIdentifier")),
56
54
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "errorMessage"))
57
55
  );
58
56
  }
59
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const OnChangeCallbackArgs& arg) {
57
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::OnChangeCallbackArgs& arg) {
60
58
  jsi::Object obj(runtime);
61
- obj.setProperty(runtime, "typeIdentifier", JSIConverter<SampleTypeIdentifier>::toJSI(runtime, arg.typeIdentifier));
59
+ obj.setProperty(runtime, "typeIdentifier", JSIConverter<margelo::nitro::healthkit::SampleTypeIdentifier>::toJSI(runtime, arg.typeIdentifier));
62
60
  obj.setProperty(runtime, "errorMessage", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.errorMessage));
63
61
  return obj;
64
62
  }
@@ -67,7 +65,7 @@ namespace margelo::nitro {
67
65
  return false;
68
66
  }
69
67
  jsi::Object obj = value.getObject(runtime);
70
- if (!JSIConverter<SampleTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "typeIdentifier"))) return false;
68
+ if (!JSIConverter<margelo::nitro::healthkit::SampleTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "typeIdentifier"))) return false;
71
69
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "errorMessage"))) return false;
72
70
  return true;
73
71
  }
@@ -33,8 +33,6 @@ namespace margelo::nitro::healthkit { struct WorkoutActivityTypePredicate; }
33
33
  // Forward declaration of `WorkoutDurationPredicate` to properly resolve imports.
34
34
  namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
35
35
 
36
- #include <vector>
37
- #include <variant>
38
36
  #include "PredicateWithUUID.hpp"
39
37
  #include "PredicateWithUUIDs.hpp"
40
38
  #include "PredicateWithMetadataKey.hpp"
@@ -42,6 +40,8 @@ namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
42
40
  #include "PredicateFromWorkout.hpp"
43
41
  #include "WorkoutActivityTypePredicate.hpp"
44
42
  #include "WorkoutDurationPredicate.hpp"
43
+ #include <variant>
44
+ #include <vector>
45
45
 
46
46
  namespace margelo::nitro::healthkit {
47
47
 
@@ -61,20 +61,18 @@ namespace margelo::nitro::healthkit {
61
61
 
62
62
  namespace margelo::nitro {
63
63
 
64
- using namespace margelo::nitro::healthkit;
65
-
66
64
  // C++ PredicateForWorkoutsAnd <> JS PredicateForWorkoutsAnd (object)
67
65
  template <>
68
- struct JSIConverter<PredicateForWorkoutsAnd> final {
69
- static inline PredicateForWorkoutsAnd fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
66
+ struct JSIConverter<margelo::nitro::healthkit::PredicateForWorkoutsAnd> final {
67
+ static inline margelo::nitro::healthkit::PredicateForWorkoutsAnd fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
70
68
  jsi::Object obj = arg.asObject(runtime);
71
- return PredicateForWorkoutsAnd(
72
- JSIConverter<std::vector<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, WorkoutActivityTypePredicate, WorkoutDurationPredicate>>>::fromJSI(runtime, obj.getProperty(runtime, "AND"))
69
+ return margelo::nitro::healthkit::PredicateForWorkoutsAnd(
70
+ JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::WorkoutActivityTypePredicate, margelo::nitro::healthkit::WorkoutDurationPredicate>>>::fromJSI(runtime, obj.getProperty(runtime, "AND"))
73
71
  );
74
72
  }
75
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const PredicateForWorkoutsAnd& arg) {
73
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::PredicateForWorkoutsAnd& arg) {
76
74
  jsi::Object obj(runtime);
77
- obj.setProperty(runtime, "AND", JSIConverter<std::vector<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, WorkoutActivityTypePredicate, WorkoutDurationPredicate>>>::toJSI(runtime, arg.AND));
75
+ obj.setProperty(runtime, "AND", JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::WorkoutActivityTypePredicate, margelo::nitro::healthkit::WorkoutDurationPredicate>>>::toJSI(runtime, arg.AND));
78
76
  return obj;
79
77
  }
80
78
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -82,7 +80,7 @@ namespace margelo::nitro {
82
80
  return false;
83
81
  }
84
82
  jsi::Object obj = value.getObject(runtime);
85
- if (!JSIConverter<std::vector<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, WorkoutActivityTypePredicate, WorkoutDurationPredicate>>>::canConvert(runtime, obj.getProperty(runtime, "AND"))) return false;
83
+ if (!JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::WorkoutActivityTypePredicate, margelo::nitro::healthkit::WorkoutDurationPredicate>>>::canConvert(runtime, obj.getProperty(runtime, "AND"))) return false;
86
84
  return true;
87
85
  }
88
86
  };
@@ -33,8 +33,6 @@ namespace margelo::nitro::healthkit { struct WorkoutActivityTypePredicate; }
33
33
  // Forward declaration of `WorkoutDurationPredicate` to properly resolve imports.
34
34
  namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
35
35
 
36
- #include <vector>
37
- #include <variant>
38
36
  #include "PredicateWithUUID.hpp"
39
37
  #include "PredicateWithUUIDs.hpp"
40
38
  #include "PredicateWithMetadataKey.hpp"
@@ -42,6 +40,8 @@ namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
42
40
  #include "PredicateFromWorkout.hpp"
43
41
  #include "WorkoutActivityTypePredicate.hpp"
44
42
  #include "WorkoutDurationPredicate.hpp"
43
+ #include <variant>
44
+ #include <vector>
45
45
 
46
46
  namespace margelo::nitro::healthkit {
47
47
 
@@ -61,20 +61,18 @@ namespace margelo::nitro::healthkit {
61
61
 
62
62
  namespace margelo::nitro {
63
63
 
64
- using namespace margelo::nitro::healthkit;
65
-
66
64
  // C++ PredicateForWorkoutsOr <> JS PredicateForWorkoutsOr (object)
67
65
  template <>
68
- struct JSIConverter<PredicateForWorkoutsOr> final {
69
- static inline PredicateForWorkoutsOr fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
66
+ struct JSIConverter<margelo::nitro::healthkit::PredicateForWorkoutsOr> final {
67
+ static inline margelo::nitro::healthkit::PredicateForWorkoutsOr fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
70
68
  jsi::Object obj = arg.asObject(runtime);
71
- return PredicateForWorkoutsOr(
72
- JSIConverter<std::vector<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, WorkoutActivityTypePredicate, WorkoutDurationPredicate>>>::fromJSI(runtime, obj.getProperty(runtime, "OR"))
69
+ return margelo::nitro::healthkit::PredicateForWorkoutsOr(
70
+ JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::WorkoutActivityTypePredicate, margelo::nitro::healthkit::WorkoutDurationPredicate>>>::fromJSI(runtime, obj.getProperty(runtime, "OR"))
73
71
  );
74
72
  }
75
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const PredicateForWorkoutsOr& arg) {
73
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::PredicateForWorkoutsOr& arg) {
76
74
  jsi::Object obj(runtime);
77
- obj.setProperty(runtime, "OR", JSIConverter<std::vector<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, WorkoutActivityTypePredicate, WorkoutDurationPredicate>>>::toJSI(runtime, arg.OR));
75
+ obj.setProperty(runtime, "OR", JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::WorkoutActivityTypePredicate, margelo::nitro::healthkit::WorkoutDurationPredicate>>>::toJSI(runtime, arg.OR));
78
76
  return obj;
79
77
  }
80
78
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -82,7 +80,7 @@ namespace margelo::nitro {
82
80
  return false;
83
81
  }
84
82
  jsi::Object obj = value.getObject(runtime);
85
- if (!JSIConverter<std::vector<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, WorkoutActivityTypePredicate, WorkoutDurationPredicate>>>::canConvert(runtime, obj.getProperty(runtime, "OR"))) return false;
83
+ if (!JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::PredicateWithUUID, margelo::nitro::healthkit::PredicateWithUUIDs, margelo::nitro::healthkit::PredicateWithMetadataKey, margelo::nitro::healthkit::PredicateWithStartAndEnd, margelo::nitro::healthkit::PredicateFromWorkout, margelo::nitro::healthkit::WorkoutActivityTypePredicate, margelo::nitro::healthkit::WorkoutDurationPredicate>>>::canConvert(runtime, obj.getProperty(runtime, "OR"))) return false;
86
84
  return true;
87
85
  }
88
86
  };
@@ -31,29 +31,27 @@ namespace margelo::nitro::healthkit {
31
31
  */
32
32
  struct PredicateFromWorkout {
33
33
  public:
34
- std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec> workout SWIFT_PRIVATE;
34
+ std::shared_ptr<HybridWorkoutProxySpec> workout SWIFT_PRIVATE;
35
35
 
36
36
  public:
37
37
  PredicateFromWorkout() = default;
38
- explicit PredicateFromWorkout(std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec> workout): workout(workout) {}
38
+ explicit PredicateFromWorkout(std::shared_ptr<HybridWorkoutProxySpec> workout): workout(workout) {}
39
39
  };
40
40
 
41
41
  } // namespace margelo::nitro::healthkit
42
42
 
43
43
  namespace margelo::nitro {
44
44
 
45
- using namespace margelo::nitro::healthkit;
46
-
47
45
  // C++ PredicateFromWorkout <> JS PredicateFromWorkout (object)
48
46
  template <>
49
- struct JSIConverter<PredicateFromWorkout> final {
50
- static inline PredicateFromWorkout fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
47
+ struct JSIConverter<margelo::nitro::healthkit::PredicateFromWorkout> final {
48
+ static inline margelo::nitro::healthkit::PredicateFromWorkout fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
49
  jsi::Object obj = arg.asObject(runtime);
52
- return PredicateFromWorkout(
50
+ return margelo::nitro::healthkit::PredicateFromWorkout(
53
51
  JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>::fromJSI(runtime, obj.getProperty(runtime, "workout"))
54
52
  );
55
53
  }
56
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const PredicateFromWorkout& arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::PredicateFromWorkout& arg) {
57
55
  jsi::Object obj(runtime);
58
56
  obj.setProperty(runtime, "workout", JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>::toJSI(runtime, arg.workout));
59
57
  return obj;
@@ -22,10 +22,10 @@
22
22
  namespace margelo::nitro::healthkit { enum class PredicateWithMetadataOperator; }
23
23
 
24
24
  #include <string>
25
- #include <optional>
26
25
  #include "PredicateWithMetadataOperator.hpp"
27
- #include <variant>
26
+ #include <optional>
28
27
  #include <chrono>
28
+ #include <variant>
29
29
 
30
30
  namespace margelo::nitro::healthkit {
31
31
 
@@ -47,23 +47,21 @@ namespace margelo::nitro::healthkit {
47
47
 
48
48
  namespace margelo::nitro {
49
49
 
50
- using namespace margelo::nitro::healthkit;
51
-
52
50
  // C++ PredicateWithMetadataKey <> JS PredicateWithMetadataKey (object)
53
51
  template <>
54
- struct JSIConverter<PredicateWithMetadataKey> final {
55
- static inline PredicateWithMetadataKey fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
+ struct JSIConverter<margelo::nitro::healthkit::PredicateWithMetadataKey> final {
53
+ static inline margelo::nitro::healthkit::PredicateWithMetadataKey fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
56
54
  jsi::Object obj = arg.asObject(runtime);
57
- return PredicateWithMetadataKey(
55
+ return margelo::nitro::healthkit::PredicateWithMetadataKey(
58
56
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "withMetadataKey")),
59
- JSIConverter<std::optional<PredicateWithMetadataOperator>>::fromJSI(runtime, obj.getProperty(runtime, "operatorType")),
57
+ JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataOperator>>::fromJSI(runtime, obj.getProperty(runtime, "operatorType")),
60
58
  JSIConverter<std::optional<std::variant<std::string, double, bool, std::chrono::system_clock::time_point>>>::fromJSI(runtime, obj.getProperty(runtime, "value"))
61
59
  );
62
60
  }
63
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const PredicateWithMetadataKey& arg) {
61
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::PredicateWithMetadataKey& arg) {
64
62
  jsi::Object obj(runtime);
65
63
  obj.setProperty(runtime, "withMetadataKey", JSIConverter<std::string>::toJSI(runtime, arg.withMetadataKey));
66
- obj.setProperty(runtime, "operatorType", JSIConverter<std::optional<PredicateWithMetadataOperator>>::toJSI(runtime, arg.operatorType));
64
+ obj.setProperty(runtime, "operatorType", JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataOperator>>::toJSI(runtime, arg.operatorType));
67
65
  obj.setProperty(runtime, "value", JSIConverter<std::optional<std::variant<std::string, double, bool, std::chrono::system_clock::time_point>>>::toJSI(runtime, arg.value));
68
66
  return obj;
69
67
  }
@@ -73,7 +71,7 @@ namespace margelo::nitro {
73
71
  }
74
72
  jsi::Object obj = value.getObject(runtime);
75
73
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "withMetadataKey"))) return false;
76
- if (!JSIConverter<std::optional<PredicateWithMetadataOperator>>::canConvert(runtime, obj.getProperty(runtime, "operatorType"))) return false;
74
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataOperator>>::canConvert(runtime, obj.getProperty(runtime, "operatorType"))) return false;
77
75
  if (!JSIConverter<std::optional<std::variant<std::string, double, bool, std::chrono::system_clock::time_point>>>::canConvert(runtime, obj.getProperty(runtime, "value"))) return false;
78
76
  return true;
79
77
  }
@@ -39,28 +39,26 @@ namespace margelo::nitro::healthkit {
39
39
 
40
40
  namespace margelo::nitro {
41
41
 
42
- using namespace margelo::nitro::healthkit;
43
-
44
42
  // C++ PredicateWithMetadataOperator <> JS PredicateWithMetadataOperator (union)
45
43
  template <>
46
- struct JSIConverter<PredicateWithMetadataOperator> final {
47
- static inline PredicateWithMetadataOperator fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
44
+ struct JSIConverter<margelo::nitro::healthkit::PredicateWithMetadataOperator> final {
45
+ static inline margelo::nitro::healthkit::PredicateWithMetadataOperator fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
46
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
49
47
  switch (hashString(unionValue.c_str(), unionValue.size())) {
50
- case hashString("equalTo"): return PredicateWithMetadataOperator::EQUALTO;
51
- case hashString("notEqualTo"): return PredicateWithMetadataOperator::NOTEQUALTO;
52
- case hashString("greaterThan"): return PredicateWithMetadataOperator::GREATERTHAN;
53
- case hashString("lessThan"): return PredicateWithMetadataOperator::LESSTHAN;
48
+ case hashString("equalTo"): return margelo::nitro::healthkit::PredicateWithMetadataOperator::EQUALTO;
49
+ case hashString("notEqualTo"): return margelo::nitro::healthkit::PredicateWithMetadataOperator::NOTEQUALTO;
50
+ case hashString("greaterThan"): return margelo::nitro::healthkit::PredicateWithMetadataOperator::GREATERTHAN;
51
+ case hashString("lessThan"): return margelo::nitro::healthkit::PredicateWithMetadataOperator::LESSTHAN;
54
52
  default: [[unlikely]]
55
53
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum PredicateWithMetadataOperator - invalid value!");
56
54
  }
57
55
  }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, PredicateWithMetadataOperator arg) {
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::PredicateWithMetadataOperator arg) {
59
57
  switch (arg) {
60
- case PredicateWithMetadataOperator::EQUALTO: return JSIConverter<std::string>::toJSI(runtime, "equalTo");
61
- case PredicateWithMetadataOperator::NOTEQUALTO: return JSIConverter<std::string>::toJSI(runtime, "notEqualTo");
62
- case PredicateWithMetadataOperator::GREATERTHAN: return JSIConverter<std::string>::toJSI(runtime, "greaterThan");
63
- case PredicateWithMetadataOperator::LESSTHAN: return JSIConverter<std::string>::toJSI(runtime, "lessThan");
58
+ case margelo::nitro::healthkit::PredicateWithMetadataOperator::EQUALTO: return JSIConverter<std::string>::toJSI(runtime, "equalTo");
59
+ case margelo::nitro::healthkit::PredicateWithMetadataOperator::NOTEQUALTO: return JSIConverter<std::string>::toJSI(runtime, "notEqualTo");
60
+ case margelo::nitro::healthkit::PredicateWithMetadataOperator::GREATERTHAN: return JSIConverter<std::string>::toJSI(runtime, "greaterThan");
61
+ case margelo::nitro::healthkit::PredicateWithMetadataOperator::LESSTHAN: return JSIConverter<std::string>::toJSI(runtime, "lessThan");
64
62
  default: [[unlikely]]
65
63
  throw std::invalid_argument("Cannot convert PredicateWithMetadataOperator to JS - invalid value: "
66
64
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -20,8 +20,8 @@
20
20
 
21
21
 
22
22
 
23
- #include <optional>
24
23
  #include <chrono>
24
+ #include <optional>
25
25
 
26
26
  namespace margelo::nitro::healthkit {
27
27
 
@@ -44,21 +44,19 @@ namespace margelo::nitro::healthkit {
44
44
 
45
45
  namespace margelo::nitro {
46
46
 
47
- using namespace margelo::nitro::healthkit;
48
-
49
47
  // C++ PredicateWithStartAndEnd <> JS PredicateWithStartAndEnd (object)
50
48
  template <>
51
- struct JSIConverter<PredicateWithStartAndEnd> final {
52
- static inline PredicateWithStartAndEnd fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ struct JSIConverter<margelo::nitro::healthkit::PredicateWithStartAndEnd> final {
50
+ static inline margelo::nitro::healthkit::PredicateWithStartAndEnd fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
51
  jsi::Object obj = arg.asObject(runtime);
54
- return PredicateWithStartAndEnd(
52
+ return margelo::nitro::healthkit::PredicateWithStartAndEnd(
55
53
  JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
56
54
  JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "endDate")),
57
55
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "strictEndDate")),
58
56
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "strictStartDate"))
59
57
  );
60
58
  }
61
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const PredicateWithStartAndEnd& arg) {
59
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::PredicateWithStartAndEnd& arg) {
62
60
  jsi::Object obj(runtime);
63
61
  obj.setProperty(runtime, "startDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.startDate));
64
62
  obj.setProperty(runtime, "endDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.endDate));
@@ -40,18 +40,16 @@ namespace margelo::nitro::healthkit {
40
40
 
41
41
  namespace margelo::nitro {
42
42
 
43
- using namespace margelo::nitro::healthkit;
44
-
45
43
  // C++ PredicateWithUUID <> JS PredicateWithUUID (object)
46
44
  template <>
47
- struct JSIConverter<PredicateWithUUID> final {
48
- static inline PredicateWithUUID fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
45
+ struct JSIConverter<margelo::nitro::healthkit::PredicateWithUUID> final {
46
+ static inline margelo::nitro::healthkit::PredicateWithUUID fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
47
  jsi::Object obj = arg.asObject(runtime);
50
- return PredicateWithUUID(
48
+ return margelo::nitro::healthkit::PredicateWithUUID(
51
49
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "uuid"))
52
50
  );
53
51
  }
54
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const PredicateWithUUID& arg) {
52
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::PredicateWithUUID& arg) {
55
53
  jsi::Object obj(runtime);
56
54
  obj.setProperty(runtime, "uuid", JSIConverter<std::string>::toJSI(runtime, arg.uuid));
57
55
  return obj;
@@ -20,8 +20,8 @@
20
20
 
21
21
 
22
22
 
23
- #include <vector>
24
23
  #include <string>
24
+ #include <vector>
25
25
 
26
26
  namespace margelo::nitro::healthkit {
27
27
 
@@ -41,18 +41,16 @@ namespace margelo::nitro::healthkit {
41
41
 
42
42
  namespace margelo::nitro {
43
43
 
44
- using namespace margelo::nitro::healthkit;
45
-
46
44
  // C++ PredicateWithUUIDs <> JS PredicateWithUUIDs (object)
47
45
  template <>
48
- struct JSIConverter<PredicateWithUUIDs> final {
49
- static inline PredicateWithUUIDs fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ struct JSIConverter<margelo::nitro::healthkit::PredicateWithUUIDs> final {
47
+ static inline margelo::nitro::healthkit::PredicateWithUUIDs fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
48
  jsi::Object obj = arg.asObject(runtime);
51
- return PredicateWithUUIDs(
49
+ return margelo::nitro::healthkit::PredicateWithUUIDs(
52
50
  JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "uuids"))
53
51
  );
54
52
  }
55
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const PredicateWithUUIDs& arg) {
53
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::PredicateWithUUIDs& arg) {
56
54
  jsi::Object obj(runtime);
57
55
  obj.setProperty(runtime, "uuids", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.uuids));
58
56
  return obj;
@@ -41,19 +41,17 @@ namespace margelo::nitro::healthkit {
41
41
 
42
42
  namespace margelo::nitro {
43
43
 
44
- using namespace margelo::nitro::healthkit;
45
-
46
44
  // C++ Quantity <> JS Quantity (object)
47
45
  template <>
48
- struct JSIConverter<Quantity> final {
49
- static inline Quantity fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ struct JSIConverter<margelo::nitro::healthkit::Quantity> final {
47
+ static inline margelo::nitro::healthkit::Quantity fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
48
  jsi::Object obj = arg.asObject(runtime);
51
- return Quantity(
49
+ return margelo::nitro::healthkit::Quantity(
52
50
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
53
51
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "quantity"))
54
52
  );
55
53
  }
56
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const Quantity& arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::Quantity& arg) {
57
55
  jsi::Object obj(runtime);
58
56
  obj.setProperty(runtime, "unit", JSIConverter<std::string>::toJSI(runtime, arg.unit));
59
57
  obj.setProperty(runtime, "quantity", JSIConverter<double>::toJSI(runtime, arg.quantity));
@@ -41,19 +41,17 @@ namespace margelo::nitro::healthkit {
41
41
 
42
42
  namespace margelo::nitro {
43
43
 
44
- using namespace margelo::nitro::healthkit;
45
-
46
44
  // C++ QuantityDateInterval <> JS QuantityDateInterval (object)
47
45
  template <>
48
- struct JSIConverter<QuantityDateInterval> final {
49
- static inline QuantityDateInterval fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ struct JSIConverter<margelo::nitro::healthkit::QuantityDateInterval> final {
47
+ static inline margelo::nitro::healthkit::QuantityDateInterval fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
48
  jsi::Object obj = arg.asObject(runtime);
51
- return QuantityDateInterval(
49
+ return margelo::nitro::healthkit::QuantityDateInterval(
52
50
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "from")),
53
51
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "to"))
54
52
  );
55
53
  }
56
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QuantityDateInterval& arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QuantityDateInterval& arg) {
57
55
  jsi::Object obj(runtime);
58
56
  obj.setProperty(runtime, "from", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.from));
59
57
  obj.setProperty(runtime, "to", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.to));
@@ -28,8 +28,8 @@ namespace NitroModules { class AnyMap; }
28
28
  namespace margelo::nitro::healthkit { struct SourceRevision; }
29
29
 
30
30
  #include <string>
31
- #include <optional>
32
31
  #include "Device.hpp"
32
+ #include <optional>
33
33
  #include "QuantityTypeIdentifier.hpp"
34
34
  #include <chrono>
35
35
  #include <NitroModules/AnyMap.hpp>
@@ -61,36 +61,34 @@ namespace margelo::nitro::healthkit {
61
61
 
62
62
  namespace margelo::nitro {
63
63
 
64
- using namespace margelo::nitro::healthkit;
65
-
66
64
  // C++ QuantitySample <> JS QuantitySample (object)
67
65
  template <>
68
- struct JSIConverter<QuantitySample> final {
69
- static inline QuantitySample fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
66
+ struct JSIConverter<margelo::nitro::healthkit::QuantitySample> final {
67
+ static inline margelo::nitro::healthkit::QuantitySample fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
70
68
  jsi::Object obj = arg.asObject(runtime);
71
- return QuantitySample(
69
+ return margelo::nitro::healthkit::QuantitySample(
72
70
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "uuid")),
73
- JSIConverter<std::optional<Device>>::fromJSI(runtime, obj.getProperty(runtime, "device")),
74
- JSIConverter<QuantityTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "quantityType")),
71
+ JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, "device")),
72
+ JSIConverter<margelo::nitro::healthkit::QuantityTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "quantityType")),
75
73
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
76
74
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "endDate")),
77
75
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "quantity")),
78
76
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
79
77
  JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
80
- JSIConverter<std::optional<SourceRevision>>::fromJSI(runtime, obj.getProperty(runtime, "sourceRevision"))
78
+ JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::fromJSI(runtime, obj.getProperty(runtime, "sourceRevision"))
81
79
  );
82
80
  }
83
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QuantitySample& arg) {
81
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QuantitySample& arg) {
84
82
  jsi::Object obj(runtime);
85
83
  obj.setProperty(runtime, "uuid", JSIConverter<std::string>::toJSI(runtime, arg.uuid));
86
- obj.setProperty(runtime, "device", JSIConverter<std::optional<Device>>::toJSI(runtime, arg.device));
87
- obj.setProperty(runtime, "quantityType", JSIConverter<QuantityTypeIdentifier>::toJSI(runtime, arg.quantityType));
84
+ obj.setProperty(runtime, "device", JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
85
+ obj.setProperty(runtime, "quantityType", JSIConverter<margelo::nitro::healthkit::QuantityTypeIdentifier>::toJSI(runtime, arg.quantityType));
88
86
  obj.setProperty(runtime, "startDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
89
87
  obj.setProperty(runtime, "endDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
90
88
  obj.setProperty(runtime, "quantity", JSIConverter<double>::toJSI(runtime, arg.quantity));
91
89
  obj.setProperty(runtime, "unit", JSIConverter<std::string>::toJSI(runtime, arg.unit));
92
90
  obj.setProperty(runtime, "metadata", JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
93
- obj.setProperty(runtime, "sourceRevision", JSIConverter<std::optional<SourceRevision>>::toJSI(runtime, arg.sourceRevision));
91
+ obj.setProperty(runtime, "sourceRevision", JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::toJSI(runtime, arg.sourceRevision));
94
92
  return obj;
95
93
  }
96
94
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -99,14 +97,14 @@ namespace margelo::nitro {
99
97
  }
100
98
  jsi::Object obj = value.getObject(runtime);
101
99
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "uuid"))) return false;
102
- if (!JSIConverter<std::optional<Device>>::canConvert(runtime, obj.getProperty(runtime, "device"))) return false;
103
- if (!JSIConverter<QuantityTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "quantityType"))) return false;
100
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, "device"))) return false;
101
+ if (!JSIConverter<margelo::nitro::healthkit::QuantityTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "quantityType"))) return false;
104
102
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
105
103
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
106
104
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "quantity"))) return false;
107
105
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
108
106
  if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
109
- if (!JSIConverter<std::optional<SourceRevision>>::canConvert(runtime, obj.getProperty(runtime, "sourceRevision"))) return false;
107
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::canConvert(runtime, obj.getProperty(runtime, "sourceRevision"))) return false;
110
108
  return true;
111
109
  }
112
110
  };
@@ -29,8 +29,8 @@ namespace margelo::nitro::healthkit { struct SourceRevision; }
29
29
  #include "QuantityTypeIdentifier.hpp"
30
30
  #include <string>
31
31
  #include <NitroModules/AnyMap.hpp>
32
- #include <optional>
33
32
  #include "SourceRevision.hpp"
33
+ #include <optional>
34
34
 
35
35
  namespace margelo::nitro::healthkit {
36
36
 
@@ -56,32 +56,30 @@ namespace margelo::nitro::healthkit {
56
56
 
57
57
  namespace margelo::nitro {
58
58
 
59
- using namespace margelo::nitro::healthkit;
60
-
61
59
  // C++ QuantitySampleForSaving <> JS QuantitySampleForSaving (object)
62
60
  template <>
63
- struct JSIConverter<QuantitySampleForSaving> final {
64
- static inline QuantitySampleForSaving fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
61
+ struct JSIConverter<margelo::nitro::healthkit::QuantitySampleForSaving> final {
62
+ static inline margelo::nitro::healthkit::QuantitySampleForSaving fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
65
63
  jsi::Object obj = arg.asObject(runtime);
66
- return QuantitySampleForSaving(
64
+ return margelo::nitro::healthkit::QuantitySampleForSaving(
67
65
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
68
66
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "endDate")),
69
- JSIConverter<QuantityTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "quantityType")),
67
+ JSIConverter<margelo::nitro::healthkit::QuantityTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "quantityType")),
70
68
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "quantity")),
71
69
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
72
70
  JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
73
- JSIConverter<std::optional<SourceRevision>>::fromJSI(runtime, obj.getProperty(runtime, "sourceRevision"))
71
+ JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::fromJSI(runtime, obj.getProperty(runtime, "sourceRevision"))
74
72
  );
75
73
  }
76
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const QuantitySampleForSaving& arg) {
74
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QuantitySampleForSaving& arg) {
77
75
  jsi::Object obj(runtime);
78
76
  obj.setProperty(runtime, "startDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
79
77
  obj.setProperty(runtime, "endDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
80
- obj.setProperty(runtime, "quantityType", JSIConverter<QuantityTypeIdentifier>::toJSI(runtime, arg.quantityType));
78
+ obj.setProperty(runtime, "quantityType", JSIConverter<margelo::nitro::healthkit::QuantityTypeIdentifier>::toJSI(runtime, arg.quantityType));
81
79
  obj.setProperty(runtime, "quantity", JSIConverter<double>::toJSI(runtime, arg.quantity));
82
80
  obj.setProperty(runtime, "unit", JSIConverter<std::string>::toJSI(runtime, arg.unit));
83
81
  obj.setProperty(runtime, "metadata", JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
84
- obj.setProperty(runtime, "sourceRevision", JSIConverter<std::optional<SourceRevision>>::toJSI(runtime, arg.sourceRevision));
82
+ obj.setProperty(runtime, "sourceRevision", JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::toJSI(runtime, arg.sourceRevision));
85
83
  return obj;
86
84
  }
87
85
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -91,11 +89,11 @@ namespace margelo::nitro {
91
89
  jsi::Object obj = value.getObject(runtime);
92
90
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
93
91
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
94
- if (!JSIConverter<QuantityTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "quantityType"))) return false;
92
+ if (!JSIConverter<margelo::nitro::healthkit::QuantityTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "quantityType"))) return false;
95
93
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "quantity"))) return false;
96
94
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
97
95
  if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
98
- if (!JSIConverter<std::optional<SourceRevision>>::canConvert(runtime, obj.getProperty(runtime, "sourceRevision"))) return false;
96
+ if (!JSIConverter<std::optional<margelo::nitro::healthkit::SourceRevision>>::canConvert(runtime, obj.getProperty(runtime, "sourceRevision"))) return false;
99
97
  return true;
100
98
  }
101
99
  };