@kingstinct/react-native-healthkit 12.1.2 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/CategoryTypeModule.swift +52 -98
- package/ios/CharacteristicTypeModule.swift +77 -63
- package/ios/CoreModule.swift +324 -280
- package/ios/CorrelationTypeModule.swift +198 -144
- package/ios/ElectrocardiogramModule.swift +185 -194
- package/ios/HeartbeatSeriesModule.swift +123 -171
- package/ios/Helpers.swift +319 -571
- package/ios/MedicationModule.swift +259 -0
- package/ios/PredicateHelpers.swift +334 -0
- package/ios/QuantityTypeModule.swift +436 -373
- package/ios/Serializers.swift +273 -210
- package/ios/SourceProxy.swift +2 -2
- package/ios/StateOfMindModule.swift +181 -125
- package/ios/WorkoutProxy.swift +235 -112
- package/ios/WorkoutsModule.swift +214 -262
- package/lib/commonjs/healthkit.ios.js +26 -2
- package/lib/commonjs/healthkit.js +46 -10
- 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 +24 -2
- package/lib/module/healthkit.js +43 -7
- 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 +24 -13
- package/lib/typescript/healthkit.ios.d.ts +45 -23
- 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 +4 -4
- package/lib/typescript/specs/CoreModule.nitro.d.ts +2 -1
- package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +5 -3
- 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 +7 -5
- package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +5 -4
- 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 +3 -9
- package/lib/typescript/types/QuantityType.d.ts +13 -9
- 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 +113 -16
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +1065 -573
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +68 -30
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +15 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +40 -34
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +36 -37
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +78 -25
- 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 +69 -44
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +60 -37
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +150 -29
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +14 -29
- 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__optional_CategorySample_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_CorrelationSample_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_QuantitySample_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_StateOfMindSample_.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_QueryStatisticsResponseFromSingleSource_.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 +2 -2
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +23 -10
- 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 +3 -2
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +42 -10
- 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 +5 -3
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +76 -47
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +3 -2
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +34 -9
- 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/QuantitySampleForSaving.swift +24 -5
- 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/QueryStatisticsResponse.swift +34 -1
- package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +266 -0
- 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/StatisticsOptions.swift +0 -4
- 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 +6 -6
- 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 +16 -5
- 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 +3 -1
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +13 -27
- 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++/QuantitySampleForSaving.hpp +6 -6
- 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++/QueryStatisticsResponse.hpp +11 -2
- package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +121 -0
- 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++/StatisticsOptions.hpp +0 -4
- 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 +38 -0
- package/src/healthkit.ts +88 -8
- package/src/hooks/queryStatisticsForQuantity.test.ts +4 -1
- 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 +6 -6
- package/src/specs/CoreModule.nitro.ts +3 -0
- package/src/specs/CorrelationTypeModule.nitro.ts +13 -5
- package/src/specs/ElectrocardiogramModule.nitro.ts +1 -1
- package/src/specs/HeartbeatSeriesModule.nitro.ts +1 -1
- package/src/specs/MedicationModule.nitro.ts +135 -0
- package/src/specs/QuantityTypeModule.nitro.ts +21 -9
- package/src/specs/StateOfMindModule.nitro.ts +11 -3
- 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 +3 -9
- package/src/types/QuantityType.ts +16 -18
- 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,89 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryCorrelationSamplesWithAnchorResponse.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 `CorrelationSample` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { struct CorrelationSample; }
|
|
28
|
+
// Forward declaration of `DeletedSample` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { struct DeletedSample; }
|
|
30
|
+
|
|
31
|
+
#include "CorrelationSample.hpp"
|
|
32
|
+
#include <vector>
|
|
33
|
+
#include "DeletedSample.hpp"
|
|
34
|
+
#include <string>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::healthkit {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (QueryCorrelationSamplesWithAnchorResponse).
|
|
40
|
+
*/
|
|
41
|
+
struct QueryCorrelationSamplesWithAnchorResponse {
|
|
42
|
+
public:
|
|
43
|
+
std::vector<CorrelationSample> correlations SWIFT_PRIVATE;
|
|
44
|
+
std::vector<DeletedSample> deletedSamples SWIFT_PRIVATE;
|
|
45
|
+
std::string newAnchor SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
QueryCorrelationSamplesWithAnchorResponse() = default;
|
|
49
|
+
explicit QueryCorrelationSamplesWithAnchorResponse(std::vector<CorrelationSample> correlations, std::vector<DeletedSample> deletedSamples, std::string newAnchor): correlations(correlations), deletedSamples(deletedSamples), newAnchor(newAnchor) {}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
} // namespace margelo::nitro::healthkit
|
|
53
|
+
|
|
54
|
+
namespace margelo::nitro {
|
|
55
|
+
|
|
56
|
+
// C++ QueryCorrelationSamplesWithAnchorResponse <> JS QueryCorrelationSamplesWithAnchorResponse (object)
|
|
57
|
+
template <>
|
|
58
|
+
struct JSIConverter<margelo::nitro::healthkit::QueryCorrelationSamplesWithAnchorResponse> final {
|
|
59
|
+
static inline margelo::nitro::healthkit::QueryCorrelationSamplesWithAnchorResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
60
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
61
|
+
return margelo::nitro::healthkit::QueryCorrelationSamplesWithAnchorResponse(
|
|
62
|
+
JSIConverter<std::vector<margelo::nitro::healthkit::CorrelationSample>>::fromJSI(runtime, obj.getProperty(runtime, "correlations")),
|
|
63
|
+
JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::fromJSI(runtime, obj.getProperty(runtime, "deletedSamples")),
|
|
64
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "newAnchor"))
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryCorrelationSamplesWithAnchorResponse& arg) {
|
|
68
|
+
jsi::Object obj(runtime);
|
|
69
|
+
obj.setProperty(runtime, "correlations", JSIConverter<std::vector<margelo::nitro::healthkit::CorrelationSample>>::toJSI(runtime, arg.correlations));
|
|
70
|
+
obj.setProperty(runtime, "deletedSamples", JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::toJSI(runtime, arg.deletedSamples));
|
|
71
|
+
obj.setProperty(runtime, "newAnchor", JSIConverter<std::string>::toJSI(runtime, arg.newAnchor));
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
74
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
75
|
+
if (!value.isObject()) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
jsi::Object obj = value.getObject(runtime);
|
|
79
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (!JSIConverter<std::vector<margelo::nitro::healthkit::CorrelationSample>>::canConvert(runtime, obj.getProperty(runtime, "correlations"))) return false;
|
|
83
|
+
if (!JSIConverter<std::vector<margelo::nitro::healthkit::DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
|
|
84
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "newAnchor"))) return false;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
} // namespace margelo::nitro
|
|
@@ -23,31 +23,12 @@
|
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
|
-
// Forward declaration of `
|
|
27
|
-
namespace margelo::nitro::healthkit { struct
|
|
28
|
-
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
29
|
-
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
30
|
-
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
31
|
-
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
32
|
-
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
33
|
-
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
34
|
-
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
35
|
-
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
36
|
-
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
37
|
-
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
38
|
-
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
39
|
-
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
26
|
+
// Forward declaration of `FilterForSamples` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { struct FilterForSamples; }
|
|
40
28
|
|
|
41
29
|
#include <string>
|
|
42
30
|
#include <optional>
|
|
43
|
-
#include "
|
|
44
|
-
#include "PredicateWithUUIDs.hpp"
|
|
45
|
-
#include "PredicateWithMetadataKey.hpp"
|
|
46
|
-
#include "PredicateWithStartAndEnd.hpp"
|
|
47
|
-
#include "PredicateFromWorkout.hpp"
|
|
48
|
-
#include "FilterForSamplesAnd.hpp"
|
|
49
|
-
#include "FilterForSamplesOr.hpp"
|
|
50
|
-
#include <variant>
|
|
31
|
+
#include "FilterForSamples.hpp"
|
|
51
32
|
|
|
52
33
|
namespace margelo::nitro::healthkit {
|
|
53
34
|
|
|
@@ -57,12 +38,12 @@ namespace margelo::nitro::healthkit {
|
|
|
57
38
|
struct QueryOptionsWithAnchor {
|
|
58
39
|
public:
|
|
59
40
|
std::optional<std::string> anchor SWIFT_PRIVATE;
|
|
60
|
-
std::optional<
|
|
61
|
-
|
|
41
|
+
std::optional<FilterForSamples> filter SWIFT_PRIVATE;
|
|
42
|
+
double limit SWIFT_PRIVATE;
|
|
62
43
|
|
|
63
44
|
public:
|
|
64
45
|
QueryOptionsWithAnchor() = default;
|
|
65
|
-
explicit QueryOptionsWithAnchor(std::optional<std::string> anchor, std::optional<
|
|
46
|
+
explicit QueryOptionsWithAnchor(std::optional<std::string> anchor, std::optional<FilterForSamples> filter, double limit): anchor(anchor), filter(filter), limit(limit) {}
|
|
66
47
|
};
|
|
67
48
|
|
|
68
49
|
} // namespace margelo::nitro::healthkit
|
|
@@ -76,15 +57,15 @@ namespace margelo::nitro {
|
|
|
76
57
|
jsi::Object obj = arg.asObject(runtime);
|
|
77
58
|
return margelo::nitro::healthkit::QueryOptionsWithAnchor(
|
|
78
59
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
|
|
79
|
-
JSIConverter<std::optional<
|
|
80
|
-
JSIConverter<
|
|
60
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
|
|
61
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
|
|
81
62
|
);
|
|
82
63
|
}
|
|
83
64
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithAnchor& arg) {
|
|
84
65
|
jsi::Object obj(runtime);
|
|
85
66
|
obj.setProperty(runtime, "anchor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.anchor));
|
|
86
|
-
obj.setProperty(runtime, "filter", JSIConverter<std::optional<
|
|
87
|
-
obj.setProperty(runtime, "limit", JSIConverter<
|
|
67
|
+
obj.setProperty(runtime, "filter", JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::toJSI(runtime, arg.filter));
|
|
68
|
+
obj.setProperty(runtime, "limit", JSIConverter<double>::toJSI(runtime, arg.limit));
|
|
88
69
|
return obj;
|
|
89
70
|
}
|
|
90
71
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -96,8 +77,8 @@ namespace margelo::nitro {
|
|
|
96
77
|
return false;
|
|
97
78
|
}
|
|
98
79
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
|
|
99
|
-
if (!JSIConverter<std::optional<
|
|
100
|
-
if (!JSIConverter<
|
|
80
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
|
|
81
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
|
|
101
82
|
return true;
|
|
102
83
|
}
|
|
103
84
|
};
|
|
@@ -23,31 +23,12 @@
|
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
|
-
// Forward declaration of `
|
|
27
|
-
namespace margelo::nitro::healthkit { struct
|
|
28
|
-
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
29
|
-
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
30
|
-
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
31
|
-
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
32
|
-
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
33
|
-
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
34
|
-
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
35
|
-
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
36
|
-
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
37
|
-
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
38
|
-
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
39
|
-
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
26
|
+
// Forward declaration of `FilterForSamples` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { struct FilterForSamples; }
|
|
40
28
|
|
|
41
29
|
#include <string>
|
|
42
30
|
#include <optional>
|
|
43
|
-
#include "
|
|
44
|
-
#include "PredicateWithUUIDs.hpp"
|
|
45
|
-
#include "PredicateWithMetadataKey.hpp"
|
|
46
|
-
#include "PredicateWithStartAndEnd.hpp"
|
|
47
|
-
#include "PredicateFromWorkout.hpp"
|
|
48
|
-
#include "FilterForSamplesAnd.hpp"
|
|
49
|
-
#include "FilterForSamplesOr.hpp"
|
|
50
|
-
#include <variant>
|
|
31
|
+
#include "FilterForSamples.hpp"
|
|
51
32
|
|
|
52
33
|
namespace margelo::nitro::healthkit {
|
|
53
34
|
|
|
@@ -58,12 +39,12 @@ namespace margelo::nitro::healthkit {
|
|
|
58
39
|
public:
|
|
59
40
|
std::optional<std::string> unit SWIFT_PRIVATE;
|
|
60
41
|
std::optional<std::string> anchor SWIFT_PRIVATE;
|
|
61
|
-
std::optional<
|
|
62
|
-
|
|
42
|
+
std::optional<FilterForSamples> filter SWIFT_PRIVATE;
|
|
43
|
+
double limit SWIFT_PRIVATE;
|
|
63
44
|
|
|
64
45
|
public:
|
|
65
46
|
QueryOptionsWithAnchorAndUnit() = default;
|
|
66
|
-
explicit QueryOptionsWithAnchorAndUnit(std::optional<std::string> unit, std::optional<std::string> anchor, std::optional<
|
|
47
|
+
explicit QueryOptionsWithAnchorAndUnit(std::optional<std::string> unit, std::optional<std::string> anchor, std::optional<FilterForSamples> filter, double limit): unit(unit), anchor(anchor), filter(filter), limit(limit) {}
|
|
67
48
|
};
|
|
68
49
|
|
|
69
50
|
} // namespace margelo::nitro::healthkit
|
|
@@ -78,16 +59,16 @@ namespace margelo::nitro {
|
|
|
78
59
|
return margelo::nitro::healthkit::QueryOptionsWithAnchorAndUnit(
|
|
79
60
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
|
|
80
61
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
|
|
81
|
-
JSIConverter<std::optional<
|
|
82
|
-
JSIConverter<
|
|
62
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
|
|
63
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
|
|
83
64
|
);
|
|
84
65
|
}
|
|
85
66
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithAnchorAndUnit& arg) {
|
|
86
67
|
jsi::Object obj(runtime);
|
|
87
68
|
obj.setProperty(runtime, "unit", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
|
|
88
69
|
obj.setProperty(runtime, "anchor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.anchor));
|
|
89
|
-
obj.setProperty(runtime, "filter", JSIConverter<std::optional<
|
|
90
|
-
obj.setProperty(runtime, "limit", JSIConverter<
|
|
70
|
+
obj.setProperty(runtime, "filter", JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::toJSI(runtime, arg.filter));
|
|
71
|
+
obj.setProperty(runtime, "limit", JSIConverter<double>::toJSI(runtime, arg.limit));
|
|
91
72
|
return obj;
|
|
92
73
|
}
|
|
93
74
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -100,8 +81,8 @@ namespace margelo::nitro {
|
|
|
100
81
|
}
|
|
101
82
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
|
|
102
83
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
|
|
103
|
-
if (!JSIConverter<std::optional<
|
|
104
|
-
if (!JSIConverter<
|
|
84
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
|
|
85
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
|
|
105
86
|
return true;
|
|
106
87
|
}
|
|
107
88
|
};
|
|
@@ -23,30 +23,11 @@
|
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
|
-
// Forward declaration of `
|
|
27
|
-
namespace margelo::nitro::healthkit { struct
|
|
28
|
-
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
29
|
-
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
30
|
-
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
31
|
-
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
32
|
-
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
33
|
-
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
34
|
-
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
35
|
-
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
36
|
-
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
37
|
-
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
38
|
-
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
39
|
-
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
26
|
+
// Forward declaration of `FilterForSamples` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { struct FilterForSamples; }
|
|
40
28
|
|
|
41
29
|
#include <optional>
|
|
42
|
-
#include "
|
|
43
|
-
#include "PredicateWithUUIDs.hpp"
|
|
44
|
-
#include "PredicateWithMetadataKey.hpp"
|
|
45
|
-
#include "PredicateWithStartAndEnd.hpp"
|
|
46
|
-
#include "PredicateFromWorkout.hpp"
|
|
47
|
-
#include "FilterForSamplesAnd.hpp"
|
|
48
|
-
#include "FilterForSamplesOr.hpp"
|
|
49
|
-
#include <variant>
|
|
30
|
+
#include "FilterForSamples.hpp"
|
|
50
31
|
|
|
51
32
|
namespace margelo::nitro::healthkit {
|
|
52
33
|
|
|
@@ -56,12 +37,12 @@ namespace margelo::nitro::healthkit {
|
|
|
56
37
|
struct QueryOptionsWithSortOrder {
|
|
57
38
|
public:
|
|
58
39
|
std::optional<bool> ascending SWIFT_PRIVATE;
|
|
59
|
-
std::optional<
|
|
60
|
-
|
|
40
|
+
std::optional<FilterForSamples> filter SWIFT_PRIVATE;
|
|
41
|
+
double limit SWIFT_PRIVATE;
|
|
61
42
|
|
|
62
43
|
public:
|
|
63
44
|
QueryOptionsWithSortOrder() = default;
|
|
64
|
-
explicit QueryOptionsWithSortOrder(std::optional<bool> ascending, std::optional<
|
|
45
|
+
explicit QueryOptionsWithSortOrder(std::optional<bool> ascending, std::optional<FilterForSamples> filter, double limit): ascending(ascending), filter(filter), limit(limit) {}
|
|
65
46
|
};
|
|
66
47
|
|
|
67
48
|
} // namespace margelo::nitro::healthkit
|
|
@@ -75,15 +56,15 @@ namespace margelo::nitro {
|
|
|
75
56
|
jsi::Object obj = arg.asObject(runtime);
|
|
76
57
|
return margelo::nitro::healthkit::QueryOptionsWithSortOrder(
|
|
77
58
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "ascending")),
|
|
78
|
-
JSIConverter<std::optional<
|
|
79
|
-
JSIConverter<
|
|
59
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
|
|
60
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
|
|
80
61
|
);
|
|
81
62
|
}
|
|
82
63
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithSortOrder& arg) {
|
|
83
64
|
jsi::Object obj(runtime);
|
|
84
65
|
obj.setProperty(runtime, "ascending", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.ascending));
|
|
85
|
-
obj.setProperty(runtime, "filter", JSIConverter<std::optional<
|
|
86
|
-
obj.setProperty(runtime, "limit", JSIConverter<
|
|
66
|
+
obj.setProperty(runtime, "filter", JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::toJSI(runtime, arg.filter));
|
|
67
|
+
obj.setProperty(runtime, "limit", JSIConverter<double>::toJSI(runtime, arg.limit));
|
|
87
68
|
return obj;
|
|
88
69
|
}
|
|
89
70
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -95,8 +76,8 @@ namespace margelo::nitro {
|
|
|
95
76
|
return false;
|
|
96
77
|
}
|
|
97
78
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "ascending"))) return false;
|
|
98
|
-
if (!JSIConverter<std::optional<
|
|
99
|
-
if (!JSIConverter<
|
|
79
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
|
|
80
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
|
|
100
81
|
return true;
|
|
101
82
|
}
|
|
102
83
|
};
|
|
@@ -23,31 +23,12 @@
|
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
|
-
// Forward declaration of `
|
|
27
|
-
namespace margelo::nitro::healthkit { struct
|
|
28
|
-
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
29
|
-
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
30
|
-
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
31
|
-
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
32
|
-
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
33
|
-
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
34
|
-
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
35
|
-
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
36
|
-
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
37
|
-
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
38
|
-
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
39
|
-
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
26
|
+
// Forward declaration of `FilterForSamples` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { struct FilterForSamples; }
|
|
40
28
|
|
|
41
29
|
#include <string>
|
|
42
30
|
#include <optional>
|
|
43
|
-
#include "
|
|
44
|
-
#include "PredicateWithUUIDs.hpp"
|
|
45
|
-
#include "PredicateWithMetadataKey.hpp"
|
|
46
|
-
#include "PredicateWithStartAndEnd.hpp"
|
|
47
|
-
#include "PredicateFromWorkout.hpp"
|
|
48
|
-
#include "FilterForSamplesAnd.hpp"
|
|
49
|
-
#include "FilterForSamplesOr.hpp"
|
|
50
|
-
#include <variant>
|
|
31
|
+
#include "FilterForSamples.hpp"
|
|
51
32
|
|
|
52
33
|
namespace margelo::nitro::healthkit {
|
|
53
34
|
|
|
@@ -58,12 +39,12 @@ namespace margelo::nitro::healthkit {
|
|
|
58
39
|
public:
|
|
59
40
|
std::optional<std::string> unit SWIFT_PRIVATE;
|
|
60
41
|
std::optional<bool> ascending SWIFT_PRIVATE;
|
|
61
|
-
std::optional<
|
|
62
|
-
|
|
42
|
+
std::optional<FilterForSamples> filter SWIFT_PRIVATE;
|
|
43
|
+
double limit SWIFT_PRIVATE;
|
|
63
44
|
|
|
64
45
|
public:
|
|
65
46
|
QueryOptionsWithSortOrderAndUnit() = default;
|
|
66
|
-
explicit QueryOptionsWithSortOrderAndUnit(std::optional<std::string> unit, std::optional<bool> ascending, std::optional<
|
|
47
|
+
explicit QueryOptionsWithSortOrderAndUnit(std::optional<std::string> unit, std::optional<bool> ascending, std::optional<FilterForSamples> filter, double limit): unit(unit), ascending(ascending), filter(filter), limit(limit) {}
|
|
67
48
|
};
|
|
68
49
|
|
|
69
50
|
} // namespace margelo::nitro::healthkit
|
|
@@ -78,16 +59,16 @@ namespace margelo::nitro {
|
|
|
78
59
|
return margelo::nitro::healthkit::QueryOptionsWithSortOrderAndUnit(
|
|
79
60
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
|
|
80
61
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "ascending")),
|
|
81
|
-
JSIConverter<std::optional<
|
|
82
|
-
JSIConverter<
|
|
62
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
|
|
63
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
|
|
83
64
|
);
|
|
84
65
|
}
|
|
85
66
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryOptionsWithSortOrderAndUnit& arg) {
|
|
86
67
|
jsi::Object obj(runtime);
|
|
87
68
|
obj.setProperty(runtime, "unit", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
|
|
88
69
|
obj.setProperty(runtime, "ascending", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.ascending));
|
|
89
|
-
obj.setProperty(runtime, "filter", JSIConverter<std::optional<
|
|
90
|
-
obj.setProperty(runtime, "limit", JSIConverter<
|
|
70
|
+
obj.setProperty(runtime, "filter", JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::toJSI(runtime, arg.filter));
|
|
71
|
+
obj.setProperty(runtime, "limit", JSIConverter<double>::toJSI(runtime, arg.limit));
|
|
91
72
|
return obj;
|
|
92
73
|
}
|
|
93
74
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -100,8 +81,8 @@ namespace margelo::nitro {
|
|
|
100
81
|
}
|
|
101
82
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
|
|
102
83
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "ascending"))) return false;
|
|
103
|
-
if (!JSIConverter<std::optional<
|
|
104
|
-
if (!JSIConverter<
|
|
84
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::FilterForSamples>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
|
|
85
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
|
|
105
86
|
return true;
|
|
106
87
|
}
|
|
107
88
|
};
|
|
@@ -27,11 +27,16 @@
|
|
|
27
27
|
namespace margelo::nitro::healthkit { struct Quantity; }
|
|
28
28
|
// Forward declaration of `QuantityDateInterval` to properly resolve imports.
|
|
29
29
|
namespace margelo::nitro::healthkit { struct QuantityDateInterval; }
|
|
30
|
+
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
30
32
|
|
|
31
33
|
#include "Quantity.hpp"
|
|
32
34
|
#include <optional>
|
|
33
35
|
#include "QuantityDateInterval.hpp"
|
|
34
36
|
#include <chrono>
|
|
37
|
+
#include <memory>
|
|
38
|
+
#include "HybridSourceProxySpec.hpp"
|
|
39
|
+
#include <vector>
|
|
35
40
|
|
|
36
41
|
namespace margelo::nitro::healthkit {
|
|
37
42
|
|
|
@@ -49,10 +54,11 @@ namespace margelo::nitro::healthkit {
|
|
|
49
54
|
std::optional<Quantity> duration SWIFT_PRIVATE;
|
|
50
55
|
std::optional<std::chrono::system_clock::time_point> startDate SWIFT_PRIVATE;
|
|
51
56
|
std::optional<std::chrono::system_clock::time_point> endDate SWIFT_PRIVATE;
|
|
57
|
+
std::vector<std::shared_ptr<HybridSourceProxySpec>> sources SWIFT_PRIVATE;
|
|
52
58
|
|
|
53
59
|
public:
|
|
54
60
|
QueryStatisticsResponse() = default;
|
|
55
|
-
explicit QueryStatisticsResponse(std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval, std::optional<Quantity> duration, std::optional<std::chrono::system_clock::time_point> startDate, std::optional<std::chrono::system_clock::time_point> endDate): averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval), duration(duration), startDate(startDate), endDate(endDate) {}
|
|
61
|
+
explicit QueryStatisticsResponse(std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval, std::optional<Quantity> duration, std::optional<std::chrono::system_clock::time_point> startDate, std::optional<std::chrono::system_clock::time_point> endDate, std::vector<std::shared_ptr<HybridSourceProxySpec>> sources): averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval), duration(duration), startDate(startDate), endDate(endDate), sources(sources) {}
|
|
56
62
|
};
|
|
57
63
|
|
|
58
64
|
} // namespace margelo::nitro::healthkit
|
|
@@ -73,7 +79,8 @@ namespace margelo::nitro {
|
|
|
73
79
|
JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval")),
|
|
74
80
|
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "duration")),
|
|
75
81
|
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
|
|
76
|
-
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "endDate"))
|
|
82
|
+
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "endDate")),
|
|
83
|
+
JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>::fromJSI(runtime, obj.getProperty(runtime, "sources"))
|
|
77
84
|
);
|
|
78
85
|
}
|
|
79
86
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryStatisticsResponse& arg) {
|
|
@@ -87,6 +94,7 @@ namespace margelo::nitro {
|
|
|
87
94
|
obj.setProperty(runtime, "duration", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.duration));
|
|
88
95
|
obj.setProperty(runtime, "startDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.startDate));
|
|
89
96
|
obj.setProperty(runtime, "endDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.endDate));
|
|
97
|
+
obj.setProperty(runtime, "sources", JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>::toJSI(runtime, arg.sources));
|
|
90
98
|
return obj;
|
|
91
99
|
}
|
|
92
100
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -106,6 +114,7 @@ namespace margelo::nitro {
|
|
|
106
114
|
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false;
|
|
107
115
|
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
|
|
108
116
|
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
|
|
117
|
+
if (!JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>::canConvert(runtime, obj.getProperty(runtime, "sources"))) return false;
|
|
109
118
|
return true;
|
|
110
119
|
}
|
|
111
120
|
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryStatisticsResponseFromSingleSource.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 `HybridSourceProxySpec` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
28
|
+
// Forward declaration of `Quantity` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { struct Quantity; }
|
|
30
|
+
// Forward declaration of `QuantityDateInterval` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::healthkit { struct QuantityDateInterval; }
|
|
32
|
+
|
|
33
|
+
#include <memory>
|
|
34
|
+
#include "HybridSourceProxySpec.hpp"
|
|
35
|
+
#include "Quantity.hpp"
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include "QuantityDateInterval.hpp"
|
|
38
|
+
#include <chrono>
|
|
39
|
+
|
|
40
|
+
namespace margelo::nitro::healthkit {
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A struct which can be represented as a JavaScript object (QueryStatisticsResponseFromSingleSource).
|
|
44
|
+
*/
|
|
45
|
+
struct QueryStatisticsResponseFromSingleSource {
|
|
46
|
+
public:
|
|
47
|
+
std::shared_ptr<HybridSourceProxySpec> source SWIFT_PRIVATE;
|
|
48
|
+
std::optional<Quantity> duration SWIFT_PRIVATE;
|
|
49
|
+
std::optional<Quantity> averageQuantity SWIFT_PRIVATE;
|
|
50
|
+
std::optional<Quantity> maximumQuantity SWIFT_PRIVATE;
|
|
51
|
+
std::optional<Quantity> minimumQuantity SWIFT_PRIVATE;
|
|
52
|
+
std::optional<Quantity> sumQuantity SWIFT_PRIVATE;
|
|
53
|
+
std::optional<Quantity> mostRecentQuantity SWIFT_PRIVATE;
|
|
54
|
+
std::optional<QuantityDateInterval> mostRecentQuantityDateInterval SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::chrono::system_clock::time_point> startDate SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::chrono::system_clock::time_point> endDate SWIFT_PRIVATE;
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
QueryStatisticsResponseFromSingleSource() = default;
|
|
60
|
+
explicit QueryStatisticsResponseFromSingleSource(std::shared_ptr<HybridSourceProxySpec> source, std::optional<Quantity> duration, std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval, std::optional<std::chrono::system_clock::time_point> startDate, std::optional<std::chrono::system_clock::time_point> endDate): source(source), duration(duration), averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval), startDate(startDate), endDate(endDate) {}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} // namespace margelo::nitro::healthkit
|
|
64
|
+
|
|
65
|
+
namespace margelo::nitro {
|
|
66
|
+
|
|
67
|
+
// C++ QueryStatisticsResponseFromSingleSource <> JS QueryStatisticsResponseFromSingleSource (object)
|
|
68
|
+
template <>
|
|
69
|
+
struct JSIConverter<margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource> final {
|
|
70
|
+
static inline margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
71
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
72
|
+
return margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource(
|
|
73
|
+
JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>::fromJSI(runtime, obj.getProperty(runtime, "source")),
|
|
74
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "duration")),
|
|
75
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "averageQuantity")),
|
|
76
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "maximumQuantity")),
|
|
77
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "minimumQuantity")),
|
|
78
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "sumQuantity")),
|
|
79
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantity")),
|
|
80
|
+
JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval")),
|
|
81
|
+
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
|
|
82
|
+
JSIConverter<std::optional<std::chrono::system_clock::time_point>>::fromJSI(runtime, obj.getProperty(runtime, "endDate"))
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::QueryStatisticsResponseFromSingleSource& arg) {
|
|
86
|
+
jsi::Object obj(runtime);
|
|
87
|
+
obj.setProperty(runtime, "source", JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>::toJSI(runtime, arg.source));
|
|
88
|
+
obj.setProperty(runtime, "duration", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.duration));
|
|
89
|
+
obj.setProperty(runtime, "averageQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.averageQuantity));
|
|
90
|
+
obj.setProperty(runtime, "maximumQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.maximumQuantity));
|
|
91
|
+
obj.setProperty(runtime, "minimumQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.minimumQuantity));
|
|
92
|
+
obj.setProperty(runtime, "sumQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.sumQuantity));
|
|
93
|
+
obj.setProperty(runtime, "mostRecentQuantity", JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.mostRecentQuantity));
|
|
94
|
+
obj.setProperty(runtime, "mostRecentQuantityDateInterval", JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::toJSI(runtime, arg.mostRecentQuantityDateInterval));
|
|
95
|
+
obj.setProperty(runtime, "startDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.startDate));
|
|
96
|
+
obj.setProperty(runtime, "endDate", JSIConverter<std::optional<std::chrono::system_clock::time_point>>::toJSI(runtime, arg.endDate));
|
|
97
|
+
return obj;
|
|
98
|
+
}
|
|
99
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
100
|
+
if (!value.isObject()) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
jsi::Object obj = value.getObject(runtime);
|
|
104
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
if (!JSIConverter<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>::canConvert(runtime, obj.getProperty(runtime, "source"))) return false;
|
|
108
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false;
|
|
109
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "averageQuantity"))) return false;
|
|
110
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "maximumQuantity"))) return false;
|
|
111
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "minimumQuantity"))) return false;
|
|
112
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "sumQuantity"))) return false;
|
|
113
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, "mostRecentQuantity"))) return false;
|
|
114
|
+
if (!JSIConverter<std::optional<margelo::nitro::healthkit::QuantityDateInterval>>::canConvert(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval"))) return false;
|
|
115
|
+
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
|
|
116
|
+
if (!JSIConverter<std::optional<std::chrono::system_clock::time_point>>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
} // namespace margelo::nitro
|