@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
|
+
/// CategorySamplesWithAnchorResponse.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 `CategorySample` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { struct CategorySample; }
|
|
23
|
+
// Forward declaration of `DeletedSample` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct DeletedSample; }
|
|
25
|
+
|
|
26
|
+
#include <vector>
|
|
27
|
+
#include "CategorySample.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 (CategorySamplesWithAnchorResponse).
|
|
35
|
+
*/
|
|
36
|
+
struct CategorySamplesWithAnchorResponse {
|
|
37
|
+
public:
|
|
38
|
+
std::vector<CategorySample> samples SWIFT_PRIVATE;
|
|
39
|
+
std::vector<DeletedSample> deletedSamples SWIFT_PRIVATE;
|
|
40
|
+
std::string newAnchor SWIFT_PRIVATE;
|
|
41
|
+
|
|
42
|
+
public:
|
|
43
|
+
CategorySamplesWithAnchorResponse() = default;
|
|
44
|
+
explicit CategorySamplesWithAnchorResponse(std::vector<CategorySample> 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++ CategorySamplesWithAnchorResponse <> JS CategorySamplesWithAnchorResponse (object)
|
|
54
|
+
template <>
|
|
55
|
+
struct JSIConverter<CategorySamplesWithAnchorResponse> final {
|
|
56
|
+
static inline CategorySamplesWithAnchorResponse fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
57
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
58
|
+
return CategorySamplesWithAnchorResponse(
|
|
59
|
+
JSIConverter<std::vector<CategorySample>>::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 CategorySamplesWithAnchorResponse& arg) {
|
|
65
|
+
jsi::Object obj(runtime);
|
|
66
|
+
obj.setProperty(runtime, "samples", JSIConverter<std::vector<CategorySample>>::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<CategorySample>>::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,326 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CategoryTypeIdentifier.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/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::healthkit {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (CategoryTypeIdentifier).
|
|
30
|
+
*/
|
|
31
|
+
enum class CategoryTypeIdentifier {
|
|
32
|
+
HKCATEGORYTYPEIDENTIFIERAPPLESTANDHOUR SWIFT_NAME(hkcategorytypeidentifierapplestandhour) = 0,
|
|
33
|
+
HKCATEGORYTYPEIDENTIFIERHIGHHEARTRATEEVENT SWIFT_NAME(hkcategorytypeidentifierhighheartrateevent) = 1,
|
|
34
|
+
HKCATEGORYTYPEIDENTIFIERLOWHEARTRATEEVENT SWIFT_NAME(hkcategorytypeidentifierlowheartrateevent) = 2,
|
|
35
|
+
HKCATEGORYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSUREEVENT SWIFT_NAME(hkcategorytypeidentifierheadphoneaudioexposureevent) = 3,
|
|
36
|
+
HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS SWIFT_NAME(hkcategorytypeidentifiersleepanalysis) = 4,
|
|
37
|
+
HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY SWIFT_NAME(hkcategorytypeidentifiercervicalmucusquality) = 5,
|
|
38
|
+
HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT SWIFT_NAME(hkcategorytypeidentifierovulationtestresult) = 6,
|
|
39
|
+
HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW SWIFT_NAME(hkcategorytypeidentifiermenstrualflow) = 7,
|
|
40
|
+
HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING SWIFT_NAME(hkcategorytypeidentifierintermenstrualbleeding) = 8,
|
|
41
|
+
HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY SWIFT_NAME(hkcategorytypeidentifiersexualactivity) = 9,
|
|
42
|
+
HKCATEGORYTYPEIDENTIFIERMINDFULSESSION SWIFT_NAME(hkcategorytypeidentifiermindfulsession) = 10,
|
|
43
|
+
HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT SWIFT_NAME(hkcategorytypeidentifierirregularheartrhythmevent) = 11,
|
|
44
|
+
HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT SWIFT_NAME(hkcategorytypeidentifieraudioexposureevent) = 12,
|
|
45
|
+
HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT SWIFT_NAME(hkcategorytypeidentifiertoothbrushingevent) = 13,
|
|
46
|
+
HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT SWIFT_NAME(hkcategorytypeidentifierlowcardiofitnessevent) = 14,
|
|
47
|
+
HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE SWIFT_NAME(hkcategorytypeidentifiercontraceptive) = 15,
|
|
48
|
+
HKCATEGORYTYPEIDENTIFIERLACTATION SWIFT_NAME(hkcategorytypeidentifierlactation) = 16,
|
|
49
|
+
HKCATEGORYTYPEIDENTIFIERPREGNANCY SWIFT_NAME(hkcategorytypeidentifierpregnancy) = 17,
|
|
50
|
+
HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT SWIFT_NAME(hkcategorytypeidentifierpregnancytestresult) = 18,
|
|
51
|
+
HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT SWIFT_NAME(hkcategorytypeidentifierprogesteronetestresult) = 19,
|
|
52
|
+
HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT SWIFT_NAME(hkcategorytypeidentifierenvironmentalaudioexposureevent) = 20,
|
|
53
|
+
HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT SWIFT_NAME(hkcategorytypeidentifierapplewalkingsteadinessevent) = 21,
|
|
54
|
+
HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT SWIFT_NAME(hkcategorytypeidentifierhandwashingevent) = 22,
|
|
55
|
+
HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS SWIFT_NAME(hkcategorytypeidentifierabdominalcramps) = 23,
|
|
56
|
+
HKCATEGORYTYPEIDENTIFIERACNE SWIFT_NAME(hkcategorytypeidentifieracne) = 24,
|
|
57
|
+
HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES SWIFT_NAME(hkcategorytypeidentifierappetitechanges) = 25,
|
|
58
|
+
HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE SWIFT_NAME(hkcategorytypeidentifierbladderincontinence) = 26,
|
|
59
|
+
HKCATEGORYTYPEIDENTIFIERBLOATING SWIFT_NAME(hkcategorytypeidentifierbloating) = 27,
|
|
60
|
+
HKCATEGORYTYPEIDENTIFIERBREASTPAIN SWIFT_NAME(hkcategorytypeidentifierbreastpain) = 28,
|
|
61
|
+
HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN SWIFT_NAME(hkcategorytypeidentifierchesttightnessorpain) = 29,
|
|
62
|
+
HKCATEGORYTYPEIDENTIFIERCHILLS SWIFT_NAME(hkcategorytypeidentifierchills) = 30,
|
|
63
|
+
HKCATEGORYTYPEIDENTIFIERCONSTIPATION SWIFT_NAME(hkcategorytypeidentifierconstipation) = 31,
|
|
64
|
+
HKCATEGORYTYPEIDENTIFIERCOUGHING SWIFT_NAME(hkcategorytypeidentifiercoughing) = 32,
|
|
65
|
+
HKCATEGORYTYPEIDENTIFIERDIARRHEA SWIFT_NAME(hkcategorytypeidentifierdiarrhea) = 33,
|
|
66
|
+
HKCATEGORYTYPEIDENTIFIERDIZZINESS SWIFT_NAME(hkcategorytypeidentifierdizziness) = 34,
|
|
67
|
+
HKCATEGORYTYPEIDENTIFIERDRYSKIN SWIFT_NAME(hkcategorytypeidentifierdryskin) = 35,
|
|
68
|
+
HKCATEGORYTYPEIDENTIFIERFAINTING SWIFT_NAME(hkcategorytypeidentifierfainting) = 36,
|
|
69
|
+
HKCATEGORYTYPEIDENTIFIERFATIGUE SWIFT_NAME(hkcategorytypeidentifierfatigue) = 37,
|
|
70
|
+
HKCATEGORYTYPEIDENTIFIERFEVER SWIFT_NAME(hkcategorytypeidentifierfever) = 38,
|
|
71
|
+
HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE SWIFT_NAME(hkcategorytypeidentifiergeneralizedbodyache) = 39,
|
|
72
|
+
HKCATEGORYTYPEIDENTIFIERHAIRLOSS SWIFT_NAME(hkcategorytypeidentifierhairloss) = 40,
|
|
73
|
+
HKCATEGORYTYPEIDENTIFIERHEADACHE SWIFT_NAME(hkcategorytypeidentifierheadache) = 41,
|
|
74
|
+
HKCATEGORYTYPEIDENTIFIERHEARTBURN SWIFT_NAME(hkcategorytypeidentifierheartburn) = 42,
|
|
75
|
+
HKCATEGORYTYPEIDENTIFIERHOTFLASHES SWIFT_NAME(hkcategorytypeidentifierhotflashes) = 43,
|
|
76
|
+
HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL SWIFT_NAME(hkcategorytypeidentifierlossofsmell) = 44,
|
|
77
|
+
HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE SWIFT_NAME(hkcategorytypeidentifierlossoftaste) = 45,
|
|
78
|
+
HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN SWIFT_NAME(hkcategorytypeidentifierlowerbackpain) = 46,
|
|
79
|
+
HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE SWIFT_NAME(hkcategorytypeidentifiermemorylapse) = 47,
|
|
80
|
+
HKCATEGORYTYPEIDENTIFIERMOODCHANGES SWIFT_NAME(hkcategorytypeidentifiermoodchanges) = 48,
|
|
81
|
+
HKCATEGORYTYPEIDENTIFIERNAUSEA SWIFT_NAME(hkcategorytypeidentifiernausea) = 49,
|
|
82
|
+
HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS SWIFT_NAME(hkcategorytypeidentifiernightsweats) = 50,
|
|
83
|
+
HKCATEGORYTYPEIDENTIFIERPELVICPAIN SWIFT_NAME(hkcategorytypeidentifierpelvicpain) = 51,
|
|
84
|
+
HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT SWIFT_NAME(hkcategorytypeidentifierrapidpoundingorflutteringheartbeat) = 52,
|
|
85
|
+
HKCATEGORYTYPEIDENTIFIERRUNNYNOSE SWIFT_NAME(hkcategorytypeidentifierrunnynose) = 53,
|
|
86
|
+
HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH SWIFT_NAME(hkcategorytypeidentifiershortnessofbreath) = 54,
|
|
87
|
+
HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION SWIFT_NAME(hkcategorytypeidentifiersinuscongestion) = 55,
|
|
88
|
+
HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT SWIFT_NAME(hkcategorytypeidentifierskippedheartbeat) = 56,
|
|
89
|
+
HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES SWIFT_NAME(hkcategorytypeidentifiersleepchanges) = 57,
|
|
90
|
+
HKCATEGORYTYPEIDENTIFIERSORETHROAT SWIFT_NAME(hkcategorytypeidentifiersorethroat) = 58,
|
|
91
|
+
HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS SWIFT_NAME(hkcategorytypeidentifiervaginaldryness) = 59,
|
|
92
|
+
HKCATEGORYTYPEIDENTIFIERVOMITING SWIFT_NAME(hkcategorytypeidentifiervomiting) = 60,
|
|
93
|
+
HKCATEGORYTYPEIDENTIFIERWHEEZING SWIFT_NAME(hkcategorytypeidentifierwheezing) = 61,
|
|
94
|
+
HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY SWIFT_NAME(hkcategorytypeidentifierbleedingafterpregnancy) = 62,
|
|
95
|
+
HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY SWIFT_NAME(hkcategorytypeidentifierbleedingduringpregnancy) = 63,
|
|
96
|
+
} CLOSED_ENUM;
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro::healthkit
|
|
99
|
+
|
|
100
|
+
namespace margelo::nitro {
|
|
101
|
+
|
|
102
|
+
using namespace margelo::nitro::healthkit;
|
|
103
|
+
|
|
104
|
+
// C++ CategoryTypeIdentifier <> JS CategoryTypeIdentifier (union)
|
|
105
|
+
template <>
|
|
106
|
+
struct JSIConverter<CategoryTypeIdentifier> final {
|
|
107
|
+
static inline CategoryTypeIdentifier fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
108
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
109
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
110
|
+
case hashString("HKCategoryTypeIdentifierAppleStandHour"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLESTANDHOUR;
|
|
111
|
+
case hashString("HKCategoryTypeIdentifierHighHeartRateEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHIGHHEARTRATEEVENT;
|
|
112
|
+
case hashString("HKCategoryTypeIdentifierLowHeartRateEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWHEARTRATEEVENT;
|
|
113
|
+
case hashString("HKCategoryTypeIdentifierHeadphoneAudioExposureEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSUREEVENT;
|
|
114
|
+
case hashString("HKCategoryTypeIdentifierSleepAnalysis"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS;
|
|
115
|
+
case hashString("HKCategoryTypeIdentifierCervicalMucusQuality"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY;
|
|
116
|
+
case hashString("HKCategoryTypeIdentifierOvulationTestResult"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT;
|
|
117
|
+
case hashString("HKCategoryTypeIdentifierMenstrualFlow"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW;
|
|
118
|
+
case hashString("HKCategoryTypeIdentifierIntermenstrualBleeding"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING;
|
|
119
|
+
case hashString("HKCategoryTypeIdentifierSexualActivity"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY;
|
|
120
|
+
case hashString("HKCategoryTypeIdentifierMindfulSession"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMINDFULSESSION;
|
|
121
|
+
case hashString("HKCategoryTypeIdentifierIrregularHeartRhythmEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT;
|
|
122
|
+
case hashString("HKCategoryTypeIdentifierAudioExposureEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT;
|
|
123
|
+
case hashString("HKCategoryTypeIdentifierToothbrushingEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT;
|
|
124
|
+
case hashString("HKCategoryTypeIdentifierLowCardioFitnessEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT;
|
|
125
|
+
case hashString("HKCategoryTypeIdentifierContraceptive"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE;
|
|
126
|
+
case hashString("HKCategoryTypeIdentifierLactation"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLACTATION;
|
|
127
|
+
case hashString("HKCategoryTypeIdentifierPregnancy"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCY;
|
|
128
|
+
case hashString("HKCategoryTypeIdentifierPregnancyTestResult"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT;
|
|
129
|
+
case hashString("HKCategoryTypeIdentifierProgesteroneTestResult"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT;
|
|
130
|
+
case hashString("HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT;
|
|
131
|
+
case hashString("HKCategoryTypeIdentifierAppleWalkingSteadinessEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT;
|
|
132
|
+
case hashString("HKCategoryTypeIdentifierHandwashingEvent"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT;
|
|
133
|
+
case hashString("HKCategoryTypeIdentifierAbdominalCramps"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS;
|
|
134
|
+
case hashString("HKCategoryTypeIdentifierAcne"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERACNE;
|
|
135
|
+
case hashString("HKCategoryTypeIdentifierAppetiteChanges"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES;
|
|
136
|
+
case hashString("HKCategoryTypeIdentifierBladderIncontinence"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE;
|
|
137
|
+
case hashString("HKCategoryTypeIdentifierBloating"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLOATING;
|
|
138
|
+
case hashString("HKCategoryTypeIdentifierBreastPain"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBREASTPAIN;
|
|
139
|
+
case hashString("HKCategoryTypeIdentifierChestTightnessOrPain"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN;
|
|
140
|
+
case hashString("HKCategoryTypeIdentifierChills"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHILLS;
|
|
141
|
+
case hashString("HKCategoryTypeIdentifierConstipation"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONSTIPATION;
|
|
142
|
+
case hashString("HKCategoryTypeIdentifierCoughing"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCOUGHING;
|
|
143
|
+
case hashString("HKCategoryTypeIdentifierDiarrhea"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIARRHEA;
|
|
144
|
+
case hashString("HKCategoryTypeIdentifierDizziness"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIZZINESS;
|
|
145
|
+
case hashString("HKCategoryTypeIdentifierDrySkin"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDRYSKIN;
|
|
146
|
+
case hashString("HKCategoryTypeIdentifierFainting"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFAINTING;
|
|
147
|
+
case hashString("HKCategoryTypeIdentifierFatigue"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFATIGUE;
|
|
148
|
+
case hashString("HKCategoryTypeIdentifierFever"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFEVER;
|
|
149
|
+
case hashString("HKCategoryTypeIdentifierGeneralizedBodyAche"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE;
|
|
150
|
+
case hashString("HKCategoryTypeIdentifierHairLoss"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHAIRLOSS;
|
|
151
|
+
case hashString("HKCategoryTypeIdentifierHeadache"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADACHE;
|
|
152
|
+
case hashString("HKCategoryTypeIdentifierHeartburn"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEARTBURN;
|
|
153
|
+
case hashString("HKCategoryTypeIdentifierHotFlashes"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHOTFLASHES;
|
|
154
|
+
case hashString("HKCategoryTypeIdentifierLossOfSmell"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL;
|
|
155
|
+
case hashString("HKCategoryTypeIdentifierLossOfTaste"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE;
|
|
156
|
+
case hashString("HKCategoryTypeIdentifierLowerBackPain"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN;
|
|
157
|
+
case hashString("HKCategoryTypeIdentifierMemoryLapse"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE;
|
|
158
|
+
case hashString("HKCategoryTypeIdentifierMoodChanges"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMOODCHANGES;
|
|
159
|
+
case hashString("HKCategoryTypeIdentifierNausea"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNAUSEA;
|
|
160
|
+
case hashString("HKCategoryTypeIdentifierNightSweats"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS;
|
|
161
|
+
case hashString("HKCategoryTypeIdentifierPelvicPain"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPELVICPAIN;
|
|
162
|
+
case hashString("HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT;
|
|
163
|
+
case hashString("HKCategoryTypeIdentifierRunnyNose"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRUNNYNOSE;
|
|
164
|
+
case hashString("HKCategoryTypeIdentifierShortnessOfBreath"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH;
|
|
165
|
+
case hashString("HKCategoryTypeIdentifierSinusCongestion"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION;
|
|
166
|
+
case hashString("HKCategoryTypeIdentifierSkippedHeartbeat"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT;
|
|
167
|
+
case hashString("HKCategoryTypeIdentifierSleepChanges"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES;
|
|
168
|
+
case hashString("HKCategoryTypeIdentifierSoreThroat"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSORETHROAT;
|
|
169
|
+
case hashString("HKCategoryTypeIdentifierVaginalDryness"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS;
|
|
170
|
+
case hashString("HKCategoryTypeIdentifierVomiting"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVOMITING;
|
|
171
|
+
case hashString("HKCategoryTypeIdentifierWheezing"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERWHEEZING;
|
|
172
|
+
case hashString("HKCategoryTypeIdentifierBleedingAfterPregnancy"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY;
|
|
173
|
+
case hashString("HKCategoryTypeIdentifierBleedingDuringPregnancy"): return CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY;
|
|
174
|
+
default: [[unlikely]]
|
|
175
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum CategoryTypeIdentifier - invalid value!");
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, CategoryTypeIdentifier arg) {
|
|
179
|
+
switch (arg) {
|
|
180
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLESTANDHOUR: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppleStandHour");
|
|
181
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHIGHHEARTRATEEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHighHeartRateEvent");
|
|
182
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWHEARTRATEEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowHeartRateEvent");
|
|
183
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADPHONEAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeadphoneAudioExposureEvent");
|
|
184
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPANALYSIS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepAnalysis");
|
|
185
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCERVICALMUCUSQUALITY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierCervicalMucusQuality");
|
|
186
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIEROVULATIONTESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierOvulationTestResult");
|
|
187
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMENSTRUALFLOW: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMenstrualFlow");
|
|
188
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERINTERMENSTRUALBLEEDING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIntermenstrualBleeding");
|
|
189
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSEXUALACTIVITY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSexualActivity");
|
|
190
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMINDFULSESSION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMindfulSession");
|
|
191
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERIRREGULARHEARTRHYTHMEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierIrregularHeartRhythmEvent");
|
|
192
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAudioExposureEvent");
|
|
193
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERTOOTHBRUSHINGEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierToothbrushingEvent");
|
|
194
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWCARDIOFITNESSEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowCardioFitnessEvent");
|
|
195
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONTRACEPTIVE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierContraceptive");
|
|
196
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLACTATION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLactation");
|
|
197
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPregnancy");
|
|
198
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPREGNANCYTESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPregnancyTestResult");
|
|
199
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPROGESTERONETESTRESULT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierProgesteroneTestResult");
|
|
200
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERENVIRONMENTALAUDIOEXPOSUREEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent");
|
|
201
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPLEWALKINGSTEADINESSEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppleWalkingSteadinessEvent");
|
|
202
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHANDWASHINGEVENT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHandwashingEvent");
|
|
203
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERABDOMINALCRAMPS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAbdominalCramps");
|
|
204
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERACNE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAcne");
|
|
205
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERAPPETITECHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierAppetiteChanges");
|
|
206
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLADDERINCONTINENCE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBladderIncontinence");
|
|
207
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLOATING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBloating");
|
|
208
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBREASTPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBreastPain");
|
|
209
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHESTTIGHTNESSORPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierChestTightnessOrPain");
|
|
210
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCHILLS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierChills");
|
|
211
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCONSTIPATION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierConstipation");
|
|
212
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERCOUGHING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierCoughing");
|
|
213
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIARRHEA: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDiarrhea");
|
|
214
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDIZZINESS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDizziness");
|
|
215
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERDRYSKIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierDrySkin");
|
|
216
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFAINTING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFainting");
|
|
217
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFATIGUE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFatigue");
|
|
218
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERFEVER: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierFever");
|
|
219
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERGENERALIZEDBODYACHE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierGeneralizedBodyAche");
|
|
220
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHAIRLOSS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHairLoss");
|
|
221
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEADACHE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeadache");
|
|
222
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHEARTBURN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHeartburn");
|
|
223
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERHOTFLASHES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierHotFlashes");
|
|
224
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFSMELL: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLossOfSmell");
|
|
225
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOSSOFTASTE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLossOfTaste");
|
|
226
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERLOWERBACKPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierLowerBackPain");
|
|
227
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMEMORYLAPSE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMemoryLapse");
|
|
228
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERMOODCHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierMoodChanges");
|
|
229
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNAUSEA: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierNausea");
|
|
230
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERNIGHTSWEATS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierNightSweats");
|
|
231
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERPELVICPAIN: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierPelvicPain");
|
|
232
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRAPIDPOUNDINGORFLUTTERINGHEARTBEAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat");
|
|
233
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERRUNNYNOSE: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierRunnyNose");
|
|
234
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSHORTNESSOFBREATH: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierShortnessOfBreath");
|
|
235
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSINUSCONGESTION: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSinusCongestion");
|
|
236
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSKIPPEDHEARTBEAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSkippedHeartbeat");
|
|
237
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSLEEPCHANGES: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSleepChanges");
|
|
238
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERSORETHROAT: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierSoreThroat");
|
|
239
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVAGINALDRYNESS: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierVaginalDryness");
|
|
240
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERVOMITING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierVomiting");
|
|
241
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERWHEEZING: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierWheezing");
|
|
242
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGAFTERPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBleedingAfterPregnancy");
|
|
243
|
+
case CategoryTypeIdentifier::HKCATEGORYTYPEIDENTIFIERBLEEDINGDURINGPREGNANCY: return JSIConverter<std::string>::toJSI(runtime, "HKCategoryTypeIdentifierBleedingDuringPregnancy");
|
|
244
|
+
default: [[unlikely]]
|
|
245
|
+
throw std::invalid_argument("Cannot convert CategoryTypeIdentifier to JS - invalid value: "
|
|
246
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
250
|
+
if (!value.isString()) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
254
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
255
|
+
case hashString("HKCategoryTypeIdentifierAppleStandHour"):
|
|
256
|
+
case hashString("HKCategoryTypeIdentifierHighHeartRateEvent"):
|
|
257
|
+
case hashString("HKCategoryTypeIdentifierLowHeartRateEvent"):
|
|
258
|
+
case hashString("HKCategoryTypeIdentifierHeadphoneAudioExposureEvent"):
|
|
259
|
+
case hashString("HKCategoryTypeIdentifierSleepAnalysis"):
|
|
260
|
+
case hashString("HKCategoryTypeIdentifierCervicalMucusQuality"):
|
|
261
|
+
case hashString("HKCategoryTypeIdentifierOvulationTestResult"):
|
|
262
|
+
case hashString("HKCategoryTypeIdentifierMenstrualFlow"):
|
|
263
|
+
case hashString("HKCategoryTypeIdentifierIntermenstrualBleeding"):
|
|
264
|
+
case hashString("HKCategoryTypeIdentifierSexualActivity"):
|
|
265
|
+
case hashString("HKCategoryTypeIdentifierMindfulSession"):
|
|
266
|
+
case hashString("HKCategoryTypeIdentifierIrregularHeartRhythmEvent"):
|
|
267
|
+
case hashString("HKCategoryTypeIdentifierAudioExposureEvent"):
|
|
268
|
+
case hashString("HKCategoryTypeIdentifierToothbrushingEvent"):
|
|
269
|
+
case hashString("HKCategoryTypeIdentifierLowCardioFitnessEvent"):
|
|
270
|
+
case hashString("HKCategoryTypeIdentifierContraceptive"):
|
|
271
|
+
case hashString("HKCategoryTypeIdentifierLactation"):
|
|
272
|
+
case hashString("HKCategoryTypeIdentifierPregnancy"):
|
|
273
|
+
case hashString("HKCategoryTypeIdentifierPregnancyTestResult"):
|
|
274
|
+
case hashString("HKCategoryTypeIdentifierProgesteroneTestResult"):
|
|
275
|
+
case hashString("HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent"):
|
|
276
|
+
case hashString("HKCategoryTypeIdentifierAppleWalkingSteadinessEvent"):
|
|
277
|
+
case hashString("HKCategoryTypeIdentifierHandwashingEvent"):
|
|
278
|
+
case hashString("HKCategoryTypeIdentifierAbdominalCramps"):
|
|
279
|
+
case hashString("HKCategoryTypeIdentifierAcne"):
|
|
280
|
+
case hashString("HKCategoryTypeIdentifierAppetiteChanges"):
|
|
281
|
+
case hashString("HKCategoryTypeIdentifierBladderIncontinence"):
|
|
282
|
+
case hashString("HKCategoryTypeIdentifierBloating"):
|
|
283
|
+
case hashString("HKCategoryTypeIdentifierBreastPain"):
|
|
284
|
+
case hashString("HKCategoryTypeIdentifierChestTightnessOrPain"):
|
|
285
|
+
case hashString("HKCategoryTypeIdentifierChills"):
|
|
286
|
+
case hashString("HKCategoryTypeIdentifierConstipation"):
|
|
287
|
+
case hashString("HKCategoryTypeIdentifierCoughing"):
|
|
288
|
+
case hashString("HKCategoryTypeIdentifierDiarrhea"):
|
|
289
|
+
case hashString("HKCategoryTypeIdentifierDizziness"):
|
|
290
|
+
case hashString("HKCategoryTypeIdentifierDrySkin"):
|
|
291
|
+
case hashString("HKCategoryTypeIdentifierFainting"):
|
|
292
|
+
case hashString("HKCategoryTypeIdentifierFatigue"):
|
|
293
|
+
case hashString("HKCategoryTypeIdentifierFever"):
|
|
294
|
+
case hashString("HKCategoryTypeIdentifierGeneralizedBodyAche"):
|
|
295
|
+
case hashString("HKCategoryTypeIdentifierHairLoss"):
|
|
296
|
+
case hashString("HKCategoryTypeIdentifierHeadache"):
|
|
297
|
+
case hashString("HKCategoryTypeIdentifierHeartburn"):
|
|
298
|
+
case hashString("HKCategoryTypeIdentifierHotFlashes"):
|
|
299
|
+
case hashString("HKCategoryTypeIdentifierLossOfSmell"):
|
|
300
|
+
case hashString("HKCategoryTypeIdentifierLossOfTaste"):
|
|
301
|
+
case hashString("HKCategoryTypeIdentifierLowerBackPain"):
|
|
302
|
+
case hashString("HKCategoryTypeIdentifierMemoryLapse"):
|
|
303
|
+
case hashString("HKCategoryTypeIdentifierMoodChanges"):
|
|
304
|
+
case hashString("HKCategoryTypeIdentifierNausea"):
|
|
305
|
+
case hashString("HKCategoryTypeIdentifierNightSweats"):
|
|
306
|
+
case hashString("HKCategoryTypeIdentifierPelvicPain"):
|
|
307
|
+
case hashString("HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat"):
|
|
308
|
+
case hashString("HKCategoryTypeIdentifierRunnyNose"):
|
|
309
|
+
case hashString("HKCategoryTypeIdentifierShortnessOfBreath"):
|
|
310
|
+
case hashString("HKCategoryTypeIdentifierSinusCongestion"):
|
|
311
|
+
case hashString("HKCategoryTypeIdentifierSkippedHeartbeat"):
|
|
312
|
+
case hashString("HKCategoryTypeIdentifierSleepChanges"):
|
|
313
|
+
case hashString("HKCategoryTypeIdentifierSoreThroat"):
|
|
314
|
+
case hashString("HKCategoryTypeIdentifierVaginalDryness"):
|
|
315
|
+
case hashString("HKCategoryTypeIdentifierVomiting"):
|
|
316
|
+
case hashString("HKCategoryTypeIdentifierWheezing"):
|
|
317
|
+
case hashString("HKCategoryTypeIdentifierBleedingAfterPregnancy"):
|
|
318
|
+
case hashString("HKCategoryTypeIdentifierBleedingDuringPregnancy"):
|
|
319
|
+
return true;
|
|
320
|
+
default:
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ComparisonPredicateOperator.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <cmath>
|
|
11
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
12
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
13
|
+
#else
|
|
14
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
15
|
+
#endif
|
|
16
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
17
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
18
|
+
#else
|
|
19
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
namespace margelo::nitro::healthkit {
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An enum which can be represented as a JavaScript enum (ComparisonPredicateOperator).
|
|
26
|
+
*/
|
|
27
|
+
enum class ComparisonPredicateOperator {
|
|
28
|
+
LESSTHAN SWIFT_NAME(lessthan) = 0,
|
|
29
|
+
LESSTHANOREQUALTO SWIFT_NAME(lessthanorequalto) = 1,
|
|
30
|
+
GREATERTHAN SWIFT_NAME(greaterthan) = 2,
|
|
31
|
+
GREATERTHANOREQUALTO SWIFT_NAME(greaterthanorequalto) = 3,
|
|
32
|
+
EQUALTO SWIFT_NAME(equalto) = 4,
|
|
33
|
+
NOTEQUALTO SWIFT_NAME(notequalto) = 5,
|
|
34
|
+
MATCHES SWIFT_NAME(matches) = 6,
|
|
35
|
+
LIKE SWIFT_NAME(like) = 7,
|
|
36
|
+
BEGINSWITH SWIFT_NAME(beginswith) = 8,
|
|
37
|
+
ENDSWITH SWIFT_NAME(endswith) = 9,
|
|
38
|
+
IN SWIFT_NAME(in) = 10,
|
|
39
|
+
CUSTOMSELECTOR SWIFT_NAME(customselector) = 11,
|
|
40
|
+
CONTAINS SWIFT_NAME(contains) = 99,
|
|
41
|
+
BETWEEN SWIFT_NAME(between) = 100,
|
|
42
|
+
} CLOSED_ENUM;
|
|
43
|
+
|
|
44
|
+
} // namespace margelo::nitro::healthkit
|
|
45
|
+
|
|
46
|
+
namespace margelo::nitro {
|
|
47
|
+
|
|
48
|
+
using namespace margelo::nitro::healthkit;
|
|
49
|
+
|
|
50
|
+
// C++ ComparisonPredicateOperator <> JS ComparisonPredicateOperator (enum)
|
|
51
|
+
template <>
|
|
52
|
+
struct JSIConverter<ComparisonPredicateOperator> final {
|
|
53
|
+
static inline ComparisonPredicateOperator fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
54
|
+
int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
|
|
55
|
+
return static_cast<ComparisonPredicateOperator>(enumValue);
|
|
56
|
+
}
|
|
57
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, ComparisonPredicateOperator arg) {
|
|
58
|
+
int enumValue = static_cast<int>(arg);
|
|
59
|
+
return JSIConverter<int>::toJSI(runtime, enumValue);
|
|
60
|
+
}
|
|
61
|
+
static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
|
|
62
|
+
if (!value.isNumber()) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
double integer;
|
|
66
|
+
double fraction = modf(value.getNumber(), &integer);
|
|
67
|
+
if (fraction != 0.0) {
|
|
68
|
+
// It is some kind of floating point number - our enums are ints.
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
// Check if we are within the bounds of the enum.
|
|
72
|
+
return integer >= 0 && integer <= 13;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CorrelationSample.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 `CorrelationTypeIdentifier` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::healthkit { enum class CorrelationTypeIdentifier; }
|
|
23
|
+
// Forward declaration of `CategorySample` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::healthkit { struct CategorySample; }
|
|
25
|
+
// Forward declaration of `QuantitySample` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::healthkit { struct QuantitySample; }
|
|
27
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
28
|
+
namespace NitroModules { class AnyMap; }
|
|
29
|
+
|
|
30
|
+
#include "CorrelationTypeIdentifier.hpp"
|
|
31
|
+
#include <vector>
|
|
32
|
+
#include <variant>
|
|
33
|
+
#include "CategorySample.hpp"
|
|
34
|
+
#include "QuantitySample.hpp"
|
|
35
|
+
#include <NitroModules/AnyMap.hpp>
|
|
36
|
+
#include <chrono>
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::healthkit {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (CorrelationSample).
|
|
42
|
+
*/
|
|
43
|
+
struct CorrelationSample {
|
|
44
|
+
public:
|
|
45
|
+
CorrelationTypeIdentifier correlationType SWIFT_PRIVATE;
|
|
46
|
+
std::vector<std::variant<CategorySample, QuantitySample>> objects SWIFT_PRIVATE;
|
|
47
|
+
std::shared_ptr<AnyMap> metadata SWIFT_PRIVATE;
|
|
48
|
+
std::chrono::system_clock::time_point startDate SWIFT_PRIVATE;
|
|
49
|
+
std::chrono::system_clock::time_point endDate SWIFT_PRIVATE;
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
CorrelationSample() = default;
|
|
53
|
+
explicit CorrelationSample(CorrelationTypeIdentifier correlationType, std::vector<std::variant<CategorySample, QuantitySample>> objects, std::shared_ptr<AnyMap> metadata, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate): correlationType(correlationType), objects(objects), metadata(metadata), startDate(startDate), endDate(endDate) {}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
} // namespace margelo::nitro::healthkit
|
|
57
|
+
|
|
58
|
+
namespace margelo::nitro {
|
|
59
|
+
|
|
60
|
+
using namespace margelo::nitro::healthkit;
|
|
61
|
+
|
|
62
|
+
// C++ CorrelationSample <> JS CorrelationSample (object)
|
|
63
|
+
template <>
|
|
64
|
+
struct JSIConverter<CorrelationSample> final {
|
|
65
|
+
static inline CorrelationSample fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
+
return CorrelationSample(
|
|
68
|
+
JSIConverter<CorrelationTypeIdentifier>::fromJSI(runtime, obj.getProperty(runtime, "correlationType")),
|
|
69
|
+
JSIConverter<std::vector<std::variant<CategorySample, QuantitySample>>>::fromJSI(runtime, obj.getProperty(runtime, "objects")),
|
|
70
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, "metadata")),
|
|
71
|
+
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "startDate")),
|
|
72
|
+
JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, "endDate"))
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const CorrelationSample& arg) {
|
|
76
|
+
jsi::Object obj(runtime);
|
|
77
|
+
obj.setProperty(runtime, "correlationType", JSIConverter<CorrelationTypeIdentifier>::toJSI(runtime, arg.correlationType));
|
|
78
|
+
obj.setProperty(runtime, "objects", JSIConverter<std::vector<std::variant<CategorySample, QuantitySample>>>::toJSI(runtime, arg.objects));
|
|
79
|
+
obj.setProperty(runtime, "metadata", JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
|
|
80
|
+
obj.setProperty(runtime, "startDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
|
|
81
|
+
obj.setProperty(runtime, "endDate", JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
85
|
+
if (!value.isObject()) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
jsi::Object obj = value.getObject(runtime);
|
|
89
|
+
if (!JSIConverter<CorrelationTypeIdentifier>::canConvert(runtime, obj.getProperty(runtime, "correlationType"))) return false;
|
|
90
|
+
if (!JSIConverter<std::vector<std::variant<CategorySample, QuantitySample>>>::canConvert(runtime, obj.getProperty(runtime, "objects"))) return false;
|
|
91
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false;
|
|
92
|
+
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "startDate"))) return false;
|
|
93
|
+
if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, "endDate"))) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro
|