@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,202 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { AuthorizationRequestStatus, AuthorizationStatus } from './types/Auth';
|
|
3
|
+
import { BiologicalSex, BloodType, FitzpatrickSkinType, WheelchairUse, } from './types/Characteristics';
|
|
4
|
+
const notAvailableError = `[@kingstinct/react-native-healthkit] Platform "${Platform.OS}" not supported. HealthKit is only available on iOS.`;
|
|
5
|
+
let hasWarned = false;
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
function UnavailableFnFromModule(fn, defaultValue) {
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
return () => {
|
|
10
|
+
if (Platform.OS !== 'ios' && !hasWarned) {
|
|
11
|
+
console.warn(notAvailableError);
|
|
12
|
+
hasWarned = true;
|
|
13
|
+
}
|
|
14
|
+
return defaultValue;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// --- Mock Implementations for exported functions ---
|
|
18
|
+
// CoreModule functions
|
|
19
|
+
export const authorizationStatusFor = UnavailableFnFromModule('authorizationStatusFor', AuthorizationStatus.notDetermined);
|
|
20
|
+
export const disableAllBackgroundDelivery = UnavailableFnFromModule('disableAllBackgroundDelivery', Promise.resolve(false));
|
|
21
|
+
export const disableBackgroundDelivery = UnavailableFnFromModule('disableBackgroundDelivery', Promise.resolve(false));
|
|
22
|
+
export const enableBackgroundDelivery = UnavailableFnFromModule('enableBackgroundDelivery', Promise.resolve(false));
|
|
23
|
+
export const getPreferredUnits = UnavailableFnFromModule('getPreferredUnits', Promise.resolve([]));
|
|
24
|
+
export const getRequestStatusForAuthorization = UnavailableFnFromModule('getRequestStatusForAuthorization', Promise.resolve(AuthorizationRequestStatus.unknown));
|
|
25
|
+
export const isHealthDataAvailable = UnavailableFnFromModule('isHealthDataAvailable', false); // Original was synchronous
|
|
26
|
+
export const isHealthDataAvailableAsync = UnavailableFnFromModule('isHealthDataAvailableAsync', Promise.resolve(false)); // Added for consistency if needed
|
|
27
|
+
export const querySources = UnavailableFnFromModule('querySources', Promise.resolve([]));
|
|
28
|
+
export const requestAuthorization = UnavailableFnFromModule('requestAuthorization', Promise.resolve(false));
|
|
29
|
+
export const deleteObjects = UnavailableFnFromModule('deleteObjects', Promise.resolve(0));
|
|
30
|
+
export const subscribeToChanges = UnavailableFnFromModule('subscribeToChanges', 'dummy-query-uuid'); // Mocking the observer query UUID
|
|
31
|
+
export const isProtectedDataAvailable = UnavailableFnFromModule('isProtectedDataAvailable', false);
|
|
32
|
+
export const isObjectTypeAvailable = UnavailableFnFromModule('isObjectTypeAvailable', false);
|
|
33
|
+
export const isObjectTypeAvailableAsync = UnavailableFnFromModule('isObjectTypeAvailableAsync', Promise.resolve(false));
|
|
34
|
+
export const areObjectTypesAvailable = UnavailableFnFromModule('areObjectTypesAvailable', {});
|
|
35
|
+
export const areObjectTypesAvailableAsync = UnavailableFnFromModule('areObjectTypesAvailableAsync', Promise.resolve({}));
|
|
36
|
+
// CharacteristicTypeModule functions
|
|
37
|
+
export const getBiologicalSex = UnavailableFnFromModule('getBiologicalSex', BiologicalSex.notSet);
|
|
38
|
+
export const getBloodType = UnavailableFnFromModule('getBloodType', BloodType.notSet);
|
|
39
|
+
export const getDateOfBirth = UnavailableFnFromModule('getDateOfBirth', new Date(0)); // Assuming string for date
|
|
40
|
+
export const getFitzpatrickSkinType = UnavailableFnFromModule('getFitzpatrickSkinType', FitzpatrickSkinType.notSet);
|
|
41
|
+
export const getWheelchairUse = UnavailableFnFromModule('getWheelchairUse', WheelchairUse.notSet);
|
|
42
|
+
// QuantityTypeModule functions
|
|
43
|
+
export const queryQuantitySamples = UnavailableFnFromModule('queryQuantitySamples', Promise.resolve([]));
|
|
44
|
+
export const queryQuantitySamplesWithAnchor = UnavailableFnFromModule('queryQuantitySamplesWithAnchor', Promise.resolve({
|
|
45
|
+
samples: [],
|
|
46
|
+
deletedSamples: [],
|
|
47
|
+
newAnchor: '',
|
|
48
|
+
}));
|
|
49
|
+
export const queryStatisticsForQuantity = UnavailableFnFromModule('queryStatisticsForQuantity', Promise.resolve({}));
|
|
50
|
+
export const queryStatisticsCollectionForQuantity = UnavailableFnFromModule('queryStatisticsCollectionForQuantity', Promise.resolve([]));
|
|
51
|
+
export const saveQuantitySample = UnavailableFnFromModule('saveQuantitySample', Promise.resolve(false));
|
|
52
|
+
export const isQuantityCompatibleWithUnit = UnavailableFnFromModule('isQuantityCompatibleWithUnit', false);
|
|
53
|
+
// CategoryTypeModule functions
|
|
54
|
+
export function queryCategorySamples(categoryTypeIdentifier) {
|
|
55
|
+
if (Platform.OS !== 'ios' && !hasWarned) {
|
|
56
|
+
console.warn(notAvailableError);
|
|
57
|
+
hasWarned = true;
|
|
58
|
+
}
|
|
59
|
+
return Promise.resolve([]);
|
|
60
|
+
}
|
|
61
|
+
export function queryCategorySamplesWithAnchor(categoryTypeIdentifier) {
|
|
62
|
+
if (Platform.OS !== 'ios' && !hasWarned) {
|
|
63
|
+
console.warn(notAvailableError);
|
|
64
|
+
hasWarned = true;
|
|
65
|
+
}
|
|
66
|
+
return Promise.resolve({
|
|
67
|
+
samples: [],
|
|
68
|
+
deletedSamples: [],
|
|
69
|
+
newAnchor: '',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
export const saveCategorySample = UnavailableFnFromModule('saveCategorySample', Promise.resolve(false));
|
|
73
|
+
// CorrelationTypeModule functions
|
|
74
|
+
export const queryCorrelationSamples = UnavailableFnFromModule('queryCorrelationSamples', Promise.resolve([]));
|
|
75
|
+
export const saveCorrelationSample = UnavailableFnFromModule('saveCorrelationSample', Promise.resolve(false));
|
|
76
|
+
// HeartbeatSeriesModule functions
|
|
77
|
+
export const queryHeartbeatSeriesSamples = UnavailableFnFromModule('queryHeartbeatSeriesSamples', Promise.resolve([]));
|
|
78
|
+
export const queryHeartbeatSeriesSamplesWithAnchor = UnavailableFnFromModule('queryHeartbeatSeriesSamplesWithAnchor', Promise.resolve({
|
|
79
|
+
samples: [],
|
|
80
|
+
deletedSamples: [],
|
|
81
|
+
newAnchor: '',
|
|
82
|
+
}));
|
|
83
|
+
// WorkoutsModule functions
|
|
84
|
+
export const queryWorkoutSamples = UnavailableFnFromModule('queryWorkoutSamples', Promise.resolve([]));
|
|
85
|
+
export const queryWorkoutSamplesWithAnchor = UnavailableFnFromModule('queryWorkoutSamplesWithAnchor', Promise.resolve({
|
|
86
|
+
workouts: [],
|
|
87
|
+
deletedSamples: [],
|
|
88
|
+
newAnchor: '',
|
|
89
|
+
}));
|
|
90
|
+
export const saveWorkoutSample = UnavailableFnFromModule('saveWorkoutSample', Promise.resolve(''));
|
|
91
|
+
export const startWatchApp = UnavailableFnFromModule('startWatchApp', Promise.resolve(false));
|
|
92
|
+
// StateOfMindModule functions
|
|
93
|
+
export const queryStateOfMindSamples = UnavailableFnFromModule('queryStateOfMindSamples', Promise.resolve([]));
|
|
94
|
+
export const saveStateOfMindSample = UnavailableFnFromModule('saveStateOfMindSample', Promise.resolve(false));
|
|
95
|
+
// Utility functions (from original export list)
|
|
96
|
+
export function getMostRecentCategorySample(identifier) {
|
|
97
|
+
if (Platform.OS !== 'ios' && !hasWarned) {
|
|
98
|
+
console.warn(notAvailableError);
|
|
99
|
+
hasWarned = true;
|
|
100
|
+
}
|
|
101
|
+
return Promise.resolve(undefined);
|
|
102
|
+
}
|
|
103
|
+
export const getMostRecentQuantitySample = UnavailableFnFromModule('getMostRecentQuantitySample',
|
|
104
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
105
|
+
Promise.resolve(undefined));
|
|
106
|
+
export const getMostRecentWorkout = UnavailableFnFromModule('getMostRecentWorkout',
|
|
107
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
108
|
+
Promise.resolve(undefined));
|
|
109
|
+
export const getPreferredUnit = UnavailableFnFromModule('getPreferredUnit', Promise.resolve('count')); // Defaulting to 'count'
|
|
110
|
+
// Hooks (from original export list)
|
|
111
|
+
export function useMostRecentCategorySample(categoryTypeIdentifier) {
|
|
112
|
+
if (Platform.OS !== 'ios' && !hasWarned) {
|
|
113
|
+
console.warn(notAvailableError);
|
|
114
|
+
hasWarned = true;
|
|
115
|
+
}
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
export const useMostRecentQuantitySample = UnavailableFnFromModule('useMostRecentQuantitySample', undefined);
|
|
119
|
+
export const useMostRecentWorkout = UnavailableFnFromModule('useMostRecentWorkout', undefined);
|
|
120
|
+
export const useSubscribeToChanges = UnavailableFnFromModule('useSubscribeToChanges', undefined); // Mocking callback structure
|
|
121
|
+
export const useHealthkitAuthorization = UnavailableFnFromModule('useHealthkitAuthorization', [
|
|
122
|
+
AuthorizationRequestStatus.unknown,
|
|
123
|
+
() => Promise.resolve(AuthorizationRequestStatus.unknown),
|
|
124
|
+
]);
|
|
125
|
+
export const useIsHealthDataAvailable = UnavailableFnFromModule('useIsHealthDataAvailable', false);
|
|
126
|
+
export const useSources = UnavailableFnFromModule('useSources', null);
|
|
127
|
+
export const useStatisticsForQuantity = UnavailableFnFromModule('useStatisticsForQuantity', null);
|
|
128
|
+
export const getBiologicalSexAsync = UnavailableFnFromModule('getBiologicalSexAsync', Promise.resolve(BiologicalSex.notSet));
|
|
129
|
+
export const getBloodTypeAsync = UnavailableFnFromModule('getBloodTypeAsync', Promise.resolve(BloodType.notSet));
|
|
130
|
+
export const getDateOfBirthAsync = UnavailableFnFromModule('getDateOfBirthAsync', Promise.resolve(new Date(0))); // Assuming string for date
|
|
131
|
+
export const getFitzpatrickSkinTypeAsync = UnavailableFnFromModule('getFitzpatrickSkinTypeAsync', Promise.resolve(FitzpatrickSkinType.notSet));
|
|
132
|
+
export const getWheelchairUseAsync = UnavailableFnFromModule('getWheelchairUseAsync', Promise.resolve(WheelchairUse.notSet));
|
|
133
|
+
export const unsubscribeQueries = UnavailableFnFromModule('unsubscribeQueries', 0);
|
|
134
|
+
// --- Default Export ---
|
|
135
|
+
// This attempts to match the structure of the default export from index.ios.ts
|
|
136
|
+
const HealthkitModule = {
|
|
137
|
+
// All named exports are also part of the default export object
|
|
138
|
+
authorizationStatusFor,
|
|
139
|
+
isObjectTypeAvailable,
|
|
140
|
+
unsubscribeQueries,
|
|
141
|
+
isObjectTypeAvailableAsync,
|
|
142
|
+
areObjectTypesAvailable,
|
|
143
|
+
areObjectTypesAvailableAsync,
|
|
144
|
+
isQuantityCompatibleWithUnit,
|
|
145
|
+
disableAllBackgroundDelivery,
|
|
146
|
+
disableBackgroundDelivery,
|
|
147
|
+
enableBackgroundDelivery,
|
|
148
|
+
getBiologicalSex,
|
|
149
|
+
getBloodType,
|
|
150
|
+
getDateOfBirth,
|
|
151
|
+
getFitzpatrickSkinType,
|
|
152
|
+
getMostRecentCategorySample,
|
|
153
|
+
getMostRecentQuantitySample,
|
|
154
|
+
getMostRecentWorkout,
|
|
155
|
+
getPreferredUnits,
|
|
156
|
+
getPreferredUnit,
|
|
157
|
+
getRequestStatusForAuthorization,
|
|
158
|
+
getWheelchairUse,
|
|
159
|
+
isHealthDataAvailable,
|
|
160
|
+
isHealthDataAvailableAsync,
|
|
161
|
+
queryCategorySamples,
|
|
162
|
+
queryCategorySamplesWithAnchor,
|
|
163
|
+
queryCorrelationSamples,
|
|
164
|
+
queryHeartbeatSeriesSamples,
|
|
165
|
+
queryHeartbeatSeriesSamplesWithAnchor,
|
|
166
|
+
queryQuantitySamples,
|
|
167
|
+
queryQuantitySamplesWithAnchor,
|
|
168
|
+
queryStatisticsForQuantity,
|
|
169
|
+
queryStatisticsCollectionForQuantity,
|
|
170
|
+
queryWorkoutSamples,
|
|
171
|
+
queryWorkoutSamplesWithAnchor,
|
|
172
|
+
querySources,
|
|
173
|
+
requestAuthorization,
|
|
174
|
+
deleteObjects,
|
|
175
|
+
saveCategorySample,
|
|
176
|
+
saveCorrelationSample,
|
|
177
|
+
saveQuantitySample,
|
|
178
|
+
saveWorkoutSample,
|
|
179
|
+
subscribeToChanges,
|
|
180
|
+
startWatchApp,
|
|
181
|
+
isProtectedDataAvailable,
|
|
182
|
+
queryStateOfMindSamples,
|
|
183
|
+
saveStateOfMindSample,
|
|
184
|
+
// Hooks
|
|
185
|
+
useMostRecentCategorySample,
|
|
186
|
+
useMostRecentQuantitySample,
|
|
187
|
+
useMostRecentWorkout,
|
|
188
|
+
useSubscribeToChanges,
|
|
189
|
+
useHealthkitAuthorization,
|
|
190
|
+
useIsHealthDataAvailable,
|
|
191
|
+
useSources,
|
|
192
|
+
useStatisticsForQuantity,
|
|
193
|
+
getBiologicalSexAsync,
|
|
194
|
+
getBloodTypeAsync,
|
|
195
|
+
getDateOfBirthAsync,
|
|
196
|
+
getFitzpatrickSkinTypeAsync,
|
|
197
|
+
getWheelchairUseAsync,
|
|
198
|
+
};
|
|
199
|
+
export default {
|
|
200
|
+
...HealthkitModule,
|
|
201
|
+
default: HealthkitModule,
|
|
202
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
|
+
export const Core = NitroModules.createHybridObject('CoreModule');
|
|
3
|
+
export const Workouts = NitroModules.createHybridObject('WorkoutsModule');
|
|
4
|
+
export const Characteristics = NitroModules.createHybridObject('CharacteristicTypeModule');
|
|
5
|
+
export const QuantityTypes = NitroModules.createHybridObject('QuantityTypeModule');
|
|
6
|
+
export const CategoryTypes = NitroModules.createHybridObject('CategoryTypeModule');
|
|
7
|
+
export const CorrelationTypes = NitroModules.createHybridObject('CorrelationTypeModule');
|
|
8
|
+
export const HeartbeatSeries = NitroModules.createHybridObject('HeartbeatSeriesModule');
|
|
9
|
+
export const StateOfMind = NitroModules.createHybridObject('StateOfMindModule');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutsessionstate Apple Docs }
|
|
3
|
+
*/
|
|
4
|
+
export var WorkoutSessionState;
|
|
5
|
+
(function (WorkoutSessionState) {
|
|
6
|
+
WorkoutSessionState[WorkoutSessionState["NotStarted"] = 1] = "NotStarted";
|
|
7
|
+
WorkoutSessionState[WorkoutSessionState["Running"] = 2] = "Running";
|
|
8
|
+
WorkoutSessionState[WorkoutSessionState["Ended"] = 3] = "Ended";
|
|
9
|
+
WorkoutSessionState[WorkoutSessionState["Paused"] = 4] = "Paused";
|
|
10
|
+
WorkoutSessionState[WorkoutSessionState["Prepared"] = 5] = "Prepared";
|
|
11
|
+
WorkoutSessionState[WorkoutSessionState["Stopped"] = 6] = "Stopped";
|
|
12
|
+
})(WorkoutSessionState || (WorkoutSessionState = {}));
|
|
13
|
+
/*type OnRemoteWorkoutStateChangeCallback = ;
|
|
14
|
+
type OnRemoteWorkoutErrorCallback = (event: WorkoutErrorEvent) => void;
|
|
15
|
+
type OnRemoteWorkoutDataCallback = (event: WorkoutDataReceivedEvent) => void;
|
|
16
|
+
type OnRemoteWorkoutEventReceivedCallback = (event: WorkoutEventReceivedEvent) => void;*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus Apple Docs }
|
|
3
|
+
*/
|
|
4
|
+
export var AuthorizationRequestStatus;
|
|
5
|
+
(function (AuthorizationRequestStatus) {
|
|
6
|
+
AuthorizationRequestStatus[AuthorizationRequestStatus["unknown"] = 0] = "unknown";
|
|
7
|
+
AuthorizationRequestStatus[AuthorizationRequestStatus["shouldRequest"] = 1] = "shouldRequest";
|
|
8
|
+
AuthorizationRequestStatus[AuthorizationRequestStatus["unnecessary"] = 2] = "unnecessary";
|
|
9
|
+
})(AuthorizationRequestStatus || (AuthorizationRequestStatus = {}));
|
|
10
|
+
/**
|
|
11
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationstatus Apple Docs }
|
|
12
|
+
*/
|
|
13
|
+
export var AuthorizationStatus;
|
|
14
|
+
(function (AuthorizationStatus) {
|
|
15
|
+
AuthorizationStatus[AuthorizationStatus["notDetermined"] = 0] = "notDetermined";
|
|
16
|
+
AuthorizationStatus[AuthorizationStatus["sharingDenied"] = 1] = "sharingDenied";
|
|
17
|
+
AuthorizationStatus[AuthorizationStatus["sharingAuthorized"] = 2] = "sharingAuthorized";
|
|
18
|
+
})(AuthorizationStatus || (AuthorizationStatus = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkupdatefrequency Apple Docs }
|
|
3
|
+
*/
|
|
4
|
+
export var UpdateFrequency;
|
|
5
|
+
(function (UpdateFrequency) {
|
|
6
|
+
UpdateFrequency[UpdateFrequency["immediate"] = 1] = "immediate";
|
|
7
|
+
UpdateFrequency[UpdateFrequency["hourly"] = 2] = "hourly";
|
|
8
|
+
UpdateFrequency[UpdateFrequency["daily"] = 3] = "daily";
|
|
9
|
+
UpdateFrequency[UpdateFrequency["weekly"] = 4] = "weekly";
|
|
10
|
+
})(UpdateFrequency || (UpdateFrequency = {}));
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepregnancytestresult Apple Docs }
|
|
3
|
+
*/
|
|
4
|
+
var CategoryValuePregnancyTestResult;
|
|
5
|
+
(function (CategoryValuePregnancyTestResult) {
|
|
6
|
+
CategoryValuePregnancyTestResult[CategoryValuePregnancyTestResult["positive"] = 2] = "positive";
|
|
7
|
+
CategoryValuePregnancyTestResult[CategoryValuePregnancyTestResult["negative"] = 1] = "negative";
|
|
8
|
+
CategoryValuePregnancyTestResult[CategoryValuePregnancyTestResult["indeterminate"] = 3] = "indeterminate";
|
|
9
|
+
})(CategoryValuePregnancyTestResult || (CategoryValuePregnancyTestResult = {}));
|
|
10
|
+
/**
|
|
11
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluecervicalmucusquality Apple Docs }
|
|
12
|
+
*/
|
|
13
|
+
export var CategoryValueCervicalMucusQuality;
|
|
14
|
+
(function (CategoryValueCervicalMucusQuality) {
|
|
15
|
+
CategoryValueCervicalMucusQuality[CategoryValueCervicalMucusQuality["dry"] = 1] = "dry";
|
|
16
|
+
CategoryValueCervicalMucusQuality[CategoryValueCervicalMucusQuality["sticky"] = 2] = "sticky";
|
|
17
|
+
CategoryValueCervicalMucusQuality[CategoryValueCervicalMucusQuality["creamy"] = 3] = "creamy";
|
|
18
|
+
CategoryValueCervicalMucusQuality[CategoryValueCervicalMucusQuality["watery"] = 4] = "watery";
|
|
19
|
+
CategoryValueCervicalMucusQuality[CategoryValueCervicalMucusQuality["eggWhite"] = 5] = "eggWhite";
|
|
20
|
+
})(CategoryValueCervicalMucusQuality || (CategoryValueCervicalMucusQuality = {}));
|
|
21
|
+
/**
|
|
22
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluemenstrualflow Apple Docs }
|
|
23
|
+
*/
|
|
24
|
+
export var CategoryValueMenstrualFlow;
|
|
25
|
+
(function (CategoryValueMenstrualFlow) {
|
|
26
|
+
CategoryValueMenstrualFlow[CategoryValueMenstrualFlow["unspecified"] = 1] = "unspecified";
|
|
27
|
+
CategoryValueMenstrualFlow[CategoryValueMenstrualFlow["none"] = 5] = "none";
|
|
28
|
+
CategoryValueMenstrualFlow[CategoryValueMenstrualFlow["light"] = 2] = "light";
|
|
29
|
+
CategoryValueMenstrualFlow[CategoryValueMenstrualFlow["medium"] = 3] = "medium";
|
|
30
|
+
CategoryValueMenstrualFlow[CategoryValueMenstrualFlow["heavy"] = 4] = "heavy";
|
|
31
|
+
})(CategoryValueMenstrualFlow || (CategoryValueMenstrualFlow = {}));
|
|
32
|
+
/**
|
|
33
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueovulationtestresult Apple Docs }
|
|
34
|
+
*/
|
|
35
|
+
export var CategoryValueOvulationTestResult;
|
|
36
|
+
(function (CategoryValueOvulationTestResult) {
|
|
37
|
+
CategoryValueOvulationTestResult[CategoryValueOvulationTestResult["negative"] = 1] = "negative";
|
|
38
|
+
CategoryValueOvulationTestResult[CategoryValueOvulationTestResult["luteinizingHormoneSurge"] = 2] = "luteinizingHormoneSurge";
|
|
39
|
+
CategoryValueOvulationTestResult[CategoryValueOvulationTestResult["indeterminate"] = 3] = "indeterminate";
|
|
40
|
+
CategoryValueOvulationTestResult[CategoryValueOvulationTestResult["estrogenSurge"] = 4] = "estrogenSurge";
|
|
41
|
+
})(CategoryValueOvulationTestResult || (CategoryValueOvulationTestResult = {}));
|
|
42
|
+
/**
|
|
43
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluesleepanalysis Apple Docs }
|
|
44
|
+
*/
|
|
45
|
+
export var CategoryValueSleepAnalysis;
|
|
46
|
+
(function (CategoryValueSleepAnalysis) {
|
|
47
|
+
CategoryValueSleepAnalysis[CategoryValueSleepAnalysis["inBed"] = 0] = "inBed";
|
|
48
|
+
CategoryValueSleepAnalysis[CategoryValueSleepAnalysis["asleepUnspecified"] = 1] = "asleepUnspecified";
|
|
49
|
+
CategoryValueSleepAnalysis[CategoryValueSleepAnalysis["awake"] = 2] = "awake";
|
|
50
|
+
CategoryValueSleepAnalysis[CategoryValueSleepAnalysis["asleepCore"] = 3] = "asleepCore";
|
|
51
|
+
CategoryValueSleepAnalysis[CategoryValueSleepAnalysis["asleepDeep"] = 4] = "asleepDeep";
|
|
52
|
+
CategoryValueSleepAnalysis[CategoryValueSleepAnalysis["asleepREM"] = 5] = "asleepREM";
|
|
53
|
+
})(CategoryValueSleepAnalysis || (CategoryValueSleepAnalysis = {}));
|
|
54
|
+
/**
|
|
55
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges Apple Docs}
|
|
56
|
+
*/
|
|
57
|
+
export var CategoryValueAppetiteChanges;
|
|
58
|
+
(function (CategoryValueAppetiteChanges) {
|
|
59
|
+
CategoryValueAppetiteChanges[CategoryValueAppetiteChanges["decreased"] = 2] = "decreased";
|
|
60
|
+
CategoryValueAppetiteChanges[CategoryValueAppetiteChanges["increased"] = 3] = "increased";
|
|
61
|
+
CategoryValueAppetiteChanges[CategoryValueAppetiteChanges["noChange"] = 1] = "noChange";
|
|
62
|
+
CategoryValueAppetiteChanges[CategoryValueAppetiteChanges["unspecified"] = 0] = "unspecified";
|
|
63
|
+
})(CategoryValueAppetiteChanges || (CategoryValueAppetiteChanges = {}));
|
|
64
|
+
/**
|
|
65
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence Apple Docs}
|
|
66
|
+
*/
|
|
67
|
+
export var CategoryValuePresence;
|
|
68
|
+
(function (CategoryValuePresence) {
|
|
69
|
+
CategoryValuePresence[CategoryValuePresence["notPresent"] = 1] = "notPresent";
|
|
70
|
+
CategoryValuePresence[CategoryValuePresence["present"] = 0] = "present";
|
|
71
|
+
})(CategoryValuePresence || (CategoryValuePresence = {}));
|
|
72
|
+
/**
|
|
73
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueseverity Apple Docs }
|
|
74
|
+
*/
|
|
75
|
+
export var CategoryValueSeverity;
|
|
76
|
+
(function (CategoryValueSeverity) {
|
|
77
|
+
CategoryValueSeverity[CategoryValueSeverity["notPresent"] = 1] = "notPresent";
|
|
78
|
+
CategoryValueSeverity[CategoryValueSeverity["mild"] = 2] = "mild";
|
|
79
|
+
CategoryValueSeverity[CategoryValueSeverity["moderate"] = 3] = "moderate";
|
|
80
|
+
CategoryValueSeverity[CategoryValueSeverity["severe"] = 4] = "severe";
|
|
81
|
+
CategoryValueSeverity[CategoryValueSeverity["unspecified"] = 0] = "unspecified";
|
|
82
|
+
})(CategoryValueSeverity || (CategoryValueSeverity = {}));
|
|
83
|
+
/**
|
|
84
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalue/notapplicable Apple Docs }
|
|
85
|
+
*/
|
|
86
|
+
export var CategoryValueNotApplicable;
|
|
87
|
+
(function (CategoryValueNotApplicable) {
|
|
88
|
+
CategoryValueNotApplicable[CategoryValueNotApplicable["notApplicable"] = 0] = "notApplicable";
|
|
89
|
+
})(CategoryValueNotApplicable || (CategoryValueNotApplicable = {}));
|
|
90
|
+
export var CategoryValueLowCardioFitnessEvent;
|
|
91
|
+
(function (CategoryValueLowCardioFitnessEvent) {
|
|
92
|
+
CategoryValueLowCardioFitnessEvent[CategoryValueLowCardioFitnessEvent["lowFitness"] = 1] = "lowFitness";
|
|
93
|
+
})(CategoryValueLowCardioFitnessEvent || (CategoryValueLowCardioFitnessEvent = {}));
|
|
94
|
+
export var CategoryValueAppleStandHour;
|
|
95
|
+
(function (CategoryValueAppleStandHour) {
|
|
96
|
+
CategoryValueAppleStandHour[CategoryValueAppleStandHour["stood"] = 0] = "stood";
|
|
97
|
+
CategoryValueAppleStandHour[CategoryValueAppleStandHour["idle"] = 1] = "idle";
|
|
98
|
+
})(CategoryValueAppleStandHour || (CategoryValueAppleStandHour = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkbloodtype Apple Docs }
|
|
3
|
+
*/
|
|
4
|
+
export var BloodType;
|
|
5
|
+
(function (BloodType) {
|
|
6
|
+
BloodType[BloodType["notSet"] = 0] = "notSet";
|
|
7
|
+
BloodType[BloodType["aPositive"] = 1] = "aPositive";
|
|
8
|
+
BloodType[BloodType["aNegative"] = 2] = "aNegative";
|
|
9
|
+
BloodType[BloodType["bPositive"] = 3] = "bPositive";
|
|
10
|
+
BloodType[BloodType["bNegative"] = 4] = "bNegative";
|
|
11
|
+
BloodType[BloodType["abPositive"] = 5] = "abPositive";
|
|
12
|
+
BloodType[BloodType["abNegative"] = 6] = "abNegative";
|
|
13
|
+
BloodType[BloodType["oPositive"] = 7] = "oPositive";
|
|
14
|
+
BloodType[BloodType["oNegative"] = 8] = "oNegative";
|
|
15
|
+
})(BloodType || (BloodType = {}));
|
|
16
|
+
/**
|
|
17
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkbiologicalsex Apple Docs }
|
|
18
|
+
*/
|
|
19
|
+
export var BiologicalSex;
|
|
20
|
+
(function (BiologicalSex) {
|
|
21
|
+
BiologicalSex[BiologicalSex["notSet"] = 0] = "notSet";
|
|
22
|
+
BiologicalSex[BiologicalSex["female"] = 1] = "female";
|
|
23
|
+
BiologicalSex[BiologicalSex["male"] = 2] = "male";
|
|
24
|
+
BiologicalSex[BiologicalSex["other"] = 3] = "other";
|
|
25
|
+
})(BiologicalSex || (BiologicalSex = {}));
|
|
26
|
+
/**
|
|
27
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkfitzpatrickskintype Apple Docs }
|
|
28
|
+
*/
|
|
29
|
+
export var FitzpatrickSkinType;
|
|
30
|
+
(function (FitzpatrickSkinType) {
|
|
31
|
+
FitzpatrickSkinType[FitzpatrickSkinType["notSet"] = 0] = "notSet";
|
|
32
|
+
FitzpatrickSkinType[FitzpatrickSkinType["I"] = 1] = "I";
|
|
33
|
+
FitzpatrickSkinType[FitzpatrickSkinType["II"] = 2] = "II";
|
|
34
|
+
FitzpatrickSkinType[FitzpatrickSkinType["III"] = 3] = "III";
|
|
35
|
+
FitzpatrickSkinType[FitzpatrickSkinType["IV"] = 4] = "IV";
|
|
36
|
+
FitzpatrickSkinType[FitzpatrickSkinType["V"] = 5] = "V";
|
|
37
|
+
FitzpatrickSkinType[FitzpatrickSkinType["VI"] = 6] = "VI";
|
|
38
|
+
})(FitzpatrickSkinType || (FitzpatrickSkinType = {}));
|
|
39
|
+
// Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse
|
|
40
|
+
export var WheelchairUse;
|
|
41
|
+
(function (WheelchairUse) {
|
|
42
|
+
WheelchairUse[WheelchairUse["notSet"] = 0] = "notSet";
|
|
43
|
+
WheelchairUse[WheelchairUse["notUsingWheelchair"] = 1] = "notUsingWheelchair";
|
|
44
|
+
WheelchairUse[WheelchairUse["usingWheelchair"] = 2] = "usingWheelchair";
|
|
45
|
+
})(WheelchairUse || (WheelchairUse = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a workout type identifier.
|
|
3
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkworkouttypeidentifier Apple Docs HKWorkoutTypeIdentifier}
|
|
4
|
+
*/
|
|
5
|
+
export const WorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier';
|
|
6
|
+
/**
|
|
7
|
+
* Represents a workout route type identifier.
|
|
8
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKWorkoutRouteTypeIdentifier Apple Docs WorkoutRouteTypeIdentifier}
|
|
9
|
+
*/
|
|
10
|
+
export const WorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier';
|
|
11
|
+
/**
|
|
12
|
+
* Represents a state of mind type identifier.
|
|
13
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkstateofmindtype Apple Docs HKStateOfMindType}
|
|
14
|
+
*/
|
|
15
|
+
export const StateOfMindTypeIdentifier = 'HKStateOfMindTypeIdentifier';
|
|
16
|
+
/**
|
|
17
|
+
* Represents a series sample containing heartbeat data..
|
|
18
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKDataTypeIdentifierHeartbeatSeries Apple Docs DataTypeIdentifierHeartbeatSeries}
|
|
19
|
+
*/
|
|
20
|
+
export const HeartbeatSeriesTypeIdentifier = 'HKDataTypeIdentifierHeartbeatSeries';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript utility types for verifying that two interfaces have matching method signatures.
|
|
3
|
+
*
|
|
4
|
+
* This is particularly useful for ensuring that typed and untyped versions of interfaces
|
|
5
|
+
* stay in sync when one has generics and the other doesn't.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import type { InterfaceAssertion } from "./InterfaceVerification";
|
|
10
|
+
*
|
|
11
|
+
* interface BaseModule extends HybridObject<{ ios: "swift" }> {
|
|
12
|
+
* getData(id: string): Promise<string>;
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* interface BaseModuleTyped {
|
|
16
|
+
* getData<T extends string>(id: T): Promise<string>;
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* // This will cause a TypeScript error if the interfaces don't match
|
|
20
|
+
* const _verification: InterfaceAssertion<BaseModule, BaseModuleTyped, keyof HybridObject> = true;
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example usage of the InterfaceVerification utility
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to use the reusable interface verification utility
|
|
5
|
+
* to ensure that typed and untyped versions of interfaces stay in sync.
|
|
6
|
+
*/
|
|
7
|
+
// Verification: This will cause a TypeScript error if the interfaces don't match
|
|
8
|
+
const _exampleVerification = true;
|
|
9
|
+
// Verification for optional parameters
|
|
10
|
+
const _configVerification = true;
|
|
11
|
+
export {};
|
|
12
|
+
// This will show a TypeScript error indicating the mismatch
|
|
13
|
+
// Uncomment to see the error:
|
|
14
|
+
// const _badVerification: InterfaceAssertion<BadModule, BadModuleTyped, keyof HybridObject> = true;
|
|
15
|
+
/**
|
|
16
|
+
* Usage Instructions:
|
|
17
|
+
*
|
|
18
|
+
* 1. Import the InterfaceAssertion type from InterfaceVerification
|
|
19
|
+
* 2. Create your base interface (extending HybridObject)
|
|
20
|
+
* 3. Create your typed interface (with generics)
|
|
21
|
+
* 4. Add a verification line:
|
|
22
|
+
* const _verification: InterfaceAssertion<BaseInterface, TypedInterface, keyof HybridObject> = true;
|
|
23
|
+
*
|
|
24
|
+
* The verification will:
|
|
25
|
+
* - Check that both interfaces have the same method names
|
|
26
|
+
* - Check that corresponding methods have the same number of parameters
|
|
27
|
+
* - Show descriptive TypeScript errors if there are mismatches
|
|
28
|
+
*
|
|
29
|
+
* Error Types:
|
|
30
|
+
* - "Interface mismatch detected" - method names don't match
|
|
31
|
+
* - "Parameter count mismatch detected" - parameter counts don't match
|
|
32
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason Apple Docs }
|
|
3
|
+
*/
|
|
4
|
+
export var InsulinDeliveryReason;
|
|
5
|
+
(function (InsulinDeliveryReason) {
|
|
6
|
+
InsulinDeliveryReason[InsulinDeliveryReason["basal"] = 1] = "basal";
|
|
7
|
+
InsulinDeliveryReason[InsulinDeliveryReason["bolus"] = 2] = "bolus";
|
|
8
|
+
})(InsulinDeliveryReason || (InsulinDeliveryReason = {}));
|
|
9
|
+
export var HeartRateMotionContext;
|
|
10
|
+
(function (HeartRateMotionContext) {
|
|
11
|
+
HeartRateMotionContext[HeartRateMotionContext["active"] = 2] = "active";
|
|
12
|
+
HeartRateMotionContext[HeartRateMotionContext["notSet"] = 0] = "notSet";
|
|
13
|
+
HeartRateMotionContext[HeartRateMotionContext["sedentary"] = 1] = "sedentary";
|
|
14
|
+
})(HeartRateMotionContext || (HeartRateMotionContext = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a type that identifies activity summary objects.
|
|
3
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkactivitysummarytype Apple Docs HKActivitySummaryType}
|
|
4
|
+
*/
|
|
5
|
+
export const ActivitySummaryTypeIdentifier = 'ActivitySummaryTypeIdentifier';
|
|
6
|
+
/**
|
|
7
|
+
* Represents an audiogram type identifier.
|
|
8
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKAudiogramSampleType Apple Docs HKAudiogramSampleType}
|
|
9
|
+
*/
|
|
10
|
+
export const AudiogramTypeIdentifier = 'HKAudiogramSampleType';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|