@kingstinct/react-native-healthkit 13.4.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/ReactNativeHealthkit.podspec +1 -0
  2. package/app.plugin.ts +40 -2
  3. package/ios/BackgroundDeliveryManager.swift +196 -0
  4. package/ios/CategoryTypeModule.swift +1 -1
  5. package/ios/CoreModule.swift +24 -0
  6. package/ios/CorrelationTypeModule.swift +2 -35
  7. package/ios/ElectrocardiogramModule.swift +2 -34
  8. package/ios/HeartbeatSeriesModule.swift +2 -34
  9. package/ios/MedicationModule.swift +3 -35
  10. package/ios/PredicateHelpers.swift +2 -2
  11. package/ios/QuantityTypeModule.swift +11 -11
  12. package/ios/Serializers.swift +58 -90
  13. package/ios/StateOfMindModule.swift +2 -34
  14. package/ios/WorkoutProxy.swift +3 -149
  15. package/ios/generated/HealthkitGenerated.swift +52 -0
  16. package/lib/commonjs/generated/healthkit.generated.js +745 -0
  17. package/lib/commonjs/healthkit.ios.js +51 -17
  18. package/lib/commonjs/healthkit.js +120 -34
  19. package/lib/commonjs/specs/QuantityTypeModule.nitro.js +1 -0
  20. package/lib/commonjs/type-tests/generated-typing.js +2 -0
  21. package/lib/commonjs/types/CategoryType.js +19 -99
  22. package/lib/commonjs/types/Medication.js +2 -0
  23. package/lib/commonjs/types/MetadataEnums.js +17 -0
  24. package/lib/commonjs/types/QuantityType.js +4 -15
  25. package/lib/commonjs/types/WeatherCondition.js +2 -32
  26. package/lib/commonjs/types/Workouts.js +3 -98
  27. package/lib/commonjs/types/index.js +2 -0
  28. package/lib/module/generated/healthkit.generated.js +742 -0
  29. package/lib/module/healthkit.ios.js +49 -15
  30. package/lib/module/healthkit.js +94 -20
  31. package/lib/module/specs/QuantityTypeModule.nitro.js +1 -0
  32. package/lib/module/type-tests/generated-typing.js +1 -0
  33. package/lib/module/types/CategoryType.js +2 -98
  34. package/lib/module/types/Medication.js +1 -0
  35. package/lib/module/types/MetadataEnums.js +1 -0
  36. package/lib/module/types/QuantityType.js +2 -14
  37. package/lib/module/types/WeatherCondition.js +1 -32
  38. package/lib/module/types/Workouts.js +2 -98
  39. package/lib/module/types/index.js +2 -0
  40. package/lib/typescript/generated/healthkit.generated.d.ts +1006 -0
  41. package/lib/typescript/healthkit.d.ts +39 -36
  42. package/lib/typescript/healthkit.ios.d.ts +64 -53
  43. package/lib/typescript/hooks/useMostRecentQuantitySample.d.ts +3 -2
  44. package/lib/typescript/hooks/useMostRecentWorkout.d.ts +2 -2
  45. package/lib/typescript/hooks/useQuantitySampleById.d.ts +5 -4
  46. package/lib/typescript/hooks/useStatisticsForQuantity.d.ts +2 -2
  47. package/lib/typescript/hooks/useSubscribeToQuantitySamples.d.ts +1 -1
  48. package/lib/typescript/modules.d.ts +2 -2
  49. package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +3 -3
  50. package/lib/typescript/specs/CoreModule.nitro.d.ts +15 -0
  51. package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +20 -9
  52. package/lib/typescript/type-tests/generated-typing.d.ts +1 -0
  53. package/lib/typescript/types/CategoryType.d.ts +10 -104
  54. package/lib/typescript/types/CategoryTypeIdentifier.d.ts +1 -61
  55. package/lib/typescript/types/CorrelationType.d.ts +8 -2
  56. package/lib/typescript/types/ElectrocardiogramSample.d.ts +8 -1
  57. package/lib/typescript/types/HeartbeatSeries.d.ts +8 -1
  58. package/lib/typescript/types/InterfaceVerification.d.ts +14 -1
  59. package/lib/typescript/types/Medication.d.ts +10 -0
  60. package/lib/typescript/types/MetadataEnums.d.ts +1 -0
  61. package/lib/typescript/types/QuantitySample.d.ts +9 -1
  62. package/lib/typescript/types/QuantityType.d.ts +14 -18
  63. package/lib/typescript/types/QuantityTypeIdentifier.d.ts +1 -671
  64. package/lib/typescript/types/QueryOptions.d.ts +8 -4
  65. package/lib/typescript/types/Shared.d.ts +12 -41
  66. package/lib/typescript/types/StateOfMind.d.ts +8 -1
  67. package/lib/typescript/types/Subscriptions.d.ts +11 -11
  68. package/lib/typescript/types/WeatherCondition.d.ts +1 -30
  69. package/lib/typescript/types/Workouts.d.ts +18 -104
  70. package/lib/typescript/types/index.d.ts +2 -0
  71. package/lib/typescript/utils/getMostRecentQuantitySample.d.ts +2 -1
  72. package/lib/typescript/utils/getMostRecentWorkout.d.ts +2 -1
  73. package/lib/typescript/utils/getPreferredUnit.d.ts +2 -1
  74. package/lib/typescript/utils/getQuantitySampleById.d.ts +2 -1
  75. package/lib/typescript/utils/subscribeToQuantitySamples.d.ts +1 -1
  76. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +55 -109
  77. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +12 -18
  78. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +5 -14
  79. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +18 -2
  80. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +1 -13
  81. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +1 -13
  82. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +2 -14
  83. package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +1 -13
  84. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +19 -28
  85. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +2 -14
  86. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +2 -115
  87. package/nitrogen/generated/ios/swift/CategorySample.swift +4 -329
  88. package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +112 -108
  89. package/nitrogen/generated/ios/swift/CategoryTypeIdentifierWriteable.swift +292 -0
  90. package/nitrogen/generated/ios/swift/CorrelationSample.swift +4 -347
  91. package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +4 -329
  92. package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +30 -30
  93. package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +30 -30
  94. package/nitrogen/generated/ios/swift/GeneralForm.swift +4 -4
  95. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +4 -329
  96. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
  97. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +1 -1
  98. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -0
  99. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +38 -0
  100. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +6 -6
  101. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +6 -6
  102. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +1 -27
  103. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +2 -340
  104. package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +4 -329
  105. package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +492 -492
  106. package/nitrogen/generated/ios/swift/QuantitySample.swift +4 -329
  107. package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +380 -384
  108. package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +372 -376
  109. package/nitrogen/generated/ios/swift/{QueryOptionsWithAnchorAndUnit.swift → QueryOptionsWithAnchorAndStringUnit.swift} +5 -5
  110. package/nitrogen/generated/ios/swift/{QueryOptionsWithSortOrderAndUnit.swift → QueryOptionsWithSortOrderAndStringUnit.swift} +5 -5
  111. package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +37 -37
  112. package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +492 -492
  113. package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +482 -486
  114. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +4 -329
  115. package/nitrogen/generated/ios/swift/{StatisticsQueryOptions.swift → StatisticsQueryOptionsWithStringUnit.swift} +5 -5
  116. package/nitrogen/generated/ios/swift/WorkoutSample.swift +4 -402
  117. package/nitrogen/generated/shared/c++/CategorySample.hpp +8 -100
  118. package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +153 -149
  119. package/nitrogen/generated/shared/c++/CategoryTypeIdentifierWriteable.hpp +328 -0
  120. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +9 -105
  121. package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +7 -99
  122. package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +13 -13
  123. package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +13 -13
  124. package/nitrogen/generated/shared/c++/GeneralForm.hpp +7 -7
  125. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +8 -100
  126. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +5 -2
  127. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +2 -0
  128. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +4 -2
  129. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +15 -15
  130. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +1 -27
  131. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +2 -37
  132. package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +7 -99
  133. package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +565 -565
  134. package/nitrogen/generated/shared/c++/QuantitySample.hpp +8 -100
  135. package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +407 -411
  136. package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +398 -402
  137. package/nitrogen/generated/shared/c++/{QueryOptionsWithAnchorAndUnit.hpp → QueryOptionsWithAnchorAndStringUnit.hpp} +11 -11
  138. package/nitrogen/generated/shared/c++/{QueryOptionsWithSortOrderAndUnit.hpp → QueryOptionsWithSortOrderAndStringUnit.hpp} +11 -11
  139. package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +12 -12
  140. package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +559 -559
  141. package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +541 -545
  142. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +8 -100
  143. package/nitrogen/generated/shared/c++/{StatisticsQueryOptions.hpp → StatisticsQueryOptionsWithStringUnit.hpp} +11 -11
  144. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +7 -120
  145. package/package.json +5 -2
  146. package/src/generated/healthkit-schema.json +3680 -0
  147. package/src/generated/healthkit.generated.ts +1307 -0
  148. package/src/healthkit.ios.ts +225 -19
  149. package/src/healthkit.ts +181 -55
  150. package/src/hooks/useMostRecentQuantitySample.ts +6 -5
  151. package/src/hooks/useMostRecentWorkout.ts +2 -2
  152. package/src/hooks/useQuantitySampleById.ts +6 -5
  153. package/src/hooks/useStatisticsForQuantity.ts +2 -1
  154. package/src/hooks/useSubscribeToQuantitySamples.ts +1 -1
  155. package/src/modules.ts +7 -2
  156. package/src/specs/CategoryTypeModule.nitro.ts +8 -5
  157. package/src/specs/CoreModule.nitro.ts +20 -0
  158. package/src/specs/QuantityTypeModule.nitro.ts +81 -7
  159. package/src/test-setup.ts +2 -0
  160. package/src/type-tests/generated-typing.ts +133 -0
  161. package/src/types/CategoryType.ts +52 -148
  162. package/src/types/CategoryTypeIdentifier.ts +5 -134
  163. package/src/types/CorrelationType.ts +13 -3
  164. package/src/types/ElectrocardiogramSample.ts +13 -1
  165. package/src/types/HeartbeatSeries.ts +13 -1
  166. package/src/types/InterfaceVerification.ts +38 -1
  167. package/src/types/Medication.ts +19 -0
  168. package/src/types/MetadataEnums.ts +15 -0
  169. package/src/types/QuantitySample.ts +14 -2
  170. package/src/types/QuantityType.ts +22 -122
  171. package/src/types/QuantityTypeIdentifier.ts +5 -772
  172. package/src/types/QueryOptions.ts +11 -4
  173. package/src/types/Shared.ts +22 -49
  174. package/src/types/StateOfMind.ts +13 -1
  175. package/src/types/Subscriptions.ts +19 -13
  176. package/src/types/WeatherCondition.ts +1 -31
  177. package/src/types/Workouts.ts +44 -108
  178. package/src/types/index.ts +2 -0
  179. package/src/utils/getMostRecentQuantitySample.ts +4 -3
  180. package/src/utils/getMostRecentWorkout.ts +5 -2
  181. package/src/utils/getPreferredUnit.ts +5 -4
  182. package/src/utils/getQuantitySampleById.ts +4 -3
  183. package/src/utils/subscribeToQuantitySamples.ts +5 -3
  184. package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +0 -44
  185. package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +0 -40
  186. package/nitrogen/generated/ios/swift/WeatherCondition.swift +0 -144
  187. package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +0 -67
  188. package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +0 -62
  189. package/nitrogen/generated/shared/c++/WeatherCondition.hpp +0 -88
@@ -0,0 +1,328 @@
1
+ ///
2
+ /// CategoryTypeIdentifierWriteable.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::healthkit {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (CategoryTypeIdentifierWriteable).
30
+ */
31
+ enum class CategoryTypeIdentifierWriteable {
32
+ HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS SWIFT_NAME(hkcategorytypeidentifierabdominalcramps) = 0,
33
+ HKCATEGORYTYPEIDENTIFIERACNE SWIFT_NAME(hkcategorytypeidentifieracne) = 1,
34
+ HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES SWIFT_NAME(hkcategorytypeidentifierappetitechanges) = 2,
35
+ HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT SWIFT_NAME(hkcategorytypeidentifierapplewalkingsteadinessevent) = 3,
36
+ HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT SWIFT_NAME(hkcategorytypeidentifieraudioexposureevent) = 4,
37
+ HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE SWIFT_NAME(hkcategorytypeidentifierbladderincontinence) = 5,
38
+ HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY SWIFT_NAME(hkcategorytypeidentifierbleedingafterpregnancy) = 6,
39
+ HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY SWIFT_NAME(hkcategorytypeidentifierbleedingduringpregnancy) = 7,
40
+ HKCATEGORYTYPEIDENTIFIERBLOATING SWIFT_NAME(hkcategorytypeidentifierbloating) = 8,
41
+ HKCATEGORYTYPEIDENTIFIERBREASTPAIN SWIFT_NAME(hkcategorytypeidentifierbreastpain) = 9,
42
+ HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY SWIFT_NAME(hkcategorytypeidentifiercervicalmucusquality) = 10,
43
+ HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN SWIFT_NAME(hkcategorytypeidentifierchesttightnessorpain) = 11,
44
+ HKCATEGORYTYPEIDENTIFIERCHILLS SWIFT_NAME(hkcategorytypeidentifierchills) = 12,
45
+ HKCATEGORYTYPEIDENTIFIERCONSTIPATION SWIFT_NAME(hkcategorytypeidentifierconstipation) = 13,
46
+ HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE SWIFT_NAME(hkcategorytypeidentifiercontraceptive) = 14,
47
+ HKCATEGORYTYPEIDENTIFIERCOUGHING SWIFT_NAME(hkcategorytypeidentifiercoughing) = 15,
48
+ HKCATEGORYTYPEIDENTIFIERDIARRHEA SWIFT_NAME(hkcategorytypeidentifierdiarrhea) = 16,
49
+ HKCATEGORYTYPEIDENTIFIERDIZZINESS SWIFT_NAME(hkcategorytypeidentifierdizziness) = 17,
50
+ HKCATEGORYTYPEIDENTIFIERDRYSKIN SWIFT_NAME(hkcategorytypeidentifierdryskin) = 18,
51
+ HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT SWIFT_NAME(hkcategorytypeidentifierenvironmentalaudioexposureevent) = 19,
52
+ HKCATEGORYTYPEIDENTIFIERFAINTING SWIFT_NAME(hkcategorytypeidentifierfainting) = 20,
53
+ HKCATEGORYTYPEIDENTIFIERFATIGUE SWIFT_NAME(hkcategorytypeidentifierfatigue) = 21,
54
+ HKCATEGORYTYPEIDENTIFIERFEVER SWIFT_NAME(hkcategorytypeidentifierfever) = 22,
55
+ HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE SWIFT_NAME(hkcategorytypeidentifiergeneralizedbodyache) = 23,
56
+ HKCATEGORYTYPEIDENTIFIERHAIRLOSS SWIFT_NAME(hkcategorytypeidentifierhairloss) = 24,
57
+ HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT SWIFT_NAME(hkcategorytypeidentifierhandwashingevent) = 25,
58
+ HKCATEGORYTYPEIDENTIFIERHEADACHE SWIFT_NAME(hkcategorytypeidentifierheadache) = 26,
59
+ HKCATEGORYTYPEIDENTIFIERHEARTBURN SWIFT_NAME(hkcategorytypeidentifierheartburn) = 27,
60
+ HKCATEGORYTYPEIDENTIFIERHOTFLASHES SWIFT_NAME(hkcategorytypeidentifierhotflashes) = 28,
61
+ HKCATEGORYTYPEIDENTIFIERINFREQUENTMENSTRUALCYCLES SWIFT_NAME(hkcategorytypeidentifierinfrequentmenstrualcycles) = 29,
62
+ HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING SWIFT_NAME(hkcategorytypeidentifierintermenstrualbleeding) = 30,
63
+ HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT SWIFT_NAME(hkcategorytypeidentifierirregularheartrhythmevent) = 31,
64
+ HKCATEGORYTYPEIDENTIFIERIRREGULARMENSTRUALCYCLES SWIFT_NAME(hkcategorytypeidentifierirregularmenstrualcycles) = 32,
65
+ HKCATEGORYTYPEIDENTIFIERLACTATION SWIFT_NAME(hkcategorytypeidentifierlactation) = 33,
66
+ HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL SWIFT_NAME(hkcategorytypeidentifierlossofsmell) = 34,
67
+ HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE SWIFT_NAME(hkcategorytypeidentifierlossoftaste) = 35,
68
+ HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT SWIFT_NAME(hkcategorytypeidentifierlowcardiofitnessevent) = 36,
69
+ HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN SWIFT_NAME(hkcategorytypeidentifierlowerbackpain) = 37,
70
+ HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE SWIFT_NAME(hkcategorytypeidentifiermemorylapse) = 38,
71
+ HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW SWIFT_NAME(hkcategorytypeidentifiermenstrualflow) = 39,
72
+ HKCATEGORYTYPEIDENTIFIERMINDFULSESSION SWIFT_NAME(hkcategorytypeidentifiermindfulsession) = 40,
73
+ HKCATEGORYTYPEIDENTIFIERMOODCHANGES SWIFT_NAME(hkcategorytypeidentifiermoodchanges) = 41,
74
+ HKCATEGORYTYPEIDENTIFIERNAUSEA SWIFT_NAME(hkcategorytypeidentifiernausea) = 42,
75
+ HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS SWIFT_NAME(hkcategorytypeidentifiernightsweats) = 43,
76
+ HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT SWIFT_NAME(hkcategorytypeidentifierovulationtestresult) = 44,
77
+ HKCATEGORYTYPEIDENTIFIERPELVICPAIN SWIFT_NAME(hkcategorytypeidentifierpelvicpain) = 45,
78
+ HKCATEGORYTYPEIDENTIFIERPERSISTENTINTERMENSTRUALBLEEDING SWIFT_NAME(hkcategorytypeidentifierpersistentintermenstrualbleeding) = 46,
79
+ HKCATEGORYTYPEIDENTIFIERPREGNANCY SWIFT_NAME(hkcategorytypeidentifierpregnancy) = 47,
80
+ HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT SWIFT_NAME(hkcategorytypeidentifierpregnancytestresult) = 48,
81
+ HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT SWIFT_NAME(hkcategorytypeidentifierprogesteronetestresult) = 49,
82
+ HKCATEGORYTYPEIDENTIFIERPROLONGEDMENSTRUALPERIODS SWIFT_NAME(hkcategorytypeidentifierprolongedmenstrualperiods) = 50,
83
+ HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT SWIFT_NAME(hkcategorytypeidentifierrapidpoundingorflutteringheartbeat) = 51,
84
+ HKCATEGORYTYPEIDENTIFIERRUNNYNOSE SWIFT_NAME(hkcategorytypeidentifierrunnynose) = 52,
85
+ HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY SWIFT_NAME(hkcategorytypeidentifiersexualactivity) = 53,
86
+ HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH SWIFT_NAME(hkcategorytypeidentifiershortnessofbreath) = 54,
87
+ HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION SWIFT_NAME(hkcategorytypeidentifiersinuscongestion) = 55,
88
+ HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT SWIFT_NAME(hkcategorytypeidentifierskippedheartbeat) = 56,
89
+ HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS SWIFT_NAME(hkcategorytypeidentifiersleepanalysis) = 57,
90
+ HKCATEGORYTYPEIDENTIFIERSLEEPAPNEAEVENT SWIFT_NAME(hkcategorytypeidentifiersleepapneaevent) = 58,
91
+ HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES SWIFT_NAME(hkcategorytypeidentifiersleepchanges) = 59,
92
+ HKCATEGORYTYPEIDENTIFIERSORETHROAT SWIFT_NAME(hkcategorytypeidentifiersorethroat) = 60,
93
+ HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT SWIFT_NAME(hkcategorytypeidentifiertoothbrushingevent) = 61,
94
+ HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS SWIFT_NAME(hkcategorytypeidentifiervaginaldryness) = 62,
95
+ HKCATEGORYTYPEIDENTIFIERVOMITING SWIFT_NAME(hkcategorytypeidentifiervomiting) = 63,
96
+ HKCATEGORYTYPEIDENTIFIERWHEEZING SWIFT_NAME(hkcategorytypeidentifierwheezing) = 64,
97
+ } CLOSED_ENUM;
98
+
99
+ } // namespace margelo::nitro::healthkit
100
+
101
+ namespace margelo::nitro {
102
+
103
+ // C++ CategoryTypeIdentifierWriteable <> JS CategoryTypeIdentifierWriteable (union)
104
+ template <>
105
+ struct JSIConverter<margelo::nitro::healthkit::CategoryTypeIdentifierWriteable> final {
106
+ static inline margelo::nitro::healthkit::CategoryTypeIdentifierWriteable fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
107
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
108
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
109
+ case hashString("HKCategoryTypeIdentifierAbdominalCramps"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS;
110
+ case hashString("HKCategoryTypeIdentifierAcne"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERACNE;
111
+ case hashString("HKCategoryTypeIdentifierAppetiteChanges"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES;
112
+ case hashString("HKCategoryTypeIdentifierAppleWalkingSteadinessEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT;
113
+ case hashString("HKCategoryTypeIdentifierAudioExposureEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT;
114
+ case hashString("HKCategoryTypeIdentifierBladderIncontinence"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE;
115
+ case hashString("HKCategoryTypeIdentifierBleedingAfterPregnancy"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY;
116
+ case hashString("HKCategoryTypeIdentifierBleedingDuringPregnancy"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY;
117
+ case hashString("HKCategoryTypeIdentifierBloating"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBLOATING;
118
+ case hashString("HKCategoryTypeIdentifierBreastPain"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBREASTPAIN;
119
+ case hashString("HKCategoryTypeIdentifierCervicalMucusQuality"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY;
120
+ case hashString("HKCategoryTypeIdentifierChestTightnessOrPain"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN;
121
+ case hashString("HKCategoryTypeIdentifierChills"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCHILLS;
122
+ case hashString("HKCategoryTypeIdentifierConstipation"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCONSTIPATION;
123
+ case hashString("HKCategoryTypeIdentifierContraceptive"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE;
124
+ case hashString("HKCategoryTypeIdentifierCoughing"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCOUGHING;
125
+ case hashString("HKCategoryTypeIdentifierDiarrhea"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERDIARRHEA;
126
+ case hashString("HKCategoryTypeIdentifierDizziness"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERDIZZINESS;
127
+ case hashString("HKCategoryTypeIdentifierDrySkin"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERDRYSKIN;
128
+ case hashString("HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT;
129
+ case hashString("HKCategoryTypeIdentifierFainting"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERFAINTING;
130
+ case hashString("HKCategoryTypeIdentifierFatigue"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERFATIGUE;
131
+ case hashString("HKCategoryTypeIdentifierFever"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERFEVER;
132
+ case hashString("HKCategoryTypeIdentifierGeneralizedBodyAche"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE;
133
+ case hashString("HKCategoryTypeIdentifierHairLoss"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHAIRLOSS;
134
+ case hashString("HKCategoryTypeIdentifierHandwashingEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT;
135
+ case hashString("HKCategoryTypeIdentifierHeadache"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHEADACHE;
136
+ case hashString("HKCategoryTypeIdentifierHeartburn"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHEARTBURN;
137
+ case hashString("HKCategoryTypeIdentifierHotFlashes"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHOTFLASHES;
138
+ case hashString("HKCategoryTypeIdentifierInfrequentMenstrualCycles"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERINFREQUENTMENSTRUALCYCLES;
139
+ case hashString("HKCategoryTypeIdentifierIntermenstrualBleeding"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING;
140
+ case hashString("HKCategoryTypeIdentifierIrregularHeartRhythmEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT;
141
+ case hashString("HKCategoryTypeIdentifierIrregularMenstrualCycles"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERIRREGULARMENSTRUALCYCLES;
142
+ case hashString("HKCategoryTypeIdentifierLactation"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLACTATION;
143
+ case hashString("HKCategoryTypeIdentifierLossOfSmell"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL;
144
+ case hashString("HKCategoryTypeIdentifierLossOfTaste"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE;
145
+ case hashString("HKCategoryTypeIdentifierLowCardioFitnessEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT;
146
+ case hashString("HKCategoryTypeIdentifierLowerBackPain"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN;
147
+ case hashString("HKCategoryTypeIdentifierMemoryLapse"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE;
148
+ case hashString("HKCategoryTypeIdentifierMenstrualFlow"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW;
149
+ case hashString("HKCategoryTypeIdentifierMindfulSession"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERMINDFULSESSION;
150
+ case hashString("HKCategoryTypeIdentifierMoodChanges"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERMOODCHANGES;
151
+ case hashString("HKCategoryTypeIdentifierNausea"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERNAUSEA;
152
+ case hashString("HKCategoryTypeIdentifierNightSweats"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS;
153
+ case hashString("HKCategoryTypeIdentifierOvulationTestResult"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT;
154
+ case hashString("HKCategoryTypeIdentifierPelvicPain"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPELVICPAIN;
155
+ case hashString("HKCategoryTypeIdentifierPersistentIntermenstrualBleeding"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPERSISTENTINTERMENSTRUALBLEEDING;
156
+ case hashString("HKCategoryTypeIdentifierPregnancy"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPREGNANCY;
157
+ case hashString("HKCategoryTypeIdentifierPregnancyTestResult"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT;
158
+ case hashString("HKCategoryTypeIdentifierProgesteroneTestResult"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT;
159
+ case hashString("HKCategoryTypeIdentifierProlongedMenstrualPeriods"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPROLONGEDMENSTRUALPERIODS;
160
+ case hashString("HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT;
161
+ case hashString("HKCategoryTypeIdentifierRunnyNose"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERRUNNYNOSE;
162
+ case hashString("HKCategoryTypeIdentifierSexualActivity"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY;
163
+ case hashString("HKCategoryTypeIdentifierShortnessOfBreath"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH;
164
+ case hashString("HKCategoryTypeIdentifierSinusCongestion"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION;
165
+ case hashString("HKCategoryTypeIdentifierSkippedHeartbeat"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT;
166
+ case hashString("HKCategoryTypeIdentifierSleepAnalysis"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS;
167
+ case hashString("HKCategoryTypeIdentifierSleepApneaEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSLEEPAPNEAEVENT;
168
+ case hashString("HKCategoryTypeIdentifierSleepChanges"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES;
169
+ case hashString("HKCategoryTypeIdentifierSoreThroat"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSORETHROAT;
170
+ case hashString("HKCategoryTypeIdentifierToothbrushingEvent"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT;
171
+ case hashString("HKCategoryTypeIdentifierVaginalDryness"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS;
172
+ case hashString("HKCategoryTypeIdentifierVomiting"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERVOMITING;
173
+ case hashString("HKCategoryTypeIdentifierWheezing"): return margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERWHEEZING;
174
+ default: [[unlikely]]
175
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum CategoryTypeIdentifierWriteable - invalid value!");
176
+ }
177
+ }
178
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::CategoryTypeIdentifierWriteable arg) {
179
+ switch (arg) {
180
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAbdominalCramps");
181
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERACNE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAcne");
182
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppetiteChanges");
183
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppleWalkingSteadinessEvent");
184
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAudioExposureEvent");
185
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBladderIncontinence");
186
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBleedingAfterPregnancy");
187
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBleedingDuringPregnancy");
188
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBLOATING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBloating");
189
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERBREASTPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBreastPain");
190
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierCervicalMucusQuality");
191
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierChestTightnessOrPain");
192
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCHILLS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierChills");
193
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCONSTIPATION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierConstipation");
194
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierContraceptive");
195
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERCOUGHING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierCoughing");
196
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERDIARRHEA: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDiarrhea");
197
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERDIZZINESS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDizziness");
198
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERDRYSKIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDrySkin");
199
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent");
200
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERFAINTING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFainting");
201
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERFATIGUE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFatigue");
202
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERFEVER: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFever");
203
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierGeneralizedBodyAche");
204
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHAIRLOSS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHairLoss");
205
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHandwashingEvent");
206
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHEADACHE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeadache");
207
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHEARTBURN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeartburn");
208
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERHOTFLASHES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHotFlashes");
209
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERINFREQUENTMENSTRUALCYCLES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierInfrequentMenstrualCycles");
210
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIntermenstrualBleeding");
211
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIrregularHeartRhythmEvent");
212
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERIRREGULARMENSTRUALCYCLES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIrregularMenstrualCycles");
213
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLACTATION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLactation");
214
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLossOfSmell");
215
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLossOfTaste");
216
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowCardioFitnessEvent");
217
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowerBackPain");
218
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMemoryLapse");
219
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMenstrualFlow");
220
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERMINDFULSESSION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMindfulSession");
221
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERMOODCHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMoodChanges");
222
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERNAUSEA: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierNausea");
223
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierNightSweats");
224
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierOvulationTestResult");
225
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPELVICPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPelvicPain");
226
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPERSISTENTINTERMENSTRUALBLEEDING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPersistentIntermenstrualBleeding");
227
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPregnancy");
228
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPregnancyTestResult");
229
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierProgesteroneTestResult");
230
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERPROLONGEDMENSTRUALPERIODS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierProlongedMenstrualPeriods");
231
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat");
232
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERRUNNYNOSE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierRunnyNose");
233
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSexualActivity");
234
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierShortnessOfBreath");
235
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSinusCongestion");
236
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSkippedHeartbeat");
237
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepAnalysis");
238
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSLEEPAPNEAEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepApneaEvent");
239
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepChanges");
240
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERSORETHROAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSoreThroat");
241
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierToothbrushingEvent");
242
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierVaginalDryness");
243
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERVOMITING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierVomiting");
244
+ case margelo::nitro::healthkit::CategoryTypeIdentifierWriteable::HKCATEGORYTYPEIDENTIFIERWHEEZING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierWheezing");
245
+ default: [[unlikely]]
246
+ throw std::invalid_argument("Cannot convert CategoryTypeIdentifierWriteable to JS - invalid value: "
247
+ + std::to_string(static_cast<int>(arg)) + "!");
248
+ }
249
+ }
250
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
251
+ if (!value.isString()) {
252
+ return false;
253
+ }
254
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
255
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
256
+ case hashString("HKCategoryTypeIdentifierAbdominalCramps"):
257
+ case hashString("HKCategoryTypeIdentifierAcne"):
258
+ case hashString("HKCategoryTypeIdentifierAppetiteChanges"):
259
+ case hashString("HKCategoryTypeIdentifierAppleWalkingSteadinessEvent"):
260
+ case hashString("HKCategoryTypeIdentifierAudioExposureEvent"):
261
+ case hashString("HKCategoryTypeIdentifierBladderIncontinence"):
262
+ case hashString("HKCategoryTypeIdentifierBleedingAfterPregnancy"):
263
+ case hashString("HKCategoryTypeIdentifierBleedingDuringPregnancy"):
264
+ case hashString("HKCategoryTypeIdentifierBloating"):
265
+ case hashString("HKCategoryTypeIdentifierBreastPain"):
266
+ case hashString("HKCategoryTypeIdentifierCervicalMucusQuality"):
267
+ case hashString("HKCategoryTypeIdentifierChestTightnessOrPain"):
268
+ case hashString("HKCategoryTypeIdentifierChills"):
269
+ case hashString("HKCategoryTypeIdentifierConstipation"):
270
+ case hashString("HKCategoryTypeIdentifierContraceptive"):
271
+ case hashString("HKCategoryTypeIdentifierCoughing"):
272
+ case hashString("HKCategoryTypeIdentifierDiarrhea"):
273
+ case hashString("HKCategoryTypeIdentifierDizziness"):
274
+ case hashString("HKCategoryTypeIdentifierDrySkin"):
275
+ case hashString("HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent"):
276
+ case hashString("HKCategoryTypeIdentifierFainting"):
277
+ case hashString("HKCategoryTypeIdentifierFatigue"):
278
+ case hashString("HKCategoryTypeIdentifierFever"):
279
+ case hashString("HKCategoryTypeIdentifierGeneralizedBodyAche"):
280
+ case hashString("HKCategoryTypeIdentifierHairLoss"):
281
+ case hashString("HKCategoryTypeIdentifierHandwashingEvent"):
282
+ case hashString("HKCategoryTypeIdentifierHeadache"):
283
+ case hashString("HKCategoryTypeIdentifierHeartburn"):
284
+ case hashString("HKCategoryTypeIdentifierHotFlashes"):
285
+ case hashString("HKCategoryTypeIdentifierInfrequentMenstrualCycles"):
286
+ case hashString("HKCategoryTypeIdentifierIntermenstrualBleeding"):
287
+ case hashString("HKCategoryTypeIdentifierIrregularHeartRhythmEvent"):
288
+ case hashString("HKCategoryTypeIdentifierIrregularMenstrualCycles"):
289
+ case hashString("HKCategoryTypeIdentifierLactation"):
290
+ case hashString("HKCategoryTypeIdentifierLossOfSmell"):
291
+ case hashString("HKCategoryTypeIdentifierLossOfTaste"):
292
+ case hashString("HKCategoryTypeIdentifierLowCardioFitnessEvent"):
293
+ case hashString("HKCategoryTypeIdentifierLowerBackPain"):
294
+ case hashString("HKCategoryTypeIdentifierMemoryLapse"):
295
+ case hashString("HKCategoryTypeIdentifierMenstrualFlow"):
296
+ case hashString("HKCategoryTypeIdentifierMindfulSession"):
297
+ case hashString("HKCategoryTypeIdentifierMoodChanges"):
298
+ case hashString("HKCategoryTypeIdentifierNausea"):
299
+ case hashString("HKCategoryTypeIdentifierNightSweats"):
300
+ case hashString("HKCategoryTypeIdentifierOvulationTestResult"):
301
+ case hashString("HKCategoryTypeIdentifierPelvicPain"):
302
+ case hashString("HKCategoryTypeIdentifierPersistentIntermenstrualBleeding"):
303
+ case hashString("HKCategoryTypeIdentifierPregnancy"):
304
+ case hashString("HKCategoryTypeIdentifierPregnancyTestResult"):
305
+ case hashString("HKCategoryTypeIdentifierProgesteroneTestResult"):
306
+ case hashString("HKCategoryTypeIdentifierProlongedMenstrualPeriods"):
307
+ case hashString("HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat"):
308
+ case hashString("HKCategoryTypeIdentifierRunnyNose"):
309
+ case hashString("HKCategoryTypeIdentifierSexualActivity"):
310
+ case hashString("HKCategoryTypeIdentifierShortnessOfBreath"):
311
+ case hashString("HKCategoryTypeIdentifierSinusCongestion"):
312
+ case hashString("HKCategoryTypeIdentifierSkippedHeartbeat"):
313
+ case hashString("HKCategoryTypeIdentifierSleepAnalysis"):
314
+ case hashString("HKCategoryTypeIdentifierSleepApneaEvent"):
315
+ case hashString("HKCategoryTypeIdentifierSleepChanges"):
316
+ case hashString("HKCategoryTypeIdentifierSoreThroat"):
317
+ case hashString("HKCategoryTypeIdentifierToothbrushingEvent"):
318
+ case hashString("HKCategoryTypeIdentifierVaginalDryness"):
319
+ case hashString("HKCategoryTypeIdentifierVomiting"):
320
+ case hashString("HKCategoryTypeIdentifierWheezing"):
321
+ return true;
322
+ default:
323
+ return false;
324
+ }
325
+ }
326
+ };
327
+
328
+ } // namespace margelo::nitro
@@ -36,14 +36,6 @@ namespace margelo::nitro::healthkit { struct CategorySample; }
36
36
  namespace margelo::nitro::healthkit { struct QuantitySample; }
37
37
  // Forward declaration of `SampleType` to properly resolve imports.
38
38
  namespace margelo::nitro::healthkit { struct SampleType; }
39
- // Forward declaration of `WeatherCondition` to properly resolve imports.
40
- namespace margelo::nitro::healthkit { enum class WeatherCondition; }
41
- // Forward declaration of `Quantity` to properly resolve imports.
42
- namespace margelo::nitro::healthkit { struct Quantity; }
43
- // Forward declaration of `InsulinDeliveryReason` to properly resolve imports.
44
- namespace margelo::nitro::healthkit { enum class InsulinDeliveryReason; }
45
- // Forward declaration of `HeartRateMotionContext` to properly resolve imports.
46
- namespace margelo::nitro::healthkit { enum class HeartRateMotionContext; }
47
39
  // Forward declaration of `SourceRevision` to properly resolve imports.
48
40
  namespace margelo::nitro::healthkit { struct SourceRevision; }
49
41
  // Forward declaration of `Device` to properly resolve imports.
@@ -54,17 +46,13 @@ namespace margelo::nitro::healthkit { struct Device; }
54
46
  #include "QuantitySample.hpp"
55
47
  #include <variant>
56
48
  #include <vector>
57
- #include <string>
58
- #include <optional>
59
49
  #include "SampleType.hpp"
60
50
  #include <chrono>
61
- #include "WeatherCondition.hpp"
62
- #include "Quantity.hpp"
63
- #include "InsulinDeliveryReason.hpp"
64
- #include "HeartRateMotionContext.hpp"
51
+ #include <NitroModules/AnyMap.hpp>
52
+ #include <string>
65
53
  #include "SourceRevision.hpp"
66
54
  #include "Device.hpp"
67
- #include <NitroModules/AnyMap.hpp>
55
+ #include <optional>
68
56
 
69
57
  namespace margelo::nitro::healthkit {
70
58
 
@@ -75,39 +63,18 @@ namespace margelo::nitro::healthkit {
75
63
  public:
76
64
  CorrelationTypeIdentifier correlationType SWIFT_PRIVATE;
77
65
  std::vector<std::variant<CategorySample, QuantitySample>> objects SWIFT_PRIVATE;
78
- std::optional<std::string> metadataFoodType SWIFT_PRIVATE;
79
66
  SampleType sampleType SWIFT_PRIVATE;
80
67
  std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
81
68
  std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
82
69
  bool hasUndeterminedDuration SWIFT_PRIVATE;
83
- std::optional<WeatherCondition> metadataWeatherCondition SWIFT_PRIVATE;
84
- std::optional<Quantity> metadataWeatherHumidity SWIFT_PRIVATE;
85
- std::optional<Quantity> metadataWeatherTemperature SWIFT_PRIVATE;
86
- std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason SWIFT_PRIVATE;
87
- std::optional<HeartRateMotionContext> metadataHeartRateMotionContext SWIFT_PRIVATE;
70
+ std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
88
71
  std::string uuid SWIFT_PRIVATE;
89
72
  SourceRevision sourceRevision SWIFT_PRIVATE;
90
73
  std::optional<Device> device SWIFT_PRIVATE;
91
- std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
92
- std::optional<std::string> metadataExternalUUID SWIFT_PRIVATE;
93
- std::optional<std::string> metadataTimeZone SWIFT_PRIVATE;
94
- std::optional<bool> metadataWasUserEntered SWIFT_PRIVATE;
95
- std::optional<std::string> metadataDeviceSerialNumber SWIFT_PRIVATE;
96
- std::optional<std::string> metadataUdiDeviceIdentifier SWIFT_PRIVATE;
97
- std::optional<std::string> metadataUdiProductionIdentifier SWIFT_PRIVATE;
98
- std::optional<std::string> metadataDigitalSignature SWIFT_PRIVATE;
99
- std::optional<std::string> metadataDeviceName SWIFT_PRIVATE;
100
- std::optional<std::string> metadataDeviceManufacturerName SWIFT_PRIVATE;
101
- std::optional<std::string> metadataSyncIdentifier SWIFT_PRIVATE;
102
- std::optional<double> metadataSyncVersion SWIFT_PRIVATE;
103
- std::optional<bool> metadataWasTakenInLab SWIFT_PRIVATE;
104
- std::optional<double> metadataReferenceRangeLowerLimit SWIFT_PRIVATE;
105
- std::optional<double> metadataReferenceRangeUpperLimit SWIFT_PRIVATE;
106
- std::optional<double> metadataAlgorithmVersion SWIFT_PRIVATE;
107
74
 
108
75
  public:
109
76
  CorrelationSample() = default;
110
- explicit CorrelationSample(CorrelationTypeIdentifier correlationType, std::vector<std::variant<CategorySample, QuantitySample>> objects, std::optional<std::string> metadataFoodType, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::optional<WeatherCondition> metadataWeatherCondition, std::optional<Quantity> metadataWeatherHumidity, std::optional<Quantity> metadataWeatherTemperature, std::optional<InsulinDeliveryReason> metadataInsulinDeliveryReason, std::optional<HeartRateMotionContext> metadataHeartRateMotionContext, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device, std::shared_ptr<AnyMap> metadata, std::optional<std::string> metadataExternalUUID, std::optional<std::string> metadataTimeZone, std::optional<bool> metadataWasUserEntered, std::optional<std::string> metadataDeviceSerialNumber, std::optional<std::string> metadataUdiDeviceIdentifier, std::optional<std::string> metadataUdiProductionIdentifier, std::optional<std::string> metadataDigitalSignature, std::optional<std::string> metadataDeviceName, std::optional<std::string> metadataDeviceManufacturerName, std::optional<std::string> metadataSyncIdentifier, std::optional<double> metadataSyncVersion, std::optional<bool> metadataWasTakenInLab, std::optional<double> metadataReferenceRangeLowerLimit, std::optional<double> metadataReferenceRangeUpperLimit, std::optional<double> metadataAlgorithmVersion): correlationType(correlationType), objects(objects), metadataFoodType(metadataFoodType), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadataWeatherCondition(metadataWeatherCondition), metadataWeatherHumidity(metadataWeatherHumidity), metadataWeatherTemperature(metadataWeatherTemperature), metadataInsulinDeliveryReason(metadataInsulinDeliveryReason), metadataHeartRateMotionContext(metadataHeartRateMotionContext), uuid(uuid), sourceRevision(sourceRevision), device(device), metadata(metadata), metadataExternalUUID(metadataExternalUUID), metadataTimeZone(metadataTimeZone), metadataWasUserEntered(metadataWasUserEntered), metadataDeviceSerialNumber(metadataDeviceSerialNumber), metadataUdiDeviceIdentifier(metadataUdiDeviceIdentifier), metadataUdiProductionIdentifier(metadataUdiProductionIdentifier), metadataDigitalSignature(metadataDigitalSignature), metadataDeviceName(metadataDeviceName), metadataDeviceManufacturerName(metadataDeviceManufacturerName), metadataSyncIdentifier(metadataSyncIdentifier), metadataSyncVersion(metadataSyncVersion), metadataWasTakenInLab(metadataWasTakenInLab), metadataReferenceRangeLowerLimit(metadataReferenceRangeLowerLimit), metadataReferenceRangeUpperLimit(metadataReferenceRangeUpperLimit), metadataAlgorithmVersion(metadataAlgorithmVersion) {}
77
+ explicit CorrelationSample(CorrelationTypeIdentifier correlationType, std::vector<std::variant<CategorySample, QuantitySample>> objects, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::shared_ptr<AnyMap> metadata, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device): correlationType(correlationType), objects(objects), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadata(metadata), uuid(uuid), sourceRevision(sourceRevision), device(device) {}
111
78
 
112
79
  public:
113
80
  friend bool operator==(const CorrelationSample& lhs, const CorrelationSample& rhs) = default;
@@ -125,70 +92,28 @@ namespace margelo::nitro {
125
92
  return margelo::nitro::healthkit::CorrelationSample(
126
93
  JSIConverter<margelo::nitro::healthkit::CorrelationTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "correlationType"))),
127
94
  JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::CategorySample, margelo::nitro::healthkit::QuantitySample>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "objects"))),
128
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataFoodType"))),
129
95
  JSIConverter<margelo::nitro::healthkit::SampleType>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sampleType"))),
130
96
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
131
97
  JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
132
98
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
133
- JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition"))),
134
- JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"))),
135
- JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"))),
136
- JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"))),
137
- JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"))),
99
+ JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
138
100
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
139
101
  JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
140
- JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device"))),
141
- JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
142
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"))),
143
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"))),
144
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"))),
145
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"))),
146
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"))),
147
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"))),
148
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"))),
149
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"))),
150
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"))),
151
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"))),
152
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"))),
153
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"))),
154
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"))),
155
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"))),
156
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))
102
+ JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
157
103
  );
158
104
  }
159
105
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::CorrelationSample& arg) {
160
106
  jsi::Object obj(runtime);
161
107
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "correlationType"), JSIConverter<margelo::nitro::healthkit::CorrelationTypeIdentifier>::toJSI(runtime, arg.correlationType));
162
108
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "objects"), JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::CategorySample, margelo::nitro::healthkit::QuantitySample>>>::toJSI(runtime, arg.objects));
163
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataFoodType"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataFoodType));
164
109
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "sampleType"), JSIConverter<margelo::nitro::healthkit::SampleType>::toJSI(runtime, arg.sampleType));
165
110
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
166
111
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
167
112
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
168
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition"), JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::toJSI(runtime, arg.metadataWeatherCondition));
169
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherHumidity));
170
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.metadataWeatherTemperature));
171
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason"), JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::toJSI(runtime, arg.metadataInsulinDeliveryReason));
172
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext"), JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::toJSI(runtime, arg.metadataHeartRateMotionContext));
113
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
173
114
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
174
115
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
175
116
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
176
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
177
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataExternalUUID));
178
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataTimeZone));
179
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasUserEntered));
180
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceSerialNumber));
181
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiDeviceIdentifier));
182
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataUdiProductionIdentifier));
183
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDigitalSignature));
184
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceName));
185
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataDeviceManufacturerName));
186
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.metadataSyncIdentifier));
187
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataSyncVersion));
188
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.metadataWasTakenInLab));
189
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeLowerLimit));
190
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataReferenceRangeUpperLimit));
191
- obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.metadataAlgorithmVersion));
192
117
  return obj;
193
118
  }
194
119
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -201,35 +126,14 @@ namespace margelo::nitro {
201
126
  }
202
127
  if (!JSIConverter<margelo::nitro::healthkit::CorrelationTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "correlationType")))) return false;
203
128
  if (!JSIConverter<std::vector<std::variant<margelo::nitro::healthkit::CategorySample, margelo::nitro::healthkit::QuantitySample>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "objects")))) return false;
204
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataFoodType")))) return false;
205
129
  if (!JSIConverter<margelo::nitro::healthkit::SampleType>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sampleType")))) return false;
206
130
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
207
131
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
208
132
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
209
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::WeatherCondition>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherCondition")))) return false;
210
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherHumidity")))) return false;
211
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWeatherTemperature")))) return false;
212
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::InsulinDeliveryReason>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataInsulinDeliveryReason")))) return false;
213
- if (!JSIConverter<std::optional<margelo::nitro::healthkit::HeartRateMotionContext>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataHeartRateMotionContext")))) return false;
133
+ if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
214
134
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
215
135
  if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
216
136
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
217
- if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
218
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataExternalUUID")))) return false;
219
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataTimeZone")))) return false;
220
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasUserEntered")))) return false;
221
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceSerialNumber")))) return false;
222
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiDeviceIdentifier")))) return false;
223
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataUdiProductionIdentifier")))) return false;
224
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDigitalSignature")))) return false;
225
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceName")))) return false;
226
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataDeviceManufacturerName")))) return false;
227
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncIdentifier")))) return false;
228
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataSyncVersion")))) return false;
229
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataWasTakenInLab")))) return false;
230
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeLowerLimit")))) return false;
231
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataReferenceRangeUpperLimit")))) return false;
232
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadataAlgorithmVersion")))) return false;
233
137
  return true;
234
138
  }
235
139
  };