@kingstinct/react-native-healthkit 10.1.0 → 11.1.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/README.md +2 -2
- package/ios/CoreModule.swift +5 -15
- package/ios/CorrelationTypeModule.swift +7 -2
- package/ios/ElectrocardiogramModule.swift +210 -0
- package/ios/QuantityTypeModule.swift +113 -124
- package/ios/Serializers.swift +39 -66
- package/ios/WorkoutProxy.swift +38 -20
- package/ios/WorkoutsModule.swift +7 -18
- package/lib/commonjs/healthkit.ios.js +6 -2
- package/lib/commonjs/healthkit.js +10 -2
- package/lib/commonjs/hooks/useMostRecentWorkout.js +2 -9
- package/lib/commonjs/hooks/useWorkoutById.js +1 -4
- package/lib/commonjs/modules.js +2 -1
- package/lib/commonjs/specs/ElectrocardiogramModule.nitro.js +2 -0
- package/lib/commonjs/types/ElectrocardiogramSample.js +2 -0
- package/lib/commonjs/utils/getMostRecentWorkout.js +1 -3
- package/lib/commonjs/utils/getWorkoutById.js +1 -3
- package/lib/module/healthkit.ios.js +5 -1
- package/lib/module/healthkit.js +8 -0
- package/lib/module/hooks/useMostRecentWorkout.js +3 -10
- package/lib/module/hooks/useWorkoutById.js +1 -4
- package/lib/module/modules.js +1 -0
- package/lib/module/specs/ElectrocardiogramModule.nitro.js +1 -0
- package/lib/module/types/ElectrocardiogramSample.js +1 -0
- package/lib/module/utils/getMostRecentWorkout.js +1 -3
- package/lib/module/utils/getWorkoutById.js +1 -3
- package/lib/typescript/healthkit.d.ts +3 -1
- package/lib/typescript/healthkit.ios.d.ts +5 -1
- package/lib/typescript/hooks/useMostRecentWorkout.d.ts +1 -4
- package/lib/typescript/modules.d.ts +2 -0
- package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +8 -0
- package/lib/typescript/specs/WorkoutProxy.nitro.d.ts +11 -0
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +39 -0
- package/lib/typescript/types/Workouts.d.ts +0 -8
- package/lib/typescript/utils/getMostRecentWorkout.d.ts +1 -2
- package/lib/typescript/utils/getWorkoutById.d.ts +1 -2
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +136 -87
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +924 -493
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +29 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +16 -8
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +31 -16
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +6 -4
- package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +4 -2
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +7 -5
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +6 -4
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +152 -0
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +7 -5
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +5 -3
- package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.hpp +3 -1
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +7 -5
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +50 -22
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +9 -7
- package/nitrogen/generated/ios/swift/CategorySample.swift +4 -2
- package/nitrogen/generated/ios/swift/CategorySampleForSaving.swift +2 -1
- package/nitrogen/generated/ios/swift/CorrelationObject.swift +2 -0
- package/nitrogen/generated/ios/swift/DeletedSample.swift +2 -1
- package/nitrogen/generated/ios/swift/Device.swift +16 -8
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +179 -0
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +184 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramClassification.swift +60 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramLead.swift +40 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +298 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramSymptomsStatus.swift +44 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramVoltage.swift +57 -0
- package/nitrogen/generated/ios/swift/FilterForSamples.swift +2 -0
- package/nitrogen/generated/ios/swift/Func_void_AuthorizationRequestStatus.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_BiologicalSex.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_BloodType.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_CategorySamplesWithAnchorResponse.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_ElectrocardiogramSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_FitzpatrickSkinType.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_HeartbeatSeriesSamplesWithAnchorResponse.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_OnChangeCallbackArgs.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_QuantitySamplesWithAnchorResponse.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryStatisticsResponse.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryWorkoutSamplesWithAnchorResponse.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_WheelchairUse.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_QueryStatisticsResponse_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_WorkoutPlan_.swift +3 -1
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__chrono__system_clock__time_point_.swift +3 -1
- package/nitrogen/generated/ios/swift/{Func_void_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec_.swift → Func_void_std__shared_ptr_HybridWorkoutProxySpec_.swift} +9 -8
- package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__QueryStatisticsResponse_.swift +55 -0
- package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__bool_.swift +2 -1
- package/nitrogen/generated/ios/swift/Func_void_std__vector_CategorySample_.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_CorrelationSample_.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_ElectrocardiogramSample_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_HeartbeatSeriesSample_.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_IdentifierWithUnit_.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_QuantitySample_.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_QueryStatisticsResponse_.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_StateOfMindSample_.swift +1 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_WorkoutRoute_.swift +1 -0
- package/nitrogen/generated/ios/swift/{Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridSourceProxySpec__.swift → Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__.swift} +9 -8
- package/nitrogen/generated/ios/swift/{Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec__.swift → Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__.swift} +9 -8
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +6 -3
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +17 -7
- package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +15 -6
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +24 -15
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +15 -6
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +50 -0
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +162 -0
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +17 -7
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +21 -9
- package/nitrogen/generated/ios/swift/HybridSourceProxySpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridSourceProxySpec_cxx.swift +17 -7
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +19 -8
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +8 -5
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +108 -41
- package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec_cxx.swift +31 -22
- package/nitrogen/generated/ios/swift/OnChangeCallbackArgs.swift +2 -1
- package/nitrogen/generated/ios/swift/PredicateForSamples.swift +2 -0
- package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +2 -0
- package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +3 -3
- package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +2 -1
- package/nitrogen/generated/ios/swift/PredicateWithStartAndEnd.swift +4 -2
- package/nitrogen/generated/ios/swift/QuantitySample.swift +4 -2
- package/nitrogen/generated/ios/swift/QuantitySampleForSaving.swift +2 -1
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +4 -2
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +6 -3
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +2 -1
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +4 -2
- package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +18 -9
- package/nitrogen/generated/ios/swift/QueryWorkoutSamplesWithAnchorResponse.swift +7 -7
- package/nitrogen/generated/ios/swift/SampleForSaving.swift +2 -0
- package/nitrogen/generated/ios/swift/SourceRevision.swift +13 -9
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +6 -3
- package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +4 -2
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +2 -0
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +2 -0
- package/nitrogen/generated/ios/swift/Variant_String_Double_Bool_Date.swift +2 -0
- package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +4 -61
- package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +6 -62
- package/nitrogen/generated/ios/swift/WorkoutRoute.swift +2 -1
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +12 -123
- package/nitrogen/generated/shared/c++/AuthorizationRequestStatus.hpp +9 -11
- package/nitrogen/generated/shared/c++/AuthorizationStatus.hpp +9 -11
- package/nitrogen/generated/shared/c++/BiologicalSex.hpp +9 -11
- package/nitrogen/generated/shared/c++/BloodType.hpp +9 -11
- package/nitrogen/generated/shared/c++/CategorySample.hpp +14 -16
- package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +11 -13
- package/nitrogen/generated/shared/c++/CategorySamplesWithAnchorResponse.hpp +11 -13
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +131 -133
- package/nitrogen/generated/shared/c++/ComparisonPredicateOperator.hpp +26 -13
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +12 -14
- package/nitrogen/generated/shared/c++/CorrelationTypeIdentifier.hpp +7 -9
- package/nitrogen/generated/shared/c++/DeletedSample.hpp +5 -7
- package/nitrogen/generated/shared/c++/Device.hpp +5 -7
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +101 -0
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +100 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramClassification.hpp +96 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramLead.hpp +76 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +135 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramSamplesWithAnchorResponse.hpp +81 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramSymptomsStatus.hpp +80 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramVoltage.hpp +76 -0
- package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +9 -11
- package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +9 -11
- package/nitrogen/generated/shared/c++/FitzpatrickSkinType.hpp +9 -11
- package/nitrogen/generated/shared/c++/Heartbeat.hpp +4 -6
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +15 -17
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSamplesWithAnchorResponse.hpp +11 -13
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +2 -2
- package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +4 -4
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +2 -2
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +76 -0
- package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +3 -3
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +3 -3
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +3 -3
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +6 -4
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +18 -9
- package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.hpp +4 -4
- package/nitrogen/generated/shared/c++/IdentifierWithUnit.hpp +4 -6
- package/nitrogen/generated/shared/c++/IntervalComponents.hpp +4 -6
- package/nitrogen/generated/shared/c++/LocationForSaving.hpp +4 -6
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +397 -399
- package/nitrogen/generated/shared/c++/OnChangeCallbackArgs.hpp +8 -10
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +9 -11
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +9 -11
- package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +6 -8
- package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +9 -11
- package/nitrogen/generated/shared/c++/PredicateWithMetadataOperator.hpp +11 -13
- package/nitrogen/generated/shared/c++/PredicateWithStartAndEnd.hpp +5 -7
- package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +4 -6
- package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +5 -7
- package/nitrogen/generated/shared/c++/Quantity.hpp +4 -6
- package/nitrogen/generated/shared/c++/QuantityDateInterval.hpp +4 -6
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +14 -16
- package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +11 -13
- package/nitrogen/generated/shared/c++/QuantitySamplesWithAnchorResponse.hpp +11 -13
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +241 -243
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +9 -11
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +9 -11
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +8 -10
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +9 -11
- package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +26 -28
- package/nitrogen/generated/shared/c++/QueryWorkoutSamplesWithAnchorResponse.hpp +10 -12
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +383 -385
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +373 -375
- package/nitrogen/generated/shared/c++/Source.hpp +4 -6
- package/nitrogen/generated/shared/c++/SourceRevision.hpp +7 -9
- package/nitrogen/generated/shared/c++/StateOfMindAssociation.hpp +10 -12
- package/nitrogen/generated/shared/c++/StateOfMindKind.hpp +14 -13
- package/nitrogen/generated/shared/c++/StateOfMindLabel.hpp +10 -12
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +24 -26
- package/nitrogen/generated/shared/c++/StateOfMindValenceClassification.hpp +10 -12
- package/nitrogen/generated/shared/c++/StatisticsOptions.hpp +17 -19
- package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +9 -11
- package/nitrogen/generated/shared/c++/UpdateFrequency.hpp +10 -12
- package/nitrogen/generated/shared/c++/WheelchairUse.hpp +9 -11
- package/nitrogen/generated/shared/c++/WorkoutActivity.hpp +4 -6
- package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +96 -13
- package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +7 -9
- package/nitrogen/generated/shared/c++/WorkoutConfiguration.hpp +11 -13
- package/nitrogen/generated/shared/c++/WorkoutDurationPredicate.hpp +7 -9
- package/nitrogen/generated/shared/c++/WorkoutEvent.hpp +7 -9
- package/nitrogen/generated/shared/c++/WorkoutEventType.hpp +10 -12
- package/nitrogen/generated/shared/c++/WorkoutPlan.hpp +7 -9
- package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +10 -21
- package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +11 -21
- package/nitrogen/generated/shared/c++/WorkoutRoute.hpp +9 -11
- package/nitrogen/generated/shared/c++/WorkoutRouteLocation.hpp +4 -6
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +25 -43
- package/nitrogen/generated/shared/c++/WorkoutSessionLocationType.hpp +10 -12
- package/nitrogen/generated/shared/c++/WorkoutTotals.hpp +4 -6
- package/package.json +11 -11
- package/src/healthkit.ios.ts +9 -0
- package/src/healthkit.ts +16 -0
- package/src/hooks/useMostRecentWorkout.ts +3 -17
- package/src/hooks/useWorkoutById.ts +1 -4
- package/src/modules.ts +6 -0
- package/src/specs/ElectrocardiogramModule.nitro.ts +18 -0
- package/src/specs/WorkoutProxy.nitro.ts +18 -1
- package/src/types/ElectrocardiogramSample.ts +60 -0
- package/src/types/Workouts.ts +0 -8
- package/src/utils/getMostRecentWorkout.ts +1 -6
- package/src/utils/getWorkoutById.ts +1 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import NitroModules
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Wraps a Swift `(_ value: [(any HybridSourceProxySpec)]) -> Void` as a class.
|
|
12
13
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
14
|
*/
|
|
14
|
-
public final class
|
|
15
|
+
public final class Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__ {
|
|
15
16
|
public typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
16
17
|
|
|
17
18
|
private let closure: (_ value: [(any HybridSourceProxySpec)]) -> Void
|
|
@@ -21,9 +22,9 @@ public final class Func_void_std__vector_std__shared_ptr_margelo__nitro__healthk
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
@inline(__always)
|
|
24
|
-
public func call(value: bridge.
|
|
25
|
+
public func call(value: bridge.std__vector_std__shared_ptr_HybridSourceProxySpec__) -> Void {
|
|
25
26
|
self.closure(value.map({ __item in { () -> HybridSourceProxySpec in
|
|
26
|
-
let __unsafePointer = bridge.
|
|
27
|
+
let __unsafePointer = bridge.get_std__shared_ptr_HybridSourceProxySpec_(__item)
|
|
27
28
|
let __instance = HybridSourceProxySpec_cxx.fromUnsafe(__unsafePointer)
|
|
28
29
|
return __instance.getHybridSourceProxySpec()
|
|
29
30
|
}() }))
|
|
@@ -39,12 +40,12 @@ public final class Func_void_std__vector_std__shared_ptr_margelo__nitro__healthk
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
|
-
* Casts an unsafe pointer to a `
|
|
43
|
-
* The pointer has to be a retained opaque `Unmanaged<
|
|
43
|
+
* Casts an unsafe pointer to a `Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__`.
|
|
44
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__>`.
|
|
44
45
|
* This removes one strong reference from the object!
|
|
45
46
|
*/
|
|
46
47
|
@inline(__always)
|
|
47
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) ->
|
|
48
|
-
return Unmanaged<
|
|
48
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__ {
|
|
49
|
+
return Unmanaged<Func_void_std__vector_std__shared_ptr_HybridSourceProxySpec__>.fromOpaque(pointer).takeRetainedValue()
|
|
49
50
|
}
|
|
50
51
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import NitroModules
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Wraps a Swift `(_ value: [(any HybridWorkoutProxySpec)]) -> Void` as a class.
|
|
12
13
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
14
|
*/
|
|
14
|
-
public final class
|
|
15
|
+
public final class Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__ {
|
|
15
16
|
public typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
16
17
|
|
|
17
18
|
private let closure: (_ value: [(any HybridWorkoutProxySpec)]) -> Void
|
|
@@ -21,9 +22,9 @@ public final class Func_void_std__vector_std__shared_ptr_margelo__nitro__healthk
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
@inline(__always)
|
|
24
|
-
public func call(value: bridge.
|
|
25
|
+
public func call(value: bridge.std__vector_std__shared_ptr_HybridWorkoutProxySpec__) -> Void {
|
|
25
26
|
self.closure(value.map({ __item in { () -> HybridWorkoutProxySpec in
|
|
26
|
-
let __unsafePointer = bridge.
|
|
27
|
+
let __unsafePointer = bridge.get_std__shared_ptr_HybridWorkoutProxySpec_(__item)
|
|
27
28
|
let __instance = HybridWorkoutProxySpec_cxx.fromUnsafe(__unsafePointer)
|
|
28
29
|
return __instance.getHybridWorkoutProxySpec()
|
|
29
30
|
}() }))
|
|
@@ -39,12 +40,12 @@ public final class Func_void_std__vector_std__shared_ptr_margelo__nitro__healthk
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
|
-
* Casts an unsafe pointer to a `
|
|
43
|
-
* The pointer has to be a retained opaque `Unmanaged<
|
|
43
|
+
* Casts an unsafe pointer to a `Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__`.
|
|
44
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__>`.
|
|
44
45
|
* This removes one strong reference from the object!
|
|
45
46
|
*/
|
|
46
47
|
@inline(__always)
|
|
47
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) ->
|
|
48
|
-
return Unmanaged<
|
|
48
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__ {
|
|
49
|
+
return Unmanaged<Func_void_std__vector_std__shared_ptr_HybridWorkoutProxySpec__>.fromOpaque(pointer).takeRetainedValue()
|
|
49
50
|
}
|
|
50
51
|
}
|
|
@@ -61,7 +61,8 @@ public extension HeartbeatSeriesSample {
|
|
|
61
61
|
@inline(__always)
|
|
62
62
|
get {
|
|
63
63
|
return { () -> Device? in
|
|
64
|
-
if
|
|
64
|
+
if bridge.has_value_std__optional_Device_(self.__device) {
|
|
65
|
+
let __unwrapped = bridge.get_std__optional_Device_(self.__device)
|
|
65
66
|
return __unwrapped
|
|
66
67
|
} else {
|
|
67
68
|
return nil
|
|
@@ -123,7 +124,8 @@ public extension HeartbeatSeriesSample {
|
|
|
123
124
|
@inline(__always)
|
|
124
125
|
get {
|
|
125
126
|
return { () -> AnyMap? in
|
|
126
|
-
if
|
|
127
|
+
if bridge.has_value_std__optional_std__shared_ptr_AnyMap__(self.__metadata) {
|
|
128
|
+
let __unwrapped = bridge.get_std__optional_std__shared_ptr_AnyMap__(self.__metadata)
|
|
127
129
|
return AnyMap(withCppPart: __unwrapped)
|
|
128
130
|
} else {
|
|
129
131
|
return nil
|
|
@@ -146,7 +148,8 @@ public extension HeartbeatSeriesSample {
|
|
|
146
148
|
@inline(__always)
|
|
147
149
|
get {
|
|
148
150
|
return { () -> SourceRevision? in
|
|
149
|
-
if
|
|
151
|
+
if bridge.has_value_std__optional_SourceRevision_(self.__sourceRevision) {
|
|
152
|
+
let __unwrapped = bridge.get_std__optional_SourceRevision_(self.__sourceRevision)
|
|
150
153
|
return __unwrapped
|
|
151
154
|
} else {
|
|
152
155
|
return nil
|
|
@@ -20,8 +20,9 @@ public protocol HybridCategoryTypeModuleSpec_protocol: HybridObject {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/// See ``HybridCategoryTypeModuleSpec``
|
|
23
|
-
|
|
23
|
+
open class HybridCategoryTypeModuleSpec_base {
|
|
24
24
|
private weak var cxxWrapper: HybridCategoryTypeModuleSpec_cxx? = nil
|
|
25
|
+
public init() { }
|
|
25
26
|
public func getCxxWrapper() -> HybridCategoryTypeModuleSpec_cxx {
|
|
26
27
|
#if DEBUG
|
|
27
28
|
guard self is HybridCategoryTypeModuleSpec else {
|
|
@@ -17,7 +17,7 @@ import NitroModules
|
|
|
17
17
|
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
18
|
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
open class HybridCategoryTypeModuleSpec_cxx {
|
|
21
21
|
/**
|
|
22
22
|
* The Swift <> C++ bridge's namespace (`margelo::nitro::healthkit::bridge::swift`)
|
|
23
23
|
* from `ReactNativeHealthkit-Swift-Cxx-Bridge.hpp`.
|
|
@@ -33,7 +33,7 @@ public class HybridCategoryTypeModuleSpec_cxx {
|
|
|
33
33
|
/**
|
|
34
34
|
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
35
|
*/
|
|
36
|
-
private var __cxxPart: bridge.
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridCategoryTypeModuleSpec_
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Create a new `HybridCategoryTypeModuleSpec_cxx` that wraps the given `HybridCategoryTypeModuleSpec`.
|
|
@@ -72,15 +72,15 @@ public class HybridCategoryTypeModuleSpec_cxx {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
-
* The C++ part is a `std::shared_ptr<
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridCategoryTypeModuleSpec>`.
|
|
76
76
|
*/
|
|
77
|
-
public func getCxxPart() -> bridge.
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridCategoryTypeModuleSpec_ {
|
|
78
78
|
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
79
|
if cachedCxxPart.__convertToBool() {
|
|
80
80
|
return cachedCxxPart
|
|
81
81
|
} else {
|
|
82
|
-
let newCxxPart = bridge.
|
|
83
|
-
__cxxPart = bridge.
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridCategoryTypeModuleSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridCategoryTypeModuleSpec_(newCxxPart)
|
|
84
84
|
return newCxxPart
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -96,6 +96,15 @@ public class HybridCategoryTypeModuleSpec_cxx {
|
|
|
96
96
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Call dispose() on the Swift class.
|
|
101
|
+
* This _may_ be called manually from JS.
|
|
102
|
+
*/
|
|
103
|
+
@inline(__always)
|
|
104
|
+
public func dispose() {
|
|
105
|
+
self.__implementation.dispose()
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
// Properties
|
|
100
109
|
|
|
101
110
|
|
|
@@ -123,7 +132,8 @@ public class HybridCategoryTypeModuleSpec_cxx {
|
|
|
123
132
|
public final func queryCategorySamples(identifier: Int32, options: bridge.std__optional_QueryOptionsWithSortOrder_) -> bridge.Result_std__shared_ptr_Promise_std__vector_CategorySample____ {
|
|
124
133
|
do {
|
|
125
134
|
let __result = try self.__implementation.queryCategorySamples(identifier: margelo.nitro.healthkit.CategoryTypeIdentifier(rawValue: identifier)!, options: { () -> QueryOptionsWithSortOrder? in
|
|
126
|
-
if
|
|
135
|
+
if bridge.has_value_std__optional_QueryOptionsWithSortOrder_(options) {
|
|
136
|
+
let __unwrapped = bridge.get_std__optional_QueryOptionsWithSortOrder_(options)
|
|
127
137
|
return __unwrapped
|
|
128
138
|
} else {
|
|
129
139
|
return nil
|
|
@@ -27,8 +27,9 @@ public protocol HybridCharacteristicTypeModuleSpec_protocol: HybridObject {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/// See ``HybridCharacteristicTypeModuleSpec``
|
|
30
|
-
|
|
30
|
+
open class HybridCharacteristicTypeModuleSpec_base {
|
|
31
31
|
private weak var cxxWrapper: HybridCharacteristicTypeModuleSpec_cxx? = nil
|
|
32
|
+
public init() { }
|
|
32
33
|
public func getCxxWrapper() -> HybridCharacteristicTypeModuleSpec_cxx {
|
|
33
34
|
#if DEBUG
|
|
34
35
|
guard self is HybridCharacteristicTypeModuleSpec else {
|
|
@@ -17,7 +17,7 @@ import NitroModules
|
|
|
17
17
|
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
18
|
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
open class HybridCharacteristicTypeModuleSpec_cxx {
|
|
21
21
|
/**
|
|
22
22
|
* The Swift <> C++ bridge's namespace (`margelo::nitro::healthkit::bridge::swift`)
|
|
23
23
|
* from `ReactNativeHealthkit-Swift-Cxx-Bridge.hpp`.
|
|
@@ -33,7 +33,7 @@ public class HybridCharacteristicTypeModuleSpec_cxx {
|
|
|
33
33
|
/**
|
|
34
34
|
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
35
|
*/
|
|
36
|
-
private var __cxxPart: bridge.
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridCharacteristicTypeModuleSpec_
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Create a new `HybridCharacteristicTypeModuleSpec_cxx` that wraps the given `HybridCharacteristicTypeModuleSpec`.
|
|
@@ -72,15 +72,15 @@ public class HybridCharacteristicTypeModuleSpec_cxx {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
-
* The C++ part is a `std::shared_ptr<
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridCharacteristicTypeModuleSpec>`.
|
|
76
76
|
*/
|
|
77
|
-
public func getCxxPart() -> bridge.
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridCharacteristicTypeModuleSpec_ {
|
|
78
78
|
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
79
|
if cachedCxxPart.__convertToBool() {
|
|
80
80
|
return cachedCxxPart
|
|
81
81
|
} else {
|
|
82
|
-
let newCxxPart = bridge.
|
|
83
|
-
__cxxPart = bridge.
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridCharacteristicTypeModuleSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridCharacteristicTypeModuleSpec_(newCxxPart)
|
|
84
84
|
return newCxxPart
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -96,6 +96,15 @@ public class HybridCharacteristicTypeModuleSpec_cxx {
|
|
|
96
96
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Call dispose() on the Swift class.
|
|
101
|
+
* This _may_ be called manually from JS.
|
|
102
|
+
*/
|
|
103
|
+
@inline(__always)
|
|
104
|
+
public func dispose() {
|
|
105
|
+
self.__implementation.dispose()
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
// Properties
|
|
100
109
|
|
|
101
110
|
|
|
@@ -39,8 +39,9 @@ public protocol HybridCoreModuleSpec_protocol: HybridObject {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/// See ``HybridCoreModuleSpec``
|
|
42
|
-
|
|
42
|
+
open class HybridCoreModuleSpec_base {
|
|
43
43
|
private weak var cxxWrapper: HybridCoreModuleSpec_cxx? = nil
|
|
44
|
+
public init() { }
|
|
44
45
|
public func getCxxWrapper() -> HybridCoreModuleSpec_cxx {
|
|
45
46
|
#if DEBUG
|
|
46
47
|
guard self is HybridCoreModuleSpec else {
|
|
@@ -17,7 +17,7 @@ import NitroModules
|
|
|
17
17
|
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
18
|
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
open class HybridCoreModuleSpec_cxx {
|
|
21
21
|
/**
|
|
22
22
|
* The Swift <> C++ bridge's namespace (`margelo::nitro::healthkit::bridge::swift`)
|
|
23
23
|
* from `ReactNativeHealthkit-Swift-Cxx-Bridge.hpp`.
|
|
@@ -33,7 +33,7 @@ public class HybridCoreModuleSpec_cxx {
|
|
|
33
33
|
/**
|
|
34
34
|
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
35
|
*/
|
|
36
|
-
private var __cxxPart: bridge.
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridCoreModuleSpec_
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Create a new `HybridCoreModuleSpec_cxx` that wraps the given `HybridCoreModuleSpec`.
|
|
@@ -72,15 +72,15 @@ public class HybridCoreModuleSpec_cxx {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
-
* The C++ part is a `std::shared_ptr<
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridCoreModuleSpec>`.
|
|
76
76
|
*/
|
|
77
|
-
public func getCxxPart() -> bridge.
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridCoreModuleSpec_ {
|
|
78
78
|
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
79
|
if cachedCxxPart.__convertToBool() {
|
|
80
80
|
return cachedCxxPart
|
|
81
81
|
} else {
|
|
82
|
-
let newCxxPart = bridge.
|
|
83
|
-
__cxxPart = bridge.
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridCoreModuleSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridCoreModuleSpec_(newCxxPart)
|
|
84
84
|
return newCxxPart
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -96,6 +96,15 @@ public class HybridCoreModuleSpec_cxx {
|
|
|
96
96
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Call dispose() on the Swift class.
|
|
101
|
+
* This _may_ be called manually from JS.
|
|
102
|
+
*/
|
|
103
|
+
@inline(__always)
|
|
104
|
+
public func dispose() {
|
|
105
|
+
self.__implementation.dispose()
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
// Properties
|
|
100
109
|
|
|
101
110
|
|
|
@@ -245,17 +254,17 @@ public class HybridCoreModuleSpec_cxx {
|
|
|
245
254
|
}
|
|
246
255
|
|
|
247
256
|
@inline(__always)
|
|
248
|
-
public final func querySources(identifier: Int32) -> bridge.
|
|
257
|
+
public final func querySources(identifier: Int32) -> bridge.Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec_____ {
|
|
249
258
|
do {
|
|
250
259
|
let __result = try self.__implementation.querySources(identifier: margelo.nitro.healthkit.SampleTypeIdentifier(rawValue: identifier)!)
|
|
251
|
-
let __resultCpp = { () -> bridge.
|
|
252
|
-
let __promise = bridge.
|
|
253
|
-
let __promiseHolder = bridge.
|
|
260
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec____ in
|
|
261
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec____()
|
|
262
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec____(__promise)
|
|
254
263
|
__result
|
|
255
|
-
.then({ __result in __promiseHolder.resolve({ () -> bridge.
|
|
256
|
-
var __vector = bridge.
|
|
264
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_std__shared_ptr_HybridSourceProxySpec__ in
|
|
265
|
+
var __vector = bridge.create_std__vector_std__shared_ptr_HybridSourceProxySpec__(__result.count)
|
|
257
266
|
for __item in __result {
|
|
258
|
-
__vector.push_back({ () -> bridge.
|
|
267
|
+
__vector.push_back({ () -> bridge.std__shared_ptr_HybridSourceProxySpec_ in
|
|
259
268
|
let __cxxWrapped = __item.getCxxWrapper()
|
|
260
269
|
return __cxxWrapped.getCxxPart()
|
|
261
270
|
}())
|
|
@@ -265,10 +274,10 @@ public class HybridCoreModuleSpec_cxx {
|
|
|
265
274
|
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
266
275
|
return __promise
|
|
267
276
|
}()
|
|
268
|
-
return bridge.
|
|
277
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec_____(__resultCpp)
|
|
269
278
|
} catch (let __error) {
|
|
270
279
|
let __exceptionPtr = __error.toCpp()
|
|
271
|
-
return bridge.
|
|
280
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_HybridSourceProxySpec_____(__exceptionPtr)
|
|
272
281
|
}
|
|
273
282
|
}
|
|
274
283
|
|
|
@@ -19,8 +19,9 @@ public protocol HybridCorrelationTypeModuleSpec_protocol: HybridObject {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/// See ``HybridCorrelationTypeModuleSpec``
|
|
22
|
-
|
|
22
|
+
open class HybridCorrelationTypeModuleSpec_base {
|
|
23
23
|
private weak var cxxWrapper: HybridCorrelationTypeModuleSpec_cxx? = nil
|
|
24
|
+
public init() { }
|
|
24
25
|
public func getCxxWrapper() -> HybridCorrelationTypeModuleSpec_cxx {
|
|
25
26
|
#if DEBUG
|
|
26
27
|
guard self is HybridCorrelationTypeModuleSpec else {
|
|
@@ -17,7 +17,7 @@ import NitroModules
|
|
|
17
17
|
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
18
|
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
open class HybridCorrelationTypeModuleSpec_cxx {
|
|
21
21
|
/**
|
|
22
22
|
* The Swift <> C++ bridge's namespace (`margelo::nitro::healthkit::bridge::swift`)
|
|
23
23
|
* from `ReactNativeHealthkit-Swift-Cxx-Bridge.hpp`.
|
|
@@ -33,7 +33,7 @@ public class HybridCorrelationTypeModuleSpec_cxx {
|
|
|
33
33
|
/**
|
|
34
34
|
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
35
|
*/
|
|
36
|
-
private var __cxxPart: bridge.
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridCorrelationTypeModuleSpec_
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Create a new `HybridCorrelationTypeModuleSpec_cxx` that wraps the given `HybridCorrelationTypeModuleSpec`.
|
|
@@ -72,15 +72,15 @@ public class HybridCorrelationTypeModuleSpec_cxx {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
-
* The C++ part is a `std::shared_ptr<
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridCorrelationTypeModuleSpec>`.
|
|
76
76
|
*/
|
|
77
|
-
public func getCxxPart() -> bridge.
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridCorrelationTypeModuleSpec_ {
|
|
78
78
|
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
79
|
if cachedCxxPart.__convertToBool() {
|
|
80
80
|
return cachedCxxPart
|
|
81
81
|
} else {
|
|
82
|
-
let newCxxPart = bridge.
|
|
83
|
-
__cxxPart = bridge.
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridCorrelationTypeModuleSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridCorrelationTypeModuleSpec_(newCxxPart)
|
|
84
84
|
return newCxxPart
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -96,6 +96,15 @@ public class HybridCorrelationTypeModuleSpec_cxx {
|
|
|
96
96
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Call dispose() on the Swift class.
|
|
101
|
+
* This _may_ be called manually from JS.
|
|
102
|
+
*/
|
|
103
|
+
@inline(__always)
|
|
104
|
+
public func dispose() {
|
|
105
|
+
self.__implementation.dispose()
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
// Properties
|
|
100
109
|
|
|
101
110
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridElectrocardiogramModuleSpec.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
|
+
|
|
11
|
+
/// See ``HybridElectrocardiogramModuleSpec``
|
|
12
|
+
public protocol HybridElectrocardiogramModuleSpec_protocol: HybridObject {
|
|
13
|
+
// Properties
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// Methods
|
|
17
|
+
func queryElectrocardiogramSamples(options: ECGQueryOptionsWithSortOrder?) throws -> Promise<[ElectrocardiogramSample]>
|
|
18
|
+
func queryElectrocardiogramSamplesWithAnchor(options: ECGQueryOptionsWithAnchor) throws -> Promise<ElectrocardiogramSamplesWithAnchorResponse>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/// See ``HybridElectrocardiogramModuleSpec``
|
|
22
|
+
open class HybridElectrocardiogramModuleSpec_base {
|
|
23
|
+
private weak var cxxWrapper: HybridElectrocardiogramModuleSpec_cxx? = nil
|
|
24
|
+
public init() { }
|
|
25
|
+
public func getCxxWrapper() -> HybridElectrocardiogramModuleSpec_cxx {
|
|
26
|
+
#if DEBUG
|
|
27
|
+
guard self is HybridElectrocardiogramModuleSpec else {
|
|
28
|
+
fatalError("`self` is not a `HybridElectrocardiogramModuleSpec`! Did you accidentally inherit from `HybridElectrocardiogramModuleSpec_base` instead of `HybridElectrocardiogramModuleSpec`?")
|
|
29
|
+
}
|
|
30
|
+
#endif
|
|
31
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
32
|
+
return cxxWrapper
|
|
33
|
+
} else {
|
|
34
|
+
let cxxWrapper = HybridElectrocardiogramModuleSpec_cxx(self as! HybridElectrocardiogramModuleSpec)
|
|
35
|
+
self.cxxWrapper = cxxWrapper
|
|
36
|
+
return cxxWrapper
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A Swift base-protocol representing the ElectrocardiogramModule HybridObject.
|
|
43
|
+
* Implement this protocol to create Swift-based instances of ElectrocardiogramModule.
|
|
44
|
+
* ```swift
|
|
45
|
+
* class HybridElectrocardiogramModule : HybridElectrocardiogramModuleSpec {
|
|
46
|
+
* // ...
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
public typealias HybridElectrocardiogramModuleSpec = HybridElectrocardiogramModuleSpec_protocol & HybridElectrocardiogramModuleSpec_base
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridElectrocardiogramModuleSpec_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
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A class implementation that bridges HybridElectrocardiogramModuleSpec over to C++.
|
|
13
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
14
|
+
*
|
|
15
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
16
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
17
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
|
+
*/
|
|
20
|
+
open class HybridElectrocardiogramModuleSpec_cxx {
|
|
21
|
+
/**
|
|
22
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::healthkit::bridge::swift`)
|
|
23
|
+
* from `ReactNativeHealthkit-Swift-Cxx-Bridge.hpp`.
|
|
24
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
25
|
+
*/
|
|
26
|
+
public typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Holds an instance of the `HybridElectrocardiogramModuleSpec` Swift protocol.
|
|
30
|
+
*/
|
|
31
|
+
private var __implementation: any HybridElectrocardiogramModuleSpec
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
|
+
*/
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridElectrocardiogramModuleSpec_
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Create a new `HybridElectrocardiogramModuleSpec_cxx` that wraps the given `HybridElectrocardiogramModuleSpec`.
|
|
40
|
+
* All properties and methods bridge to C++ types.
|
|
41
|
+
*/
|
|
42
|
+
public init(_ implementation: any HybridElectrocardiogramModuleSpec) {
|
|
43
|
+
self.__implementation = implementation
|
|
44
|
+
self.__cxxPart = .init()
|
|
45
|
+
/* no base class */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the actual `HybridElectrocardiogramModuleSpec` instance this class wraps.
|
|
50
|
+
*/
|
|
51
|
+
@inline(__always)
|
|
52
|
+
public func getHybridElectrocardiogramModuleSpec() -> any HybridElectrocardiogramModuleSpec {
|
|
53
|
+
return __implementation
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
58
|
+
* This acquires one additional strong reference on the object!
|
|
59
|
+
*/
|
|
60
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
61
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Casts an unsafe pointer to a `HybridElectrocardiogramModuleSpec_cxx`.
|
|
66
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridElectrocardiogramModuleSpec_cxx>`.
|
|
67
|
+
* This removes one strong reference from the object!
|
|
68
|
+
*/
|
|
69
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridElectrocardiogramModuleSpec_cxx {
|
|
70
|
+
return Unmanaged<HybridElectrocardiogramModuleSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridElectrocardiogramModuleSpec>`.
|
|
76
|
+
*/
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridElectrocardiogramModuleSpec_ {
|
|
78
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
|
+
if cachedCxxPart.__convertToBool() {
|
|
80
|
+
return cachedCxxPart
|
|
81
|
+
} else {
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridElectrocardiogramModuleSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridElectrocardiogramModuleSpec_(newCxxPart)
|
|
84
|
+
return newCxxPart
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
92
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
93
|
+
*/
|
|
94
|
+
@inline(__always)
|
|
95
|
+
public var memorySize: Int {
|
|
96
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Call dispose() on the Swift class.
|
|
101
|
+
* This _may_ be called manually from JS.
|
|
102
|
+
*/
|
|
103
|
+
@inline(__always)
|
|
104
|
+
public func dispose() {
|
|
105
|
+
self.__implementation.dispose()
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Properties
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
// Methods
|
|
112
|
+
@inline(__always)
|
|
113
|
+
public final func queryElectrocardiogramSamples(options: bridge.std__optional_ECGQueryOptionsWithSortOrder_) -> bridge.Result_std__shared_ptr_Promise_std__vector_ElectrocardiogramSample____ {
|
|
114
|
+
do {
|
|
115
|
+
let __result = try self.__implementation.queryElectrocardiogramSamples(options: { () -> ECGQueryOptionsWithSortOrder? in
|
|
116
|
+
if bridge.has_value_std__optional_ECGQueryOptionsWithSortOrder_(options) {
|
|
117
|
+
let __unwrapped = bridge.get_std__optional_ECGQueryOptionsWithSortOrder_(options)
|
|
118
|
+
return __unwrapped
|
|
119
|
+
} else {
|
|
120
|
+
return nil
|
|
121
|
+
}
|
|
122
|
+
}())
|
|
123
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_ElectrocardiogramSample___ in
|
|
124
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_ElectrocardiogramSample___()
|
|
125
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_ElectrocardiogramSample___(__promise)
|
|
126
|
+
__result
|
|
127
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_ElectrocardiogramSample_ in
|
|
128
|
+
var __vector = bridge.create_std__vector_ElectrocardiogramSample_(__result.count)
|
|
129
|
+
for __item in __result {
|
|
130
|
+
__vector.push_back(__item)
|
|
131
|
+
}
|
|
132
|
+
return __vector
|
|
133
|
+
}()) })
|
|
134
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
135
|
+
return __promise
|
|
136
|
+
}()
|
|
137
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_ElectrocardiogramSample____(__resultCpp)
|
|
138
|
+
} catch (let __error) {
|
|
139
|
+
let __exceptionPtr = __error.toCpp()
|
|
140
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_ElectrocardiogramSample____(__exceptionPtr)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@inline(__always)
|
|
145
|
+
public final func queryElectrocardiogramSamplesWithAnchor(options: ECGQueryOptionsWithAnchor) -> bridge.Result_std__shared_ptr_Promise_ElectrocardiogramSamplesWithAnchorResponse___ {
|
|
146
|
+
do {
|
|
147
|
+
let __result = try self.__implementation.queryElectrocardiogramSamplesWithAnchor(options: options)
|
|
148
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_ElectrocardiogramSamplesWithAnchorResponse__ in
|
|
149
|
+
let __promise = bridge.create_std__shared_ptr_Promise_ElectrocardiogramSamplesWithAnchorResponse__()
|
|
150
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_ElectrocardiogramSamplesWithAnchorResponse__(__promise)
|
|
151
|
+
__result
|
|
152
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
153
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
154
|
+
return __promise
|
|
155
|
+
}()
|
|
156
|
+
return bridge.create_Result_std__shared_ptr_Promise_ElectrocardiogramSamplesWithAnchorResponse___(__resultCpp)
|
|
157
|
+
} catch (let __error) {
|
|
158
|
+
let __exceptionPtr = __error.toCpp()
|
|
159
|
+
return bridge.create_Result_std__shared_ptr_Promise_ElectrocardiogramSamplesWithAnchorResponse___(__exceptionPtr)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|