@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,41 @@
|
|
|
1
|
+
export type CharacteristicTypeIdentifier = 'HKCharacteristicTypeIdentifierFitzpatrickSkinType' | 'HKCharacteristicTypeIdentifierBiologicalSex' | 'HKCharacteristicTypeIdentifierBloodType' | 'HKCharacteristicTypeIdentifierDateOfBirth' | 'HKCharacteristicTypeIdentifierWheelchairUse' | 'HKCharacteristicTypeIdentifierActivityMoveMode';
|
|
2
|
+
/**
|
|
3
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkbloodtype Apple Docs }
|
|
4
|
+
*/
|
|
5
|
+
export declare enum BloodType {
|
|
6
|
+
notSet = 0,
|
|
7
|
+
aPositive = 1,
|
|
8
|
+
aNegative = 2,
|
|
9
|
+
bPositive = 3,
|
|
10
|
+
bNegative = 4,
|
|
11
|
+
abPositive = 5,
|
|
12
|
+
abNegative = 6,
|
|
13
|
+
oPositive = 7,
|
|
14
|
+
oNegative = 8
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkbiologicalsex Apple Docs }
|
|
18
|
+
*/
|
|
19
|
+
export declare enum BiologicalSex {
|
|
20
|
+
notSet = 0,
|
|
21
|
+
female = 1,
|
|
22
|
+
male = 2,
|
|
23
|
+
other = 3
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkfitzpatrickskintype Apple Docs }
|
|
27
|
+
*/
|
|
28
|
+
export declare enum FitzpatrickSkinType {
|
|
29
|
+
notSet = 0,
|
|
30
|
+
I = 1,
|
|
31
|
+
II = 2,
|
|
32
|
+
III = 3,
|
|
33
|
+
IV = 4,
|
|
34
|
+
V = 5,
|
|
35
|
+
VI = 6
|
|
36
|
+
}
|
|
37
|
+
export declare enum WheelchairUse {
|
|
38
|
+
notSet = 0,
|
|
39
|
+
notUsingWheelchair = 1,
|
|
40
|
+
usingWheelchair = 2
|
|
41
|
+
}
|
|
@@ -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 declare 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 declare 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 declare 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 declare const HeartbeatSeriesTypeIdentifier: "HKDataTypeIdentifierHeartbeatSeries";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AnyMap } from 'react-native-nitro-modules';
|
|
2
|
+
import type { CategorySample, CategorySampleForSaving } from './CategoryType';
|
|
3
|
+
import type { QuantitySample, QuantitySampleForSaving } from './QuantitySample';
|
|
4
|
+
import type { GenericMetadata } from './Shared';
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcorrelationtypeidentifier Apple Docs }
|
|
7
|
+
*/
|
|
8
|
+
export type CorrelationTypeIdentifier = 'HKCorrelationTypeIdentifierBloodPressure' | 'HKCorrelationTypeIdentifierFood';
|
|
9
|
+
type CorrelationObject = CategorySample | QuantitySample;
|
|
10
|
+
export interface CorrelationSample {
|
|
11
|
+
readonly correlationType: CorrelationTypeIdentifier;
|
|
12
|
+
readonly objects: readonly CorrelationObject[];
|
|
13
|
+
readonly metadata: AnyMap;
|
|
14
|
+
readonly startDate: Date;
|
|
15
|
+
readonly endDate: Date;
|
|
16
|
+
}
|
|
17
|
+
export type MetadataMapperForCorrelationIdentifier<TCorrelationTypeIdentifier = CorrelationTypeIdentifier> = TCorrelationTypeIdentifier extends 'CorrelationTypeIdentifierFood' ? GenericMetadata & {
|
|
18
|
+
readonly HKFoodType?: string;
|
|
19
|
+
} : GenericMetadata;
|
|
20
|
+
export type SampleForSaving = CategorySampleForSaving | QuantitySampleForSaving;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkdevice Apple Docs }
|
|
3
|
+
*/
|
|
4
|
+
export interface Device {
|
|
5
|
+
readonly name: string | null;
|
|
6
|
+
readonly firmwareVersion: string | null;
|
|
7
|
+
readonly hardwareVersion: string | null;
|
|
8
|
+
readonly localIdentifier: string | null;
|
|
9
|
+
readonly manufacturer: string | null;
|
|
10
|
+
readonly model: string | null;
|
|
11
|
+
readonly softwareVersion: string | null;
|
|
12
|
+
readonly udiDeviceIdentifier: string | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AnyMap } from 'react-native-nitro-modules';
|
|
2
|
+
import type { Device } from './Device';
|
|
3
|
+
import type { DeletedSample, GenericMetadata } from './Shared';
|
|
4
|
+
import type { SourceRevision } from './Source';
|
|
5
|
+
export interface HeartbeatSeriesSampleMetadata extends GenericMetadata {
|
|
6
|
+
readonly HKMetadataKeyAlgorithmVersion: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Heartbeat {
|
|
9
|
+
readonly timeSinceSeriesStart: number;
|
|
10
|
+
readonly precededByGap: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface HeartbeatSeriesSample {
|
|
13
|
+
readonly uuid: string;
|
|
14
|
+
readonly device?: Device;
|
|
15
|
+
readonly startDate: Date;
|
|
16
|
+
readonly endDate: Date;
|
|
17
|
+
readonly heartbeats: readonly Heartbeat[];
|
|
18
|
+
readonly metadata?: AnyMap;
|
|
19
|
+
readonly sourceRevision?: SourceRevision;
|
|
20
|
+
}
|
|
21
|
+
export interface HeartbeatSeriesSamplesWithAnchorResponse {
|
|
22
|
+
readonly samples: readonly HeartbeatSeriesSample[];
|
|
23
|
+
readonly deletedSamples: readonly DeletedSample[];
|
|
24
|
+
readonly newAnchor: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
/**
|
|
24
|
+
* Extracts method names from an interface, excluding specified keys
|
|
25
|
+
*/
|
|
26
|
+
export type ExtractMethodNames<T, ExcludeKeys extends keyof T = never> = Exclude<keyof T, ExcludeKeys>;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the parameter count of a function type
|
|
29
|
+
*/
|
|
30
|
+
export type GetParameterCount<T> = T extends (...args: infer P) => unknown ? P['length'] : never;
|
|
31
|
+
/**
|
|
32
|
+
* Checks if two interfaces have the same method names
|
|
33
|
+
*/
|
|
34
|
+
export type CheckMethodNames<BaseInterface, TypedInterface, ExcludeFromBase extends keyof BaseInterface = never> = {
|
|
35
|
+
BaseMethodNames: ExtractMethodNames<BaseInterface, ExcludeFromBase>;
|
|
36
|
+
TypedMethodNames: ExtractMethodNames<TypedInterface>;
|
|
37
|
+
MissingInBase: Exclude<ExtractMethodNames<TypedInterface>, ExtractMethodNames<BaseInterface, ExcludeFromBase>>;
|
|
38
|
+
MissingInTyped: Exclude<ExtractMethodNames<BaseInterface, ExcludeFromBase>, ExtractMethodNames<TypedInterface>>;
|
|
39
|
+
InterfaceMismatch: Exclude<ExtractMethodNames<TypedInterface>, ExtractMethodNames<BaseInterface, ExcludeFromBase>> | Exclude<ExtractMethodNames<BaseInterface, ExcludeFromBase>, ExtractMethodNames<TypedInterface>>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Checks parameter counts for shared methods between two interfaces
|
|
43
|
+
*/
|
|
44
|
+
export type CheckParameterCounts<BaseInterface, TypedInterface, ExcludeFromBase extends keyof BaseInterface = never> = {
|
|
45
|
+
SharedMethodNames: ExtractMethodNames<BaseInterface, ExcludeFromBase> & ExtractMethodNames<TypedInterface>;
|
|
46
|
+
ParameterCountMismatches: {
|
|
47
|
+
[K in ExtractMethodNames<BaseInterface, ExcludeFromBase> & ExtractMethodNames<TypedInterface>]: GetParameterCount<BaseInterface[K]> extends GetParameterCount<TypedInterface[K]> ? GetParameterCount<TypedInterface[K]> extends GetParameterCount<BaseInterface[K]> ? never : K : K;
|
|
48
|
+
}[ExtractMethodNames<BaseInterface, ExcludeFromBase> & ExtractMethodNames<TypedInterface>];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Complete interface verification that checks both method names and parameter counts
|
|
52
|
+
*/
|
|
53
|
+
export type VerifyInterfaceSync<BaseInterface, TypedInterface, ExcludeFromBase extends keyof BaseInterface = never> = {
|
|
54
|
+
MethodCheck: CheckMethodNames<BaseInterface, TypedInterface, ExcludeFromBase>;
|
|
55
|
+
ParameterCheck: CheckParameterCounts<BaseInterface, TypedInterface, ExcludeFromBase>;
|
|
56
|
+
Result: CheckMethodNames<BaseInterface, TypedInterface, ExcludeFromBase>['InterfaceMismatch'] extends never ? CheckParameterCounts<BaseInterface, TypedInterface, ExcludeFromBase>['ParameterCountMismatches'] extends never ? true : {
|
|
57
|
+
ERROR: 'Parameter count mismatch detected';
|
|
58
|
+
MethodsWithParameterCountMismatch: CheckParameterCounts<BaseInterface, TypedInterface, ExcludeFromBase>['ParameterCountMismatches'];
|
|
59
|
+
} : {
|
|
60
|
+
ERROR: 'Interface mismatch detected';
|
|
61
|
+
MissingInBase: CheckMethodNames<BaseInterface, TypedInterface, ExcludeFromBase>['MissingInBase'];
|
|
62
|
+
MissingInTyped: CheckMethodNames<BaseInterface, TypedInterface, ExcludeFromBase>['MissingInTyped'];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Simplified interface verification for common use cases
|
|
67
|
+
*/
|
|
68
|
+
export type AssertInterfacesMatch<BaseInterface, TypedInterface, ExcludeFromBase extends keyof BaseInterface = never> = VerifyInterfaceSync<BaseInterface, TypedInterface, ExcludeFromBase>['Result'];
|
|
69
|
+
/**
|
|
70
|
+
* Creates a compile-time assertion that two interfaces match
|
|
71
|
+
* Usage: const _check: InterfaceAssertion<BaseInterface, TypedInterface> = true;
|
|
72
|
+
*/
|
|
73
|
+
export type InterfaceAssertion<BaseInterface, TypedInterface, ExcludeFromBase extends keyof BaseInterface = never> = AssertInterfacesMatch<BaseInterface, TypedInterface, ExcludeFromBase>;
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
8
|
+
export interface ExampleModule extends HybridObject<{
|
|
9
|
+
ios: 'swift';
|
|
10
|
+
}> {
|
|
11
|
+
getData(id: string): Promise<string>;
|
|
12
|
+
saveData(id: string, data: string): Promise<boolean>;
|
|
13
|
+
deleteData(id: string): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export interface ExampleModuleTyped {
|
|
16
|
+
getData<T extends string>(id: T): Promise<string>;
|
|
17
|
+
saveData<T extends string>(id: T, data: string): Promise<boolean>;
|
|
18
|
+
deleteData<T extends string>(id: T): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfigModule extends HybridObject<{
|
|
21
|
+
ios: 'swift';
|
|
22
|
+
}> {
|
|
23
|
+
getConfig(key: string, defaultValue?: string): Promise<string>;
|
|
24
|
+
setConfig(key: string, value: string, persistent?: boolean): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export interface ConfigModuleTyped {
|
|
27
|
+
getConfig<T extends string>(key: T, defaultValue?: string): Promise<string>;
|
|
28
|
+
setConfig<T extends string>(key: T, value: string, persistent?: boolean): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export interface BadModule extends HybridObject<{
|
|
31
|
+
ios: 'swift';
|
|
32
|
+
}> {
|
|
33
|
+
method1(): void;
|
|
34
|
+
method2(param: string): void;
|
|
35
|
+
extraMethod(): void;
|
|
36
|
+
}
|
|
37
|
+
export interface BadModuleTyped {
|
|
38
|
+
method1(): void;
|
|
39
|
+
method2(param: string): void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Usage Instructions:
|
|
43
|
+
*
|
|
44
|
+
* 1. Import the InterfaceAssertion type from InterfaceVerification
|
|
45
|
+
* 2. Create your base interface (extending HybridObject)
|
|
46
|
+
* 3. Create your typed interface (with generics)
|
|
47
|
+
* 4. Add a verification line:
|
|
48
|
+
* const _verification: InterfaceAssertion<BaseInterface, TypedInterface, keyof HybridObject> = true;
|
|
49
|
+
*
|
|
50
|
+
* The verification will:
|
|
51
|
+
* - Check that both interfaces have the same method names
|
|
52
|
+
* - Check that corresponding methods have the same number of parameters
|
|
53
|
+
* - Show descriptive TypeScript errors if there are mismatches
|
|
54
|
+
*
|
|
55
|
+
* Error Types:
|
|
56
|
+
* - "Interface mismatch detected" - method names don't match
|
|
57
|
+
* - "Parameter count mismatch detected" - parameter counts don't match
|
|
58
|
+
*/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AnyMap } from 'react-native-nitro-modules';
|
|
2
|
+
import type { Device } from './Device';
|
|
3
|
+
import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier';
|
|
4
|
+
import type { SourceRevision } from './Source';
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs }
|
|
7
|
+
*/
|
|
8
|
+
export interface QuantitySample {
|
|
9
|
+
readonly uuid: string;
|
|
10
|
+
readonly device?: Device;
|
|
11
|
+
readonly quantityType: QuantityTypeIdentifier;
|
|
12
|
+
readonly startDate: Date;
|
|
13
|
+
readonly endDate: Date;
|
|
14
|
+
readonly quantity: number;
|
|
15
|
+
readonly unit: string;
|
|
16
|
+
readonly metadata: AnyMap;
|
|
17
|
+
readonly sourceRevision?: SourceRevision;
|
|
18
|
+
}
|
|
19
|
+
export interface QuantitySampleForSaving {
|
|
20
|
+
readonly startDate: Date;
|
|
21
|
+
readonly endDate: Date;
|
|
22
|
+
readonly quantityType: QuantityTypeIdentifier;
|
|
23
|
+
readonly quantity: number;
|
|
24
|
+
readonly unit: string;
|
|
25
|
+
readonly metadata: AnyMap;
|
|
26
|
+
readonly sourceRevision?: SourceRevision;
|
|
27
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { QuantitySample } from './QuantitySample';
|
|
2
|
+
import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier';
|
|
3
|
+
import type { PredicateForSamples } from './QueryOptions';
|
|
4
|
+
import type { DeletedSample, GenericMetadata } from './Shared';
|
|
5
|
+
import type { BloodGlucoseUnit, CountPerTime, EnergyUnit, LengthUnit, MassUnit, SpeedUnit, TemperatureUnit, TimeUnit, Unit, VolumeUnit } from './Units';
|
|
6
|
+
interface QuantityDateInterval {
|
|
7
|
+
readonly from: Date;
|
|
8
|
+
readonly to: Date;
|
|
9
|
+
}
|
|
10
|
+
export interface QueryStatisticsResponse {
|
|
11
|
+
readonly averageQuantity?: Quantity;
|
|
12
|
+
readonly maximumQuantity?: Quantity;
|
|
13
|
+
readonly minimumQuantity?: Quantity;
|
|
14
|
+
readonly sumQuantity?: Quantity;
|
|
15
|
+
readonly mostRecentQuantity?: Quantity;
|
|
16
|
+
readonly mostRecentQuantityDateInterval?: QuantityDateInterval;
|
|
17
|
+
readonly duration?: Quantity;
|
|
18
|
+
}
|
|
19
|
+
export interface QuantitySamplesWithAnchorResponse {
|
|
20
|
+
readonly samples: readonly QuantitySample[];
|
|
21
|
+
readonly deletedSamples: readonly DeletedSample[];
|
|
22
|
+
readonly newAnchor: string;
|
|
23
|
+
}
|
|
24
|
+
export interface Quantity {
|
|
25
|
+
readonly unit: string;
|
|
26
|
+
readonly quantity: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason Apple Docs }
|
|
30
|
+
*/
|
|
31
|
+
export declare enum InsulinDeliveryReason {
|
|
32
|
+
basal = 1,
|
|
33
|
+
bolus = 2
|
|
34
|
+
}
|
|
35
|
+
export declare enum HeartRateMotionContext {
|
|
36
|
+
active = 2,
|
|
37
|
+
notSet = 0,
|
|
38
|
+
sedentary = 1
|
|
39
|
+
}
|
|
40
|
+
export interface IntervalComponents {
|
|
41
|
+
readonly minute?: number;
|
|
42
|
+
readonly hour?: number;
|
|
43
|
+
readonly day?: number;
|
|
44
|
+
readonly month?: number;
|
|
45
|
+
readonly year?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface StatisticsQueryOptions {
|
|
48
|
+
filter?: PredicateForSamples;
|
|
49
|
+
unit?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkstatisticsoptions Apple Docs }
|
|
53
|
+
*/
|
|
54
|
+
export type StatisticsOptions = 'cumulativeSum' | 'discreteAverage' | 'discreteMax' | 'discreteMin' | 'duration' | 'mostRecent' | 'separateBySource';
|
|
55
|
+
export type MetadataMapperForQuantityIdentifier<TQuantityTypeIdentifier = QuantityTypeIdentifier> = TQuantityTypeIdentifier extends 'QuantityTypeIdentifierInsulinDelivery' ? GenericMetadata & {
|
|
56
|
+
readonly HKInsulinDeliveryReason: InsulinDeliveryReason;
|
|
57
|
+
} : TQuantityTypeIdentifier extends 'QuantityTypeIdentifierBloodGlucose' ? GenericMetadata & {
|
|
58
|
+
readonly HKBloodGlucoseMealTime?: number;
|
|
59
|
+
} : TQuantityTypeIdentifier extends 'QuantityTypeIdentifierHeartRate' ? GenericMetadata & {
|
|
60
|
+
readonly HKHeartRateMotionContext?: HeartRateMotionContext;
|
|
61
|
+
} : GenericMetadata;
|
|
62
|
+
export type UnitForIdentifier<T extends QuantityTypeIdentifier = QuantityTypeIdentifier> = T extends 'QuantityTypeIdentifierBloodGlucose' ? BloodGlucoseUnit : T extends 'QuantityTypeIdentifierAppleExerciseTime' | 'QuantityTypeIdentifierAppleMoveTime' | 'QuantityTypeIdentifierAppleStandTime' ? TimeUnit : T extends 'QuantityTypeIdentifierActiveEnergyBurned' | 'QuantityTypeIdentifierBasalEnergyBurned' | 'QuantityTypeIdentifierDietaryEnergyConsumed' ? EnergyUnit : T extends 'QuantityTypeIdentifierDistanceCycling' | 'QuantityTypeIdentifierDistanceDownhillSnowSports' | 'QuantityTypeIdentifierDistanceSwimming' | 'QuantityTypeIdentifierDistanceWalkingRunning' | 'QuantityTypeIdentifierDistanceWheelchair' | 'QuantityTypeIdentifierSixMinuteWalkTestDistance' | 'QuantityTypeIdentifierWaistCircumference' ? LengthUnit : T extends 'QuantityTypeIdentifierBodyFatPercentage' | 'QuantityTypeIdentifierOxygenSaturation' | 'QuantityTypeIdentifierWalkingAsymmetryPercentage' | 'QuantityTypeIdentifierWalkingDoubleSupportPercentage' ? '%' : T extends 'QuantityTypeIdentifierBasalBodyTemperature' ? TemperatureUnit : T extends 'QuantityTypeIdentifierRunningSpeed' | 'QuantityTypeIdentifierStairAscentSpeed' | 'QuantityTypeIdentifierStairDescentSpeed' | 'QuantityTypeIdentifierWalkingSpeed' ? SpeedUnit<LengthUnit, TimeUnit> : T extends 'QuantityTypeIdentifierFlightsClimbed' | 'QuantityTypeIdentifierNumberOfAlcoholicBeverages' | 'QuantityTypeIdentifierNumberOfTimesFallen' | 'QuantityTypeIdentifierPushCount' | 'QuantityTypeIdentifierStepCount' | 'QuantityTypeIdentifierSwimmingStrokeCount' ? 'count' : T extends 'QuantityTypeIdentifierDietaryBiotin' | 'QuantityTypeIdentifierDietaryCaffeine' | 'QuantityTypeIdentifierDietaryCalcium' | 'QuantityTypeIdentifierDietaryCarbohydrates' | 'QuantityTypeIdentifierDietaryChloride' | 'QuantityTypeIdentifierDietaryCholesterol' | 'QuantityTypeIdentifierDietaryChromium' | 'QuantityTypeIdentifierDietaryCopper' | 'QuantityTypeIdentifierDietaryFatMonounsaturated' | 'QuantityTypeIdentifierDietaryFatPolyunsaturated' | 'QuantityTypeIdentifierDietaryFatSaturated' | 'QuantityTypeIdentifierDietaryFatTotal' | 'QuantityTypeIdentifierDietaryFiber' | 'QuantityTypeIdentifierDietaryFolate' | 'QuantityTypeIdentifierDietaryIodine' | 'QuantityTypeIdentifierDietaryIron' | 'QuantityTypeIdentifierDietaryMagnesium' | 'QuantityTypeIdentifierDietaryManganese' | 'QuantityTypeIdentifierDietaryMolybdenum' | 'QuantityTypeIdentifierDietaryNiacin' | 'QuantityTypeIdentifierDietaryPantothenicAcid' | 'QuantityTypeIdentifierDietaryPhosphorus' | 'QuantityTypeIdentifierDietaryPotassium' | 'QuantityTypeIdentifierDietaryProtein' | 'QuantityTypeIdentifierDietaryRiboflavin' | 'QuantityTypeIdentifierDietarySelenium' | 'QuantityTypeIdentifierDietarySodium' | 'QuantityTypeIdentifierDietarySugar' | 'QuantityTypeIdentifierDietaryThiamin' | 'QuantityTypeIdentifierDietaryVitaminA' | 'QuantityTypeIdentifierDietaryVitaminB6' | 'QuantityTypeIdentifierDietaryVitaminB12' | 'QuantityTypeIdentifierDietaryVitaminC' | 'QuantityTypeIdentifierDietaryVitaminD' | 'QuantityTypeIdentifierDietaryVitaminE' | 'QuantityTypeIdentifierDietaryVitaminK' | 'QuantityTypeIdentifierDietaryZinc' ? MassUnit : T extends 'QuantityTypeIdentifierDietaryWater' ? VolumeUnit : T extends 'QuantityTypeIdentifierInsulinDelivery' ? 'IU' : T extends 'QuantityTypeIdentifierHeartRate' | 'QuantityTypeIdentifierRestingHeartRate' | 'QuantityTypeIdentifierWalkingHeartRateAverage' ? CountPerTime<TimeUnit> : Unit;
|
|
63
|
+
export {};
|