@kingstinct/react-native-healthkit 9.0.0 → 9.0.2
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 +192 -0
- package/app.plugin.js +0 -1
- package/ios/Helpers.swift +33 -37
- package/ios/WorkoutProxy.swift +7 -0
- package/lib/commonjs/hooks/useCategorySampleById.js +36 -0
- package/lib/commonjs/hooks/useHealthkitAuthorization.js +34 -0
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js +23 -0
- package/lib/commonjs/hooks/useMostRecentCategorySample.js +21 -0
- package/lib/commonjs/hooks/useMostRecentQuantitySample.js +22 -0
- package/lib/commonjs/hooks/useMostRecentWorkout.js +31 -0
- package/lib/commonjs/hooks/useQuantitySampleById.js +34 -0
- package/lib/commonjs/hooks/useSources.js +17 -0
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +26 -0
- package/lib/commonjs/hooks/useSubscribeToChanges.js +20 -0
- package/lib/commonjs/hooks/useWorkoutById.js +46 -0
- package/lib/commonjs/index.ios.js +144 -0
- package/lib/commonjs/index.js +210 -0
- package/lib/commonjs/modules.js +12 -0
- package/lib/commonjs/specs/CategoryTypeModule.nitro.js +5 -0
- package/lib/commonjs/specs/CharacteristicTypeModule.nitro.js +2 -0
- package/lib/commonjs/specs/CoreModule.nitro.js +2 -0
- package/lib/commonjs/specs/CorrelationTypeModule.nitro.js +2 -0
- package/lib/commonjs/specs/HeartbeatSeriesModule.nitro.js +2 -0
- package/lib/commonjs/specs/QuantityTypeModule.nitro.js +2 -0
- package/lib/commonjs/specs/SourceProxy.nitro.js +2 -0
- package/lib/commonjs/specs/StateOfMindModule.nitro.js +2 -0
- package/lib/commonjs/specs/WorkoutProxy.nitro.js +2 -0
- package/lib/commonjs/specs/WorkoutSessionModule.nitro.js +19 -0
- package/lib/commonjs/specs/WorkoutsModule.nitro.js +2 -0
- package/lib/commonjs/types/Auth.js +21 -0
- package/lib/commonjs/types/Background.js +13 -0
- package/lib/commonjs/types/CategoryType.js +101 -0
- package/lib/commonjs/types/CategoryTypeIdentifier.js +2 -0
- package/lib/commonjs/types/Characteristics.js +48 -0
- package/lib/commonjs/types/Constants.js +23 -0
- package/lib/commonjs/types/CorrelationType.js +2 -0
- package/lib/commonjs/types/Device.js +2 -0
- package/lib/commonjs/types/HeartbeatSeries.js +2 -0
- package/lib/commonjs/types/InterfaceVerification.js +24 -0
- package/lib/commonjs/types/InterfaceVerificationExample.js +33 -0
- package/lib/commonjs/types/QuantitySample.js +2 -0
- package/lib/commonjs/types/QuantityType.js +17 -0
- package/lib/commonjs/types/QuantityTypeIdentifier.js +2 -0
- package/lib/commonjs/types/QueryOptions.js +2 -0
- package/lib/commonjs/types/Shared.js +13 -0
- package/lib/commonjs/types/Source.js +2 -0
- package/lib/commonjs/types/StateOfMind.js +90 -0
- package/lib/commonjs/types/Subscriptons.js +2 -0
- package/lib/commonjs/types/Units.js +2 -0
- package/lib/commonjs/types/WeatherCondition.js +35 -0
- package/lib/commonjs/types/WorkoutKit.js +12 -0
- package/lib/commonjs/types/Workouts.js +150 -0
- package/lib/commonjs/utils/getCategorySampleById.js +12 -0
- package/lib/commonjs/utils/getMostRecentCategorySample.js +12 -0
- package/lib/commonjs/utils/getMostRecentQuantitySample.js +11 -0
- package/lib/commonjs/utils/getMostRecentWorkout.js +13 -0
- package/lib/commonjs/utils/getPreferredUnit.js +12 -0
- package/lib/commonjs/utils/getQuantitySampleById.js +14 -0
- package/lib/commonjs/utils/getWorkoutById.js +15 -0
- package/lib/commonjs/utils/subscribeToChanges.js +11 -0
- package/lib/module/hooks/useCategorySampleById.js +30 -0
- package/lib/module/hooks/useHealthkitAuthorization.js +30 -0
- package/lib/module/hooks/useIsHealthDataAvailable.js +19 -0
- package/lib/module/hooks/useMostRecentCategorySample.js +15 -0
- package/lib/module/hooks/useMostRecentQuantitySample.js +16 -0
- package/lib/module/hooks/useMostRecentWorkout.js +25 -0
- package/lib/module/hooks/useQuantitySampleById.js +28 -0
- package/lib/module/hooks/useSources.js +14 -0
- package/lib/module/hooks/useStatisticsForQuantity.js +20 -0
- package/lib/module/hooks/useSubscribeToChanges.js +17 -0
- package/lib/module/hooks/useWorkoutById.js +40 -0
- package/lib/module/index.ios.js +126 -0
- package/lib/module/index.js +202 -0
- package/lib/module/modules.js +9 -0
- package/lib/module/specs/CategoryTypeModule.nitro.js +4 -0
- package/lib/module/specs/CharacteristicTypeModule.nitro.js +1 -0
- package/lib/module/specs/CoreModule.nitro.js +1 -0
- package/lib/module/specs/CorrelationTypeModule.nitro.js +1 -0
- package/lib/module/specs/HeartbeatSeriesModule.nitro.js +1 -0
- package/lib/module/specs/QuantityTypeModule.nitro.js +1 -0
- package/lib/module/specs/SourceProxy.nitro.js +1 -0
- package/lib/module/specs/StateOfMindModule.nitro.js +1 -0
- package/lib/module/specs/WorkoutProxy.nitro.js +1 -0
- package/lib/module/specs/WorkoutSessionModule.nitro.js +16 -0
- package/lib/module/specs/WorkoutsModule.nitro.js +1 -0
- package/lib/module/types/Auth.js +18 -0
- package/lib/module/types/Background.js +10 -0
- package/lib/module/types/CategoryType.js +98 -0
- package/lib/module/types/CategoryTypeIdentifier.js +1 -0
- package/lib/module/types/Characteristics.js +45 -0
- package/lib/module/types/Constants.js +20 -0
- package/lib/module/types/CorrelationType.js +1 -0
- package/lib/module/types/Device.js +1 -0
- package/lib/module/types/HeartbeatSeries.js +1 -0
- package/lib/module/types/InterfaceVerification.js +23 -0
- package/lib/module/types/InterfaceVerificationExample.js +32 -0
- package/lib/module/types/QuantitySample.js +1 -0
- package/lib/module/types/QuantityType.js +14 -0
- package/lib/module/types/QuantityTypeIdentifier.js +1 -0
- package/lib/module/types/QueryOptions.js +1 -0
- package/lib/module/types/Shared.js +10 -0
- package/lib/module/types/Source.js +1 -0
- package/lib/module/types/StateOfMind.js +87 -0
- package/lib/module/types/Subscriptons.js +1 -0
- package/lib/module/types/Units.js +1 -0
- package/lib/module/types/WeatherCondition.js +32 -0
- package/lib/module/types/WorkoutKit.js +9 -0
- package/lib/module/types/Workouts.js +147 -0
- package/lib/module/utils/getCategorySampleById.js +9 -0
- package/lib/module/utils/getMostRecentCategorySample.js +9 -0
- package/lib/module/utils/getMostRecentQuantitySample.js +9 -0
- package/lib/module/utils/getMostRecentWorkout.js +11 -0
- package/lib/module/utils/getPreferredUnit.js +10 -0
- package/lib/module/utils/getQuantitySampleById.js +12 -0
- package/lib/module/utils/getWorkoutById.js +13 -0
- package/lib/module/utils/subscribeToChanges.js +7 -0
- package/lib/typescript/hooks/useCategorySampleById.d.ts +11 -0
- package/lib/typescript/hooks/useHealthkitAuthorization.d.ts +9 -0
- package/lib/typescript/hooks/useIsHealthDataAvailable.d.ts +7 -0
- package/lib/typescript/hooks/useMostRecentCategorySample.d.ts +7 -0
- package/lib/typescript/hooks/useMostRecentQuantitySample.d.ts +7 -0
- package/lib/typescript/hooks/useMostRecentWorkout.d.ts +9 -0
- package/lib/typescript/hooks/useQuantitySampleById.d.ts +14 -0
- package/lib/typescript/hooks/useSources.d.ts +4 -0
- package/lib/typescript/hooks/useStatisticsForQuantity.d.ts +4 -0
- package/lib/typescript/hooks/useSubscribeToChanges.d.ts +4 -0
- package/lib/typescript/hooks/useWorkoutById.d.ts +13 -0
- package/lib/typescript/index.d.ts +74 -0
- package/lib/typescript/index.ios.d.ts +142 -0
- package/lib/typescript/modules.d.ts +16 -0
- package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +16 -0
- package/lib/typescript/specs/CharacteristicTypeModule.nitro.d.ts +16 -0
- package/lib/typescript/specs/CoreModule.nitro.d.ts +60 -0
- package/lib/typescript/specs/CorrelationTypeModule.nitro.d.ts +8 -0
- package/lib/typescript/specs/HeartbeatSeriesModule.nitro.d.ts +9 -0
- package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +16 -0
- package/lib/typescript/specs/SourceProxy.nitro.d.ts +14 -0
- package/lib/typescript/specs/StateOfMindModule.nitro.d.ts +9 -0
- package/lib/typescript/specs/WorkoutProxy.nitro.d.ts +10 -0
- package/lib/typescript/specs/WorkoutSessionModule.nitro.d.ts +47 -0
- package/lib/typescript/specs/WorkoutsModule.nitro.d.ts +13 -0
- package/lib/typescript/types/Auth.d.ts +16 -0
- package/lib/typescript/types/Background.d.ts +9 -0
- package/lib/typescript/types/CategoryType.d.ts +144 -0
- package/lib/typescript/types/CategoryTypeIdentifier.d.ts +31 -0
- package/lib/typescript/types/Characteristics.d.ts +41 -0
- package/lib/typescript/types/Constants.d.ts +20 -0
- package/lib/typescript/types/CorrelationType.d.ts +21 -0
- package/lib/typescript/types/Device.d.ts +13 -0
- package/lib/typescript/types/HeartbeatSeries.d.ts +25 -0
- package/lib/typescript/types/InterfaceVerification.d.ts +73 -0
- package/lib/typescript/types/InterfaceVerificationExample.d.ts +58 -0
- package/lib/typescript/types/QuantitySample.d.ts +27 -0
- package/lib/typescript/types/QuantityType.d.ts +63 -0
- package/lib/typescript/types/QuantityTypeIdentifier.d.ts +659 -0
- package/lib/typescript/types/QueryOptions.d.ts +47 -0
- package/lib/typescript/types/Shared.d.ts +39 -0
- package/lib/typescript/types/Source.d.ts +10 -0
- package/lib/typescript/types/StateOfMind.d.ts +103 -0
- package/lib/typescript/types/Subscriptons.d.ts +8 -0
- package/lib/typescript/types/Units.d.ts +97 -0
- package/lib/typescript/types/WeatherCondition.d.ts +30 -0
- package/lib/typescript/types/WorkoutKit.d.ts +16 -0
- package/lib/typescript/types/Workouts.d.ts +254 -0
- package/lib/typescript/utils/getCategorySampleById.d.ts +3 -0
- package/lib/typescript/utils/getMostRecentCategorySample.d.ts +3 -0
- package/lib/typescript/utils/getMostRecentQuantitySample.d.ts +3 -0
- package/lib/typescript/utils/getMostRecentWorkout.d.ts +3 -0
- package/lib/typescript/utils/getPreferredUnit.d.ts +3 -0
- package/lib/typescript/utils/getQuantitySampleById.d.ts +3 -0
- package/lib/typescript/utils/getWorkoutById.d.ts +3 -0
- package/lib/typescript/utils/subscribeToChanges.d.ts +5 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit+autolinking.rb +60 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +450 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +2570 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +326 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +89 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +130 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +146 -0
- package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +155 -0
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +300 -0
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +120 -0
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +138 -0
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +196 -0
- package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.hpp +77 -0
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +138 -0
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +196 -0
- package/nitrogen/generated/ios/c++/HybridWorkoutSessionModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridWorkoutSessionModuleSpecSwift.hpp +107 -0
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +172 -0
- package/nitrogen/generated/ios/swift/AuthorizationRequestStatus.swift +44 -0
- package/nitrogen/generated/ios/swift/AuthorizationStatus.swift +44 -0
- package/nitrogen/generated/ios/swift/BiologicalSex.swift +48 -0
- package/nitrogen/generated/ios/swift/BloodType.swift +68 -0
- package/nitrogen/generated/ios/swift/CategorySample.swift +148 -0
- package/nitrogen/generated/ios/swift/CategorySampleForSaving.swift +108 -0
- package/nitrogen/generated/ios/swift/CategorySamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +288 -0
- package/nitrogen/generated/ios/swift/ComparisonPredicateOperator.swift +88 -0
- package/nitrogen/generated/ios/swift/CorrelationObject.swift +16 -0
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +117 -0
- package/nitrogen/generated/ios/swift/CorrelationTypeIdentifier.swift +40 -0
- package/nitrogen/generated/ios/swift/DeletedSample.swift +64 -0
- package/nitrogen/generated/ios/swift/Device.swift +256 -0
- package/nitrogen/generated/ios/swift/FilterForSamples.swift +21 -0
- package/nitrogen/generated/ios/swift/FilterForSamplesAnd.swift +94 -0
- package/nitrogen/generated/ios/swift/FilterForSamplesOr.swift +94 -0
- package/nitrogen/generated/ios/swift/FitzpatrickSkinType.swift +60 -0
- package/nitrogen/generated/ios/swift/Func_void_AuthorizationRequestStatus.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BiologicalSex.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BloodType.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_CategorySamplesWithAnchorResponse.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_FitzpatrickSkinType.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_HeartbeatSeriesSamplesWithAnchorResponse.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_OnChangeCallbackArgs.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_QuantitySamplesWithAnchorResponse.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryStatisticsResponse.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryWorkoutSamplesWithAnchorResponse.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_WheelchairUse.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_WorkoutEventType.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_WorkoutSessionState_WorkoutSessionState_std__chrono__system_clock__time_point.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__chrono__system_clock__time_point.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_WorkoutPlan_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__bool_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_CategorySample_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_CorrelationSample_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_HeartbeatSeriesSample_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_IdentifierWithUnit_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_QuantitySample_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_QueryStatisticsResponse_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_RemoteSessionSharableData_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_StateOfMindSample_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_WorkoutRoute_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridSourceProxySpec__.swift +50 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_margelo__nitro__healthkit__HybridWorkoutProxySpec__.swift +50 -0
- package/nitrogen/generated/ios/swift/Heartbeat.swift +46 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +167 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +50 -0
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +171 -0
- package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +257 -0
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +69 -0
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +523 -0
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +49 -0
- package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +158 -0
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +49 -0
- package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +152 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +54 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +285 -0
- package/nitrogen/generated/ios/swift/HybridSourceProxySpec.swift +48 -0
- package/nitrogen/generated/ios/swift/HybridSourceProxySpec_cxx.swift +125 -0
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +49 -0
- package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +158 -0
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +64 -0
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +351 -0
- package/nitrogen/generated/ios/swift/HybridWorkoutSessionModuleSpec.swift +49 -0
- package/nitrogen/generated/ios/swift/HybridWorkoutSessionModuleSpec_cxx.swift +133 -0
- package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec.swift +51 -0
- package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec_cxx.swift +187 -0
- package/nitrogen/generated/ios/swift/IdentifierWithUnit.swift +46 -0
- package/nitrogen/generated/ios/swift/IntervalComponents.swift +139 -0
- package/nitrogen/generated/ios/swift/LocationForSaving.swift +112 -0
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +820 -0
- package/nitrogen/generated/ios/swift/OnChangeCallbackArgs.swift +64 -0
- package/nitrogen/generated/ios/swift/PredicateForSamples.swift +19 -0
- package/nitrogen/generated/ios/swift/PredicateForWorkouts.swift +21 -0
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsAnd.swift +108 -0
- package/nitrogen/generated/ios/swift/PredicateForWorkoutsOr.swift +108 -0
- package/nitrogen/generated/ios/swift/PredicateFromWorkout.swift +45 -0
- package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +35 -0
- package/nitrogen/generated/ios/swift/PredicateWithStartAndEnd.swift +128 -0
- package/nitrogen/generated/ios/swift/PredicateWithUUID.swift +35 -0
- package/nitrogen/generated/ios/swift/PredicateWithUUIDs.swift +47 -0
- package/nitrogen/generated/ios/swift/Quantity.swift +46 -0
- package/nitrogen/generated/ios/swift/QuantityDateInterval.swift +46 -0
- package/nitrogen/generated/ios/swift/QuantitySample.swift +159 -0
- package/nitrogen/generated/ios/swift/QuantitySampleForSaving.swift +119 -0
- package/nitrogen/generated/ios/swift/QuantitySamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +508 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchor.swift +166 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithAnchorAndUnit.swift +195 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +160 -0
- package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +189 -0
- package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +227 -0
- package/nitrogen/generated/ios/swift/QueryWorkoutSamplesWithAnchorResponse.swift +91 -0
- package/nitrogen/generated/ios/swift/RemoteSessionSharableData.swift +46 -0
- package/nitrogen/generated/ios/swift/SampleForSaving.swift +16 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +792 -0
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +772 -0
- package/nitrogen/generated/ios/swift/Source.swift +46 -0
- package/nitrogen/generated/ios/swift/SourceRevision.swift +150 -0
- package/nitrogen/generated/ios/swift/StateOfMindAssociation.swift +104 -0
- package/nitrogen/generated/ios/swift/StateOfMindKind.swift +40 -0
- package/nitrogen/generated/ios/swift/StateOfMindLabel.swift +184 -0
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +223 -0
- package/nitrogen/generated/ios/swift/StateOfMindValenceClassification.swift +60 -0
- package/nitrogen/generated/ios/swift/StatisticsOptions.swift +60 -0
- package/nitrogen/generated/ios/swift/StatisticsQueryOptions.swift +129 -0
- package/nitrogen/generated/ios/swift/UpdateFrequency.swift +48 -0
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout.swift +19 -0
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_FilterForSamplesAnd_FilterForSamplesOr.swift +21 -0
- package/nitrogen/generated/ios/swift/Variant_PredicateWithUUID_PredicateWithUUIDs_PredicateWithMetadataKey_PredicateWithStartAndEnd_PredicateFromWorkout_WorkoutActivityTypePredicate_WorkoutDurationPredicate_PredicateForWorkoutsOr_PredicateForWorkoutsAnd.swift +23 -0
- package/nitrogen/generated/ios/swift/WheelchairUse.swift +44 -0
- package/nitrogen/generated/ios/swift/WorkoutActivity.swift +68 -0
- package/nitrogen/generated/ios/swift/WorkoutActivityType.swift +368 -0
- package/nitrogen/generated/ios/swift/WorkoutActivityTypePredicate.swift +35 -0
- package/nitrogen/generated/ios/swift/WorkoutConfiguration.swift +58 -0
- package/nitrogen/generated/ios/swift/WorkoutDurationPredicate.swift +46 -0
- package/nitrogen/generated/ios/swift/WorkoutEvent.swift +57 -0
- package/nitrogen/generated/ios/swift/WorkoutEventType.swift +64 -0
- package/nitrogen/generated/ios/swift/WorkoutPlan.swift +46 -0
- package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +232 -0
- package/nitrogen/generated/ios/swift/WorkoutQueryOptionsWithAnchor.swift +238 -0
- package/nitrogen/generated/ios/swift/WorkoutRoute.swift +99 -0
- package/nitrogen/generated/ios/swift/WorkoutRouteLocation.swift +146 -0
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +364 -0
- package/nitrogen/generated/ios/swift/WorkoutSessionLocationType.swift +44 -0
- package/nitrogen/generated/ios/swift/WorkoutSessionMirroringStartHandlerOptions.swift +118 -0
- package/nitrogen/generated/ios/swift/WorkoutSessionState.swift +56 -0
- package/nitrogen/generated/ios/swift/WorkoutTotals.swift +70 -0
- package/nitrogen/generated/shared/c++/AuthorizationRequestStatus.hpp +65 -0
- package/nitrogen/generated/shared/c++/AuthorizationStatus.hpp +65 -0
- package/nitrogen/generated/shared/c++/BiologicalSex.hpp +66 -0
- package/nitrogen/generated/shared/c++/BloodType.hpp +71 -0
- package/nitrogen/generated/shared/c++/CategorySample.hpp +110 -0
- package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +98 -0
- package/nitrogen/generated/shared/c++/CategorySamplesWithAnchorResponse.hpp +83 -0
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +326 -0
- package/nitrogen/generated/shared/c++/ComparisonPredicateOperator.hpp +76 -0
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +98 -0
- package/nitrogen/generated/shared/c++/CorrelationTypeIdentifier.hpp +78 -0
- package/nitrogen/generated/shared/c++/DeletedSample.hpp +76 -0
- package/nitrogen/generated/shared/c++/Device.hpp +98 -0
- package/nitrogen/generated/shared/c++/FilterForSamplesAnd.hpp +84 -0
- package/nitrogen/generated/shared/c++/FilterForSamplesOr.hpp +84 -0
- package/nitrogen/generated/shared/c++/FitzpatrickSkinType.hpp +69 -0
- package/nitrogen/generated/shared/c++/Heartbeat.hpp +73 -0
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +107 -0
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSamplesWithAnchorResponse.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +84 -0
- package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.cpp +30 -0
- package/nitrogen/generated/shared/c++/HybridCharacteristicTypeModuleSpec.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +42 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +140 -0
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridHeartbeatSeriesModuleSpec.hpp +76 -0
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +123 -0
- package/nitrogen/generated/shared/c++/HybridSourceProxySpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridSourceProxySpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +38 -0
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +114 -0
- package/nitrogen/generated/shared/c++/HybridWorkoutSessionModuleSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridWorkoutSessionModuleSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.hpp +95 -0
- package/nitrogen/generated/shared/c++/IdentifierWithUnit.hpp +73 -0
- package/nitrogen/generated/shared/c++/IntervalComponents.hpp +85 -0
- package/nitrogen/generated/shared/c++/LocationForSaving.hpp +97 -0
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +858 -0
- package/nitrogen/generated/shared/c++/OnChangeCallbackArgs.hpp +76 -0
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsAnd.hpp +90 -0
- package/nitrogen/generated/shared/c++/PredicateForWorkoutsOr.hpp +90 -0
- package/nitrogen/generated/shared/c++/PredicateFromWorkout.hpp +71 -0
- package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +69 -0
- package/nitrogen/generated/shared/c++/PredicateWithStartAndEnd.hpp +82 -0
- package/nitrogen/generated/shared/c++/PredicateWithUUID.hpp +69 -0
- package/nitrogen/generated/shared/c++/PredicateWithUUIDs.hpp +70 -0
- package/nitrogen/generated/shared/c++/Quantity.hpp +73 -0
- package/nitrogen/generated/shared/c++/QuantityDateInterval.hpp +73 -0
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +114 -0
- package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +103 -0
- package/nitrogen/generated/shared/c++/QuantitySamplesWithAnchorResponse.hpp +83 -0
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +546 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchor.hpp +99 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithAnchorAndUnit.hpp +103 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrder.hpp +98 -0
- package/nitrogen/generated/shared/c++/QueryOptionsWithSortOrderAndUnit.hpp +103 -0
- package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +98 -0
- package/nitrogen/generated/shared/c++/QueryWorkoutSamplesWithAnchorResponse.hpp +84 -0
- package/nitrogen/generated/shared/c++/RemoteSessionSharableData.hpp +75 -0
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +830 -0
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +810 -0
- package/nitrogen/generated/shared/c++/Source.hpp +73 -0
- package/nitrogen/generated/shared/c++/SourceRevision.hpp +85 -0
- package/nitrogen/generated/shared/c++/StateOfMindAssociation.hpp +80 -0
- package/nitrogen/generated/shared/c++/StateOfMindKind.hpp +64 -0
- package/nitrogen/generated/shared/c++/StateOfMindLabel.hpp +100 -0
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +132 -0
- package/nitrogen/generated/shared/c++/StateOfMindValenceClassification.hpp +69 -0
- package/nitrogen/generated/shared/c++/StatisticsOptions.hpp +98 -0
- package/nitrogen/generated/shared/c++/StatisticsQueryOptions.hpp +89 -0
- package/nitrogen/generated/shared/c++/UpdateFrequency.hpp +66 -0
- package/nitrogen/generated/shared/c++/WheelchairUse.hpp +65 -0
- package/nitrogen/generated/shared/c++/WorkoutActivity.hpp +82 -0
- package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +146 -0
- package/nitrogen/generated/shared/c++/WorkoutActivityTypePredicate.hpp +70 -0
- package/nitrogen/generated/shared/c++/WorkoutConfiguration.hpp +78 -0
- package/nitrogen/generated/shared/c++/WorkoutDurationPredicate.hpp +74 -0
- package/nitrogen/generated/shared/c++/WorkoutEvent.hpp +79 -0
- package/nitrogen/generated/shared/c++/WorkoutEventType.hpp +70 -0
- package/nitrogen/generated/shared/c++/WorkoutPlan.hpp +75 -0
- package/nitrogen/generated/shared/c++/WorkoutQueryOptions.hpp +113 -0
- package/nitrogen/generated/shared/c++/WorkoutQueryOptionsWithAnchor.hpp +113 -0
- package/nitrogen/generated/shared/c++/WorkoutRoute.hpp +81 -0
- package/nitrogen/generated/shared/c++/WorkoutRouteLocation.hpp +106 -0
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +144 -0
- package/nitrogen/generated/shared/c++/WorkoutSessionLocationType.hpp +65 -0
- package/nitrogen/generated/shared/c++/WorkoutSessionMirroringStartHandlerOptions.hpp +92 -0
- package/nitrogen/generated/shared/c++/WorkoutSessionState.hpp +68 -0
- package/nitrogen/generated/shared/c++/WorkoutTotals.hpp +73 -0
- package/package.json +35 -12
- package/src/hooks/useCategorySampleById.ts +41 -0
- package/src/hooks/useQuantitySampleById.ts +44 -0
- package/src/hooks/useWorkoutById.ts +55 -0
- package/src/index.ios.ts +1 -9
- package/src/index.ts +4 -16
- package/src/utils/getCategorySampleById.ts +16 -0
- package/src/utils/getQuantitySampleById.ts +20 -0
- package/src/utils/getWorkoutById.ts +20 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridStateOfMindModuleSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridStateOfMindModuleSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridStateOfMindModuleSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace ReactNativeHealthkit { class HybridStateOfMindModuleSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `StateOfMindSample` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::healthkit { struct StateOfMindSample; }
|
|
17
|
+
// Forward declaration of `Device` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::healthkit { struct Device; }
|
|
19
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
20
|
+
namespace NitroModules { class AnyMap; }
|
|
21
|
+
// Forward declaration of `SourceRevision` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct SourceRevision; }
|
|
23
|
+
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
25
|
+
// Forward declaration of `StateOfMindKind` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { enum class StateOfMindKind; }
|
|
27
|
+
// Forward declaration of `StateOfMindValenceClassification` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::healthkit { enum class StateOfMindValenceClassification; }
|
|
29
|
+
// Forward declaration of `StateOfMindAssociation` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::healthkit { enum class StateOfMindAssociation; }
|
|
31
|
+
// Forward declaration of `StateOfMindLabel` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::healthkit { enum class StateOfMindLabel; }
|
|
33
|
+
// Forward declaration of `QueryOptionsWithSortOrder` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::healthkit { struct QueryOptionsWithSortOrder; }
|
|
35
|
+
// Forward declaration of `PredicateWithUUID` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
|
|
37
|
+
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
39
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
41
|
+
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
42
|
+
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
43
|
+
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
44
|
+
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
45
|
+
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
46
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
47
|
+
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
48
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
49
|
+
// Forward declaration of `HybridWorkoutProxySpec` to properly resolve imports.
|
|
50
|
+
namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
|
|
51
|
+
|
|
52
|
+
#include <NitroModules/Promise.hpp>
|
|
53
|
+
#include <vector>
|
|
54
|
+
#include "StateOfMindSample.hpp"
|
|
55
|
+
#include <string>
|
|
56
|
+
#include <optional>
|
|
57
|
+
#include "Device.hpp"
|
|
58
|
+
#include <chrono>
|
|
59
|
+
#include <NitroModules/AnyMap.hpp>
|
|
60
|
+
#include "SourceRevision.hpp"
|
|
61
|
+
#include <memory>
|
|
62
|
+
#include "HybridSourceProxySpec.hpp"
|
|
63
|
+
#include "StateOfMindKind.hpp"
|
|
64
|
+
#include "StateOfMindValenceClassification.hpp"
|
|
65
|
+
#include "StateOfMindAssociation.hpp"
|
|
66
|
+
#include "StateOfMindLabel.hpp"
|
|
67
|
+
#include "QueryOptionsWithSortOrder.hpp"
|
|
68
|
+
#include <variant>
|
|
69
|
+
#include "PredicateWithUUID.hpp"
|
|
70
|
+
#include "PredicateWithUUIDs.hpp"
|
|
71
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
72
|
+
#include "PredicateWithStartAndEnd.hpp"
|
|
73
|
+
#include "PredicateFromWorkout.hpp"
|
|
74
|
+
#include "FilterForSamplesAnd.hpp"
|
|
75
|
+
#include "FilterForSamplesOr.hpp"
|
|
76
|
+
#include "HybridWorkoutProxySpec.hpp"
|
|
77
|
+
|
|
78
|
+
#include "ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp"
|
|
79
|
+
|
|
80
|
+
namespace margelo::nitro::healthkit {
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The C++ part of HybridStateOfMindModuleSpec_cxx.swift.
|
|
84
|
+
*
|
|
85
|
+
* HybridStateOfMindModuleSpecSwift (C++) accesses HybridStateOfMindModuleSpec_cxx (Swift), and might
|
|
86
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
87
|
+
*
|
|
88
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
89
|
+
* the future, HybridStateOfMindModuleSpec_cxx can directly inherit from the C++ class HybridStateOfMindModuleSpec
|
|
90
|
+
* to simplify the whole structure and memory management.
|
|
91
|
+
*/
|
|
92
|
+
class HybridStateOfMindModuleSpecSwift: public virtual HybridStateOfMindModuleSpec {
|
|
93
|
+
public:
|
|
94
|
+
// Constructor from a Swift instance
|
|
95
|
+
explicit HybridStateOfMindModuleSpecSwift(const ReactNativeHealthkit::HybridStateOfMindModuleSpec_cxx& swiftPart):
|
|
96
|
+
HybridObject(HybridStateOfMindModuleSpec::TAG),
|
|
97
|
+
_swiftPart(swiftPart) { }
|
|
98
|
+
|
|
99
|
+
public:
|
|
100
|
+
// Get the Swift part
|
|
101
|
+
inline ReactNativeHealthkit::HybridStateOfMindModuleSpec_cxx& getSwiftPart() noexcept {
|
|
102
|
+
return _swiftPart;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public:
|
|
106
|
+
// Get memory pressure
|
|
107
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
108
|
+
return _swiftPart.getMemorySize();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public:
|
|
112
|
+
// Properties
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
public:
|
|
116
|
+
// Methods
|
|
117
|
+
inline std::shared_ptr<Promise<std::vector<StateOfMindSample>>> queryStateOfMindSamples(const std::optional<QueryOptionsWithSortOrder>& options) override {
|
|
118
|
+
auto __result = _swiftPart.queryStateOfMindSamples(options);
|
|
119
|
+
if (__result.hasError()) [[unlikely]] {
|
|
120
|
+
std::rethrow_exception(__result.error());
|
|
121
|
+
}
|
|
122
|
+
auto __value = std::move(__result.value());
|
|
123
|
+
return __value;
|
|
124
|
+
}
|
|
125
|
+
inline std::shared_ptr<Promise<bool>> saveStateOfMindSample(std::chrono::system_clock::time_point date, StateOfMindKind kind, double valence, const std::vector<StateOfMindLabel>& labels, const std::vector<StateOfMindAssociation>& associations, const std::optional<std::shared_ptr<AnyMap>>& metadata) override {
|
|
126
|
+
auto __result = _swiftPart.saveStateOfMindSample(date, static_cast<int>(kind), std::forward<decltype(valence)>(valence), labels, associations, metadata);
|
|
127
|
+
if (__result.hasError()) [[unlikely]] {
|
|
128
|
+
std::rethrow_exception(__result.error());
|
|
129
|
+
}
|
|
130
|
+
auto __value = std::move(__result.value());
|
|
131
|
+
return __value;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
private:
|
|
135
|
+
ReactNativeHealthkit::HybridStateOfMindModuleSpec_cxx _swiftPart;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridWorkoutProxySpecSwift.cpp
|
|
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
|
+
#include "HybridWorkoutProxySpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::healthkit {
|
|
11
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridWorkoutProxySpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridWorkoutProxySpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridWorkoutProxySpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace ReactNativeHealthkit { class HybridWorkoutProxySpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `Device` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::healthkit { struct Device; }
|
|
17
|
+
// Forward declaration of `WorkoutActivityType` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::healthkit { enum class WorkoutActivityType; }
|
|
19
|
+
// Forward declaration of `Quantity` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::healthkit { struct Quantity; }
|
|
21
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
22
|
+
namespace NitroModules { class AnyMap; }
|
|
23
|
+
// Forward declaration of `SourceRevision` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct SourceRevision; }
|
|
25
|
+
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
27
|
+
// Forward declaration of `WorkoutEvent` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::healthkit { struct WorkoutEvent; }
|
|
29
|
+
// Forward declaration of `WorkoutEventType` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::healthkit { enum class WorkoutEventType; }
|
|
31
|
+
// Forward declaration of `WorkoutActivity` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::healthkit { struct WorkoutActivity; }
|
|
33
|
+
// Forward declaration of `WorkoutSample` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::healthkit { struct WorkoutSample; }
|
|
35
|
+
// Forward declaration of `LocationForSaving` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::healthkit { struct LocationForSaving; }
|
|
37
|
+
// Forward declaration of `WorkoutPlan` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::healthkit { struct WorkoutPlan; }
|
|
39
|
+
// Forward declaration of `WorkoutRoute` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::healthkit { struct WorkoutRoute; }
|
|
41
|
+
// Forward declaration of `WorkoutRouteLocation` to properly resolve imports.
|
|
42
|
+
namespace margelo::nitro::healthkit { struct WorkoutRouteLocation; }
|
|
43
|
+
|
|
44
|
+
#include <string>
|
|
45
|
+
#include <optional>
|
|
46
|
+
#include "Device.hpp"
|
|
47
|
+
#include "WorkoutActivityType.hpp"
|
|
48
|
+
#include "Quantity.hpp"
|
|
49
|
+
#include <chrono>
|
|
50
|
+
#include <NitroModules/AnyMap.hpp>
|
|
51
|
+
#include "SourceRevision.hpp"
|
|
52
|
+
#include <memory>
|
|
53
|
+
#include "HybridSourceProxySpec.hpp"
|
|
54
|
+
#include <vector>
|
|
55
|
+
#include "WorkoutEvent.hpp"
|
|
56
|
+
#include "WorkoutEventType.hpp"
|
|
57
|
+
#include "WorkoutActivity.hpp"
|
|
58
|
+
#include "WorkoutSample.hpp"
|
|
59
|
+
#include <NitroModules/Promise.hpp>
|
|
60
|
+
#include "LocationForSaving.hpp"
|
|
61
|
+
#include "WorkoutPlan.hpp"
|
|
62
|
+
#include "WorkoutRoute.hpp"
|
|
63
|
+
#include "WorkoutRouteLocation.hpp"
|
|
64
|
+
|
|
65
|
+
#include "ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp"
|
|
66
|
+
|
|
67
|
+
namespace margelo::nitro::healthkit {
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The C++ part of HybridWorkoutProxySpec_cxx.swift.
|
|
71
|
+
*
|
|
72
|
+
* HybridWorkoutProxySpecSwift (C++) accesses HybridWorkoutProxySpec_cxx (Swift), and might
|
|
73
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
74
|
+
*
|
|
75
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
76
|
+
* the future, HybridWorkoutProxySpec_cxx can directly inherit from the C++ class HybridWorkoutProxySpec
|
|
77
|
+
* to simplify the whole structure and memory management.
|
|
78
|
+
*/
|
|
79
|
+
class HybridWorkoutProxySpecSwift: public virtual HybridWorkoutProxySpec {
|
|
80
|
+
public:
|
|
81
|
+
// Constructor from a Swift instance
|
|
82
|
+
explicit HybridWorkoutProxySpecSwift(const ReactNativeHealthkit::HybridWorkoutProxySpec_cxx& swiftPart):
|
|
83
|
+
HybridObject(HybridWorkoutProxySpec::TAG),
|
|
84
|
+
_swiftPart(swiftPart) { }
|
|
85
|
+
|
|
86
|
+
public:
|
|
87
|
+
// Get the Swift part
|
|
88
|
+
inline ReactNativeHealthkit::HybridWorkoutProxySpec_cxx& getSwiftPart() noexcept {
|
|
89
|
+
return _swiftPart;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public:
|
|
93
|
+
// Get memory pressure
|
|
94
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
95
|
+
return _swiftPart.getMemorySize();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public:
|
|
99
|
+
// Properties
|
|
100
|
+
inline std::string getUuid() noexcept override {
|
|
101
|
+
auto __result = _swiftPart.getUuid();
|
|
102
|
+
return __result;
|
|
103
|
+
}
|
|
104
|
+
inline std::optional<Device> getDevice() noexcept override {
|
|
105
|
+
auto __result = _swiftPart.getDevice();
|
|
106
|
+
return __result;
|
|
107
|
+
}
|
|
108
|
+
inline WorkoutActivityType getWorkoutActivityType() noexcept override {
|
|
109
|
+
auto __result = _swiftPart.getWorkoutActivityType();
|
|
110
|
+
return static_cast<WorkoutActivityType>(__result);
|
|
111
|
+
}
|
|
112
|
+
inline Quantity getDuration() noexcept override {
|
|
113
|
+
auto __result = _swiftPart.getDuration();
|
|
114
|
+
return __result;
|
|
115
|
+
}
|
|
116
|
+
inline std::optional<Quantity> getTotalDistance() noexcept override {
|
|
117
|
+
auto __result = _swiftPart.getTotalDistance();
|
|
118
|
+
return __result;
|
|
119
|
+
}
|
|
120
|
+
inline std::optional<Quantity> getTotalEnergyBurned() noexcept override {
|
|
121
|
+
auto __result = _swiftPart.getTotalEnergyBurned();
|
|
122
|
+
return __result;
|
|
123
|
+
}
|
|
124
|
+
inline std::optional<Quantity> getTotalSwimmingStrokeCount() noexcept override {
|
|
125
|
+
auto __result = _swiftPart.getTotalSwimmingStrokeCount();
|
|
126
|
+
return __result;
|
|
127
|
+
}
|
|
128
|
+
inline std::optional<Quantity> getTotalFlightsClimbed() noexcept override {
|
|
129
|
+
auto __result = _swiftPart.getTotalFlightsClimbed();
|
|
130
|
+
return __result;
|
|
131
|
+
}
|
|
132
|
+
inline std::chrono::system_clock::time_point getStartDate() noexcept override {
|
|
133
|
+
auto __result = _swiftPart.getStartDate();
|
|
134
|
+
return __result;
|
|
135
|
+
}
|
|
136
|
+
inline std::chrono::system_clock::time_point getEndDate() noexcept override {
|
|
137
|
+
auto __result = _swiftPart.getEndDate();
|
|
138
|
+
return __result;
|
|
139
|
+
}
|
|
140
|
+
inline std::optional<std::shared_ptr<AnyMap>> getMetadata() noexcept override {
|
|
141
|
+
auto __result = _swiftPart.getMetadata();
|
|
142
|
+
return __result;
|
|
143
|
+
}
|
|
144
|
+
inline std::optional<SourceRevision> getSourceRevision() noexcept override {
|
|
145
|
+
auto __result = _swiftPart.getSourceRevision();
|
|
146
|
+
return __result;
|
|
147
|
+
}
|
|
148
|
+
inline std::optional<std::vector<WorkoutEvent>> getEvents() noexcept override {
|
|
149
|
+
auto __result = _swiftPart.getEvents();
|
|
150
|
+
return __result;
|
|
151
|
+
}
|
|
152
|
+
inline std::optional<std::vector<WorkoutActivity>> getActivities() noexcept override {
|
|
153
|
+
auto __result = _swiftPart.getActivities();
|
|
154
|
+
return __result;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public:
|
|
158
|
+
// Methods
|
|
159
|
+
inline WorkoutSample toJSON(const std::optional<std::string>& key) override {
|
|
160
|
+
auto __result = _swiftPart.toJSON(key);
|
|
161
|
+
if (__result.hasError()) [[unlikely]] {
|
|
162
|
+
std::rethrow_exception(__result.error());
|
|
163
|
+
}
|
|
164
|
+
auto __value = std::move(__result.value());
|
|
165
|
+
return __value;
|
|
166
|
+
}
|
|
167
|
+
inline std::shared_ptr<Promise<bool>> saveWorkoutRoute(const std::vector<LocationForSaving>& locations) override {
|
|
168
|
+
auto __result = _swiftPart.saveWorkoutRoute(locations);
|
|
169
|
+
if (__result.hasError()) [[unlikely]] {
|
|
170
|
+
std::rethrow_exception(__result.error());
|
|
171
|
+
}
|
|
172
|
+
auto __value = std::move(__result.value());
|
|
173
|
+
return __value;
|
|
174
|
+
}
|
|
175
|
+
inline std::shared_ptr<Promise<std::optional<WorkoutPlan>>> getWorkoutPlan() override {
|
|
176
|
+
auto __result = _swiftPart.getWorkoutPlan();
|
|
177
|
+
if (__result.hasError()) [[unlikely]] {
|
|
178
|
+
std::rethrow_exception(__result.error());
|
|
179
|
+
}
|
|
180
|
+
auto __value = std::move(__result.value());
|
|
181
|
+
return __value;
|
|
182
|
+
}
|
|
183
|
+
inline std::shared_ptr<Promise<std::vector<WorkoutRoute>>> getWorkoutRoutes() override {
|
|
184
|
+
auto __result = _swiftPart.getWorkoutRoutes();
|
|
185
|
+
if (__result.hasError()) [[unlikely]] {
|
|
186
|
+
std::rethrow_exception(__result.error());
|
|
187
|
+
}
|
|
188
|
+
auto __value = std::move(__result.value());
|
|
189
|
+
return __value;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
private:
|
|
193
|
+
ReactNativeHealthkit::HybridWorkoutProxySpec_cxx _swiftPart;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridWorkoutSessionModuleSpecSwift.cpp
|
|
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
|
+
#include "HybridWorkoutSessionModuleSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::healthkit {
|
|
11
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridWorkoutSessionModuleSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridWorkoutSessionModuleSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridWorkoutSessionModuleSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace ReactNativeHealthkit { class HybridWorkoutSessionModuleSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `WorkoutConfiguration` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::healthkit { struct WorkoutConfiguration; }
|
|
17
|
+
// Forward declaration of `WorkoutActivityType` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::healthkit { enum class WorkoutActivityType; }
|
|
19
|
+
// Forward declaration of `WorkoutSessionLocationType` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::healthkit { enum class WorkoutSessionLocationType; }
|
|
21
|
+
// Forward declaration of `WorkoutSessionMirroringStartHandlerOptions` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct WorkoutSessionMirroringStartHandlerOptions; }
|
|
23
|
+
// Forward declaration of `WorkoutSessionState` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { enum class WorkoutSessionState; }
|
|
25
|
+
// Forward declaration of `RemoteSessionSharableData` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { struct RemoteSessionSharableData; }
|
|
27
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
28
|
+
namespace NitroModules { class AnyMap; }
|
|
29
|
+
// Forward declaration of `WorkoutEventType` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::healthkit { enum class WorkoutEventType; }
|
|
31
|
+
|
|
32
|
+
#include <NitroModules/Promise.hpp>
|
|
33
|
+
#include "WorkoutConfiguration.hpp"
|
|
34
|
+
#include "WorkoutActivityType.hpp"
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include "WorkoutSessionLocationType.hpp"
|
|
37
|
+
#include "WorkoutSessionMirroringStartHandlerOptions.hpp"
|
|
38
|
+
#include <functional>
|
|
39
|
+
#include <string>
|
|
40
|
+
#include "WorkoutSessionState.hpp"
|
|
41
|
+
#include <chrono>
|
|
42
|
+
#include <vector>
|
|
43
|
+
#include "RemoteSessionSharableData.hpp"
|
|
44
|
+
#include <NitroModules/AnyMap.hpp>
|
|
45
|
+
#include "WorkoutEventType.hpp"
|
|
46
|
+
|
|
47
|
+
#include "ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp"
|
|
48
|
+
|
|
49
|
+
namespace margelo::nitro::healthkit {
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The C++ part of HybridWorkoutSessionModuleSpec_cxx.swift.
|
|
53
|
+
*
|
|
54
|
+
* HybridWorkoutSessionModuleSpecSwift (C++) accesses HybridWorkoutSessionModuleSpec_cxx (Swift), and might
|
|
55
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
56
|
+
*
|
|
57
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
58
|
+
* the future, HybridWorkoutSessionModuleSpec_cxx can directly inherit from the C++ class HybridWorkoutSessionModuleSpec
|
|
59
|
+
* to simplify the whole structure and memory management.
|
|
60
|
+
*/
|
|
61
|
+
class HybridWorkoutSessionModuleSpecSwift: public virtual HybridWorkoutSessionModuleSpec {
|
|
62
|
+
public:
|
|
63
|
+
// Constructor from a Swift instance
|
|
64
|
+
explicit HybridWorkoutSessionModuleSpecSwift(const ReactNativeHealthkit::HybridWorkoutSessionModuleSpec_cxx& swiftPart):
|
|
65
|
+
HybridObject(HybridWorkoutSessionModuleSpec::TAG),
|
|
66
|
+
_swiftPart(swiftPart) { }
|
|
67
|
+
|
|
68
|
+
public:
|
|
69
|
+
// Get the Swift part
|
|
70
|
+
inline ReactNativeHealthkit::HybridWorkoutSessionModuleSpec_cxx& getSwiftPart() noexcept {
|
|
71
|
+
return _swiftPart;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public:
|
|
75
|
+
// Get memory pressure
|
|
76
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
77
|
+
return _swiftPart.getMemorySize();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public:
|
|
81
|
+
// Properties
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
public:
|
|
85
|
+
// Methods
|
|
86
|
+
inline std::shared_ptr<Promise<bool>> startWatchAppWithWorkoutConfiguration(const WorkoutConfiguration& workoutConfiguration) override {
|
|
87
|
+
auto __result = _swiftPart.startWatchAppWithWorkoutConfiguration(workoutConfiguration);
|
|
88
|
+
if (__result.hasError()) [[unlikely]] {
|
|
89
|
+
std::rethrow_exception(__result.error());
|
|
90
|
+
}
|
|
91
|
+
auto __value = std::move(__result.value());
|
|
92
|
+
return __value;
|
|
93
|
+
}
|
|
94
|
+
inline bool workoutSessionMirroringStartHandler(const WorkoutSessionMirroringStartHandlerOptions& options) override {
|
|
95
|
+
auto __result = _swiftPart.workoutSessionMirroringStartHandler(options);
|
|
96
|
+
if (__result.hasError()) [[unlikely]] {
|
|
97
|
+
std::rethrow_exception(__result.error());
|
|
98
|
+
}
|
|
99
|
+
auto __value = std::move(__result.value());
|
|
100
|
+
return __value;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private:
|
|
104
|
+
ReactNativeHealthkit::HybridWorkoutSessionModuleSpec_cxx _swiftPart;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridWorkoutsModuleSpecSwift.cpp
|
|
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
|
+
#include "HybridWorkoutsModuleSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::healthkit {
|
|
11
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridWorkoutsModuleSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridWorkoutsModuleSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridWorkoutsModuleSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace ReactNativeHealthkit { class HybridWorkoutsModuleSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `WorkoutActivityType` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::healthkit { enum class WorkoutActivityType; }
|
|
17
|
+
// Forward declaration of `QuantitySampleForSaving` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::healthkit { struct QuantitySampleForSaving; }
|
|
19
|
+
// Forward declaration of `QuantityTypeIdentifier` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::healthkit { enum class QuantityTypeIdentifier; }
|
|
21
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
22
|
+
namespace NitroModules { class AnyMap; }
|
|
23
|
+
// Forward declaration of `SourceRevision` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct SourceRevision; }
|
|
25
|
+
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
27
|
+
// Forward declaration of `WorkoutTotals` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::healthkit { struct WorkoutTotals; }
|
|
29
|
+
// Forward declaration of `QueryWorkoutSamplesWithAnchorResponse` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::healthkit { struct QueryWorkoutSamplesWithAnchorResponse; }
|
|
31
|
+
// Forward declaration of `HybridWorkoutProxySpec` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
|
|
33
|
+
// Forward declaration of `DeletedSample` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::healthkit { struct DeletedSample; }
|
|
35
|
+
// Forward declaration of `WorkoutQueryOptionsWithAnchor` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::healthkit { struct WorkoutQueryOptionsWithAnchor; }
|
|
37
|
+
// Forward declaration of `PredicateWithUUID` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
|
|
39
|
+
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
41
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
42
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
43
|
+
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
44
|
+
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
45
|
+
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
46
|
+
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
47
|
+
// Forward declaration of `WorkoutActivityTypePredicate` to properly resolve imports.
|
|
48
|
+
namespace margelo::nitro::healthkit { struct WorkoutActivityTypePredicate; }
|
|
49
|
+
// Forward declaration of `WorkoutDurationPredicate` to properly resolve imports.
|
|
50
|
+
namespace margelo::nitro::healthkit { struct WorkoutDurationPredicate; }
|
|
51
|
+
// Forward declaration of `PredicateForWorkoutsOr` to properly resolve imports.
|
|
52
|
+
namespace margelo::nitro::healthkit { struct PredicateForWorkoutsOr; }
|
|
53
|
+
// Forward declaration of `PredicateForWorkoutsAnd` to properly resolve imports.
|
|
54
|
+
namespace margelo::nitro::healthkit { struct PredicateForWorkoutsAnd; }
|
|
55
|
+
// Forward declaration of `ComparisonPredicateOperator` to properly resolve imports.
|
|
56
|
+
namespace margelo::nitro::healthkit { enum class ComparisonPredicateOperator; }
|
|
57
|
+
// Forward declaration of `WorkoutQueryOptions` to properly resolve imports.
|
|
58
|
+
namespace margelo::nitro::healthkit { struct WorkoutQueryOptions; }
|
|
59
|
+
// Forward declaration of `WorkoutConfiguration` to properly resolve imports.
|
|
60
|
+
namespace margelo::nitro::healthkit { struct WorkoutConfiguration; }
|
|
61
|
+
// Forward declaration of `WorkoutSessionLocationType` to properly resolve imports.
|
|
62
|
+
namespace margelo::nitro::healthkit { enum class WorkoutSessionLocationType; }
|
|
63
|
+
|
|
64
|
+
#include <NitroModules/Promise.hpp>
|
|
65
|
+
#include <string>
|
|
66
|
+
#include "WorkoutActivityType.hpp"
|
|
67
|
+
#include <vector>
|
|
68
|
+
#include "QuantitySampleForSaving.hpp"
|
|
69
|
+
#include <chrono>
|
|
70
|
+
#include "QuantityTypeIdentifier.hpp"
|
|
71
|
+
#include <NitroModules/AnyMap.hpp>
|
|
72
|
+
#include <optional>
|
|
73
|
+
#include "SourceRevision.hpp"
|
|
74
|
+
#include <memory>
|
|
75
|
+
#include "HybridSourceProxySpec.hpp"
|
|
76
|
+
#include "WorkoutTotals.hpp"
|
|
77
|
+
#include "QueryWorkoutSamplesWithAnchorResponse.hpp"
|
|
78
|
+
#include "HybridWorkoutProxySpec.hpp"
|
|
79
|
+
#include "DeletedSample.hpp"
|
|
80
|
+
#include "WorkoutQueryOptionsWithAnchor.hpp"
|
|
81
|
+
#include <variant>
|
|
82
|
+
#include "PredicateWithUUID.hpp"
|
|
83
|
+
#include "PredicateWithUUIDs.hpp"
|
|
84
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
85
|
+
#include "PredicateWithStartAndEnd.hpp"
|
|
86
|
+
#include "PredicateFromWorkout.hpp"
|
|
87
|
+
#include "WorkoutActivityTypePredicate.hpp"
|
|
88
|
+
#include "WorkoutDurationPredicate.hpp"
|
|
89
|
+
#include "PredicateForWorkoutsOr.hpp"
|
|
90
|
+
#include "PredicateForWorkoutsAnd.hpp"
|
|
91
|
+
#include "ComparisonPredicateOperator.hpp"
|
|
92
|
+
#include "WorkoutQueryOptions.hpp"
|
|
93
|
+
#include "WorkoutConfiguration.hpp"
|
|
94
|
+
#include "WorkoutSessionLocationType.hpp"
|
|
95
|
+
|
|
96
|
+
#include "ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp"
|
|
97
|
+
|
|
98
|
+
namespace margelo::nitro::healthkit {
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The C++ part of HybridWorkoutsModuleSpec_cxx.swift.
|
|
102
|
+
*
|
|
103
|
+
* HybridWorkoutsModuleSpecSwift (C++) accesses HybridWorkoutsModuleSpec_cxx (Swift), and might
|
|
104
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
105
|
+
*
|
|
106
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
107
|
+
* the future, HybridWorkoutsModuleSpec_cxx can directly inherit from the C++ class HybridWorkoutsModuleSpec
|
|
108
|
+
* to simplify the whole structure and memory management.
|
|
109
|
+
*/
|
|
110
|
+
class HybridWorkoutsModuleSpecSwift: public virtual HybridWorkoutsModuleSpec {
|
|
111
|
+
public:
|
|
112
|
+
// Constructor from a Swift instance
|
|
113
|
+
explicit HybridWorkoutsModuleSpecSwift(const ReactNativeHealthkit::HybridWorkoutsModuleSpec_cxx& swiftPart):
|
|
114
|
+
HybridObject(HybridWorkoutsModuleSpec::TAG),
|
|
115
|
+
_swiftPart(swiftPart) { }
|
|
116
|
+
|
|
117
|
+
public:
|
|
118
|
+
// Get the Swift part
|
|
119
|
+
inline ReactNativeHealthkit::HybridWorkoutsModuleSpec_cxx& getSwiftPart() noexcept {
|
|
120
|
+
return _swiftPart;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public:
|
|
124
|
+
// Get memory pressure
|
|
125
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
126
|
+
return _swiftPart.getMemorySize();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public:
|
|
130
|
+
// Properties
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
public:
|
|
134
|
+
// Methods
|
|
135
|
+
inline std::shared_ptr<Promise<std::string>> saveWorkoutSample(WorkoutActivityType workoutActivityType, const std::vector<QuantitySampleForSaving>& quantities, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, const WorkoutTotals& totals, const std::shared_ptr<AnyMap>& metadata) override {
|
|
136
|
+
auto __result = _swiftPart.saveWorkoutSample(static_cast<int>(workoutActivityType), quantities, startDate, endDate, totals, metadata);
|
|
137
|
+
if (__result.hasError()) [[unlikely]] {
|
|
138
|
+
std::rethrow_exception(__result.error());
|
|
139
|
+
}
|
|
140
|
+
auto __value = std::move(__result.value());
|
|
141
|
+
return __value;
|
|
142
|
+
}
|
|
143
|
+
inline std::shared_ptr<Promise<QueryWorkoutSamplesWithAnchorResponse>> queryWorkoutSamplesWithAnchor(const WorkoutQueryOptionsWithAnchor& options) override {
|
|
144
|
+
auto __result = _swiftPart.queryWorkoutSamplesWithAnchor(options);
|
|
145
|
+
if (__result.hasError()) [[unlikely]] {
|
|
146
|
+
std::rethrow_exception(__result.error());
|
|
147
|
+
}
|
|
148
|
+
auto __value = std::move(__result.value());
|
|
149
|
+
return __value;
|
|
150
|
+
}
|
|
151
|
+
inline std::shared_ptr<Promise<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>> queryWorkoutSamples(const WorkoutQueryOptions& options) override {
|
|
152
|
+
auto __result = _swiftPart.queryWorkoutSamples(options);
|
|
153
|
+
if (__result.hasError()) [[unlikely]] {
|
|
154
|
+
std::rethrow_exception(__result.error());
|
|
155
|
+
}
|
|
156
|
+
auto __value = std::move(__result.value());
|
|
157
|
+
return __value;
|
|
158
|
+
}
|
|
159
|
+
inline std::shared_ptr<Promise<bool>> startWatchAppWithWorkoutConfiguration(const WorkoutConfiguration& workoutConfiguration) override {
|
|
160
|
+
auto __result = _swiftPart.startWatchAppWithWorkoutConfiguration(workoutConfiguration);
|
|
161
|
+
if (__result.hasError()) [[unlikely]] {
|
|
162
|
+
std::rethrow_exception(__result.error());
|
|
163
|
+
}
|
|
164
|
+
auto __value = std::move(__result.value());
|
|
165
|
+
return __value;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
private:
|
|
169
|
+
ReactNativeHealthkit::HybridWorkoutsModuleSpec_cxx _swiftPart;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
} // namespace margelo::nitro::healthkit
|