@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
|
@@ -119,28 +119,41 @@ open class HybridCategoryTypeModuleSpec_cxx {
|
|
|
119
119
|
|
|
120
120
|
// Methods
|
|
121
121
|
@inline(__always)
|
|
122
|
-
public final func saveCategorySample(identifier: Int32, value: Double, startDate: margelo.nitro.chrono_time, endDate: margelo.nitro.chrono_time, metadata:
|
|
122
|
+
public final func saveCategorySample(identifier: Int32, value: Double, startDate: margelo.nitro.chrono_time, endDate: margelo.nitro.chrono_time, metadata: bridge.std__optional_std__shared_ptr_AnyMap__) -> bridge.Result_std__shared_ptr_Promise_std__optional_CategorySample____ {
|
|
123
123
|
do {
|
|
124
|
-
let __result = try self.__implementation.saveCategorySample(identifier: margelo.nitro.healthkit.CategoryTypeIdentifier(rawValue: identifier)!, value: value, startDate: Date(fromChrono: startDate), endDate: Date(fromChrono: endDate), metadata:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
let __result = try self.__implementation.saveCategorySample(identifier: margelo.nitro.healthkit.CategoryTypeIdentifier(rawValue: identifier)!, value: value, startDate: Date(fromChrono: startDate), endDate: Date(fromChrono: endDate), metadata: { () -> AnyMap? in
|
|
125
|
+
if bridge.has_value_std__optional_std__shared_ptr_AnyMap__(metadata) {
|
|
126
|
+
let __unwrapped = bridge.get_std__optional_std__shared_ptr_AnyMap__(metadata)
|
|
127
|
+
return AnyMap(withCppPart: __unwrapped)
|
|
128
|
+
} else {
|
|
129
|
+
return nil
|
|
130
|
+
}
|
|
131
|
+
}())
|
|
132
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__optional_CategorySample___ in
|
|
133
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__optional_CategorySample___()
|
|
134
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__optional_CategorySample___(__promise)
|
|
128
135
|
__result
|
|
129
|
-
.then({ __result in __promiseHolder.resolve(
|
|
136
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__optional_CategorySample_ in
|
|
137
|
+
if let __unwrappedValue = __result {
|
|
138
|
+
return bridge.create_std__optional_CategorySample_(__unwrappedValue)
|
|
139
|
+
} else {
|
|
140
|
+
return .init()
|
|
141
|
+
}
|
|
142
|
+
}()) })
|
|
130
143
|
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
131
144
|
return __promise
|
|
132
145
|
}()
|
|
133
|
-
return bridge.
|
|
146
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_CategorySample____(__resultCpp)
|
|
134
147
|
} catch (let __error) {
|
|
135
148
|
let __exceptionPtr = __error.toCpp()
|
|
136
|
-
return bridge.
|
|
149
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_CategorySample____(__exceptionPtr)
|
|
137
150
|
}
|
|
138
151
|
}
|
|
139
152
|
|
|
140
153
|
@inline(__always)
|
|
141
|
-
public final func queryCategorySamples(identifier: Int32, options:
|
|
154
|
+
public final func queryCategorySamples(identifier: Int32, options: QueryOptionsWithSortOrder) -> bridge.Result_std__shared_ptr_Promise_std__vector_CategorySample____ {
|
|
142
155
|
do {
|
|
143
|
-
let __result = try self.__implementation.queryCategorySamples(identifier: margelo.nitro.healthkit.CategoryTypeIdentifier(rawValue: identifier)!, options: options
|
|
156
|
+
let __result = try self.__implementation.queryCategorySamples(identifier: margelo.nitro.healthkit.CategoryTypeIdentifier(rawValue: identifier)!, options: options)
|
|
144
157
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_CategorySample___ in
|
|
145
158
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_CategorySample___()
|
|
146
159
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_CategorySample___(__promise)
|
|
@@ -22,8 +22,9 @@ public protocol HybridCoreModuleSpec_protocol: HybridObject {
|
|
|
22
22
|
func isHealthDataAvailableAsync() throws -> Promise<Bool>
|
|
23
23
|
func isProtectedDataAvailable() throws -> Bool
|
|
24
24
|
func isProtectedDataAvailableAsync() throws -> Promise<Bool>
|
|
25
|
+
func currentAppSource() throws -> (any HybridSourceProxySpec)
|
|
25
26
|
func getPreferredUnits(identifiers: [QuantityTypeIdentifier], forceUpdate: Bool?) throws -> Promise<[IdentifierWithUnit]>
|
|
26
|
-
func querySources(identifier: SampleTypeIdentifier) throws -> Promise<[(any HybridSourceProxySpec)]>
|
|
27
|
+
func querySources(identifier: SampleTypeIdentifier, filter: FilterForSamples?) throws -> Promise<[(any HybridSourceProxySpec)]>
|
|
27
28
|
func subscribeToObserverQuery(typeIdentifier: SampleTypeIdentifier, callback: @escaping (_ args: OnChangeCallbackArgs) -> Void) throws -> String
|
|
28
29
|
func unsubscribeQuery(queryId: String) throws -> Bool
|
|
29
30
|
func unsubscribeQueryAsync(queryId: String) throws -> Promise<Bool>
|
|
@@ -237,6 +237,21 @@ open class HybridCoreModuleSpec_cxx {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
@inline(__always)
|
|
241
|
+
public final func currentAppSource() -> bridge.Result_std__shared_ptr_HybridSourceProxySpec__ {
|
|
242
|
+
do {
|
|
243
|
+
let __result = try self.__implementation.currentAppSource()
|
|
244
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_HybridSourceProxySpec_ in
|
|
245
|
+
let __cxxWrapped = __result.getCxxWrapper()
|
|
246
|
+
return __cxxWrapped.getCxxPart()
|
|
247
|
+
}()
|
|
248
|
+
return bridge.create_Result_std__shared_ptr_HybridSourceProxySpec__(__resultCpp)
|
|
249
|
+
} catch (let __error) {
|
|
250
|
+
let __exceptionPtr = __error.toCpp()
|
|
251
|
+
return bridge.create_Result_std__shared_ptr_HybridSourceProxySpec__(__exceptionPtr)
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
240
255
|
@inline(__always)
|
|
241
256
|
public final func getPreferredUnits(identifiers: bridge.std__vector_QuantityTypeIdentifier_, forceUpdate: bridge.std__optional_bool_) -> bridge.Result_std__shared_ptr_Promise_std__vector_IdentifierWithUnit____ {
|
|
242
257
|
do {
|
|
@@ -270,9 +285,9 @@ open class HybridCoreModuleSpec_cxx {
|
|
|
270
285
|
}
|
|
271
286
|
|
|
272
287
|
@inline(__always)
|
|
273
|
-
public final func querySources(identifier: Int32) -> bridge.Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec_____ {
|
|
288
|
+
public final func querySources(identifier: Int32, filter: bridge.std__optional_FilterForSamples_) -> bridge.Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec_____ {
|
|
274
289
|
do {
|
|
275
|
-
let __result = try self.__implementation.querySources(identifier: margelo.nitro.healthkit.SampleTypeIdentifier(rawValue: identifier)
|
|
290
|
+
let __result = try self.__implementation.querySources(identifier: margelo.nitro.healthkit.SampleTypeIdentifier(rawValue: identifier)!, filter: filter.value)
|
|
276
291
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec____ in
|
|
277
292
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec____()
|
|
278
293
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec____(__promise)
|
|
@@ -427,36 +442,9 @@ open class HybridCoreModuleSpec_cxx {
|
|
|
427
442
|
}
|
|
428
443
|
|
|
429
444
|
@inline(__always)
|
|
430
|
-
public final func deleteObjects(objectTypeIdentifier: Int32, filter:
|
|
445
|
+
public final func deleteObjects(objectTypeIdentifier: Int32, filter: FilterForSamples) -> bridge.Result_std__shared_ptr_Promise_double___ {
|
|
431
446
|
do {
|
|
432
|
-
let __result = try self.__implementation.deleteObjects(objectTypeIdentifier: margelo.nitro.healthkit.ObjectTypeIdentifier(rawValue: objectTypeIdentifier)!, filter:
|
|
433
|
-
let __variant = filter
|
|
434
|
-
switch __variant.index() {
|
|
435
|
-
case 0:
|
|
436
|
-
let __actual = __variant.get_0()
|
|
437
|
-
return .first(__actual)
|
|
438
|
-
case 1:
|
|
439
|
-
let __actual = __variant.get_1()
|
|
440
|
-
return .second(__actual)
|
|
441
|
-
case 2:
|
|
442
|
-
let __actual = __variant.get_2()
|
|
443
|
-
return .third(__actual)
|
|
444
|
-
case 3:
|
|
445
|
-
let __actual = __variant.get_3()
|
|
446
|
-
return .fourth(__actual)
|
|
447
|
-
case 4:
|
|
448
|
-
let __actual = __variant.get_4()
|
|
449
|
-
return .fifth(__actual)
|
|
450
|
-
case 5:
|
|
451
|
-
let __actual = __variant.get_5()
|
|
452
|
-
return .sixth(__actual)
|
|
453
|
-
case 6:
|
|
454
|
-
let __actual = __variant.get_6()
|
|
455
|
-
return .seventh(__actual)
|
|
456
|
-
default:
|
|
457
|
-
fatalError("Variant can never have index \(__variant.index())!")
|
|
458
|
-
}
|
|
459
|
-
}())
|
|
447
|
+
let __result = try self.__implementation.deleteObjects(objectTypeIdentifier: margelo.nitro.healthkit.ObjectTypeIdentifier(rawValue: objectTypeIdentifier)!, filter: filter)
|
|
460
448
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_double__ in
|
|
461
449
|
let __promise = bridge.create_std__shared_ptr_Promise_double__()
|
|
462
450
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_double__(__promise)
|
|
@@ -15,8 +15,9 @@ public protocol HybridCorrelationTypeModuleSpec_protocol: HybridObject {
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
// Methods
|
|
18
|
-
func saveCorrelationSample(typeIdentifier: CorrelationTypeIdentifier, samples: [SampleForSaving], start: Date, end: Date, metadata: AnyMap) throws -> Promise<
|
|
19
|
-
func queryCorrelationSamples(typeIdentifier: CorrelationTypeIdentifier,
|
|
18
|
+
func saveCorrelationSample(typeIdentifier: CorrelationTypeIdentifier, samples: [SampleForSaving], start: Date, end: Date, metadata: AnyMap?) throws -> Promise<CorrelationSample?>
|
|
19
|
+
func queryCorrelationSamples(typeIdentifier: CorrelationTypeIdentifier, options: QueryOptionsWithSortOrder) throws -> Promise<[CorrelationSample]>
|
|
20
|
+
func queryCorrelationSamplesWithAnchor(typeIdentifier: CorrelationTypeIdentifier, options: QueryOptionsWithAnchor) throws -> Promise<QueryCorrelationSamplesWithAnchorResponse>
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
public extension HybridCorrelationTypeModuleSpec_protocol {
|
|
@@ -119,7 +119,7 @@ open class HybridCorrelationTypeModuleSpec_cxx {
|
|
|
119
119
|
|
|
120
120
|
// Methods
|
|
121
121
|
@inline(__always)
|
|
122
|
-
public final func saveCorrelationSample(typeIdentifier: Int32, samples: bridge.std__vector_std__variant_CategorySampleForSaving__QuantitySampleForSaving__, start: margelo.nitro.chrono_time, end: margelo.nitro.chrono_time, metadata:
|
|
122
|
+
public final func saveCorrelationSample(typeIdentifier: Int32, samples: bridge.std__vector_std__variant_CategorySampleForSaving__QuantitySampleForSaving__, start: margelo.nitro.chrono_time, end: margelo.nitro.chrono_time, metadata: bridge.std__optional_std__shared_ptr_AnyMap__) -> bridge.Result_std__shared_ptr_Promise_std__optional_CorrelationSample____ {
|
|
123
123
|
do {
|
|
124
124
|
let __result = try self.__implementation.saveCorrelationSample(typeIdentifier: margelo.nitro.healthkit.CorrelationTypeIdentifier(rawValue: typeIdentifier)!, samples: samples.map({ __item in { () -> SampleForSaving in
|
|
125
125
|
let __variant = bridge.std__variant_CategorySampleForSaving__QuantitySampleForSaving_(__item)
|
|
@@ -133,26 +133,39 @@ open class HybridCorrelationTypeModuleSpec_cxx {
|
|
|
133
133
|
default:
|
|
134
134
|
fatalError("Variant can never have index \(__variant.index())!")
|
|
135
135
|
}
|
|
136
|
-
}() }), start: Date(fromChrono: start), end: Date(fromChrono: end), metadata:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
}() }), start: Date(fromChrono: start), end: Date(fromChrono: end), metadata: { () -> AnyMap? in
|
|
137
|
+
if bridge.has_value_std__optional_std__shared_ptr_AnyMap__(metadata) {
|
|
138
|
+
let __unwrapped = bridge.get_std__optional_std__shared_ptr_AnyMap__(metadata)
|
|
139
|
+
return AnyMap(withCppPart: __unwrapped)
|
|
140
|
+
} else {
|
|
141
|
+
return nil
|
|
142
|
+
}
|
|
143
|
+
}())
|
|
144
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__optional_CorrelationSample___ in
|
|
145
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__optional_CorrelationSample___()
|
|
146
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__optional_CorrelationSample___(__promise)
|
|
140
147
|
__result
|
|
141
|
-
.then({ __result in __promiseHolder.resolve(
|
|
148
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__optional_CorrelationSample_ in
|
|
149
|
+
if let __unwrappedValue = __result {
|
|
150
|
+
return bridge.create_std__optional_CorrelationSample_(__unwrappedValue)
|
|
151
|
+
} else {
|
|
152
|
+
return .init()
|
|
153
|
+
}
|
|
154
|
+
}()) })
|
|
142
155
|
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
143
156
|
return __promise
|
|
144
157
|
}()
|
|
145
|
-
return bridge.
|
|
158
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_CorrelationSample____(__resultCpp)
|
|
146
159
|
} catch (let __error) {
|
|
147
160
|
let __exceptionPtr = __error.toCpp()
|
|
148
|
-
return bridge.
|
|
161
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_CorrelationSample____(__exceptionPtr)
|
|
149
162
|
}
|
|
150
163
|
}
|
|
151
164
|
|
|
152
165
|
@inline(__always)
|
|
153
|
-
public final func queryCorrelationSamples(typeIdentifier: Int32,
|
|
166
|
+
public final func queryCorrelationSamples(typeIdentifier: Int32, options: QueryOptionsWithSortOrder) -> bridge.Result_std__shared_ptr_Promise_std__vector_CorrelationSample____ {
|
|
154
167
|
do {
|
|
155
|
-
let __result = try self.__implementation.queryCorrelationSamples(typeIdentifier: margelo.nitro.healthkit.CorrelationTypeIdentifier(rawValue: typeIdentifier)!,
|
|
168
|
+
let __result = try self.__implementation.queryCorrelationSamples(typeIdentifier: margelo.nitro.healthkit.CorrelationTypeIdentifier(rawValue: typeIdentifier)!, options: options)
|
|
156
169
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_CorrelationSample___ in
|
|
157
170
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_CorrelationSample___()
|
|
158
171
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_CorrelationSample___(__promise)
|
|
@@ -173,4 +186,23 @@ open class HybridCorrelationTypeModuleSpec_cxx {
|
|
|
173
186
|
return bridge.create_Result_std__shared_ptr_Promise_std__vector_CorrelationSample____(__exceptionPtr)
|
|
174
187
|
}
|
|
175
188
|
}
|
|
189
|
+
|
|
190
|
+
@inline(__always)
|
|
191
|
+
public final func queryCorrelationSamplesWithAnchor(typeIdentifier: Int32, options: QueryOptionsWithAnchor) -> bridge.Result_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse___ {
|
|
192
|
+
do {
|
|
193
|
+
let __result = try self.__implementation.queryCorrelationSamplesWithAnchor(typeIdentifier: margelo.nitro.healthkit.CorrelationTypeIdentifier(rawValue: typeIdentifier)!, options: options)
|
|
194
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse__ in
|
|
195
|
+
let __promise = bridge.create_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse__()
|
|
196
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse__(__promise)
|
|
197
|
+
__result
|
|
198
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
199
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
200
|
+
return __promise
|
|
201
|
+
}()
|
|
202
|
+
return bridge.create_Result_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse___(__resultCpp)
|
|
203
|
+
} catch (let __error) {
|
|
204
|
+
let __exceptionPtr = __error.toCpp()
|
|
205
|
+
return bridge.create_Result_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse___(__exceptionPtr)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
176
208
|
}
|
|
@@ -15,7 +15,7 @@ public protocol HybridElectrocardiogramModuleSpec_protocol: HybridObject {
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
// Methods
|
|
18
|
-
func queryElectrocardiogramSamples(options: ECGQueryOptionsWithSortOrder
|
|
18
|
+
func queryElectrocardiogramSamples(options: ECGQueryOptionsWithSortOrder) throws -> Promise<[ElectrocardiogramSample]>
|
|
19
19
|
func queryElectrocardiogramSamplesWithAnchor(options: ECGQueryOptionsWithAnchor) throws -> Promise<ElectrocardiogramSamplesWithAnchorResponse>
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -119,9 +119,9 @@ open class HybridElectrocardiogramModuleSpec_cxx {
|
|
|
119
119
|
|
|
120
120
|
// Methods
|
|
121
121
|
@inline(__always)
|
|
122
|
-
public final func queryElectrocardiogramSamples(options:
|
|
122
|
+
public final func queryElectrocardiogramSamples(options: ECGQueryOptionsWithSortOrder) -> bridge.Result_std__shared_ptr_Promise_std__vector_ElectrocardiogramSample____ {
|
|
123
123
|
do {
|
|
124
|
-
let __result = try self.__implementation.queryElectrocardiogramSamples(options: options
|
|
124
|
+
let __result = try self.__implementation.queryElectrocardiogramSamples(options: options)
|
|
125
125
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_ElectrocardiogramSample___ in
|
|
126
126
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_ElectrocardiogramSample___()
|
|
127
127
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_ElectrocardiogramSample___(__promise)
|
|
@@ -15,7 +15,7 @@ public protocol HybridHeartbeatSeriesModuleSpec_protocol: HybridObject {
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
// Methods
|
|
18
|
-
func queryHeartbeatSeriesSamples(options: QueryOptionsWithSortOrder
|
|
18
|
+
func queryHeartbeatSeriesSamples(options: QueryOptionsWithSortOrder) throws -> Promise<[HeartbeatSeriesSample]>
|
|
19
19
|
func queryHeartbeatSeriesSamplesWithAnchor(options: QueryOptionsWithAnchor) throws -> Promise<HeartbeatSeriesSamplesWithAnchorResponse>
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -119,9 +119,9 @@ open class HybridHeartbeatSeriesModuleSpec_cxx {
|
|
|
119
119
|
|
|
120
120
|
// Methods
|
|
121
121
|
@inline(__always)
|
|
122
|
-
public final func queryHeartbeatSeriesSamples(options:
|
|
122
|
+
public final func queryHeartbeatSeriesSamples(options: QueryOptionsWithSortOrder) -> bridge.Result_std__shared_ptr_Promise_std__vector_HeartbeatSeriesSample____ {
|
|
123
123
|
do {
|
|
124
|
-
let __result = try self.__implementation.queryHeartbeatSeriesSamples(options: options
|
|
124
|
+
let __result = try self.__implementation.queryHeartbeatSeriesSamples(options: options)
|
|
125
125
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_HeartbeatSeriesSample___ in
|
|
126
126
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_HeartbeatSeriesSample___()
|
|
127
127
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_HeartbeatSeriesSample___(__promise)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMedicationModuleSpec.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
import NitroModules
|
|
11
|
+
|
|
12
|
+
/// See ``HybridMedicationModuleSpec``
|
|
13
|
+
public protocol HybridMedicationModuleSpec_protocol: HybridObject {
|
|
14
|
+
// Properties
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// Methods
|
|
18
|
+
func queryMedications() throws -> Promise<[UserAnnotatedMedication]>
|
|
19
|
+
func requestMedicationsAuthorization() throws -> Promise<Bool>
|
|
20
|
+
func queryMedicationEvents(options: QueryOptionsWithSortOrder) throws -> Promise<[MedicationDoseEvent]>
|
|
21
|
+
func queryMedicationEventsWithAnchor(options: QueryOptionsWithAnchor) throws -> Promise<MedicationDoseEventsWithAnchorResponse>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public extension HybridMedicationModuleSpec_protocol {
|
|
25
|
+
/// Default implementation of ``HybridObject.toString``
|
|
26
|
+
func toString() -> String {
|
|
27
|
+
return "[HybridObject MedicationModule]"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// See ``HybridMedicationModuleSpec``
|
|
32
|
+
open class HybridMedicationModuleSpec_base {
|
|
33
|
+
private weak var cxxWrapper: HybridMedicationModuleSpec_cxx? = nil
|
|
34
|
+
public init() { }
|
|
35
|
+
public func getCxxWrapper() -> HybridMedicationModuleSpec_cxx {
|
|
36
|
+
#if DEBUG
|
|
37
|
+
guard self is HybridMedicationModuleSpec else {
|
|
38
|
+
fatalError("`self` is not a `HybridMedicationModuleSpec`! Did you accidentally inherit from `HybridMedicationModuleSpec_base` instead of `HybridMedicationModuleSpec`?")
|
|
39
|
+
}
|
|
40
|
+
#endif
|
|
41
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
42
|
+
return cxxWrapper
|
|
43
|
+
} else {
|
|
44
|
+
let cxxWrapper = HybridMedicationModuleSpec_cxx(self as! HybridMedicationModuleSpec)
|
|
45
|
+
self.cxxWrapper = cxxWrapper
|
|
46
|
+
return cxxWrapper
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A Swift base-protocol representing the MedicationModule HybridObject.
|
|
53
|
+
* Implement this protocol to create Swift-based instances of MedicationModule.
|
|
54
|
+
* ```swift
|
|
55
|
+
* class HybridMedicationModule : HybridMedicationModuleSpec {
|
|
56
|
+
* // ...
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
public typealias HybridMedicationModuleSpec = HybridMedicationModuleSpec_protocol & HybridMedicationModuleSpec_base
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMedicationModuleSpec_cxx.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
import NitroModules
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A class implementation that bridges HybridMedicationModuleSpec over to C++.
|
|
14
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
15
|
+
*
|
|
16
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
17
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
18
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
19
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
20
|
+
*/
|
|
21
|
+
open class HybridMedicationModuleSpec_cxx {
|
|
22
|
+
/**
|
|
23
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::healthkit::bridge::swift`)
|
|
24
|
+
* from `ReactNativeHealthkit-Swift-Cxx-Bridge.hpp`.
|
|
25
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
26
|
+
*/
|
|
27
|
+
public typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Holds an instance of the `HybridMedicationModuleSpec` Swift protocol.
|
|
31
|
+
*/
|
|
32
|
+
private var __implementation: any HybridMedicationModuleSpec
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
36
|
+
*/
|
|
37
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridMedicationModuleSpec_
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Create a new `HybridMedicationModuleSpec_cxx` that wraps the given `HybridMedicationModuleSpec`.
|
|
41
|
+
* All properties and methods bridge to C++ types.
|
|
42
|
+
*/
|
|
43
|
+
public init(_ implementation: any HybridMedicationModuleSpec) {
|
|
44
|
+
self.__implementation = implementation
|
|
45
|
+
self.__cxxPart = .init()
|
|
46
|
+
/* no base class */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get the actual `HybridMedicationModuleSpec` instance this class wraps.
|
|
51
|
+
*/
|
|
52
|
+
@inline(__always)
|
|
53
|
+
public func getHybridMedicationModuleSpec() -> any HybridMedicationModuleSpec {
|
|
54
|
+
return __implementation
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
59
|
+
* This acquires one additional strong reference on the object!
|
|
60
|
+
*/
|
|
61
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
62
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Casts an unsafe pointer to a `HybridMedicationModuleSpec_cxx`.
|
|
67
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridMedicationModuleSpec_cxx>`.
|
|
68
|
+
* This removes one strong reference from the object!
|
|
69
|
+
*/
|
|
70
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridMedicationModuleSpec_cxx {
|
|
71
|
+
return Unmanaged<HybridMedicationModuleSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
76
|
+
* The C++ part is a `std::shared_ptr<HybridMedicationModuleSpec>`.
|
|
77
|
+
*/
|
|
78
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridMedicationModuleSpec_ {
|
|
79
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
80
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
81
|
+
return cachedCxxPart
|
|
82
|
+
} else {
|
|
83
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridMedicationModuleSpec_(self.toUnsafe())
|
|
84
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridMedicationModuleSpec_(newCxxPart)
|
|
85
|
+
return newCxxPart
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
93
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
94
|
+
*/
|
|
95
|
+
@inline(__always)
|
|
96
|
+
public var memorySize: Int {
|
|
97
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Call dispose() on the Swift class.
|
|
102
|
+
* This _may_ be called manually from JS.
|
|
103
|
+
*/
|
|
104
|
+
@inline(__always)
|
|
105
|
+
public func dispose() {
|
|
106
|
+
self.__implementation.dispose()
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Call toString() on the Swift class.
|
|
111
|
+
*/
|
|
112
|
+
@inline(__always)
|
|
113
|
+
public func toString() -> String {
|
|
114
|
+
return self.__implementation.toString()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Properties
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
// Methods
|
|
121
|
+
@inline(__always)
|
|
122
|
+
public final func queryMedications() -> bridge.Result_std__shared_ptr_Promise_std__vector_UserAnnotatedMedication____ {
|
|
123
|
+
do {
|
|
124
|
+
let __result = try self.__implementation.queryMedications()
|
|
125
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_UserAnnotatedMedication___ in
|
|
126
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_UserAnnotatedMedication___()
|
|
127
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_UserAnnotatedMedication___(__promise)
|
|
128
|
+
__result
|
|
129
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_UserAnnotatedMedication_ in
|
|
130
|
+
var __vector = bridge.create_std__vector_UserAnnotatedMedication_(__result.count)
|
|
131
|
+
for __item in __result {
|
|
132
|
+
__vector.push_back(__item)
|
|
133
|
+
}
|
|
134
|
+
return __vector
|
|
135
|
+
}()) })
|
|
136
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
137
|
+
return __promise
|
|
138
|
+
}()
|
|
139
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_UserAnnotatedMedication____(__resultCpp)
|
|
140
|
+
} catch (let __error) {
|
|
141
|
+
let __exceptionPtr = __error.toCpp()
|
|
142
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_UserAnnotatedMedication____(__exceptionPtr)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@inline(__always)
|
|
147
|
+
public final func requestMedicationsAuthorization() -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
148
|
+
do {
|
|
149
|
+
let __result = try self.__implementation.requestMedicationsAuthorization()
|
|
150
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
151
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
152
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
153
|
+
__result
|
|
154
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
155
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
156
|
+
return __promise
|
|
157
|
+
}()
|
|
158
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
159
|
+
} catch (let __error) {
|
|
160
|
+
let __exceptionPtr = __error.toCpp()
|
|
161
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@inline(__always)
|
|
166
|
+
public final func queryMedicationEvents(options: QueryOptionsWithSortOrder) -> bridge.Result_std__shared_ptr_Promise_std__vector_MedicationDoseEvent____ {
|
|
167
|
+
do {
|
|
168
|
+
let __result = try self.__implementation.queryMedicationEvents(options: options)
|
|
169
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_MedicationDoseEvent___ in
|
|
170
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_MedicationDoseEvent___()
|
|
171
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_MedicationDoseEvent___(__promise)
|
|
172
|
+
__result
|
|
173
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_MedicationDoseEvent_ in
|
|
174
|
+
var __vector = bridge.create_std__vector_MedicationDoseEvent_(__result.count)
|
|
175
|
+
for __item in __result {
|
|
176
|
+
__vector.push_back(__item)
|
|
177
|
+
}
|
|
178
|
+
return __vector
|
|
179
|
+
}()) })
|
|
180
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
181
|
+
return __promise
|
|
182
|
+
}()
|
|
183
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_MedicationDoseEvent____(__resultCpp)
|
|
184
|
+
} catch (let __error) {
|
|
185
|
+
let __exceptionPtr = __error.toCpp()
|
|
186
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_MedicationDoseEvent____(__exceptionPtr)
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@inline(__always)
|
|
191
|
+
public final func queryMedicationEventsWithAnchor(options: QueryOptionsWithAnchor) -> bridge.Result_std__shared_ptr_Promise_MedicationDoseEventsWithAnchorResponse___ {
|
|
192
|
+
do {
|
|
193
|
+
let __result = try self.__implementation.queryMedicationEventsWithAnchor(options: options)
|
|
194
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_MedicationDoseEventsWithAnchorResponse__ in
|
|
195
|
+
let __promise = bridge.create_std__shared_ptr_Promise_MedicationDoseEventsWithAnchorResponse__()
|
|
196
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_MedicationDoseEventsWithAnchorResponse__(__promise)
|
|
197
|
+
__result
|
|
198
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
199
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
200
|
+
return __promise
|
|
201
|
+
}()
|
|
202
|
+
return bridge.create_Result_std__shared_ptr_Promise_MedicationDoseEventsWithAnchorResponse___(__resultCpp)
|
|
203
|
+
} catch (let __error) {
|
|
204
|
+
let __exceptionPtr = __error.toCpp()
|
|
205
|
+
return bridge.create_Result_std__shared_ptr_Promise_MedicationDoseEventsWithAnchorResponse___(__exceptionPtr)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -16,11 +16,13 @@ public protocol HybridQuantityTypeModuleSpec_protocol: HybridObject {
|
|
|
16
16
|
|
|
17
17
|
// Methods
|
|
18
18
|
func isQuantityCompatibleWithUnit(identifier: QuantityTypeIdentifier, unit: String) throws -> Bool
|
|
19
|
-
func
|
|
20
|
-
func
|
|
21
|
-
func queryQuantitySamples(identifier: QuantityTypeIdentifier, options: QueryOptionsWithSortOrderAndUnit
|
|
19
|
+
func aggregationStyle(identifier: QuantityTypeIdentifier) throws -> AggregationStyle
|
|
20
|
+
func saveQuantitySample(identifier: QuantityTypeIdentifier, unit: String, value: Double, start: Date, end: Date, metadata: AnyMap?) throws -> Promise<QuantitySample?>
|
|
21
|
+
func queryQuantitySamples(identifier: QuantityTypeIdentifier, options: QueryOptionsWithSortOrderAndUnit) throws -> Promise<[QuantitySample]>
|
|
22
22
|
func queryStatisticsForQuantity(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], options: StatisticsQueryOptions?) throws -> Promise<QueryStatisticsResponse>
|
|
23
23
|
func queryStatisticsCollectionForQuantity(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], anchorDate: Date, intervalComponents: IntervalComponents, options: StatisticsQueryOptions?) throws -> Promise<[QueryStatisticsResponse]>
|
|
24
|
+
func queryStatisticsForQuantitySeparateBySource(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], options: StatisticsQueryOptions?) throws -> Promise<[QueryStatisticsResponseFromSingleSource]>
|
|
25
|
+
func queryStatisticsCollectionForQuantitySeparateBySource(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], anchorDate: Date, intervalComponents: IntervalComponents, options: StatisticsQueryOptions?) throws -> Promise<[QueryStatisticsResponseFromSingleSource]>
|
|
24
26
|
func queryQuantitySamplesWithAnchor(identifier: QuantityTypeIdentifier, options: QueryOptionsWithAnchorAndUnit) throws -> Promise<QuantitySamplesWithAnchorResponse>
|
|
25
27
|
}
|
|
26
28
|
|