@kingstinct/react-native-healthkit 12.1.2 → 12.2.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.
- package/ios/CategoryTypeModule.swift +49 -97
- package/ios/CharacteristicTypeModule.swift +77 -63
- package/ios/CoreModule.swift +324 -280
- package/ios/CorrelationTypeModule.swift +192 -144
- package/ios/ElectrocardiogramModule.swift +185 -194
- package/ios/HeartbeatSeriesModule.swift +123 -171
- package/ios/Helpers.swift +312 -571
- package/ios/MedicationModule.swift +259 -0
- package/ios/PredicateHelpers.swift +334 -0
- package/ios/QuantityTypeModule.swift +297 -378
- package/ios/Serializers.swift +273 -210
- package/ios/SourceProxy.swift +2 -2
- package/ios/StateOfMindModule.swift +179 -125
- package/ios/WorkoutProxy.swift +235 -112
- package/ios/WorkoutsModule.swift +214 -262
- package/lib/commonjs/healthkit.ios.js +22 -2
- package/lib/commonjs/healthkit.js +35 -5
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/commonjs/hooks/useSubscribeToCategorySamples.js +20 -0
- package/lib/commonjs/modules.js +2 -1
- package/lib/commonjs/specs/MedicationModule.nitro.js +27 -0
- package/lib/commonjs/types/Constants.js +2 -1
- package/lib/commonjs/types/QuantityType.js +8 -1
- package/lib/commonjs/types/QueryOptions.js +18 -0
- package/lib/commonjs/types/WeatherCondition.js +32 -32
- package/lib/commonjs/types/Workouts.js +1 -50
- package/lib/commonjs/utils/getCategorySampleById.js +1 -1
- package/lib/commonjs/utils/getQuantitySampleById.js +1 -1
- package/lib/commonjs/utils/getWorkoutById.js +1 -1
- package/lib/commonjs/utils/subscribeToCategorySamples.js +29 -0
- package/lib/commonjs/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/module/healthkit.ios.js +20 -2
- package/lib/module/healthkit.js +32 -2
- package/lib/module/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/module/hooks/useSubscribeToCategorySamples.js +17 -0
- package/lib/module/modules.js +1 -0
- package/lib/module/specs/MedicationModule.nitro.js +26 -0
- package/lib/module/types/Constants.js +1 -0
- package/lib/module/types/QuantityType.js +7 -0
- package/lib/module/types/QueryOptions.js +17 -1
- package/lib/module/types/WeatherCondition.js +31 -31
- package/lib/module/types/Workouts.js +0 -49
- package/lib/module/utils/getCategorySampleById.js +1 -1
- package/lib/module/utils/getQuantitySampleById.js +1 -1
- package/lib/module/utils/getWorkoutById.js +1 -1
- package/lib/module/utils/subscribeToCategorySamples.js +26 -0
- package/lib/module/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/typescript/healthkit.d.ts +18 -9
- package/lib/typescript/healthkit.ios.d.ts +33 -15
- package/lib/typescript/hooks/useSubscribeToCategorySamples.d.ts +3 -0
- package/lib/typescript/modules.d.ts +2 -0
- package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +2 -2
- package/lib/typescript/specs/CoreModule.nitro.d.ts +2 -1
- package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +4 -2
- package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/HeartbeatSeriesModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/MedicationModule.nitro.d.ts +56 -0
- package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +4 -4
- package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +4 -3
- package/lib/typescript/types/CategoryType.d.ts +10 -20
- package/lib/typescript/types/Constants.d.ts +1 -0
- package/lib/typescript/types/CorrelationType.d.ts +8 -10
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +2 -12
- package/lib/typescript/types/HeartbeatSeries.d.ts +2 -14
- package/lib/typescript/types/QuantitySample.d.ts +2 -8
- package/lib/typescript/types/QuantityType.d.ts +7 -8
- package/lib/typescript/types/QuantityTypeIdentifier.d.ts +23 -23
- package/lib/typescript/types/QueryOptions.d.ts +43 -28
- package/lib/typescript/types/Shared.d.ts +52 -7
- package/lib/typescript/types/StateOfMind.d.ts +7 -10
- package/lib/typescript/types/Subscriptions.d.ts +12 -3
- package/lib/typescript/types/WeatherCondition.d.ts +1 -1
- package/lib/typescript/types/Workouts.d.ts +28 -81
- package/lib/typescript/utils/subscribeToCategorySamples.d.ts +5 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +57 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +592 -389
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +65 -30
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +15 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +32 -26
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +36 -37
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +55 -2
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +36 -30
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +35 -29
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +181 -0
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +48 -42
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +59 -36
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +150 -29
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +13 -28
- package/nitrogen/generated/ios/swift/AggregationStyle.swift +48 -0
- package/nitrogen/generated/ios/swift/CategorySample.swift +571 -24
- package/nitrogen/generated/ios/swift/ComparisonPredicateOperator.swift +2 -2
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +640 -17
- package/nitrogen/generated/ios/swift/{PredicateWithStartAndEnd.swift → DateFilter.swift} +5 -5
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +570 -72
- package/nitrogen/generated/ios/swift/FilterForSamples.swift +349 -12
- package/nitrogen/generated/ios/swift/FilterForSamplesBase.swift +234 -0
- package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +366 -0
- package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +240 -0
- package/nitrogen/generated/ios/swift/Func_void_MedicationDoseEventsWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryCorrelationSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_StateOfMindSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MedicationDoseEvent_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_UserAnnotatedMedication_.swift +47 -0
- package/nitrogen/generated/ios/swift/GeneralForm.swift +104 -0
- package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +44 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +565 -37
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +19 -31
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec_cxx.swift +208 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +9 -43
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +34 -6
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +376 -36
- package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationConcept.swift +80 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +781 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventLogStatus.swift +56 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventScheduleType.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventsWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +7 -7
- package/nitrogen/generated/ios/swift/QuantitySample.swift +574 -27
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/QueryCorrelationSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/RelatedCoding.swift +76 -0
- package/nitrogen/generated/ios/swift/SampleType.swift +68 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +0 -16
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +586 -58
- package/nitrogen/generated/ios/swift/StateOfMindSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +7 -75
- package/nitrogen/generated/ios/swift/UserAnnotatedMedication.swift +87 -0
- package/nitrogen/generated/ios/swift/WeatherCondition.swift +144 -0
- package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +751 -78
- package/nitrogen/generated/shared/c++/AggregationStyle.hpp +64 -0
- package/nitrogen/generated/shared/c++/CategorySample.hpp +126 -23
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +134 -12
- package/nitrogen/generated/shared/c++/{PredicateWithStartAndEnd.hpp → DateFilter.hpp} +10 -10
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +135 -36
- package/nitrogen/generated/shared/c++/FilterForSamples.hpp +124 -0
- package/nitrogen/generated/shared/c++/FilterForSamplesBase.hpp +109 -0
- package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +131 -0
- package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +116 -0
- package/nitrogen/generated/shared/c++/GeneralForm.hpp +140 -0
- package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +67 -0
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +131 -28
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +10 -28
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +11 -1
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +6 -25
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +9 -2
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +33 -5
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +56 -16
- package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationConcept.hpp +93 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +240 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventLogStatus.hpp +66 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventScheduleType.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventsWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +8 -8
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +130 -27
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/QueryCorrelationSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/RelatedCoding.hpp +84 -0
- package/nitrogen/generated/shared/c++/SampleType.hpp +87 -0
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +105 -121
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +139 -36
- package/nitrogen/generated/shared/c++/StateOfMindSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +8 -27
- package/nitrogen/generated/shared/c++/UserAnnotatedMedication.hpp +90 -0
- package/nitrogen/generated/shared/c++/WeatherCondition.hpp +88 -0
- package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +159 -35
- package/package.json +1 -1
- package/src/healthkit.ios.ts +30 -0
- package/src/healthkit.ts +68 -3
- package/src/hooks/useStatisticsForQuantity.ts +1 -1
- package/src/hooks/useSubscribeToCategorySamples.ts +31 -0
- package/src/modules.ts +4 -0
- package/src/specs/CategoryTypeModule.nitro.ts +2 -2
- package/src/specs/CoreModule.nitro.ts +3 -0
- package/src/specs/CorrelationTypeModule.nitro.ts +11 -3
- package/src/specs/ElectrocardiogramModule.nitro.ts +1 -1
- package/src/specs/HeartbeatSeriesModule.nitro.ts +1 -1
- package/src/specs/MedicationModule.nitro.ts +140 -0
- package/src/specs/QuantityTypeModule.nitro.ts +4 -7
- package/src/specs/StateOfMindModule.nitro.ts +10 -2
- package/src/types/CategoryType.ts +15 -22
- package/src/types/Constants.ts +3 -0
- package/src/types/CorrelationType.ts +10 -15
- package/src/types/ElectrocardiogramSample.ts +2 -14
- package/src/types/HeartbeatSeries.ts +2 -15
- package/src/types/QuantitySample.ts +2 -8
- package/src/types/QuantityType.ts +8 -17
- package/src/types/QuantityTypeIdentifier.ts +25 -25
- package/src/types/QueryOptions.ts +54 -43
- package/src/types/Shared.ts +74 -17
- package/src/types/StateOfMind.ts +8 -10
- package/src/types/Subscriptions.ts +19 -3
- package/src/types/WeatherCondition.ts +1 -1
- package/src/types/Workouts.ts +28 -91
- package/src/utils/getCategorySampleById.ts +1 -1
- package/src/utils/getQuantitySampleById.ts +1 -1
- package/src/utils/getWorkoutById.ts +1 -2
- package/src/utils/subscribeToCategorySamples.ts +38 -0
- package/src/utils/subscribeToQuantitySamples.ts +12 -37
- package/nitrogen/generated/ios/swift/FilterForSamplesAnd.swift +0 -94
- package/nitrogen/generated/ios/swift/FilterForSamplesOr.swift +0 -94
- package/nitrogen/generated/ios/swift/PredicateForSamples.swift +0 -21
- package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +0 -23
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsAnd.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsOr.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +0 -45
- package/nitrogen/generated/ios/swift/PredicateWithMetadataOperator.swift +0 -48
- package/nitrogen/generated/ios/swift/PredicateWithUUID.swift +0 -35
- package/nitrogen/generated/ios/swift/PredicateWithUUIDs.swift +0 -47
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +0 -23
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +0 -25
- package/nitrogen/generated/ios/swift/WorkoutActivityTypePredicate.swift +0 -35
- package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +0 -90
- package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +0 -90
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +0 -77
- package/nitrogen/generated/shared/c++/PredicateWithMetadataOperator.hpp +0 -84
- package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +0 -75
- package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +0 -76
- package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +0 -76
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// FilterForSamplesBase.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/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
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
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
28
|
+
// Forward declaration of `DateFilter` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { struct DateFilter; }
|
|
30
|
+
// Forward declaration of `HybridWorkoutProxySpec` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
|
|
32
|
+
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
34
|
+
|
|
35
|
+
#include <string>
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include <vector>
|
|
38
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
39
|
+
#include "DateFilter.hpp"
|
|
40
|
+
#include <memory>
|
|
41
|
+
#include "HybridWorkoutProxySpec.hpp"
|
|
42
|
+
#include "HybridSourceProxySpec.hpp"
|
|
43
|
+
|
|
44
|
+
namespace margelo::nitro::healthkit {
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A struct which can be represented as a JavaScript object (FilterForSamplesBase).
|
|
48
|
+
*/
|
|
49
|
+
struct FilterForSamplesBase {
|
|
50
|
+
public:
|
|
51
|
+
std::optional<std::string> uuid SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::vector<std::string>> uuids SWIFT_PRIVATE;
|
|
53
|
+
std::optional<PredicateWithMetadataKey> metadata SWIFT_PRIVATE;
|
|
54
|
+
std::optional<DateFilter> date SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::shared_ptr<HybridWorkoutProxySpec>> workout SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources SWIFT_PRIVATE;
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
FilterForSamplesBase() = default;
|
|
60
|
+
explicit FilterForSamplesBase(std::optional<std::string> uuid, std::optional<std::vector<std::string>> uuids, std::optional<PredicateWithMetadataKey> metadata, std::optional<DateFilter> date, std::optional<std::shared_ptr<HybridWorkoutProxySpec>> workout, std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources): uuid(uuid), uuids(uuids), metadata(metadata), date(date), workout(workout), sources(sources) {}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} // namespace margelo::nitro::healthkit
|
|
64
|
+
|
|
65
|
+
namespace margelo::nitro {
|
|
66
|
+
|
|
67
|
+
// C++ FilterForSamplesBase <> JS FilterForSamplesBase (object)
|
|
68
|
+
template <>
|
|
69
|
+
struct JSIConverter<margelo::nitro::healthkit::FilterForSamplesBase> final {
|
|
70
|
+
static inline margelo::nitro::healthkit::FilterForSamplesBase fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
71
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
72
|
+
return margelo::nitro::healthkit::FilterForSamplesBase(
|
|
73
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "uuid")),
|
|
74
|
+
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "uuids")),
|
|
75
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
|
|
76
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::fromJSI(runtime, obj.getProperty(runtime, "date")),
|
|
77
|
+
JSIConverter<std::optional<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::fromJSI(runtime, obj.getProperty(runtime, "workout")),
|
|
78
|
+
JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::fromJSI(runtime, obj.getProperty(runtime, "sources"))
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::FilterForSamplesBase& arg) {
|
|
82
|
+
jsi::Object obj(runtime);
|
|
83
|
+
obj.setProperty(runtime, "uuid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.uuid));
|
|
84
|
+
obj.setProperty(runtime, "uuids", JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.uuids));
|
|
85
|
+
obj.setProperty(runtime, "metadata", JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::toJSI(runtime, arg.metadata));
|
|
86
|
+
obj.setProperty(runtime, "date", JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::toJSI(runtime, arg.date));
|
|
87
|
+
obj.setProperty(runtime, "workout", JSIConverter<std::optional<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::toJSI(runtime, arg.workout));
|
|
88
|
+
obj.setProperty(runtime, "sources", JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::toJSI(runtime, arg.sources));
|
|
89
|
+
return obj;
|
|
90
|
+
}
|
|
91
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
92
|
+
if (!value.isObject()) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
jsi::Object obj = value.getObject(runtime);
|
|
96
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "uuid"))) return false;
|
|
100
|
+
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, "uuids"))) return false;
|
|
101
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
|
|
102
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::canConvert(runtime, obj.getProperty(runtime, "date"))) return false;
|
|
103
|
+
if (!JSIConverter<std::optional<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::canConvert(runtime, obj.getProperty(runtime, "workout"))) return false;
|
|
104
|
+
if (!JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::canConvert(runtime, obj.getProperty(runtime, "sources"))) return false;
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// FilterForWorkouts.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/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
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
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `FilterForWorkoutsBase` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { struct FilterForWorkoutsBase; }
|
|
28
|
+
// Forward declaration of `WorkoutActivityType` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { enum class WorkoutActivityType; }
|
|
30
|
+
// Forward declaration of `WorkoutDurationPredicate` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
|
|
32
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
34
|
+
// Forward declaration of `DateFilter` to properly resolve imports.
|
|
35
|
+
namespace margelo::nitro::healthkit { struct DateFilter; }
|
|
36
|
+
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
|
|
37
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
38
|
+
|
|
39
|
+
#include "FilterForWorkoutsBase.hpp"
|
|
40
|
+
#include <vector>
|
|
41
|
+
#include <optional>
|
|
42
|
+
#include "WorkoutActivityType.hpp"
|
|
43
|
+
#include "WorkoutDurationPredicate.hpp"
|
|
44
|
+
#include <string>
|
|
45
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
46
|
+
#include "DateFilter.hpp"
|
|
47
|
+
#include <memory>
|
|
48
|
+
#include "HybridSourceProxySpec.hpp"
|
|
49
|
+
|
|
50
|
+
namespace margelo::nitro::healthkit {
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A struct which can be represented as a JavaScript object (FilterForWorkouts).
|
|
54
|
+
*/
|
|
55
|
+
struct FilterForWorkouts {
|
|
56
|
+
public:
|
|
57
|
+
std::optional<std::vector<FilterForWorkoutsBase>> OR SWIFT_PRIVATE;
|
|
58
|
+
std::optional<std::vector<FilterForWorkoutsBase>> NOT SWIFT_PRIVATE;
|
|
59
|
+
std::optional<std::vector<FilterForWorkoutsBase>> AND SWIFT_PRIVATE;
|
|
60
|
+
std::optional<WorkoutActivityType> workoutActivityType SWIFT_PRIVATE;
|
|
61
|
+
std::optional<WorkoutDurationPredicate> duration SWIFT_PRIVATE;
|
|
62
|
+
std::optional<std::string> uuid SWIFT_PRIVATE;
|
|
63
|
+
std::optional<std::vector<std::string>> uuids SWIFT_PRIVATE;
|
|
64
|
+
std::optional<PredicateWithMetadataKey> metadata SWIFT_PRIVATE;
|
|
65
|
+
std::optional<DateFilter> date SWIFT_PRIVATE;
|
|
66
|
+
std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources SWIFT_PRIVATE;
|
|
67
|
+
|
|
68
|
+
public:
|
|
69
|
+
FilterForWorkouts() = default;
|
|
70
|
+
explicit FilterForWorkouts(std::optional<std::vector<FilterForWorkoutsBase>> OR, std::optional<std::vector<FilterForWorkoutsBase>> NOT, std::optional<std::vector<FilterForWorkoutsBase>> AND, std::optional<WorkoutActivityType> workoutActivityType, std::optional<WorkoutDurationPredicate> duration, std::optional<std::string> uuid, std::optional<std::vector<std::string>> uuids, std::optional<PredicateWithMetadataKey> metadata, std::optional<DateFilter> date, std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources): OR(OR), NOT(NOT), AND(AND), workoutActivityType(workoutActivityType), duration(duration), uuid(uuid), uuids(uuids), metadata(metadata), date(date), sources(sources) {}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
} // namespace margelo::nitro::healthkit
|
|
74
|
+
|
|
75
|
+
namespace margelo::nitro {
|
|
76
|
+
|
|
77
|
+
// C++ FilterForWorkouts <> JS FilterForWorkouts (object)
|
|
78
|
+
template <>
|
|
79
|
+
struct JSIConverter<margelo::nitro::healthkit::FilterForWorkouts> final {
|
|
80
|
+
static inline margelo::nitro::healthkit::FilterForWorkouts fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
81
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
82
|
+
return margelo::nitro::healthkit::FilterForWorkouts(
|
|
83
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::fromJSI(runtime, obj.getProperty(runtime, "OR")),
|
|
84
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::fromJSI(runtime, obj.getProperty(runtime, "NOT")),
|
|
85
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::fromJSI(runtime, obj.getProperty(runtime, "AND")),
|
|
86
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::fromJSI(runtime, obj.getProperty(runtime, "workoutActivityType")),
|
|
87
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::fromJSI(runtime, obj.getProperty(runtime, "duration")),
|
|
88
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "uuid")),
|
|
89
|
+
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "uuids")),
|
|
90
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
|
|
91
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::fromJSI(runtime, obj.getProperty(runtime, "date")),
|
|
92
|
+
JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::fromJSI(runtime, obj.getProperty(runtime, "sources"))
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::FilterForWorkouts& arg) {
|
|
96
|
+
jsi::Object obj(runtime);
|
|
97
|
+
obj.setProperty(runtime, "OR", JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::toJSI(runtime, arg.OR));
|
|
98
|
+
obj.setProperty(runtime, "NOT", JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::toJSI(runtime, arg.NOT));
|
|
99
|
+
obj.setProperty(runtime, "AND", JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::toJSI(runtime, arg.AND));
|
|
100
|
+
obj.setProperty(runtime, "workoutActivityType", JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::toJSI(runtime, arg.workoutActivityType));
|
|
101
|
+
obj.setProperty(runtime, "duration", JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::toJSI(runtime, arg.duration));
|
|
102
|
+
obj.setProperty(runtime, "uuid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.uuid));
|
|
103
|
+
obj.setProperty(runtime, "uuids", JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.uuids));
|
|
104
|
+
obj.setProperty(runtime, "metadata", JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::toJSI(runtime, arg.metadata));
|
|
105
|
+
obj.setProperty(runtime, "date", JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::toJSI(runtime, arg.date));
|
|
106
|
+
obj.setProperty(runtime, "sources", JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::toJSI(runtime, arg.sources));
|
|
107
|
+
return obj;
|
|
108
|
+
}
|
|
109
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
110
|
+
if (!value.isObject()) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
jsi::Object obj = value.getObject(runtime);
|
|
114
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::canConvert(runtime, obj.getProperty(runtime, "OR"))) return false;
|
|
118
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::canConvert(runtime, obj.getProperty(runtime, "NOT"))) return false;
|
|
119
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::healthkit::FilterForWorkoutsBase>>>::canConvert(runtime, obj.getProperty(runtime, "AND"))) return false;
|
|
120
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::canConvert(runtime, obj.getProperty(runtime, "workoutActivityType"))) return false;
|
|
121
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false;
|
|
122
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "uuid"))) return false;
|
|
123
|
+
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, "uuids"))) return false;
|
|
124
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
|
|
125
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::canConvert(runtime, obj.getProperty(runtime, "date"))) return false;
|
|
126
|
+
if (!JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::canConvert(runtime, obj.getProperty(runtime, "sources"))) return false;
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// FilterForWorkoutsBase.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/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
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
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `WorkoutActivityType` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { enum class WorkoutActivityType; }
|
|
28
|
+
// Forward declaration of `WorkoutDurationPredicate` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
|
|
30
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
32
|
+
// Forward declaration of `DateFilter` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::healthkit { struct DateFilter; }
|
|
34
|
+
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
|
|
35
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
36
|
+
|
|
37
|
+
#include "WorkoutActivityType.hpp"
|
|
38
|
+
#include <optional>
|
|
39
|
+
#include "WorkoutDurationPredicate.hpp"
|
|
40
|
+
#include <string>
|
|
41
|
+
#include <vector>
|
|
42
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
43
|
+
#include "DateFilter.hpp"
|
|
44
|
+
#include <memory>
|
|
45
|
+
#include "HybridSourceProxySpec.hpp"
|
|
46
|
+
|
|
47
|
+
namespace margelo::nitro::healthkit {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A struct which can be represented as a JavaScript object (FilterForWorkoutsBase).
|
|
51
|
+
*/
|
|
52
|
+
struct FilterForWorkoutsBase {
|
|
53
|
+
public:
|
|
54
|
+
std::optional<WorkoutActivityType> workoutActivityType SWIFT_PRIVATE;
|
|
55
|
+
std::optional<WorkoutDurationPredicate> duration SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::string> uuid SWIFT_PRIVATE;
|
|
57
|
+
std::optional<std::vector<std::string>> uuids SWIFT_PRIVATE;
|
|
58
|
+
std::optional<PredicateWithMetadataKey> metadata SWIFT_PRIVATE;
|
|
59
|
+
std::optional<DateFilter> date SWIFT_PRIVATE;
|
|
60
|
+
std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources SWIFT_PRIVATE;
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
FilterForWorkoutsBase() = default;
|
|
64
|
+
explicit FilterForWorkoutsBase(std::optional<WorkoutActivityType> workoutActivityType, std::optional<WorkoutDurationPredicate> duration, std::optional<std::string> uuid, std::optional<std::vector<std::string>> uuids, std::optional<PredicateWithMetadataKey> metadata, std::optional<DateFilter> date, std::optional<std::vector<std::shared_ptr<HybridSourceProxySpec>>> sources): workoutActivityType(workoutActivityType), duration(duration), uuid(uuid), uuids(uuids), metadata(metadata), date(date), sources(sources) {}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace margelo::nitro::healthkit
|
|
68
|
+
|
|
69
|
+
namespace margelo::nitro {
|
|
70
|
+
|
|
71
|
+
// C++ FilterForWorkoutsBase <> JS FilterForWorkoutsBase (object)
|
|
72
|
+
template <>
|
|
73
|
+
struct JSIConverter<margelo::nitro::healthkit::FilterForWorkoutsBase> final {
|
|
74
|
+
static inline margelo::nitro::healthkit::FilterForWorkoutsBase fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
75
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
76
|
+
return margelo::nitro::healthkit::FilterForWorkoutsBase(
|
|
77
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::fromJSI(runtime, obj.getProperty(runtime, "workoutActivityType")),
|
|
78
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::fromJSI(runtime, obj.getProperty(runtime, "duration")),
|
|
79
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "uuid")),
|
|
80
|
+
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "uuids")),
|
|
81
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
|
|
82
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::fromJSI(runtime, obj.getProperty(runtime, "date")),
|
|
83
|
+
JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::fromJSI(runtime, obj.getProperty(runtime, "sources"))
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::FilterForWorkoutsBase& arg) {
|
|
87
|
+
jsi::Object obj(runtime);
|
|
88
|
+
obj.setProperty(runtime, "workoutActivityType", JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::toJSI(runtime, arg.workoutActivityType));
|
|
89
|
+
obj.setProperty(runtime, "duration", JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::toJSI(runtime, arg.duration));
|
|
90
|
+
obj.setProperty(runtime, "uuid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.uuid));
|
|
91
|
+
obj.setProperty(runtime, "uuids", JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.uuids));
|
|
92
|
+
obj.setProperty(runtime, "metadata", JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::toJSI(runtime, arg.metadata));
|
|
93
|
+
obj.setProperty(runtime, "date", JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::toJSI(runtime, arg.date));
|
|
94
|
+
obj.setProperty(runtime, "sources", JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::toJSI(runtime, arg.sources));
|
|
95
|
+
return obj;
|
|
96
|
+
}
|
|
97
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
98
|
+
if (!value.isObject()) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
jsi::Object obj = value.getObject(runtime);
|
|
102
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutActivityType>>::canConvert(runtime, obj.getProperty(runtime, "workoutActivityType"))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::WorkoutDurationPredicate>>::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false;
|
|
107
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "uuid"))) return false;
|
|
108
|
+
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, "uuids"))) return false;
|
|
109
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::PredicateWithMetadataKey>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
|
|
110
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::DateFilter>>::canConvert(runtime, obj.getProperty(runtime, "date"))) return false;
|
|
111
|
+
if (!JSIConverter<std::optional<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>>::canConvert(runtime, obj.getProperty(runtime, "sources"))) return false;
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GeneralForm.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/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 (GeneralForm).
|
|
30
|
+
*/
|
|
31
|
+
enum class GeneralForm {
|
|
32
|
+
UNKNOWN SWIFT_NAME(unknown) = 0,
|
|
33
|
+
CAPSULE SWIFT_NAME(capsule) = 1,
|
|
34
|
+
CREAM SWIFT_NAME(cream) = 2,
|
|
35
|
+
DEVICE SWIFT_NAME(device) = 3,
|
|
36
|
+
DROPS SWIFT_NAME(drops) = 4,
|
|
37
|
+
FOAM SWIFT_NAME(foam) = 5,
|
|
38
|
+
GEL SWIFT_NAME(gel) = 6,
|
|
39
|
+
INHALER SWIFT_NAME(inhaler) = 7,
|
|
40
|
+
INJECTION SWIFT_NAME(injection) = 8,
|
|
41
|
+
LIQUID SWIFT_NAME(liquid) = 9,
|
|
42
|
+
LOTION SWIFT_NAME(lotion) = 10,
|
|
43
|
+
OINTMENT SWIFT_NAME(ointment) = 11,
|
|
44
|
+
PATCH SWIFT_NAME(patch) = 12,
|
|
45
|
+
POWDER SWIFT_NAME(powder) = 13,
|
|
46
|
+
SPRAY SWIFT_NAME(spray) = 14,
|
|
47
|
+
SUPPOSITORY SWIFT_NAME(suppository) = 15,
|
|
48
|
+
TABLET SWIFT_NAME(tablet) = 16,
|
|
49
|
+
TOPICAL SWIFT_NAME(topical) = 17,
|
|
50
|
+
} CLOSED_ENUM;
|
|
51
|
+
|
|
52
|
+
} // namespace margelo::nitro::healthkit
|
|
53
|
+
|
|
54
|
+
namespace margelo::nitro {
|
|
55
|
+
|
|
56
|
+
// C++ GeneralForm <> JS GeneralForm (union)
|
|
57
|
+
template <>
|
|
58
|
+
struct JSIConverter<margelo::nitro::healthkit::GeneralForm> final {
|
|
59
|
+
static inline margelo::nitro::healthkit::GeneralForm fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
60
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
61
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
62
|
+
case hashString("unknown"): return margelo::nitro::healthkit::GeneralForm::UNKNOWN;
|
|
63
|
+
case hashString("capsule"): return margelo::nitro::healthkit::GeneralForm::CAPSULE;
|
|
64
|
+
case hashString("cream"): return margelo::nitro::healthkit::GeneralForm::CREAM;
|
|
65
|
+
case hashString("device"): return margelo::nitro::healthkit::GeneralForm::DEVICE;
|
|
66
|
+
case hashString("drops"): return margelo::nitro::healthkit::GeneralForm::DROPS;
|
|
67
|
+
case hashString("foam"): return margelo::nitro::healthkit::GeneralForm::FOAM;
|
|
68
|
+
case hashString("gel"): return margelo::nitro::healthkit::GeneralForm::GEL;
|
|
69
|
+
case hashString("inhaler"): return margelo::nitro::healthkit::GeneralForm::INHALER;
|
|
70
|
+
case hashString("injection"): return margelo::nitro::healthkit::GeneralForm::INJECTION;
|
|
71
|
+
case hashString("liquid"): return margelo::nitro::healthkit::GeneralForm::LIQUID;
|
|
72
|
+
case hashString("lotion"): return margelo::nitro::healthkit::GeneralForm::LOTION;
|
|
73
|
+
case hashString("ointment"): return margelo::nitro::healthkit::GeneralForm::OINTMENT;
|
|
74
|
+
case hashString("patch"): return margelo::nitro::healthkit::GeneralForm::PATCH;
|
|
75
|
+
case hashString("powder"): return margelo::nitro::healthkit::GeneralForm::POWDER;
|
|
76
|
+
case hashString("spray"): return margelo::nitro::healthkit::GeneralForm::SPRAY;
|
|
77
|
+
case hashString("suppository"): return margelo::nitro::healthkit::GeneralForm::SUPPOSITORY;
|
|
78
|
+
case hashString("tablet"): return margelo::nitro::healthkit::GeneralForm::TABLET;
|
|
79
|
+
case hashString("topical"): return margelo::nitro::healthkit::GeneralForm::TOPICAL;
|
|
80
|
+
default: [[unlikely]]
|
|
81
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum GeneralForm - invalid value!");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::GeneralForm arg) {
|
|
85
|
+
switch (arg) {
|
|
86
|
+
case margelo::nitro::healthkit::GeneralForm::UNKNOWN: return JSIConverter<std::string>::toJSI(runtime, "unknown");
|
|
87
|
+
case margelo::nitro::healthkit::GeneralForm::CAPSULE: return JSIConverter<std::string>::toJSI(runtime, "capsule");
|
|
88
|
+
case margelo::nitro::healthkit::GeneralForm::CREAM: return JSIConverter<std::string>::toJSI(runtime, "cream");
|
|
89
|
+
case margelo::nitro::healthkit::GeneralForm::DEVICE: return JSIConverter<std::string>::toJSI(runtime, "device");
|
|
90
|
+
case margelo::nitro::healthkit::GeneralForm::DROPS: return JSIConverter<std::string>::toJSI(runtime, "drops");
|
|
91
|
+
case margelo::nitro::healthkit::GeneralForm::FOAM: return JSIConverter<std::string>::toJSI(runtime, "foam");
|
|
92
|
+
case margelo::nitro::healthkit::GeneralForm::GEL: return JSIConverter<std::string>::toJSI(runtime, "gel");
|
|
93
|
+
case margelo::nitro::healthkit::GeneralForm::INHALER: return JSIConverter<std::string>::toJSI(runtime, "inhaler");
|
|
94
|
+
case margelo::nitro::healthkit::GeneralForm::INJECTION: return JSIConverter<std::string>::toJSI(runtime, "injection");
|
|
95
|
+
case margelo::nitro::healthkit::GeneralForm::LIQUID: return JSIConverter<std::string>::toJSI(runtime, "liquid");
|
|
96
|
+
case margelo::nitro::healthkit::GeneralForm::LOTION: return JSIConverter<std::string>::toJSI(runtime, "lotion");
|
|
97
|
+
case margelo::nitro::healthkit::GeneralForm::OINTMENT: return JSIConverter<std::string>::toJSI(runtime, "ointment");
|
|
98
|
+
case margelo::nitro::healthkit::GeneralForm::PATCH: return JSIConverter<std::string>::toJSI(runtime, "patch");
|
|
99
|
+
case margelo::nitro::healthkit::GeneralForm::POWDER: return JSIConverter<std::string>::toJSI(runtime, "powder");
|
|
100
|
+
case margelo::nitro::healthkit::GeneralForm::SPRAY: return JSIConverter<std::string>::toJSI(runtime, "spray");
|
|
101
|
+
case margelo::nitro::healthkit::GeneralForm::SUPPOSITORY: return JSIConverter<std::string>::toJSI(runtime, "suppository");
|
|
102
|
+
case margelo::nitro::healthkit::GeneralForm::TABLET: return JSIConverter<std::string>::toJSI(runtime, "tablet");
|
|
103
|
+
case margelo::nitro::healthkit::GeneralForm::TOPICAL: return JSIConverter<std::string>::toJSI(runtime, "topical");
|
|
104
|
+
default: [[unlikely]]
|
|
105
|
+
throw std::invalid_argument("Cannot convert GeneralForm to JS - invalid value: "
|
|
106
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
110
|
+
if (!value.isString()) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
114
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
115
|
+
case hashString("unknown"):
|
|
116
|
+
case hashString("capsule"):
|
|
117
|
+
case hashString("cream"):
|
|
118
|
+
case hashString("device"):
|
|
119
|
+
case hashString("drops"):
|
|
120
|
+
case hashString("foam"):
|
|
121
|
+
case hashString("gel"):
|
|
122
|
+
case hashString("inhaler"):
|
|
123
|
+
case hashString("injection"):
|
|
124
|
+
case hashString("liquid"):
|
|
125
|
+
case hashString("lotion"):
|
|
126
|
+
case hashString("ointment"):
|
|
127
|
+
case hashString("patch"):
|
|
128
|
+
case hashString("powder"):
|
|
129
|
+
case hashString("spray"):
|
|
130
|
+
case hashString("suppository"):
|
|
131
|
+
case hashString("tablet"):
|
|
132
|
+
case hashString("topical"):
|
|
133
|
+
return true;
|
|
134
|
+
default:
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HeartRateMotionContext.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/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::healthkit {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An enum which can be represented as a JavaScript enum (HeartRateMotionContext).
|
|
25
|
+
*/
|
|
26
|
+
enum class HeartRateMotionContext {
|
|
27
|
+
ACTIVE SWIFT_NAME(active) = 2,
|
|
28
|
+
NOTSET SWIFT_NAME(notset) = 0,
|
|
29
|
+
SEDENTARY SWIFT_NAME(sedentary) = 1,
|
|
30
|
+
} CLOSED_ENUM;
|
|
31
|
+
|
|
32
|
+
} // namespace margelo::nitro::healthkit
|
|
33
|
+
|
|
34
|
+
namespace margelo::nitro {
|
|
35
|
+
|
|
36
|
+
// C++ HeartRateMotionContext <> JS HeartRateMotionContext (enum)
|
|
37
|
+
template <>
|
|
38
|
+
struct JSIConverter<margelo::nitro::healthkit::HeartRateMotionContext> final {
|
|
39
|
+
static inline margelo::nitro::healthkit::HeartRateMotionContext fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
40
|
+
int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
|
|
41
|
+
return static_cast<margelo::nitro::healthkit::HeartRateMotionContext>(enumValue);
|
|
42
|
+
}
|
|
43
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::HeartRateMotionContext arg) {
|
|
44
|
+
int enumValue = static_cast<int>(arg);
|
|
45
|
+
return JSIConverter<int>::toJSI(runtime, enumValue);
|
|
46
|
+
}
|
|
47
|
+
static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
|
|
48
|
+
if (!value.isNumber()) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
double number = value.getNumber();
|
|
52
|
+
int integer = static_cast<int>(number);
|
|
53
|
+
if (number != integer) {
|
|
54
|
+
// The integer is not the same value as the double - we truncated floating points.
|
|
55
|
+
// Enums are all integers, so the input floating point number is obviously invalid.
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
switch (integer) {
|
|
59
|
+
case 2 /* ACTIVE */: return true;
|
|
60
|
+
case 0 /* NOTSET */: return true;
|
|
61
|
+
case 1 /* SEDENTARY */: return true;
|
|
62
|
+
default: return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace margelo::nitro
|