@kingstinct/react-native-healthkit 9.0.1 → 9.0.3
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 +10 -10
- package/app.plugin.js +0 -1
- 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 +34 -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
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ This library is provided as-is without any warranty and is not affiliated with A
|
|
|
26
26
|
### Expo
|
|
27
27
|
Usage with Expo is possible - just keep in mind it will not work in Expo Go and [you'll need to roll your own Dev Client](https://docs.expo.dev/development/getting-started/).
|
|
28
28
|
|
|
29
|
-
1. `yarn add @kingstinct/react-native-healthkit`
|
|
29
|
+
1. `yarn add @kingstinct/react-native-healthkit react-native-nitro-modules`
|
|
30
30
|
2. Update your app.json with the config plugin:
|
|
31
31
|
```json
|
|
32
32
|
{
|
|
@@ -42,8 +42,8 @@ this will give you defaults that make the app build without any further configur
|
|
|
42
42
|
"plugins": [
|
|
43
43
|
["@kingstinct/react-native-healthkit", {
|
|
44
44
|
"NSHealthShareUsageDescription": "Your own custom usage description",
|
|
45
|
-
"NSHealthUpdateUsageDescription":
|
|
46
|
-
"background":
|
|
45
|
+
"NSHealthUpdateUsageDescription": "Your own custom usage description",
|
|
46
|
+
"background": true
|
|
47
47
|
}]
|
|
48
48
|
]
|
|
49
49
|
}
|
|
@@ -52,7 +52,7 @@ this will give you defaults that make the app build without any further configur
|
|
|
52
52
|
3. Build a new Dev Client
|
|
53
53
|
|
|
54
54
|
### Native or Expo Bare Workflow
|
|
55
|
-
1. `yarn add @kingstinct/react-native-healthkit`
|
|
55
|
+
1. `yarn add @kingstinct/react-native-healthkit react-native-nitro-modules`
|
|
56
56
|
2. `npx pod-install`
|
|
57
57
|
3. Set `NSHealthUpdateUsageDescription` and `NSHealthShareUsageDescription` in your `Info.plist`
|
|
58
58
|
4. Enable the HealthKit capability for the project in Xcode.
|
|
@@ -155,14 +155,14 @@ Example:
|
|
|
155
155
|
## Migration to 9.0.0
|
|
156
156
|
|
|
157
157
|
There are a lot of under-the-hood changes in version 9.0.0, some of them are breaking (although I've tried to reduce it as much as possible).
|
|
158
|
-
-
|
|
159
|
-
- Naming conventions have changed - most of the HK-prefixed stuff has been removed to avoid conflicts on the native side and also make the library more beautiful to look at. As an example the type previously called HKQuantityTypeIdentifier is
|
|
160
|
-
-
|
|
161
|
-
- Flexible filters that map closer to the native constructs.
|
|
158
|
+
- The library has been migrated to react-native-nitro-modules. This improves performance, type-safety and gets rid of a lot of boilerplate code that made it harder to maintain and add features to the library.
|
|
159
|
+
- Naming conventions have changed - most of the HK-prefixed stuff has been removed to avoid conflicts on the native side and also make the library more beautiful to look at. As an example the type previously called HKQuantityTypeIdentifier is now just QuantityTypeIdentifier.
|
|
160
|
+
- Fewer required params - for example calling `queryQuantitySamples('HKQuantityTypeIdentifierStepCount')` without arguments will simply return the last 20 samples.
|
|
161
|
+
- Flexible filters that map closer to the native constructs. For example this supports filtering by uuid, multiple uuids as well as on items related to a specific workout.
|
|
162
162
|
- `deleteObjects` replaces all previous deletion methods, using the new flexible filters.
|
|
163
163
|
- Workouts are returned as proxies containing not only data but also functions, for example `getWorkoutRoutes`.
|
|
164
|
-
-
|
|
165
|
-
- Units are now just strings.
|
|
164
|
+
- Object identifiers are now just strings (not enums), but more strictly typed for each use case.
|
|
165
|
+
- Units are now just strings. There's a `isQuantityCompatibleWithUnit()` helper function. Also, units are never required when querying, it always defaults to the users preferred unit.
|
|
166
166
|
|
|
167
167
|
## A note on Apple Documentation
|
|
168
168
|
|
package/app.plugin.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useCategorySampleById = useCategorySampleById;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const getCategorySampleById_1 = __importDefault(require("../utils/getCategorySampleById"));
|
|
9
|
+
const useSubscribeToChanges_1 = __importDefault(require("./useSubscribeToChanges"));
|
|
10
|
+
/**
|
|
11
|
+
* @returns the most recent sample for the given category type.
|
|
12
|
+
*/
|
|
13
|
+
function useCategorySampleById(identifier, uuid) {
|
|
14
|
+
const [sample, setSample] = (0, react_1.useState)();
|
|
15
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(true);
|
|
16
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
17
|
+
const updater = (0, react_1.useCallback)(async () => {
|
|
18
|
+
setIsLoading(true);
|
|
19
|
+
setError(null);
|
|
20
|
+
try {
|
|
21
|
+
const fetchedSample = await (0, getCategorySampleById_1.default)(identifier, uuid);
|
|
22
|
+
setSample(fetchedSample);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
setError(err instanceof Error
|
|
26
|
+
? err
|
|
27
|
+
: new Error('Unknown error fetching category sample by ID'));
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
setIsLoading(false);
|
|
31
|
+
}
|
|
32
|
+
}, [identifier, uuid]);
|
|
33
|
+
(0, useSubscribeToChanges_1.default)(identifier, updater);
|
|
34
|
+
return { sample, isLoading, error };
|
|
35
|
+
}
|
|
36
|
+
exports.default = useCategorySampleById;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useHealthkitAuthorization = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const modules_1 = require("../modules");
|
|
6
|
+
/**
|
|
7
|
+
* @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
|
|
8
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
|
|
9
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
|
|
10
|
+
*/
|
|
11
|
+
const useHealthkitAuthorization = (read, write) => {
|
|
12
|
+
const [status, setStatus] = (0, react_1.useState)(null);
|
|
13
|
+
const readMemo = (0, react_1.useRef)(read);
|
|
14
|
+
const writeMemo = (0, react_1.useRef)(write);
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
readMemo.current = read;
|
|
17
|
+
writeMemo.current = write;
|
|
18
|
+
}, [read, write]);
|
|
19
|
+
const refreshAuthStatus = (0, react_1.useCallback)(async () => {
|
|
20
|
+
const auth = await modules_1.Core.getRequestStatusForAuthorization(writeMemo.current ?? [], readMemo.current);
|
|
21
|
+
setStatus(auth);
|
|
22
|
+
return auth;
|
|
23
|
+
}, []);
|
|
24
|
+
const request = (0, react_1.useCallback)(async () => {
|
|
25
|
+
await modules_1.Core.requestAuthorization(writeMemo.current ?? [], readMemo.current);
|
|
26
|
+
return refreshAuthStatus();
|
|
27
|
+
}, [refreshAuthStatus]);
|
|
28
|
+
(0, react_1.useEffect)(() => {
|
|
29
|
+
void refreshAuthStatus();
|
|
30
|
+
}, [refreshAuthStatus]);
|
|
31
|
+
return [status, request];
|
|
32
|
+
};
|
|
33
|
+
exports.useHealthkitAuthorization = useHealthkitAuthorization;
|
|
34
|
+
exports.default = exports.useHealthkitAuthorization;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIsHealthDataAvailable = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const modules_1 = require("../modules");
|
|
6
|
+
/**
|
|
7
|
+
* @description Now there is a Core.isHealthDataAvailable() that can be called synchronously. By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
|
|
8
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple HealthKit isHealthDataAvailable}
|
|
9
|
+
* @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
|
|
10
|
+
*/
|
|
11
|
+
const useIsHealthDataAvailable = () => {
|
|
12
|
+
const [isAvailable, setIsAvailable] = (0, react_1.useState)(null);
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
14
|
+
const init = async () => {
|
|
15
|
+
const res = await modules_1.Core.isHealthDataAvailableAsync();
|
|
16
|
+
setIsAvailable(res);
|
|
17
|
+
};
|
|
18
|
+
void init();
|
|
19
|
+
}, []);
|
|
20
|
+
return isAvailable;
|
|
21
|
+
};
|
|
22
|
+
exports.useIsHealthDataAvailable = useIsHealthDataAvailable;
|
|
23
|
+
exports.default = exports.useIsHealthDataAvailable;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useMostRecentCategorySample = useMostRecentCategorySample;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const getMostRecentCategorySample_1 = __importDefault(require("../utils/getMostRecentCategorySample"));
|
|
9
|
+
const useSubscribeToChanges_1 = __importDefault(require("./useSubscribeToChanges"));
|
|
10
|
+
/**
|
|
11
|
+
* @returns the most recent sample for the given category type.
|
|
12
|
+
*/
|
|
13
|
+
function useMostRecentCategorySample(identifier) {
|
|
14
|
+
const [category, setCategory] = (0, react_1.useState)();
|
|
15
|
+
const updater = (0, react_1.useCallback)(() => {
|
|
16
|
+
void (0, getMostRecentCategorySample_1.default)(identifier).then(setCategory);
|
|
17
|
+
}, [identifier]);
|
|
18
|
+
(0, useSubscribeToChanges_1.default)(identifier, updater);
|
|
19
|
+
return category;
|
|
20
|
+
}
|
|
21
|
+
exports.default = useMostRecentCategorySample;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useMostRecentQuantitySample = useMostRecentQuantitySample;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const getMostRecentQuantitySample_1 = __importDefault(require("../utils/getMostRecentQuantitySample"));
|
|
9
|
+
const useSubscribeToChanges_1 = __importDefault(require("./useSubscribeToChanges"));
|
|
10
|
+
/**
|
|
11
|
+
* @returns the most recent sample for the given quantity type.
|
|
12
|
+
*/
|
|
13
|
+
function useMostRecentQuantitySample(identifier, unit) {
|
|
14
|
+
const [lastSample, setLastSample] = (0, react_1.useState)();
|
|
15
|
+
const fetchMostRecentSample = (0, react_1.useCallback)(async () => {
|
|
16
|
+
const value = await (0, getMostRecentQuantitySample_1.default)(identifier, unit);
|
|
17
|
+
setLastSample(value);
|
|
18
|
+
}, [identifier, unit]);
|
|
19
|
+
(0, useSubscribeToChanges_1.default)(identifier, fetchMostRecentSample);
|
|
20
|
+
return lastSample;
|
|
21
|
+
}
|
|
22
|
+
exports.default = useMostRecentQuantitySample;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useMostRecentWorkout = useMostRecentWorkout;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const getMostRecentWorkout_1 = __importDefault(require("../utils/getMostRecentWorkout"));
|
|
9
|
+
const useSubscribeToChanges_1 = __importDefault(require("./useSubscribeToChanges"));
|
|
10
|
+
/**
|
|
11
|
+
* @returns the most recent workout sample.
|
|
12
|
+
*/
|
|
13
|
+
function useMostRecentWorkout(options) {
|
|
14
|
+
const [workout, setWorkout] = (0, react_1.useState)();
|
|
15
|
+
const optionsRef = (0, react_1.useRef)(options);
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
optionsRef.current = options;
|
|
18
|
+
}, [options]);
|
|
19
|
+
const update = (0, react_1.useCallback)(async () => {
|
|
20
|
+
setWorkout(await (0, getMostRecentWorkout_1.default)({
|
|
21
|
+
energyUnit: optionsRef.current?.energyUnit,
|
|
22
|
+
distanceUnit: optionsRef.current?.distanceUnit,
|
|
23
|
+
}));
|
|
24
|
+
}, []);
|
|
25
|
+
(0, react_1.useEffect)(() => {
|
|
26
|
+
void update();
|
|
27
|
+
}, [update]);
|
|
28
|
+
(0, useSubscribeToChanges_1.default)('HKWorkoutTypeIdentifier', update);
|
|
29
|
+
return workout;
|
|
30
|
+
}
|
|
31
|
+
exports.default = useMostRecentWorkout;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useQuantitySampleById = useQuantitySampleById;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const getQuantitySampleById_1 = __importDefault(require("../utils/getQuantitySampleById"));
|
|
9
|
+
const useSubscribeToChanges_1 = __importDefault(require("./useSubscribeToChanges"));
|
|
10
|
+
/**
|
|
11
|
+
* @returns the most recent sample for the given quantity type.
|
|
12
|
+
*/
|
|
13
|
+
function useQuantitySampleById(identifier, uuid, options = {}) {
|
|
14
|
+
const [sample, setSample] = (0, react_1.useState)();
|
|
15
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(true);
|
|
16
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
17
|
+
const fetchMostRecentSample = (0, react_1.useCallback)(async () => {
|
|
18
|
+
setIsLoading(true);
|
|
19
|
+
try {
|
|
20
|
+
const sample = await (0, getQuantitySampleById_1.default)(identifier, uuid, options?.unit);
|
|
21
|
+
setSample(sample);
|
|
22
|
+
setError(null);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
setError(err instanceof Error ? err : new Error('Unknown error'));
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
setIsLoading(false);
|
|
29
|
+
}
|
|
30
|
+
}, [identifier, uuid, options.unit]);
|
|
31
|
+
(0, useSubscribeToChanges_1.default)(identifier, fetchMostRecentSample);
|
|
32
|
+
return { sample, isLoading, error };
|
|
33
|
+
}
|
|
34
|
+
exports.default = useQuantitySampleById;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSources = useSources;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const modules_1 = require("../modules");
|
|
6
|
+
function useSources(identifier) {
|
|
7
|
+
const [result, setResult] = (0, react_1.useState)(null);
|
|
8
|
+
const update = (0, react_1.useCallback)(async () => {
|
|
9
|
+
const res = await modules_1.Core.querySources(identifier);
|
|
10
|
+
setResult(res);
|
|
11
|
+
}, [identifier]);
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
void update();
|
|
14
|
+
}, [update]);
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
exports.default = useSources;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useStatisticsForQuantity = useStatisticsForQuantity;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const useSubscribeToChanges_1 = __importDefault(require("./useSubscribeToChanges"));
|
|
9
|
+
const modules_1 = require("../modules");
|
|
10
|
+
function useStatisticsForQuantity(identifier, options, from, to, unit) {
|
|
11
|
+
const [result, setResult] = (0, react_1.useState)(null);
|
|
12
|
+
const optionsRef = (0, react_1.useRef)(options);
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
14
|
+
optionsRef.current = options;
|
|
15
|
+
}, [options]);
|
|
16
|
+
const update = (0, react_1.useCallback)(async () => {
|
|
17
|
+
const res = await modules_1.QuantityTypes.queryStatisticsForQuantity(identifier, optionsRef.current, { filter: { startDate: from, endDate: to }, unit });
|
|
18
|
+
setResult(res);
|
|
19
|
+
}, [identifier, from, to, unit]);
|
|
20
|
+
(0, react_1.useEffect)(() => {
|
|
21
|
+
void update();
|
|
22
|
+
}, [update]);
|
|
23
|
+
(0, useSubscribeToChanges_1.default)(identifier, update);
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
exports.default = useStatisticsForQuantity;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSubscribeToChanges = useSubscribeToChanges;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const subscribeToChanges_1 = require("../utils/subscribeToChanges");
|
|
6
|
+
function useSubscribeToChanges(identifier, onChange) {
|
|
7
|
+
const onChangeRef = (0, react_1.useRef)(onChange);
|
|
8
|
+
(0, react_1.useEffect)(() => {
|
|
9
|
+
onChangeRef.current = onChange;
|
|
10
|
+
}, [onChange]);
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
12
|
+
const subscription = (0, subscribeToChanges_1.subscribeToChanges)(identifier, (args) => {
|
|
13
|
+
onChangeRef.current(args);
|
|
14
|
+
});
|
|
15
|
+
return () => {
|
|
16
|
+
subscription.remove();
|
|
17
|
+
};
|
|
18
|
+
}, [identifier]);
|
|
19
|
+
}
|
|
20
|
+
exports.default = useSubscribeToChanges;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useWorkoutById = useWorkoutById;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const getWorkoutById_1 = __importDefault(require("../utils/getWorkoutById"));
|
|
9
|
+
const useSubscribeToChanges_1 = __importDefault(require("./useSubscribeToChanges"));
|
|
10
|
+
/**
|
|
11
|
+
* @returns the most recent workout sample.
|
|
12
|
+
*/
|
|
13
|
+
function useWorkoutById(uuid, options) {
|
|
14
|
+
const [workout, setWorkout] = (0, react_1.useState)();
|
|
15
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(true);
|
|
16
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
17
|
+
const optionsRef = (0, react_1.useRef)(options);
|
|
18
|
+
(0, react_1.useEffect)(() => {
|
|
19
|
+
optionsRef.current = options;
|
|
20
|
+
}, [options]);
|
|
21
|
+
const update = (0, react_1.useCallback)(async () => {
|
|
22
|
+
setIsLoading(true);
|
|
23
|
+
setError(null);
|
|
24
|
+
try {
|
|
25
|
+
const fetchedWorkout = await (0, getWorkoutById_1.default)(uuid, {
|
|
26
|
+
energyUnit: optionsRef.current?.energyUnit,
|
|
27
|
+
distanceUnit: optionsRef.current?.distanceUnit,
|
|
28
|
+
});
|
|
29
|
+
setWorkout(fetchedWorkout);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
setError(err instanceof Error
|
|
33
|
+
? err
|
|
34
|
+
: new Error('Unknown error fetching workout by ID'));
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
setIsLoading(false);
|
|
38
|
+
}
|
|
39
|
+
}, [uuid]);
|
|
40
|
+
(0, react_1.useEffect)(() => {
|
|
41
|
+
void update();
|
|
42
|
+
}, [update]);
|
|
43
|
+
(0, useSubscribeToChanges_1.default)('HKWorkoutTypeIdentifier', update);
|
|
44
|
+
return { workout, isLoading, error };
|
|
45
|
+
}
|
|
46
|
+
exports.default = useWorkoutById;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.unsubscribeQueries = exports.isQuantityCompatibleWithUnit = exports.saveStateOfMindSample = exports.queryStateOfMindSamples = exports.isProtectedDataAvailable = exports.startWatchApp = exports.subscribeToChanges = exports.saveWorkoutSample = exports.saveQuantitySample = exports.saveCorrelationSample = exports.saveCategorySample = exports.deleteObjects = exports.requestAuthorization = exports.querySources = exports.queryWorkoutSamplesWithAnchor = exports.queryWorkoutSamples = exports.queryStatisticsCollectionForQuantity = exports.queryStatisticsForQuantity = exports.queryQuantitySamplesWithAnchor = exports.queryQuantitySamples = exports.queryHeartbeatSeriesSamplesWithAnchor = exports.queryHeartbeatSeriesSamples = exports.queryCorrelationSamples = exports.queryCategorySamplesWithAnchor = exports.queryCategorySamples = exports.isHealthDataAvailableAsync = exports.isHealthDataAvailable = exports.getWheelchairUse = exports.getRequestStatusForAuthorization = exports.getPreferredUnits = exports.getFitzpatrickSkinType = exports.getDateOfBirth = exports.getBloodType = exports.getBiologicalSex = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = exports.authorizationStatusFor = exports.useStatisticsForQuantity = exports.useSources = exports.useIsHealthDataAvailable = exports.useHealthkitAuthorization = exports.useSubscribeToChanges = exports.useMostRecentWorkout = exports.useMostRecentQuantitySample = exports.useMostRecentCategorySample = exports.getPreferredUnit = exports.getMostRecentWorkout = exports.getMostRecentQuantitySample = exports.getMostRecentCategorySample = void 0;
|
|
7
|
+
exports.getWheelchairUseAsync = exports.getFitzpatrickSkinTypeAsync = exports.getDateOfBirthAsync = exports.getBloodTypeAsync = exports.getBiologicalSexAsync = exports.areObjectTypesAvailableAsync = exports.areObjectTypesAvailable = exports.isObjectTypeAvailableAsync = exports.isObjectTypeAvailable = void 0;
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const useHealthkitAuthorization_1 = __importDefault(require("./hooks/useHealthkitAuthorization"));
|
|
10
|
+
exports.useHealthkitAuthorization = useHealthkitAuthorization_1.default;
|
|
11
|
+
const useIsHealthDataAvailable_1 = require("./hooks/useIsHealthDataAvailable");
|
|
12
|
+
Object.defineProperty(exports, "useIsHealthDataAvailable", { enumerable: true, get: function () { return useIsHealthDataAvailable_1.useIsHealthDataAvailable; } });
|
|
13
|
+
const useMostRecentCategorySample_1 = __importDefault(require("./hooks/useMostRecentCategorySample"));
|
|
14
|
+
exports.useMostRecentCategorySample = useMostRecentCategorySample_1.default;
|
|
15
|
+
const useMostRecentQuantitySample_1 = __importDefault(require("./hooks/useMostRecentQuantitySample"));
|
|
16
|
+
exports.useMostRecentQuantitySample = useMostRecentQuantitySample_1.default;
|
|
17
|
+
const useMostRecentWorkout_1 = __importDefault(require("./hooks/useMostRecentWorkout"));
|
|
18
|
+
exports.useMostRecentWorkout = useMostRecentWorkout_1.default;
|
|
19
|
+
const useSources_1 = __importDefault(require("./hooks/useSources"));
|
|
20
|
+
exports.useSources = useSources_1.default;
|
|
21
|
+
const useStatisticsForQuantity_1 = __importDefault(require("./hooks/useStatisticsForQuantity"));
|
|
22
|
+
exports.useStatisticsForQuantity = useStatisticsForQuantity_1.default;
|
|
23
|
+
const useSubscribeToChanges_1 = __importDefault(require("./hooks/useSubscribeToChanges"));
|
|
24
|
+
exports.useSubscribeToChanges = useSubscribeToChanges_1.default;
|
|
25
|
+
const modules_1 = require("./modules");
|
|
26
|
+
const getMostRecentCategorySample_1 = __importDefault(require("./utils/getMostRecentCategorySample"));
|
|
27
|
+
exports.getMostRecentCategorySample = getMostRecentCategorySample_1.default;
|
|
28
|
+
const getMostRecentQuantitySample_1 = __importDefault(require("./utils/getMostRecentQuantitySample"));
|
|
29
|
+
exports.getMostRecentQuantitySample = getMostRecentQuantitySample_1.default;
|
|
30
|
+
const getMostRecentWorkout_1 = __importDefault(require("./utils/getMostRecentWorkout"));
|
|
31
|
+
exports.getMostRecentWorkout = getMostRecentWorkout_1.default;
|
|
32
|
+
const getPreferredUnit_1 = __importDefault(require("./utils/getPreferredUnit"));
|
|
33
|
+
exports.getPreferredUnit = getPreferredUnit_1.default;
|
|
34
|
+
const currentMajorVersionIOS = react_native_1.Platform.OS === 'ios' ? Number.parseInt(react_native_1.Platform.Version, 10) : 0;
|
|
35
|
+
// Named exports - all functions bound to their respective modules
|
|
36
|
+
exports.authorizationStatusFor = modules_1.Core.authorizationStatusFor.bind(modules_1.Core);
|
|
37
|
+
exports.disableAllBackgroundDelivery = modules_1.Core.disableAllBackgroundDelivery.bind(modules_1.Core);
|
|
38
|
+
exports.disableBackgroundDelivery = modules_1.Core.disableBackgroundDelivery.bind(modules_1.Core);
|
|
39
|
+
exports.enableBackgroundDelivery = modules_1.Core.enableBackgroundDelivery.bind(modules_1.Core);
|
|
40
|
+
exports.getBiologicalSex = modules_1.Characteristics.getBiologicalSex.bind(modules_1.Characteristics);
|
|
41
|
+
exports.getBloodType = modules_1.Characteristics.getBloodType.bind(modules_1.Characteristics);
|
|
42
|
+
exports.getDateOfBirth = modules_1.Characteristics.getDateOfBirth.bind(modules_1.Characteristics);
|
|
43
|
+
exports.getFitzpatrickSkinType = modules_1.Characteristics.getFitzpatrickSkinType.bind(modules_1.Characteristics);
|
|
44
|
+
exports.getPreferredUnits = modules_1.Core.getPreferredUnits.bind(modules_1.Core);
|
|
45
|
+
exports.getRequestStatusForAuthorization = modules_1.Core.getRequestStatusForAuthorization.bind(modules_1.Core);
|
|
46
|
+
exports.getWheelchairUse = modules_1.Characteristics.getWheelchairUse.bind(modules_1.Characteristics);
|
|
47
|
+
exports.isHealthDataAvailable = modules_1.Core.isHealthDataAvailable.bind(modules_1.Core);
|
|
48
|
+
exports.isHealthDataAvailableAsync = modules_1.Core.isHealthDataAvailableAsync.bind(modules_1.Core);
|
|
49
|
+
exports.queryCategorySamples = modules_1.CategoryTypes.queryCategorySamples.bind(modules_1.CategoryTypes);
|
|
50
|
+
exports.queryCategorySamplesWithAnchor = modules_1.CategoryTypes.queryCategorySamplesWithAnchor.bind(modules_1.CategoryTypes);
|
|
51
|
+
exports.queryCorrelationSamples = modules_1.CorrelationTypes.queryCorrelationSamples.bind(modules_1.CorrelationTypes);
|
|
52
|
+
exports.queryHeartbeatSeriesSamples = modules_1.HeartbeatSeries.queryHeartbeatSeriesSamples.bind(modules_1.HeartbeatSeries);
|
|
53
|
+
exports.queryHeartbeatSeriesSamplesWithAnchor = modules_1.HeartbeatSeries.queryHeartbeatSeriesSamplesWithAnchor.bind(modules_1.HeartbeatSeries);
|
|
54
|
+
exports.queryQuantitySamples = modules_1.QuantityTypes.queryQuantitySamples.bind(modules_1.QuantityTypes);
|
|
55
|
+
exports.queryQuantitySamplesWithAnchor = modules_1.QuantityTypes.queryQuantitySamplesWithAnchor.bind(modules_1.QuantityTypes);
|
|
56
|
+
exports.queryStatisticsForQuantity = modules_1.QuantityTypes.queryStatisticsForQuantity.bind(modules_1.QuantityTypes);
|
|
57
|
+
exports.queryStatisticsCollectionForQuantity = modules_1.QuantityTypes.queryStatisticsCollectionForQuantity.bind(modules_1.QuantityTypes);
|
|
58
|
+
exports.queryWorkoutSamples = modules_1.Workouts.queryWorkoutSamples.bind(modules_1.Workouts);
|
|
59
|
+
exports.queryWorkoutSamplesWithAnchor = modules_1.Workouts.queryWorkoutSamplesWithAnchor.bind(modules_1.Workouts);
|
|
60
|
+
exports.querySources = modules_1.Core.querySources.bind(modules_1.Core);
|
|
61
|
+
exports.requestAuthorization = modules_1.Core.requestAuthorization.bind(modules_1.Core);
|
|
62
|
+
exports.deleteObjects = modules_1.Core.deleteObjects.bind(modules_1.Core);
|
|
63
|
+
exports.saveCategorySample = modules_1.CategoryTypes.saveCategorySample.bind(modules_1.CategoryTypes);
|
|
64
|
+
exports.saveCorrelationSample = modules_1.CorrelationTypes.saveCorrelationSample.bind(modules_1.CorrelationTypes);
|
|
65
|
+
exports.saveQuantitySample = modules_1.QuantityTypes.saveQuantitySample.bind(modules_1.QuantityTypes);
|
|
66
|
+
exports.saveWorkoutSample = modules_1.Workouts.saveWorkoutSample.bind(modules_1.Workouts);
|
|
67
|
+
exports.subscribeToChanges = modules_1.Core.subscribeToObserverQuery.bind(modules_1.Core);
|
|
68
|
+
exports.startWatchApp = modules_1.Workouts.startWatchAppWithWorkoutConfiguration.bind(modules_1.Workouts);
|
|
69
|
+
exports.isProtectedDataAvailable = modules_1.Core.isProtectedDataAvailable.bind(modules_1.Core);
|
|
70
|
+
exports.queryStateOfMindSamples = modules_1.StateOfMind.queryStateOfMindSamples.bind(modules_1.StateOfMind);
|
|
71
|
+
exports.saveStateOfMindSample = modules_1.StateOfMind.saveStateOfMindSample.bind(modules_1.StateOfMind);
|
|
72
|
+
exports.isQuantityCompatibleWithUnit = modules_1.QuantityTypes.isQuantityCompatibleWithUnit.bind(modules_1.QuantityTypes);
|
|
73
|
+
exports.unsubscribeQueries = modules_1.Core.unsubscribeQueries.bind(modules_1.Core);
|
|
74
|
+
exports.isObjectTypeAvailable = modules_1.Core.isObjectTypeAvailable.bind(modules_1.Core);
|
|
75
|
+
exports.isObjectTypeAvailableAsync = modules_1.Core.isObjectTypeAvailableAsync.bind(modules_1.Core);
|
|
76
|
+
exports.areObjectTypesAvailable = modules_1.Core.areObjectTypesAvailable.bind(modules_1.Core);
|
|
77
|
+
exports.areObjectTypesAvailableAsync = modules_1.Core.areObjectTypesAvailableAsync.bind(modules_1.Core);
|
|
78
|
+
exports.getBiologicalSexAsync = modules_1.Characteristics.getBiologicalSexAsync.bind(modules_1.Characteristics);
|
|
79
|
+
exports.getBloodTypeAsync = modules_1.Characteristics.getBloodTypeAsync.bind(modules_1.Characteristics);
|
|
80
|
+
exports.getDateOfBirthAsync = modules_1.Characteristics.getDateOfBirthAsync.bind(modules_1.Characteristics);
|
|
81
|
+
exports.getFitzpatrickSkinTypeAsync = modules_1.Characteristics.getFitzpatrickSkinTypeAsync.bind(modules_1.Characteristics);
|
|
82
|
+
exports.getWheelchairUseAsync = modules_1.Characteristics.getWheelchairUseAsync.bind(modules_1.Characteristics);
|
|
83
|
+
exports.default = {
|
|
84
|
+
authorizationStatusFor: exports.authorizationStatusFor,
|
|
85
|
+
isObjectTypeAvailable: exports.isObjectTypeAvailable,
|
|
86
|
+
isObjectTypeAvailableAsync: exports.isObjectTypeAvailableAsync,
|
|
87
|
+
areObjectTypesAvailable: exports.areObjectTypesAvailable,
|
|
88
|
+
areObjectTypesAvailableAsync: exports.areObjectTypesAvailableAsync,
|
|
89
|
+
isQuantityCompatibleWithUnit: exports.isQuantityCompatibleWithUnit,
|
|
90
|
+
disableAllBackgroundDelivery: exports.disableAllBackgroundDelivery,
|
|
91
|
+
disableBackgroundDelivery: exports.disableBackgroundDelivery,
|
|
92
|
+
enableBackgroundDelivery: exports.enableBackgroundDelivery,
|
|
93
|
+
getBiologicalSex: exports.getBiologicalSex,
|
|
94
|
+
getBloodType: exports.getBloodType,
|
|
95
|
+
getDateOfBirth: exports.getDateOfBirth,
|
|
96
|
+
getFitzpatrickSkinType: exports.getFitzpatrickSkinType,
|
|
97
|
+
getBiologicalSexAsync: exports.getBiologicalSexAsync,
|
|
98
|
+
getBloodTypeAsync: exports.getBloodTypeAsync,
|
|
99
|
+
getDateOfBirthAsync: exports.getDateOfBirthAsync,
|
|
100
|
+
getFitzpatrickSkinTypeAsync: exports.getFitzpatrickSkinTypeAsync,
|
|
101
|
+
getWheelchairUseAsync: exports.getWheelchairUseAsync,
|
|
102
|
+
getMostRecentCategorySample: getMostRecentCategorySample_1.default,
|
|
103
|
+
getMostRecentQuantitySample: getMostRecentQuantitySample_1.default,
|
|
104
|
+
getMostRecentWorkout: getMostRecentWorkout_1.default,
|
|
105
|
+
getPreferredUnits: exports.getPreferredUnits,
|
|
106
|
+
getPreferredUnit: getPreferredUnit_1.default,
|
|
107
|
+
getRequestStatusForAuthorization: exports.getRequestStatusForAuthorization,
|
|
108
|
+
getWheelchairUse: exports.getWheelchairUse,
|
|
109
|
+
isHealthDataAvailable: exports.isHealthDataAvailable,
|
|
110
|
+
isHealthDataAvailableAsync: exports.isHealthDataAvailableAsync,
|
|
111
|
+
queryCategorySamples: exports.queryCategorySamples,
|
|
112
|
+
queryCategorySamplesWithAnchor: exports.queryCategorySamplesWithAnchor,
|
|
113
|
+
queryCorrelationSamples: exports.queryCorrelationSamples,
|
|
114
|
+
queryHeartbeatSeriesSamples: exports.queryHeartbeatSeriesSamples,
|
|
115
|
+
queryHeartbeatSeriesSamplesWithAnchor: exports.queryHeartbeatSeriesSamplesWithAnchor,
|
|
116
|
+
queryQuantitySamples: exports.queryQuantitySamples,
|
|
117
|
+
queryQuantitySamplesWithAnchor: exports.queryQuantitySamplesWithAnchor,
|
|
118
|
+
queryStatisticsForQuantity: exports.queryStatisticsForQuantity,
|
|
119
|
+
queryStatisticsCollectionForQuantity: exports.queryStatisticsCollectionForQuantity,
|
|
120
|
+
queryWorkoutSamples: exports.queryWorkoutSamples,
|
|
121
|
+
queryWorkoutSamplesWithAnchor: exports.queryWorkoutSamplesWithAnchor,
|
|
122
|
+
querySources: exports.querySources,
|
|
123
|
+
requestAuthorization: exports.requestAuthorization,
|
|
124
|
+
deleteObjects: exports.deleteObjects,
|
|
125
|
+
saveCategorySample: exports.saveCategorySample,
|
|
126
|
+
saveCorrelationSample: exports.saveCorrelationSample,
|
|
127
|
+
saveQuantitySample: exports.saveQuantitySample,
|
|
128
|
+
saveWorkoutSample: exports.saveWorkoutSample,
|
|
129
|
+
subscribeToChanges: exports.subscribeToChanges,
|
|
130
|
+
unsubscribeQueries: exports.unsubscribeQueries,
|
|
131
|
+
startWatchApp: exports.startWatchApp,
|
|
132
|
+
isProtectedDataAvailable: exports.isProtectedDataAvailable,
|
|
133
|
+
queryStateOfMindSamples: exports.queryStateOfMindSamples,
|
|
134
|
+
saveStateOfMindSample: exports.saveStateOfMindSample,
|
|
135
|
+
// hooks
|
|
136
|
+
useMostRecentCategorySample: useMostRecentCategorySample_1.default,
|
|
137
|
+
useMostRecentQuantitySample: useMostRecentQuantitySample_1.default,
|
|
138
|
+
useMostRecentWorkout: useMostRecentWorkout_1.default,
|
|
139
|
+
useSubscribeToChanges: useSubscribeToChanges_1.default,
|
|
140
|
+
useHealthkitAuthorization: useHealthkitAuthorization_1.default,
|
|
141
|
+
useIsHealthDataAvailable: useIsHealthDataAvailable_1.useIsHealthDataAvailable,
|
|
142
|
+
useSources: useSources_1.default,
|
|
143
|
+
useStatisticsForQuantity: useStatisticsForQuantity_1.default,
|
|
144
|
+
};
|