@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,83 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HeartbeatSeriesSamplesWithAnchorResponse.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// Forward declaration of `HeartbeatSeriesSample` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct HeartbeatSeriesSample; }
|
|
23
|
+
// Forward declaration of `DeletedSample` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct DeletedSample; }
|
|
25
|
+
|
|
26
|
+
#include <vector>
|
|
27
|
+
#include "HeartbeatSeriesSample.hpp"
|
|
28
|
+
#include "DeletedSample.hpp"
|
|
29
|
+
#include <string>
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::healthkit {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (HeartbeatSeriesSamplesWithAnchorResponse).
|
|
35
|
+
*/
|
|
36
|
+
struct HeartbeatSeriesSamplesWithAnchorResponse {
|
|
37
|
+
public:
|
|
38
|
+
std::vector<HeartbeatSeriesSample> samples SWIFT_PRIVATE;
|
|
39
|
+
std::vector<DeletedSample> deletedSamples SWIFT_PRIVATE;
|
|
40
|
+
std::string newAnchor SWIFT_PRIVATE;
|
|
41
|
+
|
|
42
|
+
public:
|
|
43
|
+
HeartbeatSeriesSamplesWithAnchorResponse() = default;
|
|
44
|
+
explicit HeartbeatSeriesSamplesWithAnchorResponse(std::vector<HeartbeatSeriesSample> samples, std::vector<DeletedSample> deletedSamples, std::string newAnchor): samples(samples), deletedSamples(deletedSamples), newAnchor(newAnchor) {}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
} // namespace margelo::nitro::healthkit
|
|
48
|
+
|
|
49
|
+
namespace margelo::nitro {
|
|
50
|
+
|
|
51
|
+
using namespace margelo::nitro::healthkit;
|
|
52
|
+
|
|
53
|
+
// C++ HeartbeatSeriesSamplesWithAnchorResponse <> JS HeartbeatSeriesSamplesWithAnchorResponse (object)
|
|
54
|
+
template <>
|
|
55
|
+
struct JSIConverter<HeartbeatSeriesSamplesWithAnchorResponse> final {
|
|
56
|
+
static inline HeartbeatSeriesSamplesWithAnchorResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
57
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
58
|
+
return HeartbeatSeriesSamplesWithAnchorResponse(
|
|
59
|
+
JSIConverter<std::vector<HeartbeatSeriesSample>>::fromJSI(runtime, obj.getProperty(runtime, "samples")),
|
|
60
|
+
JSIConverter<std::vector<DeletedSample>>::fromJSI(runtime, obj.getProperty(runtime, "deletedSamples")),
|
|
61
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "newAnchor"))
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const HeartbeatSeriesSamplesWithAnchorResponse& arg) {
|
|
65
|
+
jsi::Object obj(runtime);
|
|
66
|
+
obj.setProperty(runtime, "samples", JSIConverter<std::vector<HeartbeatSeriesSample>>::toJSI(runtime, arg.samples));
|
|
67
|
+
obj.setProperty(runtime, "deletedSamples", JSIConverter<std::vector<DeletedSample>>::toJSI(runtime, arg.deletedSamples));
|
|
68
|
+
obj.setProperty(runtime, "newAnchor", JSIConverter<std::string>::toJSI(runtime, arg.newAnchor));
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
72
|
+
if (!value.isObject()) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
jsi::Object obj = value.getObject(runtime);
|
|
76
|
+
if (!JSIConverter<std::vector<HeartbeatSeriesSample>>::canConvert(runtime, obj.getProperty(runtime, "samples"))) return false;
|
|
77
|
+
if (!JSIConverter<std::vector<DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
|
|
78
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "newAnchor"))) return false;
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCategoryTypeModuleSpec.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 "HybridCategoryTypeModuleSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::healthkit {
|
|
11
|
+
|
|
12
|
+
void HybridCategoryTypeModuleSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("saveCategorySample", &HybridCategoryTypeModuleSpec::saveCategorySample);
|
|
18
|
+
prototype.registerHybridMethod("queryCategorySamples", &HybridCategoryTypeModuleSpec::queryCategorySamples);
|
|
19
|
+
prototype.registerHybridMethod("queryCategorySamplesWithAnchor", &HybridCategoryTypeModuleSpec::queryCategorySamplesWithAnchor);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCategoryTypeModuleSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `CategoryTypeIdentifier` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::healthkit { enum class CategoryTypeIdentifier; }
|
|
18
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
19
|
+
namespace NitroModules { class AnyMap; }
|
|
20
|
+
// Forward declaration of `CategorySample` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::healthkit { struct CategorySample; }
|
|
22
|
+
// Forward declaration of `QueryOptionsWithSortOrder` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::healthkit { struct QueryOptionsWithSortOrder; }
|
|
24
|
+
// Forward declaration of `CategorySamplesWithAnchorResponse` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::healthkit { struct CategorySamplesWithAnchorResponse; }
|
|
26
|
+
// Forward declaration of `QueryOptionsWithAnchor` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { struct QueryOptionsWithAnchor; }
|
|
28
|
+
|
|
29
|
+
#include <NitroModules/Promise.hpp>
|
|
30
|
+
#include "CategoryTypeIdentifier.hpp"
|
|
31
|
+
#include <chrono>
|
|
32
|
+
#include <NitroModules/AnyMap.hpp>
|
|
33
|
+
#include <vector>
|
|
34
|
+
#include "CategorySample.hpp"
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include "QueryOptionsWithSortOrder.hpp"
|
|
37
|
+
#include "CategorySamplesWithAnchorResponse.hpp"
|
|
38
|
+
#include "QueryOptionsWithAnchor.hpp"
|
|
39
|
+
|
|
40
|
+
namespace margelo::nitro::healthkit {
|
|
41
|
+
|
|
42
|
+
using namespace margelo::nitro;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* An abstract base class for `CategoryTypeModule`
|
|
46
|
+
* Inherit this class to create instances of `HybridCategoryTypeModuleSpec` in C++.
|
|
47
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
48
|
+
* @example
|
|
49
|
+
* ```cpp
|
|
50
|
+
* class HybridCategoryTypeModule: public HybridCategoryTypeModuleSpec {
|
|
51
|
+
* public:
|
|
52
|
+
* HybridCategoryTypeModule(...): HybridObject(TAG) { ... }
|
|
53
|
+
* // ...
|
|
54
|
+
* };
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
class HybridCategoryTypeModuleSpec: public virtual HybridObject {
|
|
58
|
+
public:
|
|
59
|
+
// Constructor
|
|
60
|
+
explicit HybridCategoryTypeModuleSpec(): HybridObject(TAG) { }
|
|
61
|
+
|
|
62
|
+
// Destructor
|
|
63
|
+
~HybridCategoryTypeModuleSpec() override = default;
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
// Properties
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
public:
|
|
70
|
+
// Methods
|
|
71
|
+
virtual std::shared_ptr<Promise<bool>> saveCategorySample(CategoryTypeIdentifier identifier, double value, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, const std::shared_ptr<AnyMap>& metadata) = 0;
|
|
72
|
+
virtual std::shared_ptr<Promise<std::vector<CategorySample>>> queryCategorySamples(CategoryTypeIdentifier identifier, const std::optional<QueryOptionsWithSortOrder>& options) = 0;
|
|
73
|
+
virtual std::shared_ptr<Promise<CategorySamplesWithAnchorResponse>> queryCategorySamplesWithAnchor(CategoryTypeIdentifier identifier, const QueryOptionsWithAnchor& options) = 0;
|
|
74
|
+
|
|
75
|
+
protected:
|
|
76
|
+
// Hybrid Setup
|
|
77
|
+
void loadHybridMethods() override;
|
|
78
|
+
|
|
79
|
+
protected:
|
|
80
|
+
// Tag for logging
|
|
81
|
+
static constexpr auto TAG = "CategoryTypeModule";
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCharacteristicTypeModuleSpec.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 "HybridCharacteristicTypeModuleSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::healthkit {
|
|
11
|
+
|
|
12
|
+
void HybridCharacteristicTypeModuleSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("getBloodType", &HybridCharacteristicTypeModuleSpec::getBloodType);
|
|
18
|
+
prototype.registerHybridMethod("getDateOfBirth", &HybridCharacteristicTypeModuleSpec::getDateOfBirth);
|
|
19
|
+
prototype.registerHybridMethod("getBiologicalSex", &HybridCharacteristicTypeModuleSpec::getBiologicalSex);
|
|
20
|
+
prototype.registerHybridMethod("getFitzpatrickSkinType", &HybridCharacteristicTypeModuleSpec::getFitzpatrickSkinType);
|
|
21
|
+
prototype.registerHybridMethod("getWheelchairUse", &HybridCharacteristicTypeModuleSpec::getWheelchairUse);
|
|
22
|
+
prototype.registerHybridMethod("getBloodTypeAsync", &HybridCharacteristicTypeModuleSpec::getBloodTypeAsync);
|
|
23
|
+
prototype.registerHybridMethod("getDateOfBirthAsync", &HybridCharacteristicTypeModuleSpec::getDateOfBirthAsync);
|
|
24
|
+
prototype.registerHybridMethod("getBiologicalSexAsync", &HybridCharacteristicTypeModuleSpec::getBiologicalSexAsync);
|
|
25
|
+
prototype.registerHybridMethod("getFitzpatrickSkinTypeAsync", &HybridCharacteristicTypeModuleSpec::getFitzpatrickSkinTypeAsync);
|
|
26
|
+
prototype.registerHybridMethod("getWheelchairUseAsync", &HybridCharacteristicTypeModuleSpec::getWheelchairUseAsync);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCharacteristicTypeModuleSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `BloodType` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::healthkit { enum class BloodType; }
|
|
18
|
+
// Forward declaration of `BiologicalSex` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::healthkit { enum class BiologicalSex; }
|
|
20
|
+
// Forward declaration of `FitzpatrickSkinType` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::healthkit { enum class FitzpatrickSkinType; }
|
|
22
|
+
// Forward declaration of `WheelchairUse` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::healthkit { enum class WheelchairUse; }
|
|
24
|
+
|
|
25
|
+
#include "BloodType.hpp"
|
|
26
|
+
#include <chrono>
|
|
27
|
+
#include "BiologicalSex.hpp"
|
|
28
|
+
#include "FitzpatrickSkinType.hpp"
|
|
29
|
+
#include "WheelchairUse.hpp"
|
|
30
|
+
#include <NitroModules/Promise.hpp>
|
|
31
|
+
|
|
32
|
+
namespace margelo::nitro::healthkit {
|
|
33
|
+
|
|
34
|
+
using namespace margelo::nitro;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* An abstract base class for `CharacteristicTypeModule`
|
|
38
|
+
* Inherit this class to create instances of `HybridCharacteristicTypeModuleSpec` in C++.
|
|
39
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
40
|
+
* @example
|
|
41
|
+
* ```cpp
|
|
42
|
+
* class HybridCharacteristicTypeModule: public HybridCharacteristicTypeModuleSpec {
|
|
43
|
+
* public:
|
|
44
|
+
* HybridCharacteristicTypeModule(...): HybridObject(TAG) { ... }
|
|
45
|
+
* // ...
|
|
46
|
+
* };
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
class HybridCharacteristicTypeModuleSpec: public virtual HybridObject {
|
|
50
|
+
public:
|
|
51
|
+
// Constructor
|
|
52
|
+
explicit HybridCharacteristicTypeModuleSpec(): HybridObject(TAG) { }
|
|
53
|
+
|
|
54
|
+
// Destructor
|
|
55
|
+
~HybridCharacteristicTypeModuleSpec() override = default;
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
// Properties
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
public:
|
|
62
|
+
// Methods
|
|
63
|
+
virtual BloodType getBloodType() = 0;
|
|
64
|
+
virtual std::chrono::system_clock::time_point getDateOfBirth() = 0;
|
|
65
|
+
virtual BiologicalSex getBiologicalSex() = 0;
|
|
66
|
+
virtual FitzpatrickSkinType getFitzpatrickSkinType() = 0;
|
|
67
|
+
virtual WheelchairUse getWheelchairUse() = 0;
|
|
68
|
+
virtual std::shared_ptr<Promise<BloodType>> getBloodTypeAsync() = 0;
|
|
69
|
+
virtual std::shared_ptr<Promise<std::chrono::system_clock::time_point>> getDateOfBirthAsync() = 0;
|
|
70
|
+
virtual std::shared_ptr<Promise<BiologicalSex>> getBiologicalSexAsync() = 0;
|
|
71
|
+
virtual std::shared_ptr<Promise<FitzpatrickSkinType>> getFitzpatrickSkinTypeAsync() = 0;
|
|
72
|
+
virtual std::shared_ptr<Promise<WheelchairUse>> getWheelchairUseAsync() = 0;
|
|
73
|
+
|
|
74
|
+
protected:
|
|
75
|
+
// Hybrid Setup
|
|
76
|
+
void loadHybridMethods() override;
|
|
77
|
+
|
|
78
|
+
protected:
|
|
79
|
+
// Tag for logging
|
|
80
|
+
static constexpr auto TAG = "CharacteristicTypeModule";
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCoreModuleSpec.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 "HybridCoreModuleSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::healthkit {
|
|
11
|
+
|
|
12
|
+
void HybridCoreModuleSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("enableBackgroundDelivery", &HybridCoreModuleSpec::enableBackgroundDelivery);
|
|
18
|
+
prototype.registerHybridMethod("disableBackgroundDelivery", &HybridCoreModuleSpec::disableBackgroundDelivery);
|
|
19
|
+
prototype.registerHybridMethod("disableAllBackgroundDelivery", &HybridCoreModuleSpec::disableAllBackgroundDelivery);
|
|
20
|
+
prototype.registerHybridMethod("isHealthDataAvailable", &HybridCoreModuleSpec::isHealthDataAvailable);
|
|
21
|
+
prototype.registerHybridMethod("isHealthDataAvailableAsync", &HybridCoreModuleSpec::isHealthDataAvailableAsync);
|
|
22
|
+
prototype.registerHybridMethod("isProtectedDataAvailable", &HybridCoreModuleSpec::isProtectedDataAvailable);
|
|
23
|
+
prototype.registerHybridMethod("isProtectedDataAvailableAsync", &HybridCoreModuleSpec::isProtectedDataAvailableAsync);
|
|
24
|
+
prototype.registerHybridMethod("getPreferredUnits", &HybridCoreModuleSpec::getPreferredUnits);
|
|
25
|
+
prototype.registerHybridMethod("querySources", &HybridCoreModuleSpec::querySources);
|
|
26
|
+
prototype.registerHybridMethod("subscribeToObserverQuery", &HybridCoreModuleSpec::subscribeToObserverQuery);
|
|
27
|
+
prototype.registerHybridMethod("unsubscribeQuery", &HybridCoreModuleSpec::unsubscribeQuery);
|
|
28
|
+
prototype.registerHybridMethod("unsubscribeQueryAsync", &HybridCoreModuleSpec::unsubscribeQueryAsync);
|
|
29
|
+
prototype.registerHybridMethod("unsubscribeQueries", &HybridCoreModuleSpec::unsubscribeQueries);
|
|
30
|
+
prototype.registerHybridMethod("unsubscribeQueriesAsync", &HybridCoreModuleSpec::unsubscribeQueriesAsync);
|
|
31
|
+
prototype.registerHybridMethod("authorizationStatusFor", &HybridCoreModuleSpec::authorizationStatusFor);
|
|
32
|
+
prototype.registerHybridMethod("getRequestStatusForAuthorization", &HybridCoreModuleSpec::getRequestStatusForAuthorization);
|
|
33
|
+
prototype.registerHybridMethod("requestAuthorization", &HybridCoreModuleSpec::requestAuthorization);
|
|
34
|
+
prototype.registerHybridMethod("deleteObjects", &HybridCoreModuleSpec::deleteObjects);
|
|
35
|
+
prototype.registerHybridMethod("isObjectTypeAvailable", &HybridCoreModuleSpec::isObjectTypeAvailable);
|
|
36
|
+
prototype.registerHybridMethod("areObjectTypesAvailable", &HybridCoreModuleSpec::areObjectTypesAvailable);
|
|
37
|
+
prototype.registerHybridMethod("areObjectTypesAvailableAsync", &HybridCoreModuleSpec::areObjectTypesAvailableAsync);
|
|
38
|
+
prototype.registerHybridMethod("isObjectTypeAvailableAsync", &HybridCoreModuleSpec::isObjectTypeAvailableAsync);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCoreModuleSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `ObjectTypeIdentifier` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::healthkit { enum class ObjectTypeIdentifier; }
|
|
18
|
+
// Forward declaration of `UpdateFrequency` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::healthkit { enum class UpdateFrequency; }
|
|
20
|
+
// Forward declaration of `IdentifierWithUnit` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::healthkit { struct IdentifierWithUnit; }
|
|
22
|
+
// Forward declaration of `QuantityTypeIdentifier` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::healthkit { enum class QuantityTypeIdentifier; }
|
|
24
|
+
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
|
|
26
|
+
// Forward declaration of `SampleTypeIdentifier` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::healthkit { enum class SampleTypeIdentifier; }
|
|
28
|
+
// Forward declaration of `OnChangeCallbackArgs` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::healthkit { struct OnChangeCallbackArgs; }
|
|
30
|
+
// Forward declaration of `AuthorizationStatus` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::healthkit { enum class AuthorizationStatus; }
|
|
32
|
+
// Forward declaration of `AuthorizationRequestStatus` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::healthkit { enum class AuthorizationRequestStatus; }
|
|
34
|
+
// Forward declaration of `SampleTypeIdentifierWriteable` to properly resolve imports.
|
|
35
|
+
namespace margelo::nitro::healthkit { enum class SampleTypeIdentifierWriteable; }
|
|
36
|
+
// Forward declaration of `PredicateWithUUID` to properly resolve imports.
|
|
37
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
|
|
38
|
+
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
39
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
40
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
41
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
42
|
+
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
43
|
+
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
44
|
+
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
45
|
+
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
46
|
+
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
47
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
48
|
+
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
49
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
50
|
+
|
|
51
|
+
#include <NitroModules/Promise.hpp>
|
|
52
|
+
#include "ObjectTypeIdentifier.hpp"
|
|
53
|
+
#include "UpdateFrequency.hpp"
|
|
54
|
+
#include <vector>
|
|
55
|
+
#include "IdentifierWithUnit.hpp"
|
|
56
|
+
#include "QuantityTypeIdentifier.hpp"
|
|
57
|
+
#include <optional>
|
|
58
|
+
#include <memory>
|
|
59
|
+
#include "HybridSourceProxySpec.hpp"
|
|
60
|
+
#include "SampleTypeIdentifier.hpp"
|
|
61
|
+
#include <string>
|
|
62
|
+
#include <functional>
|
|
63
|
+
#include "OnChangeCallbackArgs.hpp"
|
|
64
|
+
#include "AuthorizationStatus.hpp"
|
|
65
|
+
#include "AuthorizationRequestStatus.hpp"
|
|
66
|
+
#include "SampleTypeIdentifierWriteable.hpp"
|
|
67
|
+
#include <variant>
|
|
68
|
+
#include "PredicateWithUUID.hpp"
|
|
69
|
+
#include "PredicateWithUUIDs.hpp"
|
|
70
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
71
|
+
#include "PredicateWithStartAndEnd.hpp"
|
|
72
|
+
#include "PredicateFromWorkout.hpp"
|
|
73
|
+
#include "FilterForSamplesAnd.hpp"
|
|
74
|
+
#include "FilterForSamplesOr.hpp"
|
|
75
|
+
#include <unordered_map>
|
|
76
|
+
|
|
77
|
+
namespace margelo::nitro::healthkit {
|
|
78
|
+
|
|
79
|
+
using namespace margelo::nitro;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* An abstract base class for `CoreModule`
|
|
83
|
+
* Inherit this class to create instances of `HybridCoreModuleSpec` in C++.
|
|
84
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
85
|
+
* @example
|
|
86
|
+
* ```cpp
|
|
87
|
+
* class HybridCoreModule: public HybridCoreModuleSpec {
|
|
88
|
+
* public:
|
|
89
|
+
* HybridCoreModule(...): HybridObject(TAG) { ... }
|
|
90
|
+
* // ...
|
|
91
|
+
* };
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
class HybridCoreModuleSpec: public virtual HybridObject {
|
|
95
|
+
public:
|
|
96
|
+
// Constructor
|
|
97
|
+
explicit HybridCoreModuleSpec(): HybridObject(TAG) { }
|
|
98
|
+
|
|
99
|
+
// Destructor
|
|
100
|
+
~HybridCoreModuleSpec() override = default;
|
|
101
|
+
|
|
102
|
+
public:
|
|
103
|
+
// Properties
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
public:
|
|
107
|
+
// Methods
|
|
108
|
+
virtual std::shared_ptr<Promise<bool>> enableBackgroundDelivery(ObjectTypeIdentifier typeIdentifier, UpdateFrequency updateFrequency) = 0;
|
|
109
|
+
virtual std::shared_ptr<Promise<bool>> disableBackgroundDelivery(ObjectTypeIdentifier typeIdentifier) = 0;
|
|
110
|
+
virtual std::shared_ptr<Promise<bool>> disableAllBackgroundDelivery() = 0;
|
|
111
|
+
virtual bool isHealthDataAvailable() = 0;
|
|
112
|
+
virtual std::shared_ptr<Promise<bool>> isHealthDataAvailableAsync() = 0;
|
|
113
|
+
virtual bool isProtectedDataAvailable() = 0;
|
|
114
|
+
virtual std::shared_ptr<Promise<bool>> isProtectedDataAvailableAsync() = 0;
|
|
115
|
+
virtual std::shared_ptr<Promise<std::vector<IdentifierWithUnit>>> getPreferredUnits(const std::vector<QuantityTypeIdentifier>& identifiers, std::optional<bool> forceUpdate) = 0;
|
|
116
|
+
virtual std::shared_ptr<Promise<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridSourceProxySpec>>>> querySources(SampleTypeIdentifier identifier) = 0;
|
|
117
|
+
virtual std::string subscribeToObserverQuery(SampleTypeIdentifier typeIdentifier, const std::function<void(const OnChangeCallbackArgs& /* args */)>& callback) = 0;
|
|
118
|
+
virtual bool unsubscribeQuery(const std::string& queryId) = 0;
|
|
119
|
+
virtual std::shared_ptr<Promise<bool>> unsubscribeQueryAsync(const std::string& queryId) = 0;
|
|
120
|
+
virtual double unsubscribeQueries(const std::vector<std::string>& queryIds) = 0;
|
|
121
|
+
virtual std::shared_ptr<Promise<double>> unsubscribeQueriesAsync(const std::vector<std::string>& queryIds) = 0;
|
|
122
|
+
virtual AuthorizationStatus authorizationStatusFor(ObjectTypeIdentifier type) = 0;
|
|
123
|
+
virtual std::shared_ptr<Promise<AuthorizationRequestStatus>> getRequestStatusForAuthorization(const std::vector<SampleTypeIdentifierWriteable>& toShare, const std::vector<ObjectTypeIdentifier>& toRead) = 0;
|
|
124
|
+
virtual std::shared_ptr<Promise<bool>> requestAuthorization(const std::vector<SampleTypeIdentifierWriteable>& toShare, const std::vector<ObjectTypeIdentifier>& toRead) = 0;
|
|
125
|
+
virtual std::shared_ptr<Promise<double>> deleteObjects(ObjectTypeIdentifier objectTypeIdentifier, const std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>& filter) = 0;
|
|
126
|
+
virtual bool isObjectTypeAvailable(ObjectTypeIdentifier objectTypeIdentifier) = 0;
|
|
127
|
+
virtual std::unordered_map<std::string, bool> areObjectTypesAvailable(const std::vector<ObjectTypeIdentifier>& objectTypeIdentifiers) = 0;
|
|
128
|
+
virtual std::shared_ptr<Promise<std::unordered_map<std::string, bool>>> areObjectTypesAvailableAsync(const std::vector<ObjectTypeIdentifier>& objectTypeIdentifiers) = 0;
|
|
129
|
+
virtual std::shared_ptr<Promise<bool>> isObjectTypeAvailableAsync(ObjectTypeIdentifier objectTypeIdentifier) = 0;
|
|
130
|
+
|
|
131
|
+
protected:
|
|
132
|
+
// Hybrid Setup
|
|
133
|
+
void loadHybridMethods() override;
|
|
134
|
+
|
|
135
|
+
protected:
|
|
136
|
+
// Tag for logging
|
|
137
|
+
static constexpr auto TAG = "CoreModule";
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCorrelationTypeModuleSpec.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 "HybridCorrelationTypeModuleSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::healthkit {
|
|
11
|
+
|
|
12
|
+
void HybridCorrelationTypeModuleSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("saveCorrelationSample", &HybridCorrelationTypeModuleSpec::saveCorrelationSample);
|
|
18
|
+
prototype.registerHybridMethod("queryCorrelationSamples", &HybridCorrelationTypeModuleSpec::queryCorrelationSamples);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCorrelationTypeModuleSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `CorrelationTypeIdentifier` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::healthkit { enum class CorrelationTypeIdentifier; }
|
|
18
|
+
// Forward declaration of `CategorySampleForSaving` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::healthkit { struct CategorySampleForSaving; }
|
|
20
|
+
// Forward declaration of `QuantitySampleForSaving` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::healthkit { struct QuantitySampleForSaving; }
|
|
22
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
23
|
+
namespace NitroModules { class AnyMap; }
|
|
24
|
+
// Forward declaration of `CorrelationSample` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::healthkit { struct CorrelationSample; }
|
|
26
|
+
|
|
27
|
+
#include <NitroModules/Promise.hpp>
|
|
28
|
+
#include "CorrelationTypeIdentifier.hpp"
|
|
29
|
+
#include <vector>
|
|
30
|
+
#include <variant>
|
|
31
|
+
#include "CategorySampleForSaving.hpp"
|
|
32
|
+
#include "QuantitySampleForSaving.hpp"
|
|
33
|
+
#include <chrono>
|
|
34
|
+
#include <NitroModules/AnyMap.hpp>
|
|
35
|
+
#include "CorrelationSample.hpp"
|
|
36
|
+
|
|
37
|
+
namespace margelo::nitro::healthkit {
|
|
38
|
+
|
|
39
|
+
using namespace margelo::nitro;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* An abstract base class for `CorrelationTypeModule`
|
|
43
|
+
* Inherit this class to create instances of `HybridCorrelationTypeModuleSpec` in C++.
|
|
44
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
45
|
+
* @example
|
|
46
|
+
* ```cpp
|
|
47
|
+
* class HybridCorrelationTypeModule: public HybridCorrelationTypeModuleSpec {
|
|
48
|
+
* public:
|
|
49
|
+
* HybridCorrelationTypeModule(...): HybridObject(TAG) { ... }
|
|
50
|
+
* // ...
|
|
51
|
+
* };
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
class HybridCorrelationTypeModuleSpec: public virtual HybridObject {
|
|
55
|
+
public:
|
|
56
|
+
// Constructor
|
|
57
|
+
explicit HybridCorrelationTypeModuleSpec(): HybridObject(TAG) { }
|
|
58
|
+
|
|
59
|
+
// Destructor
|
|
60
|
+
~HybridCorrelationTypeModuleSpec() override = default;
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
// Properties
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
// Methods
|
|
68
|
+
virtual std::shared_ptr<Promise<bool>> saveCorrelationSample(CorrelationTypeIdentifier typeIdentifier, const std::vector<std::variant<CategorySampleForSaving, QuantitySampleForSaving>>& samples, std::chrono::system_clock::time_point start, std::chrono::system_clock::time_point end, const std::shared_ptr<AnyMap>& metadata) = 0;
|
|
69
|
+
virtual std::shared_ptr<Promise<std::vector<CorrelationSample>>> queryCorrelationSamples(CorrelationTypeIdentifier typeIdentifier, std::chrono::system_clock::time_point from, std::chrono::system_clock::time_point to) = 0;
|
|
70
|
+
|
|
71
|
+
protected:
|
|
72
|
+
// Hybrid Setup
|
|
73
|
+
void loadHybridMethods() override;
|
|
74
|
+
|
|
75
|
+
protected:
|
|
76
|
+
// Tag for logging
|
|
77
|
+
static constexpr auto TAG = "CorrelationTypeModule";
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro::healthkit
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridHeartbeatSeriesModuleSpec.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 "HybridHeartbeatSeriesModuleSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::healthkit {
|
|
11
|
+
|
|
12
|
+
void HybridHeartbeatSeriesModuleSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("queryHeartbeatSeriesSamples", &HybridHeartbeatSeriesModuleSpec::queryHeartbeatSeriesSamples);
|
|
18
|
+
prototype.registerHybridMethod("queryHeartbeatSeriesSamplesWithAnchor", &HybridHeartbeatSeriesModuleSpec::queryHeartbeatSeriesSamplesWithAnchor);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace margelo::nitro::healthkit
|