@kingstinct/react-native-healthkit 12.1.2 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/CategoryTypeModule.swift +49 -97
- package/ios/CharacteristicTypeModule.swift +77 -63
- package/ios/CoreModule.swift +324 -280
- package/ios/CorrelationTypeModule.swift +192 -144
- package/ios/ElectrocardiogramModule.swift +185 -194
- package/ios/HeartbeatSeriesModule.swift +123 -171
- package/ios/Helpers.swift +312 -571
- package/ios/MedicationModule.swift +259 -0
- package/ios/PredicateHelpers.swift +334 -0
- package/ios/QuantityTypeModule.swift +297 -378
- package/ios/Serializers.swift +273 -210
- package/ios/SourceProxy.swift +2 -2
- package/ios/StateOfMindModule.swift +179 -125
- package/ios/WorkoutProxy.swift +235 -112
- package/ios/WorkoutsModule.swift +214 -262
- package/lib/commonjs/healthkit.ios.js +22 -2
- package/lib/commonjs/healthkit.js +35 -5
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/commonjs/hooks/useSubscribeToCategorySamples.js +20 -0
- package/lib/commonjs/modules.js +2 -1
- package/lib/commonjs/specs/MedicationModule.nitro.js +27 -0
- package/lib/commonjs/types/Constants.js +2 -1
- package/lib/commonjs/types/QuantityType.js +8 -1
- package/lib/commonjs/types/QueryOptions.js +18 -0
- package/lib/commonjs/types/WeatherCondition.js +32 -32
- package/lib/commonjs/types/Workouts.js +1 -50
- package/lib/commonjs/utils/getCategorySampleById.js +1 -1
- package/lib/commonjs/utils/getQuantitySampleById.js +1 -1
- package/lib/commonjs/utils/getWorkoutById.js +1 -1
- package/lib/commonjs/utils/subscribeToCategorySamples.js +29 -0
- package/lib/commonjs/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/module/healthkit.ios.js +20 -2
- package/lib/module/healthkit.js +32 -2
- package/lib/module/hooks/useStatisticsForQuantity.js +1 -1
- package/lib/module/hooks/useSubscribeToCategorySamples.js +17 -0
- package/lib/module/modules.js +1 -0
- package/lib/module/specs/MedicationModule.nitro.js +26 -0
- package/lib/module/types/Constants.js +1 -0
- package/lib/module/types/QuantityType.js +7 -0
- package/lib/module/types/QueryOptions.js +17 -1
- package/lib/module/types/WeatherCondition.js +31 -31
- package/lib/module/types/Workouts.js +0 -49
- package/lib/module/utils/getCategorySampleById.js +1 -1
- package/lib/module/utils/getQuantitySampleById.js +1 -1
- package/lib/module/utils/getWorkoutById.js +1 -1
- package/lib/module/utils/subscribeToCategorySamples.js +26 -0
- package/lib/module/utils/subscribeToQuantitySamples.js +8 -25
- package/lib/typescript/healthkit.d.ts +18 -9
- package/lib/typescript/healthkit.ios.d.ts +33 -15
- package/lib/typescript/hooks/useSubscribeToCategorySamples.d.ts +3 -0
- package/lib/typescript/modules.d.ts +2 -0
- package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +2 -2
- package/lib/typescript/specs/CoreModule.nitro.d.ts +2 -1
- package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +4 -2
- package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/HeartbeatSeriesModule.nitro.d.ts +1 -1
- package/lib/typescript/specs/MedicationModule.nitro.d.ts +56 -0
- package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +4 -4
- package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +4 -3
- package/lib/typescript/types/CategoryType.d.ts +10 -20
- package/lib/typescript/types/Constants.d.ts +1 -0
- package/lib/typescript/types/CorrelationType.d.ts +8 -10
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +2 -12
- package/lib/typescript/types/HeartbeatSeries.d.ts +2 -14
- package/lib/typescript/types/QuantitySample.d.ts +2 -8
- package/lib/typescript/types/QuantityType.d.ts +7 -8
- package/lib/typescript/types/QuantityTypeIdentifier.d.ts +23 -23
- package/lib/typescript/types/QueryOptions.d.ts +43 -28
- package/lib/typescript/types/Shared.d.ts +52 -7
- package/lib/typescript/types/StateOfMind.d.ts +7 -10
- package/lib/typescript/types/Subscriptions.d.ts +12 -3
- package/lib/typescript/types/WeatherCondition.d.ts +1 -1
- package/lib/typescript/types/Workouts.d.ts +28 -81
- package/lib/typescript/utils/subscribeToCategorySamples.d.ts +5 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +57 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +592 -389
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +65 -30
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +15 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +32 -26
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +36 -37
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +55 -2
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +36 -30
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +35 -29
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +181 -0
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +48 -42
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +59 -36
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +150 -29
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +13 -28
- package/nitrogen/generated/ios/swift/AggregationStyle.swift +48 -0
- package/nitrogen/generated/ios/swift/CategorySample.swift +571 -24
- package/nitrogen/generated/ios/swift/ComparisonPredicateOperator.swift +2 -2
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +640 -17
- package/nitrogen/generated/ios/swift/{PredicateWithStartAndEnd.swift → DateFilter.swift} +5 -5
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +570 -72
- package/nitrogen/generated/ios/swift/FilterForSamples.swift +349 -12
- package/nitrogen/generated/ios/swift/FilterForSamplesBase.swift +234 -0
- package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +366 -0
- package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +240 -0
- package/nitrogen/generated/ios/swift/Func_void_MedicationDoseEventsWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryCorrelationSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_StateOfMindSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MedicationDoseEvent_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_UserAnnotatedMedication_.swift +47 -0
- package/nitrogen/generated/ios/swift/GeneralForm.swift +104 -0
- package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +44 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +565 -37
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +19 -31
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridMedicationModuleSpec_cxx.swift +208 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +9 -43
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +21 -2
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +34 -6
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +376 -36
- package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationConcept.swift +80 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +781 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventLogStatus.swift +56 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventScheduleType.swift +40 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEventsWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +7 -7
- package/nitrogen/generated/ios/swift/QuantitySample.swift +574 -27
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/QueryCorrelationSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +11 -91
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +11 -91
- package/nitrogen/generated/ios/swift/RelatedCoding.swift +76 -0
- package/nitrogen/generated/ios/swift/SampleType.swift +68 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +16 -16
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +0 -16
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +586 -58
- package/nitrogen/generated/ios/swift/StateOfMindSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +7 -75
- package/nitrogen/generated/ios/swift/UserAnnotatedMedication.swift +87 -0
- package/nitrogen/generated/ios/swift/WeatherCondition.swift +144 -0
- package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +11 -105
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +751 -78
- package/nitrogen/generated/shared/c++/AggregationStyle.hpp +64 -0
- package/nitrogen/generated/shared/c++/CategorySample.hpp +126 -23
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +134 -12
- package/nitrogen/generated/shared/c++/{PredicateWithStartAndEnd.hpp → DateFilter.hpp} +10 -10
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +135 -36
- package/nitrogen/generated/shared/c++/FilterForSamples.hpp +124 -0
- package/nitrogen/generated/shared/c++/FilterForSamplesBase.hpp +109 -0
- package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +131 -0
- package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +116 -0
- package/nitrogen/generated/shared/c++/GeneralForm.hpp +140 -0
- package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +67 -0
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +131 -28
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +10 -28
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +11 -1
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +1 -2
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridMedicationModuleSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +6 -25
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +9 -2
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +33 -5
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +56 -16
- package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationConcept.hpp +93 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +240 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventLogStatus.hpp +66 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventScheduleType.hpp +62 -0
- package/nitrogen/generated/shared/c++/MedicationDoseEventsWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +8 -8
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +130 -27
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/QueryCorrelationSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +12 -31
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +12 -31
- package/nitrogen/generated/shared/c++/RelatedCoding.hpp +84 -0
- package/nitrogen/generated/shared/c++/SampleType.hpp +87 -0
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +105 -105
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +105 -121
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +139 -36
- package/nitrogen/generated/shared/c++/StateOfMindSamplesWithAnchorResponse.hpp +89 -0
- package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +8 -27
- package/nitrogen/generated/shared/c++/UserAnnotatedMedication.hpp +90 -0
- package/nitrogen/generated/shared/c++/WeatherCondition.hpp +88 -0
- package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +12 -37
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +159 -35
- package/package.json +1 -1
- package/src/healthkit.ios.ts +30 -0
- package/src/healthkit.ts +68 -3
- package/src/hooks/useStatisticsForQuantity.ts +1 -1
- package/src/hooks/useSubscribeToCategorySamples.ts +31 -0
- package/src/modules.ts +4 -0
- package/src/specs/CategoryTypeModule.nitro.ts +2 -2
- package/src/specs/CoreModule.nitro.ts +3 -0
- package/src/specs/CorrelationTypeModule.nitro.ts +11 -3
- package/src/specs/ElectrocardiogramModule.nitro.ts +1 -1
- package/src/specs/HeartbeatSeriesModule.nitro.ts +1 -1
- package/src/specs/MedicationModule.nitro.ts +140 -0
- package/src/specs/QuantityTypeModule.nitro.ts +4 -7
- package/src/specs/StateOfMindModule.nitro.ts +10 -2
- package/src/types/CategoryType.ts +15 -22
- package/src/types/Constants.ts +3 -0
- package/src/types/CorrelationType.ts +10 -15
- package/src/types/ElectrocardiogramSample.ts +2 -14
- package/src/types/HeartbeatSeries.ts +2 -15
- package/src/types/QuantitySample.ts +2 -8
- package/src/types/QuantityType.ts +8 -17
- package/src/types/QuantityTypeIdentifier.ts +25 -25
- package/src/types/QueryOptions.ts +54 -43
- package/src/types/Shared.ts +74 -17
- package/src/types/StateOfMind.ts +8 -10
- package/src/types/Subscriptions.ts +19 -3
- package/src/types/WeatherCondition.ts +1 -1
- package/src/types/Workouts.ts +28 -91
- package/src/utils/getCategorySampleById.ts +1 -1
- package/src/utils/getQuantitySampleById.ts +1 -1
- package/src/utils/getWorkoutById.ts +1 -2
- package/src/utils/subscribeToCategorySamples.ts +38 -0
- package/src/utils/subscribeToQuantitySamples.ts +12 -37
- package/nitrogen/generated/ios/swift/FilterForSamplesAnd.swift +0 -94
- package/nitrogen/generated/ios/swift/FilterForSamplesOr.swift +0 -94
- package/nitrogen/generated/ios/swift/PredicateForSamples.swift +0 -21
- package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +0 -23
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsAnd.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsOr.swift +0 -108
- package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +0 -45
- package/nitrogen/generated/ios/swift/PredicateWithMetadataOperator.swift +0 -48
- package/nitrogen/generated/ios/swift/PredicateWithUUID.swift +0 -35
- package/nitrogen/generated/ios/swift/PredicateWithUUIDs.swift +0 -47
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +0 -23
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +0 -25
- package/nitrogen/generated/ios/swift/WorkoutActivityTypePredicate.swift +0 -35
- package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +0 -90
- package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +0 -90
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +0 -96
- package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +0 -77
- package/nitrogen/generated/shared/c++/PredicateWithMetadataOperator.hpp +0 -84
- package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +0 -75
- package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +0 -76
- package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +0 -76
|
@@ -138,9 +138,9 @@ open class HybridCategoryTypeModuleSpec_cxx {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
@inline(__always)
|
|
141
|
-
public final func queryCategorySamples(identifier: Int32, options:
|
|
141
|
+
public final func queryCategorySamples(identifier: Int32, options: QueryOptionsWithSortOrder) -> bridge.Result_std__shared_ptr_Promise_std__vector_CategorySample____ {
|
|
142
142
|
do {
|
|
143
|
-
let __result = try self.__implementation.queryCategorySamples(identifier: margelo.nitro.healthkit.CategoryTypeIdentifier(rawValue: identifier)!, options: options
|
|
143
|
+
let __result = try self.__implementation.queryCategorySamples(identifier: margelo.nitro.healthkit.CategoryTypeIdentifier(rawValue: identifier)!, options: options)
|
|
144
144
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_CategorySample___ in
|
|
145
145
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_CategorySample___()
|
|
146
146
|
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)
|
|
@@ -16,7 +16,8 @@ public protocol HybridCorrelationTypeModuleSpec_protocol: HybridObject {
|
|
|
16
16
|
|
|
17
17
|
// Methods
|
|
18
18
|
func saveCorrelationSample(typeIdentifier: CorrelationTypeIdentifier, samples: [SampleForSaving], start: Date, end: Date, metadata: AnyMap) throws -> Promise<Bool>
|
|
19
|
-
func queryCorrelationSamples(typeIdentifier: CorrelationTypeIdentifier,
|
|
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 {
|
|
@@ -150,9 +150,9 @@ open class HybridCorrelationTypeModuleSpec_cxx {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
@inline(__always)
|
|
153
|
-
public final func queryCorrelationSamples(typeIdentifier: Int32,
|
|
153
|
+
public final func queryCorrelationSamples(typeIdentifier: Int32, options: QueryOptionsWithSortOrder) -> bridge.Result_std__shared_ptr_Promise_std__vector_CorrelationSample____ {
|
|
154
154
|
do {
|
|
155
|
-
let __result = try self.__implementation.queryCorrelationSamples(typeIdentifier: margelo.nitro.healthkit.CorrelationTypeIdentifier(rawValue: typeIdentifier)!,
|
|
155
|
+
let __result = try self.__implementation.queryCorrelationSamples(typeIdentifier: margelo.nitro.healthkit.CorrelationTypeIdentifier(rawValue: typeIdentifier)!, options: options)
|
|
156
156
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_CorrelationSample___ in
|
|
157
157
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_CorrelationSample___()
|
|
158
158
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_CorrelationSample___(__promise)
|
|
@@ -173,4 +173,23 @@ open class HybridCorrelationTypeModuleSpec_cxx {
|
|
|
173
173
|
return bridge.create_Result_std__shared_ptr_Promise_std__vector_CorrelationSample____(__exceptionPtr)
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
+
|
|
177
|
+
@inline(__always)
|
|
178
|
+
public final func queryCorrelationSamplesWithAnchor(typeIdentifier: Int32, options: QueryOptionsWithAnchor) -> bridge.Result_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse___ {
|
|
179
|
+
do {
|
|
180
|
+
let __result = try self.__implementation.queryCorrelationSamplesWithAnchor(typeIdentifier: margelo.nitro.healthkit.CorrelationTypeIdentifier(rawValue: typeIdentifier)!, options: options)
|
|
181
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse__ in
|
|
182
|
+
let __promise = bridge.create_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse__()
|
|
183
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse__(__promise)
|
|
184
|
+
__result
|
|
185
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
186
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
187
|
+
return __promise
|
|
188
|
+
}()
|
|
189
|
+
return bridge.create_Result_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse___(__resultCpp)
|
|
190
|
+
} catch (let __error) {
|
|
191
|
+
let __exceptionPtr = __error.toCpp()
|
|
192
|
+
return bridge.create_Result_std__shared_ptr_Promise_QueryCorrelationSamplesWithAnchorResponse___(__exceptionPtr)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
176
195
|
}
|
|
@@ -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,9 +16,9 @@ public protocol HybridQuantityTypeModuleSpec_protocol: HybridObject {
|
|
|
16
16
|
|
|
17
17
|
// Methods
|
|
18
18
|
func isQuantityCompatibleWithUnit(identifier: QuantityTypeIdentifier, unit: String) throws -> Bool
|
|
19
|
+
func aggregationStyle(identifier: QuantityTypeIdentifier) throws -> AggregationStyle
|
|
19
20
|
func saveQuantitySample(identifier: QuantityTypeIdentifier, unit: String, value: Double, start: Date, end: Date, metadata: AnyMap) throws -> Promise<Bool>
|
|
20
|
-
func
|
|
21
|
-
func queryQuantitySamples(identifier: QuantityTypeIdentifier, options: QueryOptionsWithSortOrderAndUnit?) 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
24
|
func queryQuantitySamplesWithAnchor(identifier: QuantityTypeIdentifier, options: QueryOptionsWithAnchorAndUnit) throws -> Promise<QuantitySamplesWithAnchorResponse>
|
|
@@ -131,55 +131,21 @@ open class HybridQuantityTypeModuleSpec_cxx {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
@inline(__always)
|
|
134
|
-
public final func
|
|
134
|
+
public final func aggregationStyle(identifier: Int32) -> bridge.Result_AggregationStyle_ {
|
|
135
135
|
do {
|
|
136
|
-
let __result = try self.__implementation.
|
|
137
|
-
let __resultCpp =
|
|
138
|
-
|
|
139
|
-
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
140
|
-
__result
|
|
141
|
-
.then({ __result in __promiseHolder.resolve(__result) })
|
|
142
|
-
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
143
|
-
return __promise
|
|
144
|
-
}()
|
|
145
|
-
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
136
|
+
let __result = try self.__implementation.aggregationStyle(identifier: margelo.nitro.healthkit.QuantityTypeIdentifier(rawValue: identifier)!)
|
|
137
|
+
let __resultCpp = __result
|
|
138
|
+
return bridge.create_Result_AggregationStyle_(__resultCpp)
|
|
146
139
|
} catch (let __error) {
|
|
147
140
|
let __exceptionPtr = __error.toCpp()
|
|
148
|
-
return bridge.
|
|
141
|
+
return bridge.create_Result_AggregationStyle_(__exceptionPtr)
|
|
149
142
|
}
|
|
150
143
|
}
|
|
151
144
|
|
|
152
145
|
@inline(__always)
|
|
153
|
-
public final func
|
|
146
|
+
public final func saveQuantitySample(identifier: Int32, unit: std.string, value: Double, start: margelo.nitro.chrono_time, end: margelo.nitro.chrono_time, metadata: margelo.nitro.SharedAnyMap) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
154
147
|
do {
|
|
155
|
-
let __result = try self.__implementation.
|
|
156
|
-
let __variant = filter
|
|
157
|
-
switch __variant.index() {
|
|
158
|
-
case 0:
|
|
159
|
-
let __actual = __variant.get_0()
|
|
160
|
-
return .first(__actual)
|
|
161
|
-
case 1:
|
|
162
|
-
let __actual = __variant.get_1()
|
|
163
|
-
return .second(__actual)
|
|
164
|
-
case 2:
|
|
165
|
-
let __actual = __variant.get_2()
|
|
166
|
-
return .third(__actual)
|
|
167
|
-
case 3:
|
|
168
|
-
let __actual = __variant.get_3()
|
|
169
|
-
return .fourth(__actual)
|
|
170
|
-
case 4:
|
|
171
|
-
let __actual = __variant.get_4()
|
|
172
|
-
return .fifth(__actual)
|
|
173
|
-
case 5:
|
|
174
|
-
let __actual = __variant.get_5()
|
|
175
|
-
return .sixth(__actual)
|
|
176
|
-
case 6:
|
|
177
|
-
let __actual = __variant.get_6()
|
|
178
|
-
return .seventh(__actual)
|
|
179
|
-
default:
|
|
180
|
-
fatalError("Variant can never have index \(__variant.index())!")
|
|
181
|
-
}
|
|
182
|
-
}())
|
|
148
|
+
let __result = try self.__implementation.saveQuantitySample(identifier: margelo.nitro.healthkit.QuantityTypeIdentifier(rawValue: identifier)!, unit: String(unit), value: value, start: Date(fromChrono: start), end: Date(fromChrono: end), metadata: AnyMap(withCppPart: metadata))
|
|
183
149
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
184
150
|
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
185
151
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
@@ -196,9 +162,9 @@ open class HybridQuantityTypeModuleSpec_cxx {
|
|
|
196
162
|
}
|
|
197
163
|
|
|
198
164
|
@inline(__always)
|
|
199
|
-
public final func queryQuantitySamples(identifier: Int32, options:
|
|
165
|
+
public final func queryQuantitySamples(identifier: Int32, options: QueryOptionsWithSortOrderAndUnit) -> bridge.Result_std__shared_ptr_Promise_std__vector_QuantitySample____ {
|
|
200
166
|
do {
|
|
201
|
-
let __result = try self.__implementation.queryQuantitySamples(identifier: margelo.nitro.healthkit.QuantityTypeIdentifier(rawValue: identifier)!, options: options
|
|
167
|
+
let __result = try self.__implementation.queryQuantitySamples(identifier: margelo.nitro.healthkit.QuantityTypeIdentifier(rawValue: identifier)!, options: options)
|
|
202
168
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_QuantitySample___ in
|
|
203
169
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_QuantitySample___()
|
|
204
170
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_QuantitySample___(__promise)
|
|
@@ -15,7 +15,8 @@ public protocol HybridStateOfMindModuleSpec_protocol: HybridObject {
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
// Methods
|
|
18
|
-
func queryStateOfMindSamples(options: QueryOptionsWithSortOrder
|
|
18
|
+
func queryStateOfMindSamples(options: QueryOptionsWithSortOrder) throws -> Promise<[StateOfMindSample]>
|
|
19
|
+
func queryStateOfMindSamplesWithAnchor(options: QueryOptionsWithAnchor) throws -> Promise<StateOfMindSamplesWithAnchorResponse>
|
|
19
20
|
func saveStateOfMindSample(date: Date, kind: StateOfMindKind, valence: Double, labels: [StateOfMindLabel], associations: [StateOfMindAssociation], metadata: AnyMap?) throws -> Promise<Bool>
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -119,9 +119,9 @@ open class HybridStateOfMindModuleSpec_cxx {
|
|
|
119
119
|
|
|
120
120
|
// Methods
|
|
121
121
|
@inline(__always)
|
|
122
|
-
public final func queryStateOfMindSamples(options:
|
|
122
|
+
public final func queryStateOfMindSamples(options: QueryOptionsWithSortOrder) -> bridge.Result_std__shared_ptr_Promise_std__vector_StateOfMindSample____ {
|
|
123
123
|
do {
|
|
124
|
-
let __result = try self.__implementation.queryStateOfMindSamples(options: options
|
|
124
|
+
let __result = try self.__implementation.queryStateOfMindSamples(options: options)
|
|
125
125
|
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_StateOfMindSample___ in
|
|
126
126
|
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_StateOfMindSample___()
|
|
127
127
|
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_StateOfMindSample___(__promise)
|
|
@@ -143,6 +143,25 @@ open class HybridStateOfMindModuleSpec_cxx {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
@inline(__always)
|
|
147
|
+
public final func queryStateOfMindSamplesWithAnchor(options: QueryOptionsWithAnchor) -> bridge.Result_std__shared_ptr_Promise_StateOfMindSamplesWithAnchorResponse___ {
|
|
148
|
+
do {
|
|
149
|
+
let __result = try self.__implementation.queryStateOfMindSamplesWithAnchor(options: options)
|
|
150
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_StateOfMindSamplesWithAnchorResponse__ in
|
|
151
|
+
let __promise = bridge.create_std__shared_ptr_Promise_StateOfMindSamplesWithAnchorResponse__()
|
|
152
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_StateOfMindSamplesWithAnchorResponse__(__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_StateOfMindSamplesWithAnchorResponse___(__resultCpp)
|
|
159
|
+
} catch (let __error) {
|
|
160
|
+
let __exceptionPtr = __error.toCpp()
|
|
161
|
+
return bridge.create_Result_std__shared_ptr_Promise_StateOfMindSamplesWithAnchorResponse___(__exceptionPtr)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
146
165
|
@inline(__always)
|
|
147
166
|
public final func saveStateOfMindSample(date: margelo.nitro.chrono_time, kind: Int32, valence: Double, labels: bridge.std__vector_StateOfMindLabel_, associations: bridge.std__vector_StateOfMindAssociation_, metadata: bridge.std__optional_std__shared_ptr_AnyMap__) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
148
167
|
do {
|
|
@@ -12,16 +12,44 @@ import NitroModules
|
|
|
12
12
|
/// See ``HybridWorkoutProxySpec``
|
|
13
13
|
public protocol HybridWorkoutProxySpec_protocol: HybridObject {
|
|
14
14
|
// Properties
|
|
15
|
-
var uuid: String { get }
|
|
16
|
-
var device: Device? { get }
|
|
17
15
|
var workoutActivityType: WorkoutActivityType { get }
|
|
18
16
|
var duration: Quantity { get }
|
|
19
|
-
var startDate: Date { get }
|
|
20
|
-
var endDate: Date { get }
|
|
21
|
-
var metadata: AnyMap? { get }
|
|
22
|
-
var sourceRevision: SourceRevision? { get }
|
|
23
17
|
var events: [WorkoutEvent]? { get }
|
|
24
18
|
var activities: [WorkoutActivity]? { get }
|
|
19
|
+
var metadataAverageMETs: Quantity? { get }
|
|
20
|
+
var metadataElevationAscended: Quantity? { get }
|
|
21
|
+
var metadataElevationDescended: Quantity? { get }
|
|
22
|
+
var metadataIndoorWorkout: Bool? { get }
|
|
23
|
+
var metadataAverageSpeed: Quantity? { get }
|
|
24
|
+
var metadataMaximumSpeed: Quantity? { get }
|
|
25
|
+
var sampleType: SampleType { get }
|
|
26
|
+
var startDate: Date { get }
|
|
27
|
+
var endDate: Date { get }
|
|
28
|
+
var hasUndeterminedDuration: Bool { get }
|
|
29
|
+
var metadataWeatherCondition: WeatherCondition? { get }
|
|
30
|
+
var metadataWeatherHumidity: Quantity? { get }
|
|
31
|
+
var metadataWeatherTemperature: Quantity? { get }
|
|
32
|
+
var metadataInsulinDeliveryReason: InsulinDeliveryReason? { get }
|
|
33
|
+
var metadataHeartRateMotionContext: HeartRateMotionContext? { get }
|
|
34
|
+
var uuid: String { get }
|
|
35
|
+
var sourceRevision: SourceRevision { get }
|
|
36
|
+
var device: Device? { get }
|
|
37
|
+
var metadata: AnyMap { get }
|
|
38
|
+
var metadataExternalUUID: String? { get }
|
|
39
|
+
var metadataTimeZone: String? { get }
|
|
40
|
+
var metadataWasUserEntered: Bool? { get }
|
|
41
|
+
var metadataDeviceSerialNumber: String? { get }
|
|
42
|
+
var metadataUdiDeviceIdentifier: String? { get }
|
|
43
|
+
var metadataUdiProductionIdentifier: String? { get }
|
|
44
|
+
var metadataDigitalSignature: String? { get }
|
|
45
|
+
var metadataDeviceName: String? { get }
|
|
46
|
+
var metadataDeviceManufacturerName: String? { get }
|
|
47
|
+
var metadataSyncIdentifier: String? { get }
|
|
48
|
+
var metadataSyncVersion: Double? { get }
|
|
49
|
+
var metadataWasTakenInLab: Bool? { get }
|
|
50
|
+
var metadataReferenceRangeLowerLimit: Double? { get }
|
|
51
|
+
var metadataReferenceRangeUpperLimit: Double? { get }
|
|
52
|
+
var metadataAlgorithmVersion: Double? { get }
|
|
25
53
|
|
|
26
54
|
// Methods
|
|
27
55
|
func toJSON(key: String?) throws -> WorkoutSample
|