@kingstinct/react-native-healthkit 11.0.0 → 11.1.1

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 (122) hide show
  1. package/README.md +2 -2
  2. package/ios/ElectrocardiogramModule.swift +212 -0
  3. package/ios/QuantityTypeModule.swift +52 -15
  4. package/lib/commonjs/healthkit.ios.js +6 -2
  5. package/lib/commonjs/healthkit.js +10 -2
  6. package/lib/commonjs/modules.js +2 -1
  7. package/lib/commonjs/specs/ElectrocardiogramModule.nitro.js +2 -0
  8. package/lib/commonjs/types/ElectrocardiogramSample.js +2 -0
  9. package/lib/module/healthkit.ios.js +5 -1
  10. package/lib/module/healthkit.js +8 -0
  11. package/lib/module/modules.js +1 -0
  12. package/lib/module/specs/ElectrocardiogramModule.nitro.js +1 -0
  13. package/lib/module/types/ElectrocardiogramSample.js +1 -0
  14. package/lib/typescript/healthkit.d.ts +2 -0
  15. package/lib/typescript/healthkit.ios.d.ts +4 -0
  16. package/lib/typescript/modules.d.ts +2 -0
  17. package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +8 -0
  18. package/lib/typescript/types/ElectrocardiogramSample.d.ts +39 -0
  19. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +83 -50
  20. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +257 -74
  21. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +29 -0
  22. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -0
  23. package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +15 -0
  24. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +1 -1
  25. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.cpp +11 -0
  26. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +152 -0
  27. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +1 -1
  28. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +2 -2
  29. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +1 -2
  30. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +4 -4
  31. package/nitrogen/generated/ios/swift/CategorySample.swift +2 -16
  32. package/nitrogen/generated/ios/swift/CategorySampleForSaving.swift +1 -8
  33. package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +179 -0
  34. package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +184 -0
  35. package/nitrogen/generated/ios/swift/ElectrocardiogramClassification.swift +60 -0
  36. package/nitrogen/generated/ios/swift/ElectrocardiogramLead.swift +40 -0
  37. package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +284 -0
  38. package/nitrogen/generated/ios/swift/ElectrocardiogramSamplesWithAnchorResponse.swift +81 -0
  39. package/nitrogen/generated/ios/swift/ElectrocardiogramSymptomsStatus.swift +44 -0
  40. package/nitrogen/generated/ios/swift/ElectrocardiogramVoltage.swift +57 -0
  41. package/nitrogen/generated/ios/swift/Func_void_ElectrocardiogramSamplesWithAnchorResponse.swift +47 -0
  42. package/nitrogen/generated/ios/swift/Func_void_std__optional_QueryStatisticsResponse_.swift +1 -8
  43. package/nitrogen/generated/ios/swift/Func_void_std__optional_WorkoutPlan_.swift +1 -8
  44. package/nitrogen/generated/ios/swift/Func_void_std__vector_ElectrocardiogramSample_.swift +47 -0
  45. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +2 -16
  46. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +1 -8
  47. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +33 -5
  48. package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +50 -0
  49. package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +155 -0
  50. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +1 -8
  51. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +11 -24
  52. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +10 -9
  53. package/nitrogen/generated/ios/swift/QuantitySample.swift +2 -16
  54. package/nitrogen/generated/ios/swift/QuantitySampleForSaving.swift +1 -8
  55. package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +7 -56
  56. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +23 -45
  57. package/nitrogen/generated/ios/swift/WorkoutSample.swift +2 -16
  58. package/nitrogen/generated/shared/c++/CategorySample.hpp +8 -0
  59. package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +8 -0
  60. package/nitrogen/generated/shared/c++/CategorySamplesWithAnchorResponse.hpp +8 -0
  61. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +8 -0
  62. package/nitrogen/generated/shared/c++/DeletedSample.hpp +8 -0
  63. package/nitrogen/generated/shared/c++/Device.hpp +8 -0
  64. package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +109 -0
  65. package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +108 -0
  66. package/nitrogen/generated/shared/c++/ElectrocardiogramClassification.hpp +96 -0
  67. package/nitrogen/generated/shared/c++/ElectrocardiogramLead.hpp +76 -0
  68. package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +143 -0
  69. package/nitrogen/generated/shared/c++/ElectrocardiogramSamplesWithAnchorResponse.hpp +89 -0
  70. package/nitrogen/generated/shared/c++/ElectrocardiogramSymptomsStatus.hpp +80 -0
  71. package/nitrogen/generated/shared/c++/ElectrocardiogramVoltage.hpp +84 -0
  72. package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +8 -0
  73. package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +8 -0
  74. package/nitrogen/generated/shared/c++/Heartbeat.hpp +8 -0
  75. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +8 -0
  76. package/nitrogen/generated/shared/c++/HeartbeatSeriesSamplesWithAnchorResponse.hpp +8 -0
  77. package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.cpp +22 -0
  78. package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +76 -0
  79. package/nitrogen/generated/shared/c++/IdentifierWithUnit.hpp +8 -0
  80. package/nitrogen/generated/shared/c++/IntervalComponents.hpp +8 -0
  81. package/nitrogen/generated/shared/c++/LocationForSaving.hpp +8 -0
  82. package/nitrogen/generated/shared/c++/OnChangeCallbackArgs.hpp +8 -0
  83. package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +8 -0
  84. package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +8 -0
  85. package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +8 -0
  86. package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +8 -0
  87. package/nitrogen/generated/shared/c++/PredicateWithStartAndEnd.hpp +8 -0
  88. package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +8 -0
  89. package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +8 -0
  90. package/nitrogen/generated/shared/c++/Quantity.hpp +8 -0
  91. package/nitrogen/generated/shared/c++/QuantityDateInterval.hpp +8 -0
  92. package/nitrogen/generated/shared/c++/QuantitySample.hpp +8 -0
  93. package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +8 -0
  94. package/nitrogen/generated/shared/c++/QuantitySamplesWithAnchorResponse.hpp +8 -0
  95. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +8 -0
  96. package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +8 -0
  97. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +8 -0
  98. package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +8 -0
  99. package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +8 -0
  100. package/nitrogen/generated/shared/c++/QueryWorkoutSamplesWithAnchorResponse.hpp +8 -0
  101. package/nitrogen/generated/shared/c++/Source.hpp +8 -0
  102. package/nitrogen/generated/shared/c++/SourceRevision.hpp +8 -0
  103. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +8 -0
  104. package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +8 -0
  105. package/nitrogen/generated/shared/c++/WorkoutActivity.hpp +8 -0
  106. package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +8 -0
  107. package/nitrogen/generated/shared/c++/WorkoutConfiguration.hpp +8 -0
  108. package/nitrogen/generated/shared/c++/WorkoutDurationPredicate.hpp +8 -0
  109. package/nitrogen/generated/shared/c++/WorkoutEvent.hpp +8 -0
  110. package/nitrogen/generated/shared/c++/WorkoutPlan.hpp +8 -0
  111. package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +8 -0
  112. package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +8 -0
  113. package/nitrogen/generated/shared/c++/WorkoutRoute.hpp +8 -0
  114. package/nitrogen/generated/shared/c++/WorkoutRouteLocation.hpp +8 -0
  115. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +8 -0
  116. package/nitrogen/generated/shared/c++/WorkoutTotals.hpp +8 -0
  117. package/package.json +5 -5
  118. package/src/healthkit.ios.ts +9 -0
  119. package/src/healthkit.ts +16 -0
  120. package/src/modules.ts +6 -0
  121. package/src/specs/ElectrocardiogramModule.nitro.ts +18 -0
  122. package/src/types/ElectrocardiogramSample.ts +60 -0
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `HeartbeatSeriesSample` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct HeartbeatSeriesSample; }
@@ -71,6 +76,9 @@ namespace margelo::nitro {
71
76
  return false;
72
77
  }
73
78
  jsi::Object obj = value.getObject(runtime);
79
+ if (!nitro::isPlainObject(runtime, obj)) {
80
+ return false;
81
+ }
74
82
  if (!JSIConverter<std::vector<margelo::nitro::healthkit::HeartbeatSeriesSample>>::canConvert(runtime, obj.getProperty(runtime, "samples"))) return false;
75
83
  if (!JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
76
84
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "newAnchor"))) return false;
@@ -0,0 +1,22 @@
1
+ ///
2
+ /// HybridElectrocardiogramModuleSpec.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "HybridElectrocardiogramModuleSpec.hpp"
9
+
10
+ namespace margelo::nitro::healthkit {
11
+
12
+ void HybridElectrocardiogramModuleSpec::loadHybridMethods() {
13
+ // load base methods/properties
14
+ HybridObject::loadHybridMethods();
15
+ // load custom methods/properties
16
+ registerHybrids(this, [](Prototype& prototype) {
17
+ prototype.registerHybridMethod("queryElectrocardiogramSamples", &HybridElectrocardiogramModuleSpec::queryElectrocardiogramSamples);
18
+ prototype.registerHybridMethod("queryElectrocardiogramSamplesWithAnchor", &HybridElectrocardiogramModuleSpec::queryElectrocardiogramSamplesWithAnchor);
19
+ });
20
+ }
21
+
22
+ } // namespace margelo::nitro::healthkit
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// HybridElectrocardiogramModuleSpec.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/HybridObject.hpp>)
11
+ #include <NitroModules/HybridObject.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+
16
+ // Forward declaration of `ElectrocardiogramSample` to properly resolve imports.
17
+ namespace margelo::nitro::healthkit { struct ElectrocardiogramSample; }
18
+ // Forward declaration of `ECGQueryOptionsWithSortOrder` to properly resolve imports.
19
+ namespace margelo::nitro::healthkit { struct ECGQueryOptionsWithSortOrder; }
20
+ // Forward declaration of `ElectrocardiogramSamplesWithAnchorResponse` to properly resolve imports.
21
+ namespace margelo::nitro::healthkit { struct ElectrocardiogramSamplesWithAnchorResponse; }
22
+ // Forward declaration of `ECGQueryOptionsWithAnchor` to properly resolve imports.
23
+ namespace margelo::nitro::healthkit { struct ECGQueryOptionsWithAnchor; }
24
+
25
+ #include "ElectrocardiogramSample.hpp"
26
+ #include <vector>
27
+ #include <NitroModules/Promise.hpp>
28
+ #include "ECGQueryOptionsWithSortOrder.hpp"
29
+ #include <optional>
30
+ #include "ElectrocardiogramSamplesWithAnchorResponse.hpp"
31
+ #include "ECGQueryOptionsWithAnchor.hpp"
32
+
33
+ namespace margelo::nitro::healthkit {
34
+
35
+ using namespace margelo::nitro;
36
+
37
+ /**
38
+ * An abstract base class for `ElectrocardiogramModule`
39
+ * Inherit this class to create instances of `HybridElectrocardiogramModuleSpec` in C++.
40
+ * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
41
+ * @example
42
+ * ```cpp
43
+ * class HybridElectrocardiogramModule: public HybridElectrocardiogramModuleSpec {
44
+ * public:
45
+ * HybridElectrocardiogramModule(...): HybridObject(TAG) { ... }
46
+ * // ...
47
+ * };
48
+ * ```
49
+ */
50
+ class HybridElectrocardiogramModuleSpec: public virtual HybridObject {
51
+ public:
52
+ // Constructor
53
+ explicit HybridElectrocardiogramModuleSpec(): HybridObject(TAG) { }
54
+
55
+ // Destructor
56
+ ~HybridElectrocardiogramModuleSpec() override = default;
57
+
58
+ public:
59
+ // Properties
60
+
61
+
62
+ public:
63
+ // Methods
64
+ virtual std::shared_ptr<Promise<std::vector<ElectrocardiogramSample>>> queryElectrocardiogramSamples(const std::optional<ECGQueryOptionsWithSortOrder>& options) = 0;
65
+ virtual std::shared_ptr<Promise<ElectrocardiogramSamplesWithAnchorResponse>> queryElectrocardiogramSamplesWithAnchor(const ECGQueryOptionsWithAnchor& options) = 0;
66
+
67
+ protected:
68
+ // Hybrid Setup
69
+ void loadHybridMethods() override;
70
+
71
+ protected:
72
+ // Tag for logging
73
+ static constexpr auto TAG = "ElectrocardiogramModule";
74
+ };
75
+
76
+ } // namespace margelo::nitro::healthkit
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -62,6 +67,9 @@ namespace margelo::nitro {
62
67
  return false;
63
68
  }
64
69
  jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
65
73
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "typeIdentifier"))) return false;
66
74
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
67
75
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -71,6 +76,9 @@ namespace margelo::nitro {
71
76
  return false;
72
77
  }
73
78
  jsi::Object obj = value.getObject(runtime);
79
+ if (!nitro::isPlainObject(runtime, obj)) {
80
+ return false;
81
+ }
74
82
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "minute"))) return false;
75
83
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "hour"))) return false;
76
84
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "day"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -80,6 +85,9 @@ namespace margelo::nitro {
80
85
  return false;
81
86
  }
82
87
  jsi::Object obj = value.getObject(runtime);
88
+ if (!nitro::isPlainObject(runtime, obj)) {
89
+ return false;
90
+ }
83
91
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "altitude"))) return false;
84
92
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "course"))) return false;
85
93
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "date"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `SampleTypeIdentifier` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { enum class SampleTypeIdentifier; }
@@ -65,6 +70,9 @@ namespace margelo::nitro {
65
70
  return false;
66
71
  }
67
72
  jsi::Object obj = value.getObject(runtime);
73
+ if (!nitro::isPlainObject(runtime, obj)) {
74
+ return false;
75
+ }
68
76
  if (!JSIConverter<margelo::nitro::healthkit::SampleTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "typeIdentifier"))) return false;
69
77
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "errorMessage"))) return false;
70
78
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `PredicateWithUUID` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
@@ -80,6 +85,9 @@ namespace margelo::nitro {
80
85
  return false;
81
86
  }
82
87
  jsi::Object obj = value.getObject(runtime);
88
+ if (!nitro::isPlainObject(runtime, obj)) {
89
+ return false;
90
+ }
83
91
  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;
84
92
  return true;
85
93
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `PredicateWithUUID` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
@@ -80,6 +85,9 @@ namespace margelo::nitro {
80
85
  return false;
81
86
  }
82
87
  jsi::Object obj = value.getObject(runtime);
88
+ if (!nitro::isPlainObject(runtime, obj)) {
89
+ return false;
90
+ }
83
91
  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;
84
92
  return true;
85
93
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `HybridWorkoutProxySpec` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
@@ -61,6 +66,9 @@ namespace margelo::nitro {
61
66
  return false;
62
67
  }
63
68
  jsi::Object obj = value.getObject(runtime);
69
+ if (!nitro::isPlainObject(runtime, obj)) {
70
+ return false;
71
+ }
64
72
  if (!JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>::canConvert(runtime, obj.getProperty(runtime, "workout"))) return false;
65
73
  return true;
66
74
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `PredicateWithMetadataOperator` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { enum class PredicateWithMetadataOperator; }
@@ -70,6 +75,9 @@ namespace margelo::nitro {
70
75
  return false;
71
76
  }
72
77
  jsi::Object obj = value.getObject(runtime);
78
+ if (!nitro::isPlainObject(runtime, obj)) {
79
+ return false;
80
+ }
73
81
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "withMetadataKey"))) return false;
74
82
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataOperator>>::canConvert(runtime, obj.getProperty(runtime, "operatorType"))) return false;
75
83
  if (!JSIConverter<std::optional<std::variant<std::string, double, bool, std::chrono::system_clock::time_point>>>::canConvert(runtime, obj.getProperty(runtime, "value"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -69,6 +74,9 @@ namespace margelo::nitro {
69
74
  return false;
70
75
  }
71
76
  jsi::Object obj = value.getObject(runtime);
77
+ if (!nitro::isPlainObject(runtime, obj)) {
78
+ return false;
79
+ }
72
80
  if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
73
81
  if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
74
82
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "strictEndDate"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -59,6 +64,9 @@ namespace margelo::nitro {
59
64
  return false;
60
65
  }
61
66
  jsi::Object obj = value.getObject(runtime);
67
+ if (!nitro::isPlainObject(runtime, obj)) {
68
+ return false;
69
+ }
62
70
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "uuid"))) return false;
63
71
  return true;
64
72
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -60,6 +65,9 @@ namespace margelo::nitro {
60
65
  return false;
61
66
  }
62
67
  jsi::Object obj = value.getObject(runtime);
68
+ if (!nitro::isPlainObject(runtime, obj)) {
69
+ return false;
70
+ }
63
71
  if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "uuids"))) return false;
64
72
  return true;
65
73
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -62,6 +67,9 @@ namespace margelo::nitro {
62
67
  return false;
63
68
  }
64
69
  jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
65
73
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
66
74
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "quantity"))) return false;
67
75
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -62,6 +67,9 @@ namespace margelo::nitro {
62
67
  return false;
63
68
  }
64
69
  jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
65
73
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "from"))) return false;
66
74
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "to"))) return false;
67
75
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `Device` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct Device; }
@@ -96,6 +101,9 @@ namespace margelo::nitro {
96
101
  return false;
97
102
  }
98
103
  jsi::Object obj = value.getObject(runtime);
104
+ if (!nitro::isPlainObject(runtime, obj)) {
105
+ return false;
106
+ }
99
107
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "uuid"))) return false;
100
108
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, "device"))) return false;
101
109
  if (!JSIConverter<margelo::nitro::healthkit::QuantityTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "quantityType"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `QuantityTypeIdentifier` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { enum class QuantityTypeIdentifier; }
@@ -87,6 +92,9 @@ namespace margelo::nitro {
87
92
  return false;
88
93
  }
89
94
  jsi::Object obj = value.getObject(runtime);
95
+ if (!nitro::isPlainObject(runtime, obj)) {
96
+ return false;
97
+ }
90
98
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
91
99
  if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
92
100
  if (!JSIConverter<margelo::nitro::healthkit::QuantityTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "quantityType"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `QuantitySample` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct QuantitySample; }
@@ -71,6 +76,9 @@ namespace margelo::nitro {
71
76
  return false;
72
77
  }
73
78
  jsi::Object obj = value.getObject(runtime);
79
+ if (!nitro::isPlainObject(runtime, obj)) {
80
+ return false;
81
+ }
74
82
  if (!JSIConverter<std::vector<margelo::nitro::healthkit::QuantitySample>>::canConvert(runtime, obj.getProperty(runtime, "samples"))) return false;
75
83
  if (!JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
76
84
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "newAnchor"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `PredicateWithUUID` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
@@ -87,6 +92,9 @@ namespace margelo::nitro {
87
92
  return false;
88
93
  }
89
94
  jsi::Object obj = value.getObject(runtime);
95
+ if (!nitro::isPlainObject(runtime, obj)) {
96
+ return false;
97
+ }
90
98
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
91
99
  if (!JSIConverter<std::optional<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::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
92
100
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `PredicateWithUUID` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
@@ -90,6 +95,9 @@ namespace margelo::nitro {
90
95
  return false;
91
96
  }
92
97
  jsi::Object obj = value.getObject(runtime);
98
+ if (!nitro::isPlainObject(runtime, obj)) {
99
+ return false;
100
+ }
93
101
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
94
102
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
95
103
  if (!JSIConverter<std::optional<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::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `PredicateWithUUID` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
@@ -86,6 +91,9 @@ namespace margelo::nitro {
86
91
  return false;
87
92
  }
88
93
  jsi::Object obj = value.getObject(runtime);
94
+ if (!nitro::isPlainObject(runtime, obj)) {
95
+ return false;
96
+ }
89
97
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "ascending"))) return false;
90
98
  if (!JSIConverter<std::optional<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::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
91
99
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `PredicateWithUUID` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
@@ -90,6 +95,9 @@ namespace margelo::nitro {
90
95
  return false;
91
96
  }
92
97
  jsi::Object obj = value.getObject(runtime);
98
+ if (!nitro::isPlainObject(runtime, obj)) {
99
+ return false;
100
+ }
93
101
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
94
102
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "ascending"))) return false;
95
103
  if (!JSIConverter<std::optional<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::FilterForSamplesAnd, margelo::nitro::healthkit::FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `Quantity` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { struct Quantity; }
@@ -89,6 +94,9 @@ namespace margelo::nitro {
89
94
  return false;
90
95
  }
91
96
  jsi::Object obj = value.getObject(runtime);
97
+ if (!nitro::isPlainObject(runtime, obj)) {
98
+ return false;
99
+ }
92
100
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "averageQuantity"))) return false;
93
101
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "maximumQuantity"))) return false;
94
102
  if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "minimumQuantity"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `HybridWorkoutProxySpec` to properly resolve imports.
22
27
  namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
@@ -72,6 +77,9 @@ namespace margelo::nitro {
72
77
  return false;
73
78
  }
74
79
  jsi::Object obj = value.getObject(runtime);
80
+ if (!nitro::isPlainObject(runtime, obj)) {
81
+ return false;
82
+ }
75
83
  if (!JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::canConvert(runtime, obj.getProperty(runtime, "workouts"))) return false;
76
84
  if (!JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
77
85
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "newAnchor"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -62,6 +67,9 @@ namespace margelo::nitro {
62
67
  return false;
63
68
  }
64
69
  jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
65
73
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
66
74
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bundleIdentifier"))) return false;
67
75
  return true;