@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,99 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryOptionsWithAnchor.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 `PredicateWithUUID` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
|
|
23
|
+
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
25
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
27
|
+
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
29
|
+
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
31
|
+
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
33
|
+
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
35
|
+
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include <string>
|
|
38
|
+
#include <variant>
|
|
39
|
+
#include "PredicateWithUUID.hpp"
|
|
40
|
+
#include "PredicateWithUUIDs.hpp"
|
|
41
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
42
|
+
#include "PredicateWithStartAndEnd.hpp"
|
|
43
|
+
#include "PredicateFromWorkout.hpp"
|
|
44
|
+
#include "FilterForSamplesAnd.hpp"
|
|
45
|
+
#include "FilterForSamplesOr.hpp"
|
|
46
|
+
|
|
47
|
+
namespace margelo::nitro::healthkit {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A struct which can be represented as a JavaScript object (QueryOptionsWithAnchor).
|
|
51
|
+
*/
|
|
52
|
+
struct QueryOptionsWithAnchor {
|
|
53
|
+
public:
|
|
54
|
+
std::optional<std::string> anchor SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>> filter SWIFT_PRIVATE;
|
|
56
|
+
std::optional<double> limit SWIFT_PRIVATE;
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
QueryOptionsWithAnchor() = default;
|
|
60
|
+
explicit QueryOptionsWithAnchor(std::optional<std::string> anchor, std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>> filter, std::optional<double> limit): anchor(anchor), filter(filter), limit(limit) {}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} // namespace margelo::nitro::healthkit
|
|
64
|
+
|
|
65
|
+
namespace margelo::nitro {
|
|
66
|
+
|
|
67
|
+
using namespace margelo::nitro::healthkit;
|
|
68
|
+
|
|
69
|
+
// C++ QueryOptionsWithAnchor <> JS QueryOptionsWithAnchor (object)
|
|
70
|
+
template <>
|
|
71
|
+
struct JSIConverter<QueryOptionsWithAnchor> final {
|
|
72
|
+
static inline QueryOptionsWithAnchor fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
73
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
74
|
+
return QueryOptionsWithAnchor(
|
|
75
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
|
|
76
|
+
JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
|
|
77
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryOptionsWithAnchor& arg) {
|
|
81
|
+
jsi::Object obj(runtime);
|
|
82
|
+
obj.setProperty(runtime, "anchor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.anchor));
|
|
83
|
+
obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
|
|
84
|
+
obj.setProperty(runtime, "limit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
|
|
85
|
+
return obj;
|
|
86
|
+
}
|
|
87
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
88
|
+
if (!value.isObject()) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
jsi::Object obj = value.getObject(runtime);
|
|
92
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryOptionsWithAnchorAndUnit.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 `PredicateWithUUID` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
|
|
23
|
+
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
25
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
27
|
+
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
29
|
+
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
31
|
+
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
33
|
+
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
35
|
+
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include <string>
|
|
38
|
+
#include <variant>
|
|
39
|
+
#include "PredicateWithUUID.hpp"
|
|
40
|
+
#include "PredicateWithUUIDs.hpp"
|
|
41
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
42
|
+
#include "PredicateWithStartAndEnd.hpp"
|
|
43
|
+
#include "PredicateFromWorkout.hpp"
|
|
44
|
+
#include "FilterForSamplesAnd.hpp"
|
|
45
|
+
#include "FilterForSamplesOr.hpp"
|
|
46
|
+
|
|
47
|
+
namespace margelo::nitro::healthkit {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A struct which can be represented as a JavaScript object (QueryOptionsWithAnchorAndUnit).
|
|
51
|
+
*/
|
|
52
|
+
struct QueryOptionsWithAnchorAndUnit {
|
|
53
|
+
public:
|
|
54
|
+
std::optional<std::string> unit SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::string> anchor SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>> filter SWIFT_PRIVATE;
|
|
57
|
+
std::optional<double> limit SWIFT_PRIVATE;
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
QueryOptionsWithAnchorAndUnit() = default;
|
|
61
|
+
explicit QueryOptionsWithAnchorAndUnit(std::optional<std::string> unit, std::optional<std::string> anchor, std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>> filter, std::optional<double> limit): unit(unit), anchor(anchor), filter(filter), limit(limit) {}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::healthkit
|
|
65
|
+
|
|
66
|
+
namespace margelo::nitro {
|
|
67
|
+
|
|
68
|
+
using namespace margelo::nitro::healthkit;
|
|
69
|
+
|
|
70
|
+
// C++ QueryOptionsWithAnchorAndUnit <> JS QueryOptionsWithAnchorAndUnit (object)
|
|
71
|
+
template <>
|
|
72
|
+
struct JSIConverter<QueryOptionsWithAnchorAndUnit> final {
|
|
73
|
+
static inline QueryOptionsWithAnchorAndUnit fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
74
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
75
|
+
return QueryOptionsWithAnchorAndUnit(
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
|
|
77
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
|
|
78
|
+
JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
|
|
79
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryOptionsWithAnchorAndUnit& arg) {
|
|
83
|
+
jsi::Object obj(runtime);
|
|
84
|
+
obj.setProperty(runtime, "unit", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
|
|
85
|
+
obj.setProperty(runtime, "anchor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.anchor));
|
|
86
|
+
obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
|
|
87
|
+
obj.setProperty(runtime, "limit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
91
|
+
if (!value.isObject()) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
jsi::Object obj = value.getObject(runtime);
|
|
95
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
|
|
96
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
|
|
97
|
+
if (!JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
|
|
98
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryOptionsWithSortOrder.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 `PredicateWithUUID` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
|
|
23
|
+
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
25
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
27
|
+
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
29
|
+
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
31
|
+
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
33
|
+
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
35
|
+
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include <variant>
|
|
38
|
+
#include "PredicateWithUUID.hpp"
|
|
39
|
+
#include "PredicateWithUUIDs.hpp"
|
|
40
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
41
|
+
#include "PredicateWithStartAndEnd.hpp"
|
|
42
|
+
#include "PredicateFromWorkout.hpp"
|
|
43
|
+
#include "FilterForSamplesAnd.hpp"
|
|
44
|
+
#include "FilterForSamplesOr.hpp"
|
|
45
|
+
|
|
46
|
+
namespace margelo::nitro::healthkit {
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A struct which can be represented as a JavaScript object (QueryOptionsWithSortOrder).
|
|
50
|
+
*/
|
|
51
|
+
struct QueryOptionsWithSortOrder {
|
|
52
|
+
public:
|
|
53
|
+
std::optional<bool> ascending SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>> filter SWIFT_PRIVATE;
|
|
55
|
+
std::optional<double> limit SWIFT_PRIVATE;
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
QueryOptionsWithSortOrder() = default;
|
|
59
|
+
explicit QueryOptionsWithSortOrder(std::optional<bool> ascending, std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>> filter, std::optional<double> limit): ascending(ascending), filter(filter), limit(limit) {}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::healthkit
|
|
63
|
+
|
|
64
|
+
namespace margelo::nitro {
|
|
65
|
+
|
|
66
|
+
using namespace margelo::nitro::healthkit;
|
|
67
|
+
|
|
68
|
+
// C++ QueryOptionsWithSortOrder <> JS QueryOptionsWithSortOrder (object)
|
|
69
|
+
template <>
|
|
70
|
+
struct JSIConverter<QueryOptionsWithSortOrder> final {
|
|
71
|
+
static inline QueryOptionsWithSortOrder fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
72
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
73
|
+
return QueryOptionsWithSortOrder(
|
|
74
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "ascending")),
|
|
75
|
+
JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
|
|
76
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryOptionsWithSortOrder& arg) {
|
|
80
|
+
jsi::Object obj(runtime);
|
|
81
|
+
obj.setProperty(runtime, "ascending", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.ascending));
|
|
82
|
+
obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
|
|
83
|
+
obj.setProperty(runtime, "limit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
|
|
84
|
+
return obj;
|
|
85
|
+
}
|
|
86
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
87
|
+
if (!value.isObject()) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
jsi::Object obj = value.getObject(runtime);
|
|
91
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "ascending"))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryOptionsWithSortOrderAndUnit.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 `PredicateWithUUID` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUID; }
|
|
23
|
+
// Forward declaration of `PredicateWithUUIDs` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct PredicateWithUUIDs; }
|
|
25
|
+
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
|
|
27
|
+
// Forward declaration of `PredicateWithStartAndEnd` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::healthkit { struct PredicateWithStartAndEnd; }
|
|
29
|
+
// Forward declaration of `PredicateFromWorkout` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::healthkit { struct PredicateFromWorkout; }
|
|
31
|
+
// Forward declaration of `FilterForSamplesAnd` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesAnd; }
|
|
33
|
+
// Forward declaration of `FilterForSamplesOr` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::healthkit { struct FilterForSamplesOr; }
|
|
35
|
+
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include <string>
|
|
38
|
+
#include <variant>
|
|
39
|
+
#include "PredicateWithUUID.hpp"
|
|
40
|
+
#include "PredicateWithUUIDs.hpp"
|
|
41
|
+
#include "PredicateWithMetadataKey.hpp"
|
|
42
|
+
#include "PredicateWithStartAndEnd.hpp"
|
|
43
|
+
#include "PredicateFromWorkout.hpp"
|
|
44
|
+
#include "FilterForSamplesAnd.hpp"
|
|
45
|
+
#include "FilterForSamplesOr.hpp"
|
|
46
|
+
|
|
47
|
+
namespace margelo::nitro::healthkit {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A struct which can be represented as a JavaScript object (QueryOptionsWithSortOrderAndUnit).
|
|
51
|
+
*/
|
|
52
|
+
struct QueryOptionsWithSortOrderAndUnit {
|
|
53
|
+
public:
|
|
54
|
+
std::optional<std::string> unit SWIFT_PRIVATE;
|
|
55
|
+
std::optional<bool> ascending SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>> filter SWIFT_PRIVATE;
|
|
57
|
+
std::optional<double> limit SWIFT_PRIVATE;
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
QueryOptionsWithSortOrderAndUnit() = default;
|
|
61
|
+
explicit QueryOptionsWithSortOrderAndUnit(std::optional<std::string> unit, std::optional<bool> ascending, std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>> filter, std::optional<double> limit): unit(unit), ascending(ascending), filter(filter), limit(limit) {}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::healthkit
|
|
65
|
+
|
|
66
|
+
namespace margelo::nitro {
|
|
67
|
+
|
|
68
|
+
using namespace margelo::nitro::healthkit;
|
|
69
|
+
|
|
70
|
+
// C++ QueryOptionsWithSortOrderAndUnit <> JS QueryOptionsWithSortOrderAndUnit (object)
|
|
71
|
+
template <>
|
|
72
|
+
struct JSIConverter<QueryOptionsWithSortOrderAndUnit> final {
|
|
73
|
+
static inline QueryOptionsWithSortOrderAndUnit fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
74
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
75
|
+
return QueryOptionsWithSortOrderAndUnit(
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "unit")),
|
|
77
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "ascending")),
|
|
78
|
+
JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::fromJSI(runtime, obj.getProperty(runtime, "filter")),
|
|
79
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "limit"))
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryOptionsWithSortOrderAndUnit& arg) {
|
|
83
|
+
jsi::Object obj(runtime);
|
|
84
|
+
obj.setProperty(runtime, "unit", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.unit));
|
|
85
|
+
obj.setProperty(runtime, "ascending", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.ascending));
|
|
86
|
+
obj.setProperty(runtime, "filter", JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::toJSI(runtime, arg.filter));
|
|
87
|
+
obj.setProperty(runtime, "limit", JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
91
|
+
if (!value.isObject()) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
jsi::Object obj = value.getObject(runtime);
|
|
95
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "unit"))) return false;
|
|
96
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "ascending"))) return false;
|
|
97
|
+
if (!JSIConverter<std::optional<std::variant<PredicateWithUUID, PredicateWithUUIDs, PredicateWithMetadataKey, PredicateWithStartAndEnd, PredicateFromWorkout, FilterForSamplesAnd, FilterForSamplesOr>>>::canConvert(runtime, obj.getProperty(runtime, "filter"))) return false;
|
|
98
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "limit"))) return false;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryStatisticsResponse.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 `Quantity` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct Quantity; }
|
|
23
|
+
// Forward declaration of `QuantityDateInterval` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct QuantityDateInterval; }
|
|
25
|
+
|
|
26
|
+
#include <optional>
|
|
27
|
+
#include "Quantity.hpp"
|
|
28
|
+
#include "QuantityDateInterval.hpp"
|
|
29
|
+
|
|
30
|
+
namespace margelo::nitro::healthkit {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A struct which can be represented as a JavaScript object (QueryStatisticsResponse).
|
|
34
|
+
*/
|
|
35
|
+
struct QueryStatisticsResponse {
|
|
36
|
+
public:
|
|
37
|
+
std::optional<Quantity> averageQuantity SWIFT_PRIVATE;
|
|
38
|
+
std::optional<Quantity> maximumQuantity SWIFT_PRIVATE;
|
|
39
|
+
std::optional<Quantity> minimumQuantity SWIFT_PRIVATE;
|
|
40
|
+
std::optional<Quantity> sumQuantity SWIFT_PRIVATE;
|
|
41
|
+
std::optional<Quantity> mostRecentQuantity SWIFT_PRIVATE;
|
|
42
|
+
std::optional<QuantityDateInterval> mostRecentQuantityDateInterval SWIFT_PRIVATE;
|
|
43
|
+
std::optional<Quantity> duration SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
QueryStatisticsResponse() = default;
|
|
47
|
+
explicit QueryStatisticsResponse(std::optional<Quantity> averageQuantity, std::optional<Quantity> maximumQuantity, std::optional<Quantity> minimumQuantity, std::optional<Quantity> sumQuantity, std::optional<Quantity> mostRecentQuantity, std::optional<QuantityDateInterval> mostRecentQuantityDateInterval, std::optional<Quantity> duration): averageQuantity(averageQuantity), maximumQuantity(maximumQuantity), minimumQuantity(minimumQuantity), sumQuantity(sumQuantity), mostRecentQuantity(mostRecentQuantity), mostRecentQuantityDateInterval(mostRecentQuantityDateInterval), duration(duration) {}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
} // namespace margelo::nitro::healthkit
|
|
51
|
+
|
|
52
|
+
namespace margelo::nitro {
|
|
53
|
+
|
|
54
|
+
using namespace margelo::nitro::healthkit;
|
|
55
|
+
|
|
56
|
+
// C++ QueryStatisticsResponse <> JS QueryStatisticsResponse (object)
|
|
57
|
+
template <>
|
|
58
|
+
struct JSIConverter<QueryStatisticsResponse> final {
|
|
59
|
+
static inline QueryStatisticsResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
60
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
61
|
+
return QueryStatisticsResponse(
|
|
62
|
+
JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "averageQuantity")),
|
|
63
|
+
JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "maximumQuantity")),
|
|
64
|
+
JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "minimumQuantity")),
|
|
65
|
+
JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "sumQuantity")),
|
|
66
|
+
JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantity")),
|
|
67
|
+
JSIConverter<std::optional<QuantityDateInterval>>::fromJSI(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval")),
|
|
68
|
+
JSIConverter<std::optional<Quantity>>::fromJSI(runtime, obj.getProperty(runtime, "duration"))
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryStatisticsResponse& arg) {
|
|
72
|
+
jsi::Object obj(runtime);
|
|
73
|
+
obj.setProperty(runtime, "averageQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.averageQuantity));
|
|
74
|
+
obj.setProperty(runtime, "maximumQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.maximumQuantity));
|
|
75
|
+
obj.setProperty(runtime, "minimumQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.minimumQuantity));
|
|
76
|
+
obj.setProperty(runtime, "sumQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.sumQuantity));
|
|
77
|
+
obj.setProperty(runtime, "mostRecentQuantity", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.mostRecentQuantity));
|
|
78
|
+
obj.setProperty(runtime, "mostRecentQuantityDateInterval", JSIConverter<std::optional<QuantityDateInterval>>::toJSI(runtime, arg.mostRecentQuantityDateInterval));
|
|
79
|
+
obj.setProperty(runtime, "duration", JSIConverter<std::optional<Quantity>>::toJSI(runtime, arg.duration));
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
83
|
+
if (!value.isObject()) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
jsi::Object obj = value.getObject(runtime);
|
|
87
|
+
if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "averageQuantity"))) return false;
|
|
88
|
+
if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "maximumQuantity"))) return false;
|
|
89
|
+
if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "minimumQuantity"))) return false;
|
|
90
|
+
if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "sumQuantity"))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "mostRecentQuantity"))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<QuantityDateInterval>>::canConvert(runtime, obj.getProperty(runtime, "mostRecentQuantityDateInterval"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<Quantity>>::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryWorkoutSamplesWithAnchorResponse.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 `HybridWorkoutProxySpec` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
|
|
23
|
+
// Forward declaration of `DeletedSample` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct DeletedSample; }
|
|
25
|
+
|
|
26
|
+
#include <vector>
|
|
27
|
+
#include <memory>
|
|
28
|
+
#include "HybridWorkoutProxySpec.hpp"
|
|
29
|
+
#include "DeletedSample.hpp"
|
|
30
|
+
#include <string>
|
|
31
|
+
|
|
32
|
+
namespace margelo::nitro::healthkit {
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A struct which can be represented as a JavaScript object (QueryWorkoutSamplesWithAnchorResponse).
|
|
36
|
+
*/
|
|
37
|
+
struct QueryWorkoutSamplesWithAnchorResponse {
|
|
38
|
+
public:
|
|
39
|
+
std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>> workouts SWIFT_PRIVATE;
|
|
40
|
+
std::vector<DeletedSample> deletedSamples SWIFT_PRIVATE;
|
|
41
|
+
std::string newAnchor SWIFT_PRIVATE;
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
QueryWorkoutSamplesWithAnchorResponse() = default;
|
|
45
|
+
explicit QueryWorkoutSamplesWithAnchorResponse(std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>> workouts, std::vector<DeletedSample> deletedSamples, std::string newAnchor): workouts(workouts), deletedSamples(deletedSamples), newAnchor(newAnchor) {}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
} // namespace margelo::nitro::healthkit
|
|
49
|
+
|
|
50
|
+
namespace margelo::nitro {
|
|
51
|
+
|
|
52
|
+
using namespace margelo::nitro::healthkit;
|
|
53
|
+
|
|
54
|
+
// C++ QueryWorkoutSamplesWithAnchorResponse <> JS QueryWorkoutSamplesWithAnchorResponse (object)
|
|
55
|
+
template <>
|
|
56
|
+
struct JSIConverter<QueryWorkoutSamplesWithAnchorResponse> final {
|
|
57
|
+
static inline QueryWorkoutSamplesWithAnchorResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
58
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
59
|
+
return QueryWorkoutSamplesWithAnchorResponse(
|
|
60
|
+
JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::fromJSI(runtime, obj.getProperty(runtime, "workouts")),
|
|
61
|
+
JSIConverter<std::vector<DeletedSample>>::fromJSI(runtime, obj.getProperty(runtime, "deletedSamples")),
|
|
62
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "newAnchor"))
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const QueryWorkoutSamplesWithAnchorResponse& arg) {
|
|
66
|
+
jsi::Object obj(runtime);
|
|
67
|
+
obj.setProperty(runtime, "workouts", JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::toJSI(runtime, arg.workouts));
|
|
68
|
+
obj.setProperty(runtime, "deletedSamples", JSIConverter<std::vector<DeletedSample>>::toJSI(runtime, arg.deletedSamples));
|
|
69
|
+
obj.setProperty(runtime, "newAnchor", JSIConverter<std::string>::toJSI(runtime, arg.newAnchor));
|
|
70
|
+
return obj;
|
|
71
|
+
}
|
|
72
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
73
|
+
if (!value.isObject()) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
jsi::Object obj = value.getObject(runtime);
|
|
77
|
+
if (!JSIConverter<std::vector<std::shared_ptr<margelo::nitro::healthkit::HybridWorkoutProxySpec>>>::canConvert(runtime, obj.getProperty(runtime, "workouts"))) return false;
|
|
78
|
+
if (!JSIConverter<std::vector<DeletedSample>>::canConvert(runtime, obj.getProperty(runtime, "deletedSamples"))) return false;
|
|
79
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "newAnchor"))) return false;
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro
|