@kingstinct/react-native-healthkit 15.1.0 → 16.1.0

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.
Files changed (107) hide show
  1. package/README.md +22 -3
  2. package/ReactNativeHealthkit.podspec +17 -6
  3. package/app.plugin.js +18 -34
  4. package/app.plugin.ts +25 -50
  5. package/ios/CategoryTypeModule.swift +1 -0
  6. package/ios/CharacteristicTypeModule.swift +7 -6
  7. package/ios/Constants.swift +9 -34
  8. package/ios/CoreModule.swift +72 -41
  9. package/ios/CorrelationTypeModule.swift +3 -2
  10. package/ios/ElectrocardiogramModule.swift +4 -3
  11. package/ios/HeartbeatSeriesModule.swift +4 -3
  12. package/ios/Helpers.swift +10 -243
  13. package/ios/MedicationModule.swift +9 -8
  14. package/ios/MemoryEstimation.swift +1 -0
  15. package/ios/PredicateHelpers.swift +16 -86
  16. package/ios/QuantityTypeModule.swift +3 -2
  17. package/ios/Serializers.swift +16 -67
  18. package/ios/SourceProxy.swift +1 -0
  19. package/ios/StateOfMindModule.swift +3 -2
  20. package/ios/WorkoutProxy.swift +3 -2
  21. package/ios/WorkoutsModule.swift +4 -3
  22. package/lib/commonjs/generated/healthkit.generated.js +3 -0
  23. package/lib/commonjs/healthkit.ios.js +4 -2
  24. package/lib/commonjs/healthkit.js +21 -78
  25. package/lib/commonjs/types/Auth.js +3 -18
  26. package/lib/commonjs/types/Background.js +2 -10
  27. package/lib/commonjs/types/QueryOptions.js +2 -17
  28. package/lib/module/generated/healthkit.generated.js +3 -0
  29. package/lib/module/healthkit.ios.js +2 -0
  30. package/lib/module/healthkit.js +20 -77
  31. package/lib/module/types/Auth.js +1 -18
  32. package/lib/module/types/Background.js +1 -10
  33. package/lib/module/types/QueryOptions.js +1 -17
  34. package/lib/typescript/generated/healthkit.generated.d.ts +6 -2
  35. package/lib/typescript/healthkit.d.ts +3 -2
  36. package/lib/typescript/healthkit.ios.d.ts +11 -9
  37. package/lib/typescript/specs/CoreModule.nitro.d.ts +16 -0
  38. package/lib/typescript/specs/SourceProxy.nitro.d.ts +2 -4
  39. package/lib/typescript/types/Auth.d.ts +1 -16
  40. package/lib/typescript/types/Background.d.ts +1 -9
  41. package/lib/typescript/types/Device.d.ts +1 -13
  42. package/lib/typescript/types/QuantityType.d.ts +1 -1
  43. package/lib/typescript/types/QueryOptions.d.ts +3 -37
  44. package/lib/typescript/types/Shared.d.ts +2 -25
  45. package/lib/typescript/types/Source.d.ts +1 -10
  46. package/lib/typescript/types/Subscriptions.d.ts +2 -3
  47. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +8 -0
  48. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +68 -0
  49. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +1 -1
  50. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +8 -0
  51. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +1 -1
  52. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +1 -1
  53. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +1 -1
  54. package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +1 -1
  55. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +1 -1
  56. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +1 -1
  57. package/nitrogen/generated/ios/swift/CategorySample.swift +8 -8
  58. package/nitrogen/generated/ios/swift/CorrelationSample.swift +8 -8
  59. package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +8 -8
  60. package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_.swift +54 -0
  61. package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +8 -8
  62. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +1 -0
  63. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +25 -0
  64. package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +8 -8
  65. package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +4 -0
  66. package/nitrogen/generated/ios/swift/QuantitySample.swift +8 -8
  67. package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +4 -0
  68. package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +4 -0
  69. package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +4 -0
  70. package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +4 -0
  71. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +8 -8
  72. package/nitrogen/generated/shared/c++/CategorySample.hpp +7 -7
  73. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +7 -7
  74. package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +7 -7
  75. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +7 -7
  76. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +1 -0
  77. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +3 -1
  78. package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +7 -7
  79. package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +49 -45
  80. package/nitrogen/generated/shared/c++/QuantitySample.hpp +7 -7
  81. package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +42 -38
  82. package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +42 -38
  83. package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +48 -44
  84. package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +47 -43
  85. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +7 -7
  86. package/package.json +4 -1
  87. package/src/generated/healthkit-schema.json +13 -0
  88. package/src/generated/healthkit.generated.ts +5 -0
  89. package/src/healthkit.ios.ts +3 -0
  90. package/src/healthkit.ts +27 -84
  91. package/src/specs/CoreModule.nitro.ts +19 -0
  92. package/src/specs/SourceProxy.nitro.ts +2 -4
  93. package/src/test-setup.ts +1 -0
  94. package/src/types/Auth.ts +4 -17
  95. package/src/types/Background.ts +1 -9
  96. package/src/types/Device.ts +1 -13
  97. package/src/types/QuantityType.ts +1 -1
  98. package/src/types/QueryOptions.ts +7 -65
  99. package/src/types/Shared.ts +7 -28
  100. package/src/types/Source.ts +1 -11
  101. package/src/types/Subscriptions.ts +2 -3
  102. package/ios/BackgroundDeliveryManager.swift +0 -284
  103. package/ios/BackgroundLaunchHook.mm +0 -41
  104. package/ios/Bridge.h +0 -10
  105. package/ios/ExceptionCatcher.h +0 -5
  106. package/ios/ExceptionCatcher.mm +0 -32
  107. package/ios/module.modulemap +0 -5
@@ -1,18 +1 @@
1
- /**
2
- * @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus Apple Docs }
3
- */
4
- export var AuthorizationRequestStatus;
5
- (function (AuthorizationRequestStatus) {
6
- AuthorizationRequestStatus[AuthorizationRequestStatus["unknown"] = 0] = "unknown";
7
- AuthorizationRequestStatus[AuthorizationRequestStatus["shouldRequest"] = 1] = "shouldRequest";
8
- AuthorizationRequestStatus[AuthorizationRequestStatus["unnecessary"] = 2] = "unnecessary";
9
- })(AuthorizationRequestStatus || (AuthorizationRequestStatus = {}));
10
- /**
11
- * @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationstatus Apple Docs }
12
- */
13
- export var AuthorizationStatus;
14
- (function (AuthorizationStatus) {
15
- AuthorizationStatus[AuthorizationStatus["notDetermined"] = 0] = "notDetermined";
16
- AuthorizationStatus[AuthorizationStatus["sharingDenied"] = 1] = "sharingDenied";
17
- AuthorizationStatus[AuthorizationStatus["sharingAuthorized"] = 2] = "sharingAuthorized";
18
- })(AuthorizationStatus || (AuthorizationStatus = {}));
1
+ export { AuthorizationRequestStatus, AuthorizationStatus, } from '@react-native-healthkit/core';
@@ -1,10 +1 @@
1
- /**
2
- * @see {@link https://developer.apple.com/documentation/healthkit/hkupdatefrequency Apple Docs }
3
- */
4
- export var UpdateFrequency;
5
- (function (UpdateFrequency) {
6
- UpdateFrequency[UpdateFrequency["immediate"] = 1] = "immediate";
7
- UpdateFrequency[UpdateFrequency["hourly"] = 2] = "hourly";
8
- UpdateFrequency[UpdateFrequency["daily"] = 3] = "daily";
9
- UpdateFrequency[UpdateFrequency["weekly"] = 4] = "weekly";
10
- })(UpdateFrequency || (UpdateFrequency = {}));
1
+ export { UpdateFrequency } from '@react-native-healthkit/core';
@@ -1,17 +1 @@
1
- export var ComparisonPredicateOperator;
2
- (function (ComparisonPredicateOperator) {
3
- ComparisonPredicateOperator[ComparisonPredicateOperator["lessThan"] = 0] = "lessThan";
4
- ComparisonPredicateOperator[ComparisonPredicateOperator["lessThanOrEqualTo"] = 1] = "lessThanOrEqualTo";
5
- ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThan"] = 2] = "greaterThan";
6
- ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThanOrEqualTo"] = 3] = "greaterThanOrEqualTo";
7
- ComparisonPredicateOperator[ComparisonPredicateOperator["equalTo"] = 4] = "equalTo";
8
- ComparisonPredicateOperator[ComparisonPredicateOperator["notEqualTo"] = 5] = "notEqualTo";
9
- ComparisonPredicateOperator[ComparisonPredicateOperator["matches"] = 6] = "matches";
10
- ComparisonPredicateOperator[ComparisonPredicateOperator["like"] = 7] = "like";
11
- ComparisonPredicateOperator[ComparisonPredicateOperator["beginsWith"] = 8] = "beginsWith";
12
- ComparisonPredicateOperator[ComparisonPredicateOperator["endsWith"] = 9] = "endsWith";
13
- ComparisonPredicateOperator[ComparisonPredicateOperator["IN"] = 10] = "IN";
14
- ComparisonPredicateOperator[ComparisonPredicateOperator["customSelector"] = 11] = "customSelector";
15
- ComparisonPredicateOperator[ComparisonPredicateOperator["contains"] = 99] = "contains";
16
- ComparisonPredicateOperator[ComparisonPredicateOperator["between"] = 100] = "between";
17
- })(ComparisonPredicateOperator || (ComparisonPredicateOperator = {}));
1
+ export { ComparisonPredicateOperator } from '@react-native-healthkit/core';
@@ -1,7 +1,7 @@
1
1
  import type { Quantity } from '../types/QuantityType';
2
2
  import type { BloodGlucoseUnit, CountPerTime, EnergyUnit, LengthUnit, MassUnit, PressureUnit, SpeedUnit, TemperatureUnit, TimeUnit } from '../types/Units';
3
3
  export type QuantityTypeIdentifierReadOnly = 'HKQuantityTypeIdentifierAppleExerciseTime' | 'HKQuantityTypeIdentifierAppleStandTime' | 'HKQuantityTypeIdentifierAppleWalkingSteadiness' | 'HKQuantityTypeIdentifierAtrialFibrillationBurden' | 'HKQuantityTypeIdentifierWalkingHeartRateAverage';
4
- export type QuantityTypeIdentifierWriteable = 'HKQuantityTypeIdentifierActiveEnergyBurned' | 'HKQuantityTypeIdentifierAppleMoveTime' | 'HKQuantityTypeIdentifierAppleSleepingBreathingDisturbances' | 'HKQuantityTypeIdentifierAppleSleepingWristTemperature' | 'HKQuantityTypeIdentifierBasalBodyTemperature' | 'HKQuantityTypeIdentifierBasalEnergyBurned' | 'HKQuantityTypeIdentifierBloodAlcoholContent' | 'HKQuantityTypeIdentifierBloodGlucose' | 'HKQuantityTypeIdentifierBloodPressureDiastolic' | 'HKQuantityTypeIdentifierBloodPressureSystolic' | 'HKQuantityTypeIdentifierBodyFatPercentage' | 'HKQuantityTypeIdentifierBodyMass' | 'HKQuantityTypeIdentifierBodyMassIndex' | 'HKQuantityTypeIdentifierBodyTemperature' | 'HKQuantityTypeIdentifierCrossCountrySkiingSpeed' | 'HKQuantityTypeIdentifierCyclingCadence' | 'HKQuantityTypeIdentifierCyclingFunctionalThresholdPower' | 'HKQuantityTypeIdentifierCyclingPower' | 'HKQuantityTypeIdentifierCyclingSpeed' | 'HKQuantityTypeIdentifierDietaryBiotin' | 'HKQuantityTypeIdentifierDietaryCaffeine' | 'HKQuantityTypeIdentifierDietaryCalcium' | 'HKQuantityTypeIdentifierDietaryCarbohydrates' | 'HKQuantityTypeIdentifierDietaryChloride' | 'HKQuantityTypeIdentifierDietaryCholesterol' | 'HKQuantityTypeIdentifierDietaryChromium' | 'HKQuantityTypeIdentifierDietaryCopper' | 'HKQuantityTypeIdentifierDietaryEnergyConsumed' | 'HKQuantityTypeIdentifierDietaryFatMonounsaturated' | 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated' | 'HKQuantityTypeIdentifierDietaryFatSaturated' | 'HKQuantityTypeIdentifierDietaryFatTotal' | 'HKQuantityTypeIdentifierDietaryFiber' | 'HKQuantityTypeIdentifierDietaryFolate' | 'HKQuantityTypeIdentifierDietaryIodine' | 'HKQuantityTypeIdentifierDietaryIron' | 'HKQuantityTypeIdentifierDietaryMagnesium' | 'HKQuantityTypeIdentifierDietaryManganese' | 'HKQuantityTypeIdentifierDietaryMolybdenum' | 'HKQuantityTypeIdentifierDietaryNiacin' | 'HKQuantityTypeIdentifierDietaryPantothenicAcid' | 'HKQuantityTypeIdentifierDietaryPhosphorus' | 'HKQuantityTypeIdentifierDietaryPotassium' | 'HKQuantityTypeIdentifierDietaryProtein' | 'HKQuantityTypeIdentifierDietaryRiboflavin' | 'HKQuantityTypeIdentifierDietarySelenium' | 'HKQuantityTypeIdentifierDietarySodium' | 'HKQuantityTypeIdentifierDietarySugar' | 'HKQuantityTypeIdentifierDietaryThiamin' | 'HKQuantityTypeIdentifierDietaryVitaminA' | 'HKQuantityTypeIdentifierDietaryVitaminB12' | 'HKQuantityTypeIdentifierDietaryVitaminB6' | 'HKQuantityTypeIdentifierDietaryVitaminC' | 'HKQuantityTypeIdentifierDietaryVitaminD' | 'HKQuantityTypeIdentifierDietaryVitaminE' | 'HKQuantityTypeIdentifierDietaryVitaminK' | 'HKQuantityTypeIdentifierDietaryWater' | 'HKQuantityTypeIdentifierDietaryZinc' | 'HKQuantityTypeIdentifierDistanceCrossCountrySkiing' | 'HKQuantityTypeIdentifierDistanceCycling' | 'HKQuantityTypeIdentifierDistanceDownhillSnowSports' | 'HKQuantityTypeIdentifierDistancePaddleSports' | 'HKQuantityTypeIdentifierDistanceRowing' | 'HKQuantityTypeIdentifierDistanceSkatingSports' | 'HKQuantityTypeIdentifierDistanceSwimming' | 'HKQuantityTypeIdentifierDistanceWalkingRunning' | 'HKQuantityTypeIdentifierDistanceWheelchair' | 'HKQuantityTypeIdentifierElectrodermalActivity' | 'HKQuantityTypeIdentifierEnvironmentalAudioExposure' | 'HKQuantityTypeIdentifierEnvironmentalSoundReduction' | 'HKQuantityTypeIdentifierEstimatedWorkoutEffortScore' | 'HKQuantityTypeIdentifierFlightsClimbed' | 'HKQuantityTypeIdentifierForcedExpiratoryVolume1' | 'HKQuantityTypeIdentifierForcedVitalCapacity' | 'HKQuantityTypeIdentifierHeadphoneAudioExposure' | 'HKQuantityTypeIdentifierHeartRate' | 'HKQuantityTypeIdentifierHeartRateRecoveryOneMinute' | 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN' | 'HKQuantityTypeIdentifierHeight' | 'HKQuantityTypeIdentifierInhalerUsage' | 'HKQuantityTypeIdentifierInsulinDelivery' | 'HKQuantityTypeIdentifierLeanBodyMass' | 'HKQuantityTypeIdentifierNikeFuel' | 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages' | 'HKQuantityTypeIdentifierNumberOfTimesFallen' | 'HKQuantityTypeIdentifierOxygenSaturation' | 'HKQuantityTypeIdentifierPaddleSportsSpeed' | 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate' | 'HKQuantityTypeIdentifierPeripheralPerfusionIndex' | 'HKQuantityTypeIdentifierPhysicalEffort' | 'HKQuantityTypeIdentifierPushCount' | 'HKQuantityTypeIdentifierRespiratoryRate' | 'HKQuantityTypeIdentifierRestingHeartRate' | 'HKQuantityTypeIdentifierRowingSpeed' | 'HKQuantityTypeIdentifierRunningGroundContactTime' | 'HKQuantityTypeIdentifierRunningPower' | 'HKQuantityTypeIdentifierRunningSpeed' | 'HKQuantityTypeIdentifierRunningStrideLength' | 'HKQuantityTypeIdentifierRunningVerticalOscillation' | 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance' | 'HKQuantityTypeIdentifierStairAscentSpeed' | 'HKQuantityTypeIdentifierStairDescentSpeed' | 'HKQuantityTypeIdentifierStepCount' | 'HKQuantityTypeIdentifierSwimmingStrokeCount' | 'HKQuantityTypeIdentifierTimeInDaylight' | 'HKQuantityTypeIdentifierUnderwaterDepth' | 'HKQuantityTypeIdentifierUVExposure' | 'HKQuantityTypeIdentifierVO2Max' | 'HKQuantityTypeIdentifierWaistCircumference' | 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage' | 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage' | 'HKQuantityTypeIdentifierWalkingSpeed' | 'HKQuantityTypeIdentifierWalkingStepLength' | 'HKQuantityTypeIdentifierWaterTemperature' | 'HKQuantityTypeIdentifierWorkoutEffortScore';
4
+ export type QuantityTypeIdentifierWriteable = 'HKQuantityTypeIdentifierActiveEnergyBurned' | 'HKQuantityTypeIdentifierAppleMoveTime' | 'HKQuantityTypeIdentifierAppleSleepingBreathingDisturbances' | 'HKQuantityTypeIdentifierAppleSleepingWristTemperature' | 'HKQuantityTypeIdentifierBasalBodyTemperature' | 'HKQuantityTypeIdentifierBasalEnergyBurned' | 'HKQuantityTypeIdentifierBloodAlcoholContent' | 'HKQuantityTypeIdentifierBloodGlucose' | 'HKQuantityTypeIdentifierBloodPressureDiastolic' | 'HKQuantityTypeIdentifierBloodPressureSystolic' | 'HKQuantityTypeIdentifierBodyFatPercentage' | 'HKQuantityTypeIdentifierBodyMass' | 'HKQuantityTypeIdentifierBodyMassIndex' | 'HKQuantityTypeIdentifierBodyTemperature' | 'HKQuantityTypeIdentifierCrossCountrySkiingSpeed' | 'HKQuantityTypeIdentifierCyclingCadence' | 'HKQuantityTypeIdentifierCyclingFunctionalThresholdPower' | 'HKQuantityTypeIdentifierCyclingPower' | 'HKQuantityTypeIdentifierCyclingSpeed' | 'HKQuantityTypeIdentifierDietaryBiotin' | 'HKQuantityTypeIdentifierDietaryCaffeine' | 'HKQuantityTypeIdentifierDietaryCalcium' | 'HKQuantityTypeIdentifierDietaryCarbohydrates' | 'HKQuantityTypeIdentifierDietaryChloride' | 'HKQuantityTypeIdentifierDietaryCholesterol' | 'HKQuantityTypeIdentifierDietaryChromium' | 'HKQuantityTypeIdentifierDietaryCopper' | 'HKQuantityTypeIdentifierDietaryEnergyConsumed' | 'HKQuantityTypeIdentifierDietaryFatMonounsaturated' | 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated' | 'HKQuantityTypeIdentifierDietaryFatSaturated' | 'HKQuantityTypeIdentifierDietaryFatTotal' | 'HKQuantityTypeIdentifierDietaryFiber' | 'HKQuantityTypeIdentifierDietaryFolate' | 'HKQuantityTypeIdentifierDietaryIodine' | 'HKQuantityTypeIdentifierDietaryIron' | 'HKQuantityTypeIdentifierDietaryMagnesium' | 'HKQuantityTypeIdentifierDietaryManganese' | 'HKQuantityTypeIdentifierDietaryMolybdenum' | 'HKQuantityTypeIdentifierDietaryNiacin' | 'HKQuantityTypeIdentifierDietaryPantothenicAcid' | 'HKQuantityTypeIdentifierDietaryPhosphorus' | 'HKQuantityTypeIdentifierDietaryPotassium' | 'HKQuantityTypeIdentifierDietaryProtein' | 'HKQuantityTypeIdentifierDietaryRiboflavin' | 'HKQuantityTypeIdentifierDietarySelenium' | 'HKQuantityTypeIdentifierDietarySodium' | 'HKQuantityTypeIdentifierDietarySugar' | 'HKQuantityTypeIdentifierDietaryThiamin' | 'HKQuantityTypeIdentifierDietaryVitaminA' | 'HKQuantityTypeIdentifierDietaryVitaminB12' | 'HKQuantityTypeIdentifierDietaryVitaminB6' | 'HKQuantityTypeIdentifierDietaryVitaminC' | 'HKQuantityTypeIdentifierDietaryVitaminD' | 'HKQuantityTypeIdentifierDietaryVitaminE' | 'HKQuantityTypeIdentifierDietaryVitaminK' | 'HKQuantityTypeIdentifierDietaryWater' | 'HKQuantityTypeIdentifierDietaryZinc' | 'HKQuantityTypeIdentifierDistanceCrossCountrySkiing' | 'HKQuantityTypeIdentifierDistanceCycling' | 'HKQuantityTypeIdentifierDistanceDownhillSnowSports' | 'HKQuantityTypeIdentifierDistancePaddleSports' | 'HKQuantityTypeIdentifierDistanceRowing' | 'HKQuantityTypeIdentifierDistanceSkatingSports' | 'HKQuantityTypeIdentifierDistanceSwimming' | 'HKQuantityTypeIdentifierDistanceWalkingRunning' | 'HKQuantityTypeIdentifierDistanceWheelchair' | 'HKQuantityTypeIdentifierElectrodermalActivity' | 'HKQuantityTypeIdentifierEnvironmentalAudioExposure' | 'HKQuantityTypeIdentifierEnvironmentalSoundReduction' | 'HKQuantityTypeIdentifierEstimatedWorkoutEffortScore' | 'HKQuantityTypeIdentifierFlightsClimbed' | 'HKQuantityTypeIdentifierForcedExpiratoryVolume1' | 'HKQuantityTypeIdentifierForcedVitalCapacity' | 'HKQuantityTypeIdentifierHeadphoneAudioExposure' | 'HKQuantityTypeIdentifierHeartRate' | 'HKQuantityTypeIdentifierHeartRateRecoveryOneMinute' | 'HKQuantityTypeIdentifierHeartRateVariabilityRMSSD' | 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN' | 'HKQuantityTypeIdentifierHeight' | 'HKQuantityTypeIdentifierInhalerUsage' | 'HKQuantityTypeIdentifierInsulinDelivery' | 'HKQuantityTypeIdentifierLeanBodyMass' | 'HKQuantityTypeIdentifierNikeFuel' | 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages' | 'HKQuantityTypeIdentifierNumberOfTimesFallen' | 'HKQuantityTypeIdentifierOxygenSaturation' | 'HKQuantityTypeIdentifierPaddleSportsSpeed' | 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate' | 'HKQuantityTypeIdentifierPeripheralPerfusionIndex' | 'HKQuantityTypeIdentifierPhysicalEffort' | 'HKQuantityTypeIdentifierPushCount' | 'HKQuantityTypeIdentifierRespiratoryRate' | 'HKQuantityTypeIdentifierRestingHeartRate' | 'HKQuantityTypeIdentifierRowingSpeed' | 'HKQuantityTypeIdentifierRunningGroundContactTime' | 'HKQuantityTypeIdentifierRunningPower' | 'HKQuantityTypeIdentifierRunningSpeed' | 'HKQuantityTypeIdentifierRunningStrideLength' | 'HKQuantityTypeIdentifierRunningVerticalOscillation' | 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance' | 'HKQuantityTypeIdentifierStairAscentSpeed' | 'HKQuantityTypeIdentifierStairDescentSpeed' | 'HKQuantityTypeIdentifierStepCount' | 'HKQuantityTypeIdentifierSwimmingStrokeCount' | 'HKQuantityTypeIdentifierTimeInDaylight' | 'HKQuantityTypeIdentifierUnderwaterDepth' | 'HKQuantityTypeIdentifierUVExposure' | 'HKQuantityTypeIdentifierVO2Max' | 'HKQuantityTypeIdentifierWaistCircumference' | 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage' | 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage' | 'HKQuantityTypeIdentifierWalkingSpeed' | 'HKQuantityTypeIdentifierWalkingStepLength' | 'HKQuantityTypeIdentifierWaterTemperature' | 'HKQuantityTypeIdentifierWorkoutEffortScore';
5
5
  export type QuantityTypeIdentifier = QuantityTypeIdentifierReadOnly | QuantityTypeIdentifierWriteable;
6
6
  export type CategoryTypeIdentifierReadOnly = 'HKCategoryTypeIdentifierAppleStandHour' | 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent' | 'HKCategoryTypeIdentifierHighHeartRateEvent' | 'HKCategoryTypeIdentifierHypertensionEvent' | 'HKCategoryTypeIdentifierLowHeartRateEvent';
7
7
  export type CategoryTypeIdentifierWriteable = 'HKCategoryTypeIdentifierAbdominalCramps' | 'HKCategoryTypeIdentifierAcne' | 'HKCategoryTypeIdentifierAppetiteChanges' | 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent' | 'HKCategoryTypeIdentifierAudioExposureEvent' | 'HKCategoryTypeIdentifierBladderIncontinence' | 'HKCategoryTypeIdentifierBleedingAfterMenopause' | 'HKCategoryTypeIdentifierBleedingAfterPregnancy' | 'HKCategoryTypeIdentifierBleedingDuringPregnancy' | 'HKCategoryTypeIdentifierBloating' | 'HKCategoryTypeIdentifierBreastPain' | 'HKCategoryTypeIdentifierCervicalMucusQuality' | 'HKCategoryTypeIdentifierChestTightnessOrPain' | 'HKCategoryTypeIdentifierChills' | 'HKCategoryTypeIdentifierConstipation' | 'HKCategoryTypeIdentifierContraceptive' | 'HKCategoryTypeIdentifierCoughing' | 'HKCategoryTypeIdentifierDiarrhea' | 'HKCategoryTypeIdentifierDizziness' | 'HKCategoryTypeIdentifierDrySkin' | 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent' | 'HKCategoryTypeIdentifierFainting' | 'HKCategoryTypeIdentifierFatigue' | 'HKCategoryTypeIdentifierFever' | 'HKCategoryTypeIdentifierGeneralizedBodyAche' | 'HKCategoryTypeIdentifierHairLoss' | 'HKCategoryTypeIdentifierHandwashingEvent' | 'HKCategoryTypeIdentifierHeadache' | 'HKCategoryTypeIdentifierHeartburn' | 'HKCategoryTypeIdentifierHotFlashes' | 'HKCategoryTypeIdentifierInfrequentMenstrualCycles' | 'HKCategoryTypeIdentifierIntermenstrualBleeding' | 'HKCategoryTypeIdentifierIrregularHeartRhythmEvent' | 'HKCategoryTypeIdentifierIrregularMenstrualCycles' | 'HKCategoryTypeIdentifierLactation' | 'HKCategoryTypeIdentifierLossOfSmell' | 'HKCategoryTypeIdentifierLossOfTaste' | 'HKCategoryTypeIdentifierLowCardioFitnessEvent' | 'HKCategoryTypeIdentifierLowerBackPain' | 'HKCategoryTypeIdentifierMemoryLapse' | 'HKCategoryTypeIdentifierMenopausalState' | 'HKCategoryTypeIdentifierMenstrualFlow' | 'HKCategoryTypeIdentifierMindfulSession' | 'HKCategoryTypeIdentifierMoodChanges' | 'HKCategoryTypeIdentifierNausea' | 'HKCategoryTypeIdentifierNightSweats' | 'HKCategoryTypeIdentifierOvulationTestResult' | 'HKCategoryTypeIdentifierPelvicPain' | 'HKCategoryTypeIdentifierPersistentIntermenstrualBleeding' | 'HKCategoryTypeIdentifierPregnancy' | 'HKCategoryTypeIdentifierPregnancyTestResult' | 'HKCategoryTypeIdentifierProgesteroneTestResult' | 'HKCategoryTypeIdentifierProlongedMenstrualPeriods' | 'HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat' | 'HKCategoryTypeIdentifierRunnyNose' | 'HKCategoryTypeIdentifierSexualActivity' | 'HKCategoryTypeIdentifierShortnessOfBreath' | 'HKCategoryTypeIdentifierSinusCongestion' | 'HKCategoryTypeIdentifierSkippedHeartbeat' | 'HKCategoryTypeIdentifierSleepAnalysis' | 'HKCategoryTypeIdentifierSleepApneaEvent' | 'HKCategoryTypeIdentifierSleepChanges' | 'HKCategoryTypeIdentifierSoreThroat' | 'HKCategoryTypeIdentifierToothbrushingEvent' | 'HKCategoryTypeIdentifierVaginalDryness' | 'HKCategoryTypeIdentifierVomiting' | 'HKCategoryTypeIdentifierWheezing';
@@ -88,6 +88,7 @@ export declare const QUANTITY_IDENTIFIER_IOS_AVAILABILITY: {
88
88
  readonly HKQuantityTypeIdentifierHeadphoneAudioExposure: "13.0";
89
89
  readonly HKQuantityTypeIdentifierHeartRate: "8.0";
90
90
  readonly HKQuantityTypeIdentifierHeartRateRecoveryOneMinute: "16.0";
91
+ readonly HKQuantityTypeIdentifierHeartRateVariabilityRMSSD: "27.0";
91
92
  readonly HKQuantityTypeIdentifierHeartRateVariabilitySDNN: "11.0";
92
93
  readonly HKQuantityTypeIdentifierHeight: "8.0";
93
94
  readonly HKQuantityTypeIdentifierInhalerUsage: "8.0";
@@ -284,6 +285,7 @@ export declare const QUANTITY_IDENTIFIER_CANONICAL_UNITS: {
284
285
  readonly HKQuantityTypeIdentifierHeadphoneAudioExposure: "dBASPL";
285
286
  readonly HKQuantityTypeIdentifierHeartRate: "count/s";
286
287
  readonly HKQuantityTypeIdentifierHeartRateRecoveryOneMinute: "count/min";
288
+ readonly HKQuantityTypeIdentifierHeartRateVariabilityRMSSD: "ms";
287
289
  readonly HKQuantityTypeIdentifierHeartRateVariabilitySDNN: "ms";
288
290
  readonly HKQuantityTypeIdentifierHeight: "m";
289
291
  readonly HKQuantityTypeIdentifierInhalerUsage: "count";
@@ -543,7 +545,8 @@ export declare enum HeartRateMotionContext {
543
545
  export declare enum HeartRateRecoveryTestType {
544
546
  maxExercise = 1,
545
547
  predictionSubMaxExercise = 2,
546
- predictionNonExercise = 3
548
+ predictionNonExercise = 3,
549
+ stepTest = 4
547
550
  }
548
551
  export declare enum HeartRateSensorLocation {
549
552
  other = 0,
@@ -976,6 +979,7 @@ export interface QuantityUnitByIdentifierMap {
976
979
  readonly HKQuantityTypeIdentifierHeadphoneAudioExposure: PressureUnit;
977
980
  readonly HKQuantityTypeIdentifierHeartRate: CountPerTime<TimeUnit>;
978
981
  readonly HKQuantityTypeIdentifierHeartRateRecoveryOneMinute: CountPerTime<TimeUnit>;
982
+ readonly HKQuantityTypeIdentifierHeartRateVariabilityRMSSD: string;
979
983
  readonly HKQuantityTypeIdentifierHeartRateVariabilitySDNN: string;
980
984
  readonly HKQuantityTypeIdentifierHeight: LengthUnit;
981
985
  readonly HKQuantityTypeIdentifierInhalerUsage: 'count';
@@ -12,8 +12,8 @@ export * from './types';
12
12
  export declare const authorizationStatusFor: (type: import("./types").ObjectTypeIdentifier) => AuthorizationStatus;
13
13
  export declare const disableAllBackgroundDelivery: () => Promise<boolean>;
14
14
  export declare const disableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier) => Promise<boolean>;
15
- export declare const enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
16
- export declare const configureBackgroundTypes: (typeIdentifiers: string[], updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
15
+ export declare const enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("@react-native-healthkit/core").UpdateFrequency) => Promise<boolean>;
16
+ export declare const configureBackgroundTypes: (typeIdentifiers: string[], updateFrequency: import("@react-native-healthkit/core").UpdateFrequency) => Promise<boolean>;
17
17
  export declare const clearBackgroundTypes: () => Promise<boolean>;
18
18
  export declare const getPreferredUnits: (identifiers: readonly QuantityTypeIdentifier[], forceUpdate?: boolean) => Promise<import("./types").IdentifierWithUnit[]>;
19
19
  export declare const getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<AuthorizationRequestStatus>;
@@ -92,6 +92,7 @@ export declare const queryMedicationEventsWithAnchor: (options: QueryOptionsWith
92
92
  export declare const useSubscribeToQuantitySamples: typeof import("./healthkit.ios").useSubscribeToQuantitySamples;
93
93
  export declare const useSubscribeToCategorySamples: typeof import("./healthkit.ios").useSubscribeToCategorySamples;
94
94
  export declare const requestPerObjectReadAuthorization: (typeIdentifier: import("./types").PerObjectTypeIdentifier) => Promise<void>;
95
+ export declare const getEarliestAuthorizedSampleDates: (objectTypeIdentifiers: readonly import("./types").ObjectTypeIdentifier[]) => Promise<Record<string, Date>>;
95
96
  export declare const subscribeToCategorySamples: typeof import("./healthkit.ios").subscribeToCategorySamples;
96
97
  export declare const requestMedicationsAuthorization: () => Promise<boolean>;
97
98
  declare const _default: typeof ReactNativeHealthkit;
@@ -44,19 +44,20 @@ export type AvailableQuantityTypesIOS17Plus = QuantityTypeIdentifier;
44
44
  */
45
45
  export type AvailableQuantityTypes<T extends number = typeof currentMajorVersionIOS> = T extends 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 ? AvailableQuantityTypesIOS17Plus : AvailableQuantityTypesBeforeIOS17;
46
46
  type BoundMethod<TMethod, TReturn = TMethod extends (...args: infer _Args) => infer TResult ? TResult : never> = (...args: TMethod extends (...args: infer TArgs) => unknown ? TArgs : never) => TReturn;
47
- export declare const authorizationStatusFor: (type: import("./types").ObjectTypeIdentifier) => import("./types").AuthorizationStatus;
47
+ export declare const authorizationStatusFor: (type: import("./types").ObjectTypeIdentifier) => import("@react-native-healthkit/core").AuthorizationStatus;
48
48
  export declare const requestPerObjectReadAuthorization: (typeIdentifier: import("./types").PerObjectTypeIdentifier) => Promise<void>;
49
+ export declare const getEarliestAuthorizedSampleDates: (objectTypeIdentifiers: readonly import("./types").ObjectTypeIdentifier[]) => Promise<Record<string, Date>>;
49
50
  export declare const disableAllBackgroundDelivery: () => Promise<boolean>;
50
51
  export declare const disableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier) => Promise<boolean>;
51
- export declare const enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
52
- export declare const configureBackgroundTypes: (typeIdentifiers: string[], updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
52
+ export declare const enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("@react-native-healthkit/core").UpdateFrequency) => Promise<boolean>;
53
+ export declare const configureBackgroundTypes: (typeIdentifiers: string[], updateFrequency: import("@react-native-healthkit/core").UpdateFrequency) => Promise<boolean>;
53
54
  export declare const clearBackgroundTypes: () => Promise<boolean>;
54
55
  export declare const getBiologicalSex: () => import("./types").BiologicalSex;
55
56
  export declare const getBloodType: () => import("./types").BloodType;
56
57
  export declare const getDateOfBirth: () => Date | undefined;
57
58
  export declare const getFitzpatrickSkinType: () => import("./types").FitzpatrickSkinType;
58
59
  export declare const getPreferredUnits: (identifiers: readonly QuantityTypeIdentifier[], forceUpdate?: boolean) => Promise<import("./types").IdentifierWithUnit[]>;
59
- export declare const getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<import("./types").AuthorizationRequestStatus>;
60
+ export declare const getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<import("@react-native-healthkit/core").AuthorizationRequestStatus>;
60
61
  export declare const getWheelchairUse: () => import("./types").WheelchairUse;
61
62
  export declare const isHealthDataAvailable: () => boolean;
62
63
  export declare const isHealthDataAvailableAsync: () => Promise<boolean>;
@@ -105,17 +106,17 @@ export declare const getDateOfBirthAsync: () => Promise<Date | undefined>;
105
106
  export declare const getFitzpatrickSkinTypeAsync: () => Promise<import("./types").FitzpatrickSkinType>;
106
107
  export declare const getWheelchairUseAsync: () => Promise<import("./types").WheelchairUse>;
107
108
  declare const _default: {
108
- authorizationStatusFor: (type: import("./types").ObjectTypeIdentifier) => import("./types").AuthorizationStatus;
109
+ authorizationStatusFor: (type: import("./types").ObjectTypeIdentifier) => import("@react-native-healthkit/core").AuthorizationStatus;
109
110
  isObjectTypeAvailable: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier) => boolean;
110
111
  isObjectTypeAvailableAsync: (objectTypeIdentifier: import("./types").ObjectTypeIdentifier) => Promise<boolean>;
111
112
  areObjectTypesAvailable: (objectTypeIdentifiers: readonly import("./types").ObjectTypeIdentifier[]) => Record<string, boolean>;
112
113
  areObjectTypesAvailableAsync: (objectTypeIdentifiers: import("./types").ObjectTypeIdentifier[]) => Promise<Record<string, boolean>>;
113
114
  isQuantityCompatibleWithUnit: <T extends QuantityTypeIdentifier>(identifier: T, unit: import("./types").UnitForIdentifier<T>) => boolean;
114
- configureBackgroundTypes: (typeIdentifiers: string[], updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
115
+ configureBackgroundTypes: (typeIdentifiers: string[], updateFrequency: import("@react-native-healthkit/core").UpdateFrequency) => Promise<boolean>;
115
116
  clearBackgroundTypes: () => Promise<boolean>;
116
117
  disableAllBackgroundDelivery: () => Promise<boolean>;
117
118
  disableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier) => Promise<boolean>;
118
- enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("./types").UpdateFrequency) => Promise<boolean>;
119
+ enableBackgroundDelivery: (typeIdentifier: import("./types").ObjectTypeIdentifier, updateFrequency: import("@react-native-healthkit/core").UpdateFrequency) => Promise<boolean>;
119
120
  getBiologicalSex: () => import("./types").BiologicalSex;
120
121
  getBloodType: () => import("./types").BloodType;
121
122
  getDateOfBirth: () => Date | undefined;
@@ -130,7 +131,7 @@ declare const _default: {
130
131
  getMostRecentWorkout: () => Promise<WorkoutProxyTyped | undefined>;
131
132
  getPreferredUnits: (identifiers: readonly QuantityTypeIdentifier[], forceUpdate?: boolean) => Promise<import("./types").IdentifierWithUnit[]>;
132
133
  getPreferredUnit: <T extends QuantityTypeIdentifier>(quantityType: T) => Promise<import("./types").UnitForIdentifier<T>>;
133
- getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<import("./types").AuthorizationRequestStatus>;
134
+ getRequestStatusForAuthorization: (toCheck: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<import("@react-native-healthkit/core").AuthorizationRequestStatus>;
134
135
  getWheelchairUse: () => import("./types").WheelchairUse;
135
136
  isHealthDataAvailable: () => boolean;
136
137
  isHealthDataAvailableAsync: () => Promise<boolean>;
@@ -153,6 +154,7 @@ declare const _default: {
153
154
  querySources: (identifier: import("./types").SampleTypeIdentifier, filter?: import("./types").FilterForSamples) => Promise<import("./specs/SourceProxy.nitro").SourceProxy[]>;
154
155
  requestAuthorization: (toRequest: import("./specs/CoreModule.nitro").AuthDataTypes) => Promise<boolean>;
155
156
  requestPerObjectReadAuthorization: (typeIdentifier: import("./types").PerObjectTypeIdentifier) => Promise<void>;
157
+ getEarliestAuthorizedSampleDates: (objectTypeIdentifiers: readonly import("./types").ObjectTypeIdentifier[]) => Promise<Record<string, Date>>;
156
158
  deleteObjects: (objectTypeIdentifier: import("./types").SampleTypeIdentifierWriteable, filter: import("./types").FilterForSamples) => Promise<number>;
157
159
  saveCategorySample: <T extends import("./types").CategoryTypeIdentifierWriteable>(identifier: T, value: import("./types").CategoryValueForIdentifier<T>, startDate: Date, endDate: Date, metadata?: import("./types").MetadataForCategoryIdentifier<T>) => Promise<import("./types").CategorySampleTyped<T> | undefined>;
158
160
  saveCorrelationSample: BoundMethod<(typeIdentifier: import("./types").CorrelationTypeIdentifier, samples: import("./types").SampleForSaving[], start: Date, end: Date, metadata?: import("react-native-nitro-modules").AnyMap) => Promise<import("./types").CorrelationSample | undefined>, Promise<CorrelationSampleTyped | undefined>>;
@@ -185,7 +187,7 @@ declare const _default: {
185
187
  useHealthkitAuthorization: ({ toWrite, toRead, }: {
186
188
  toRead?: readonly import("./types").ObjectTypeIdentifier[];
187
189
  toWrite?: readonly import("./types").SampleTypeIdentifierWriteable[];
188
- }) => readonly [import("./types").AuthorizationRequestStatus | null, () => Promise<import("./types").AuthorizationRequestStatus>];
190
+ }) => readonly [import("@react-native-healthkit/core").AuthorizationRequestStatus | null, () => Promise<import("@react-native-healthkit/core").AuthorizationRequestStatus>];
189
191
  useIsHealthDataAvailable: () => boolean | null;
190
192
  useSources: typeof useSources;
191
193
  useStatisticsForQuantity: typeof useStatisticsForQuantity;
@@ -76,6 +76,22 @@ export interface CoreModule extends HybridObject<{
76
76
  */
77
77
  requestAuthorization(toRequest: AuthDataTypes): Promise<boolean>;
78
78
  requestPerObjectReadAuthorization(typeIdentifier: PerObjectTypeIdentifier): Promise<void>;
79
+ /**
80
+ * Reports, for each of the given object types, the earliest date from which the app is
81
+ * authorized to read samples when the user has granted only limited access.
82
+ *
83
+ * A type is only present in the result when the user has imposed a lower time bound on
84
+ * the app's read access for it - types without such a bound are omitted. Use it to clamp
85
+ * the `startDate` of a query filter so you don't request data you can't read.
86
+ *
87
+ * Requires iOS 27. On earlier versions there is no limited-access lower bound, so this
88
+ * resolves to an empty object. It also resolves to an empty object - and logs a warning -
89
+ * when running on iOS 27 in an app built with an SDK older than iOS 27, since the
90
+ * underlying API cannot be called from such a binary.
91
+ *
92
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/earliestauthorizedsampledate(for:) Apple Docs }
93
+ */
94
+ getEarliestAuthorizedSampleDates(objectTypeIdentifiers: readonly ObjectTypeIdentifier[]): Promise<Record<string, Date>>;
79
95
  deleteObjects(objectTypeIdentifier: SampleTypeIdentifierWriteable, filter: FilterForSamples): Promise<number>;
80
96
  isObjectTypeAvailable(objectTypeIdentifier: ObjectTypeIdentifier): boolean;
81
97
  areObjectTypesAvailable(objectTypeIdentifiers: readonly ObjectTypeIdentifier[]): Record<string, boolean>;
@@ -1,8 +1,6 @@
1
+ import type { Source } from '@react-native-healthkit/core';
1
2
  import type { HybridObject } from 'react-native-nitro-modules';
2
- export interface Source {
3
- readonly name: string;
4
- readonly bundleIdentifier: string;
5
- }
3
+ export type { Source };
6
4
  /**
7
5
  * @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615781-source Apple Docs }
8
6
  */
@@ -1,16 +1 @@
1
- /**
2
- * @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus Apple Docs }
3
- */
4
- export declare enum AuthorizationRequestStatus {
5
- unknown = 0,
6
- shouldRequest = 1,
7
- unnecessary = 2
8
- }
9
- /**
10
- * @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationstatus Apple Docs }
11
- */
12
- export declare enum AuthorizationStatus {
13
- notDetermined = 0,
14
- sharingDenied = 1,
15
- sharingAuthorized = 2
16
- }
1
+ export { AuthorizationRequestStatus, AuthorizationStatus, } from '@react-native-healthkit/core';
@@ -1,9 +1 @@
1
- /**
2
- * @see {@link https://developer.apple.com/documentation/healthkit/hkupdatefrequency Apple Docs }
3
- */
4
- export declare enum UpdateFrequency {
5
- immediate = 1,
6
- hourly = 2,
7
- daily = 3,
8
- weekly = 4
9
- }
1
+ export { UpdateFrequency } from '@react-native-healthkit/core';
@@ -1,13 +1 @@
1
- /**
2
- * @see {@link https://developer.apple.com/documentation/healthkit/hkdevice Apple Docs }
3
- */
4
- export interface Device {
5
- readonly name?: string;
6
- readonly firmwareVersion?: string;
7
- readonly hardwareVersion?: string;
8
- readonly localIdentifier?: string;
9
- readonly manufacturer?: string;
10
- readonly model?: string;
11
- readonly softwareVersion?: string;
12
- readonly udiDeviceIdentifier?: string;
13
- }
1
+ export type { Device } from '@react-native-healthkit/core';
@@ -1,10 +1,10 @@
1
1
  import type { UnitForIdentifierGenerated } from '../generated/healthkit.generated';
2
2
  import { HeartRateMotionContext, InsulinDeliveryReason } from '../generated/healthkit.generated';
3
- import type { Source } from '../specs/SourceProxy.nitro';
4
3
  import type { QuantitySample, QuantitySampleTyped } from './QuantitySample';
5
4
  import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier';
6
5
  import type { FilterForSamples } from './QueryOptions';
7
6
  import type { DeletedSample } from './Shared';
7
+ import type { Source } from './Source';
8
8
  export { HeartRateMotionContext, InsulinDeliveryReason };
9
9
  interface QuantityDateInterval {
10
10
  readonly from: Date;
@@ -1,41 +1,8 @@
1
+ import type { DateFilter, PredicateWithMetadataKey, StrictUnion } from '@react-native-healthkit/core';
1
2
  import type { SourceProxy } from '../specs/SourceProxy.nitro';
2
3
  import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro';
3
- export declare enum ComparisonPredicateOperator {
4
- lessThan = 0,
5
- lessThanOrEqualTo = 1,
6
- greaterThan = 2,
7
- greaterThanOrEqualTo = 3,
8
- equalTo = 4,
9
- notEqualTo = 5,
10
- matches = 6,
11
- like = 7,
12
- beginsWith = 8,
13
- endsWith = 9,
14
- IN = 10,
15
- customSelector = 11,
16
- contains = 99,
17
- between = 100
18
- }
19
- type PredicateWithMetadataValue = string | number | Date | boolean;
20
- export interface PredicateWithMetadataKey {
21
- readonly withMetadataKey: string;
22
- readonly operatorType?: ComparisonPredicateOperator;
23
- readonly value?: PredicateWithMetadataValue;
24
- }
25
- type ComputeRaw<A> = A extends Function ? A : {
26
- [K in keyof A]: A[K];
27
- } & {};
28
- type AllKeys<U> = U extends any ? keyof U : never;
29
- type _Strict<U, UAll extends U = U> = U extends any ? ComputeRaw<U & {
30
- [K in Exclude<AllKeys<UAll>, keyof U>]?: never;
31
- }> : never;
32
- export type StrictUnion<U extends object> = _Strict<U>;
33
- export interface DateFilter {
34
- readonly startDate?: Date;
35
- readonly endDate?: Date;
36
- readonly strictEndDate?: boolean;
37
- readonly strictStartDate?: boolean;
38
- }
4
+ export { ComparisonPredicateOperator } from '@react-native-healthkit/core';
5
+ export type { DateFilter, PredicateWithMetadataKey, StrictUnion };
39
6
  export interface FilterForSamplesBase {
40
7
  readonly uuid?: string;
41
8
  readonly uuids?: string[];
@@ -76,4 +43,3 @@ export interface QueryOptionsWithSortOrderAndStringUnit extends QueryOptionsWith
76
43
  }
77
44
  export interface QueryOptionsWithAnchorAndStringUnit extends QueryOptionsWithAnchorAndUnit<string> {
78
45
  }
79
- export {};
@@ -1,16 +1,12 @@
1
+ import type { BaseObject, BaseSample, DeletedSample, SampleType } from '@react-native-healthkit/core';
1
2
  import type { AnyMap } from 'react-native-nitro-modules';
2
3
  import type { KnownObjectMetadata, KnownSampleMetadata } from '../generated/healthkit.generated';
3
4
  import type { CategoryTypeIdentifier, CategoryTypeIdentifierWriteable } from './CategoryTypeIdentifier';
4
5
  import type { CharacteristicTypeIdentifier } from './Characteristics';
5
6
  import type { ActivitySummaryTypeIdentifier, AudiogramTypeIdentifier, ElectrocardiogramTypeIdentifier, HeartbeatSeriesTypeIdentifier, HKVisionPrescriptionTypeIdentifier, StateOfMindTypeIdentifier, UserAnnotatedMedicationTypeIdentifier, WorkoutRouteTypeIdentifier, WorkoutTypeIdentifier } from './Constants';
6
7
  import type { CorrelationTypeIdentifier } from './CorrelationType';
7
- import type { Device } from './Device';
8
8
  import type { QuantityTypeIdentifier, QuantityTypeIdentifierWriteable } from './QuantityTypeIdentifier';
9
- import type { SourceRevision } from './Source';
10
- export interface DeletedSample {
11
- readonly uuid: string;
12
- readonly metadata?: AnyMap;
13
- }
9
+ export type { BaseObject, BaseSample, DeletedSample, SampleType };
14
10
  export type ObjectTypeIdentifier = CharacteristicTypeIdentifier | SampleTypeIdentifier | typeof ActivitySummaryTypeIdentifier;
15
11
  export type PerObjectTypeIdentifier = typeof HKVisionPrescriptionTypeIdentifier | typeof UserAnnotatedMedicationTypeIdentifier;
16
12
  export type SampleTypeIdentifier = CategoryTypeIdentifier | CorrelationTypeIdentifier | QuantityTypeIdentifier | typeof StateOfMindTypeIdentifier | typeof AudiogramTypeIdentifier | typeof HeartbeatSeriesTypeIdentifier | typeof WorkoutRouteTypeIdentifier | typeof WorkoutTypeIdentifier | typeof ElectrocardiogramTypeIdentifier;
@@ -25,22 +21,3 @@ export type WithOptionalTypedMetadata<T, TMetadata extends object> = Omit<T, 'me
25
21
  };
26
22
  export type BaseObjectTyped<TMetadata extends object = KnownObjectMetadata> = WithTypedMetadata<BaseObject, TMetadata>;
27
23
  export type BaseSampleTyped<TMetadata extends object = KnownSampleMetadata> = WithTypedMetadata<BaseSample, TMetadata>;
28
- export interface BaseObject {
29
- readonly uuid: string;
30
- readonly sourceRevision: SourceRevision;
31
- readonly device?: Device;
32
- readonly metadata: AnyMap;
33
- }
34
- export interface SampleType {
35
- identifier: string;
36
- allowsRecalibrationForEstimates: boolean;
37
- isMinimumDurationRestricted: boolean;
38
- isMaximumDurationRestricted: boolean;
39
- }
40
- export interface BaseSample extends BaseObject {
41
- readonly sampleType: SampleType;
42
- readonly startDate: Date;
43
- readonly endDate: Date;
44
- readonly hasUndeterminedDuration: boolean;
45
- readonly metadata: AnyMap;
46
- }
@@ -1,10 +1 @@
1
- import type { Source } from '../specs/SourceProxy.nitro';
2
- /**
3
- * @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615483-sourcerevision Apple Docs }
4
- */
5
- export interface SourceRevision {
6
- readonly source: Source;
7
- readonly version?: string;
8
- readonly operatingSystemVersion: string;
9
- readonly productType?: string;
10
- }
1
+ export type { Source, SourceRevision } from '@react-native-healthkit/core';
@@ -1,11 +1,10 @@
1
+ import type { EmitterSubscription } from '@react-native-healthkit/core';
1
2
  import type { CategorySampleTyped } from './CategoryType';
2
3
  import type { CategoryTypeIdentifier } from './CategoryTypeIdentifier';
3
4
  import type { QuantitySampleTyped } from './QuantitySample';
4
5
  import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier';
5
6
  import type { SampleTypeIdentifier } from './Shared';
6
- export interface EmitterSubscription {
7
- remove: () => void;
8
- }
7
+ export type { EmitterSubscription };
9
8
  export interface OnChangeCallbackArgs {
10
9
  readonly typeIdentifier: SampleTypeIdentifier;
11
10
  readonly errorMessage?: string;
@@ -217,6 +217,14 @@ namespace margelo::nitro::healthkit::bridge::swift {
217
217
  };
218
218
  }
219
219
 
220
+ // pragma MARK: std::function<void(const std::unordered_map<std::string, std::chrono::system_clock::time_point>& /* result */)>
221
+ Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_ create_Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_(void* NON_NULL swiftClosureWrapper) noexcept {
222
+ auto swiftClosure = ReactNativeHealthkit::Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_::fromUnsafe(swiftClosureWrapper);
223
+ return [swiftClosure = std::move(swiftClosure)](const std::unordered_map<std::string, std::chrono::system_clock::time_point>& result) mutable -> void {
224
+ swiftClosure.call(result);
225
+ };
226
+ }
227
+
220
228
  // pragma MARK: std::function<void(const std::unordered_map<std::string, bool>& /* result */)>
221
229
  Func_void_std__unordered_map_std__string__bool_ create_Func_void_std__unordered_map_std__string__bool_(void* NON_NULL swiftClosureWrapper) noexcept {
222
230
  auto swiftClosure = ReactNativeHealthkit::Func_void_std__unordered_map_std__string__bool_::fromUnsafe(swiftClosureWrapper);
@@ -1403,6 +1403,65 @@ namespace margelo::nitro::healthkit::bridge::swift {
1403
1403
  return Func_void_Wrapper(std::move(value));
1404
1404
  }
1405
1405
 
1406
+ // pragma MARK: std::unordered_map<std::string, std::chrono::system_clock::time_point>
1407
+ /**
1408
+ * Specialized version of `std::unordered_map<std::string, std::chrono::system_clock::time_point>`.
1409
+ */
1410
+ using std__unordered_map_std__string__std__chrono__system_clock__time_point_ = std::unordered_map<std::string, std::chrono::system_clock::time_point>;
1411
+ inline std::unordered_map<std::string, std::chrono::system_clock::time_point> create_std__unordered_map_std__string__std__chrono__system_clock__time_point_(size_t size) noexcept {
1412
+ std::unordered_map<std::string, std::chrono::system_clock::time_point> map;
1413
+ map.reserve(size);
1414
+ return map;
1415
+ }
1416
+ inline std::vector<std::string> get_std__unordered_map_std__string__std__chrono__system_clock__time_point__keys(const std__unordered_map_std__string__std__chrono__system_clock__time_point_& map) noexcept {
1417
+ std::vector<std::string> keys;
1418
+ keys.reserve(map.size());
1419
+ for (const auto& entry : map) {
1420
+ keys.push_back(entry.first);
1421
+ }
1422
+ return keys;
1423
+ }
1424
+ inline std::chrono::system_clock::time_point get_std__unordered_map_std__string__std__chrono__system_clock__time_point__value(const std__unordered_map_std__string__std__chrono__system_clock__time_point_& map, const std::string& key) noexcept {
1425
+ return map.find(key)->second;
1426
+ }
1427
+ inline void emplace_std__unordered_map_std__string__std__chrono__system_clock__time_point_(std__unordered_map_std__string__std__chrono__system_clock__time_point_& map, const std::string& key, const std::chrono::system_clock::time_point& value) noexcept {
1428
+ map.emplace(key, value);
1429
+ }
1430
+
1431
+ // pragma MARK: std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>>
1432
+ /**
1433
+ * Specialized version of `std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>>`.
1434
+ */
1435
+ using std__shared_ptr_Promise_std__unordered_map_std__string__std__chrono__system_clock__time_point___ = std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>>;
1436
+ inline std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>> create_std__shared_ptr_Promise_std__unordered_map_std__string__std__chrono__system_clock__time_point___() noexcept {
1437
+ return Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>::create();
1438
+ }
1439
+ inline PromiseHolder<std::unordered_map<std::string, std::chrono::system_clock::time_point>> wrap_std__shared_ptr_Promise_std__unordered_map_std__string__std__chrono__system_clock__time_point___(std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>> promise) noexcept {
1440
+ return PromiseHolder<std::unordered_map<std::string, std::chrono::system_clock::time_point>>(std::move(promise));
1441
+ }
1442
+
1443
+ // pragma MARK: std::function<void(const std::unordered_map<std::string, std::chrono::system_clock::time_point>& /* result */)>
1444
+ /**
1445
+ * Specialized version of `std::function<void(const std::unordered_map<std::string, std::chrono::system_clock::time_point>&)>`.
1446
+ */
1447
+ using Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_ = std::function<void(const std::unordered_map<std::string, std::chrono::system_clock::time_point>& /* result */)>;
1448
+ /**
1449
+ * Wrapper class for a `std::function<void(const std::unordered_map<std::string, std::chrono::system_clock::time_point>& / * result * /)>`, this can be used from Swift.
1450
+ */
1451
+ class Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point__Wrapper final {
1452
+ public:
1453
+ explicit Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point__Wrapper(std::function<void(const std::unordered_map<std::string, std::chrono::system_clock::time_point>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::unordered_map<std::string, std::chrono::system_clock::time_point>& /* result */)>>(std::move(func))) {}
1454
+ inline void call(std::unordered_map<std::string, std::chrono::system_clock::time_point> result) const noexcept {
1455
+ _function->operator()(result);
1456
+ }
1457
+ private:
1458
+ std::unique_ptr<std::function<void(const std::unordered_map<std::string, std::chrono::system_clock::time_point>& /* result */)>> _function;
1459
+ } SWIFT_NONCOPYABLE;
1460
+ Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_ create_Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_(void* NON_NULL swiftClosureWrapper) noexcept;
1461
+ inline Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point__Wrapper wrap_Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_(Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_ value) noexcept {
1462
+ return Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point__Wrapper(std::move(value));
1463
+ }
1464
+
1406
1465
  // pragma MARK: std::unordered_map<std::string, bool>
1407
1466
  /**
1408
1467
  * Specialized version of `std::unordered_map<std::string, bool>`.
@@ -1573,6 +1632,15 @@ namespace margelo::nitro::healthkit::bridge::swift {
1573
1632
  return Result<std::shared_ptr<Promise<void>>>::withError(error);
1574
1633
  }
1575
1634
 
1635
+ // pragma MARK: Result<std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>>>
1636
+ using Result_std__shared_ptr_Promise_std__unordered_map_std__string__std__chrono__system_clock__time_point____ = Result<std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>>>;
1637
+ inline Result_std__shared_ptr_Promise_std__unordered_map_std__string__std__chrono__system_clock__time_point____ create_Result_std__shared_ptr_Promise_std__unordered_map_std__string__std__chrono__system_clock__time_point____(const std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>>& value) noexcept {
1638
+ return Result<std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>>>::withValue(value);
1639
+ }
1640
+ inline Result_std__shared_ptr_Promise_std__unordered_map_std__string__std__chrono__system_clock__time_point____ create_Result_std__shared_ptr_Promise_std__unordered_map_std__string__std__chrono__system_clock__time_point____(const std::exception_ptr& error) noexcept {
1641
+ return Result<std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>>>::withError(error);
1642
+ }
1643
+
1576
1644
  // pragma MARK: Result<std::unordered_map<std::string, bool>>
1577
1645
  using Result_std__unordered_map_std__string__bool__ = Result<std::unordered_map<std::string, bool>>;
1578
1646
  inline Result_std__unordered_map_std__string__bool__ create_Result_std__unordered_map_std__string__bool__(const std::unordered_map<std::string, bool>& value) noexcept {
@@ -56,10 +56,10 @@ namespace margelo::nitro::healthkit { struct QueryOptionsWithAnchor; }
56
56
  #include "SampleType.hpp"
57
57
  #include <string>
58
58
  #include <chrono>
59
- #include <NitroModules/AnyMap.hpp>
60
59
  #include "SourceRevision.hpp"
61
60
  #include "Source.hpp"
62
61
  #include "Device.hpp"
62
+ #include <NitroModules/AnyMap.hpp>
63
63
  #include "CategoryTypeIdentifierWriteable.hpp"
64
64
  #include <vector>
65
65
  #include "QueryOptionsWithSortOrder.hpp"
@@ -295,6 +295,14 @@ namespace margelo::nitro::healthkit {
295
295
  auto __value = std::move(__result.value());
296
296
  return __value;
297
297
  }
298
+ inline std::shared_ptr<Promise<std::unordered_map<std::string, std::chrono::system_clock::time_point>>> getEarliestAuthorizedSampleDates(const std::vector<ObjectTypeIdentifier>& objectTypeIdentifiers) override {
299
+ auto __result = _swiftPart.getEarliestAuthorizedSampleDates(objectTypeIdentifiers);
300
+ if (__result.hasError()) [[unlikely]] {
301
+ std::rethrow_exception(__result.error());
302
+ }
303
+ auto __value = std::move(__result.value());
304
+ return __value;
305
+ }
298
306
  inline std::shared_ptr<Promise<double>> deleteObjects(SampleTypeIdentifierWriteable objectTypeIdentifier, const FilterForSamples& filter) override {
299
307
  auto __result = _swiftPart.deleteObjects(static_cast<int>(objectTypeIdentifier), std::forward<decltype(filter)>(filter));
300
308
  if (__result.hasError()) [[unlikely]] {
@@ -71,10 +71,10 @@ namespace margelo::nitro::healthkit { struct QueryOptionsWithAnchor; }
71
71
  #include "SampleType.hpp"
72
72
  #include <string>
73
73
  #include <chrono>
74
- #include <NitroModules/AnyMap.hpp>
75
74
  #include "SourceRevision.hpp"
76
75
  #include "Source.hpp"
77
76
  #include "Device.hpp"
77
+ #include <NitroModules/AnyMap.hpp>
78
78
  #include "QuantityTypeIdentifier.hpp"
79
79
  #include "CategorySampleForSaving.hpp"
80
80
  #include "QuantitySampleForSaving.hpp"
@@ -64,10 +64,10 @@ namespace margelo::nitro::healthkit { struct ECGQueryOptionsWithAnchor; }
64
64
  #include "SampleType.hpp"
65
65
  #include <string>
66
66
  #include <chrono>
67
- #include <NitroModules/AnyMap.hpp>
68
67
  #include "SourceRevision.hpp"
69
68
  #include "Source.hpp"
70
69
  #include "Device.hpp"
70
+ #include <NitroModules/AnyMap.hpp>
71
71
  #include "ECGQueryOptionsWithSortOrder.hpp"
72
72
  #include "FilterForSamples.hpp"
73
73
  #include <memory>
@@ -54,11 +54,11 @@ namespace margelo::nitro::healthkit { struct QueryOptionsWithAnchor; }
54
54
  #include "SampleType.hpp"
55
55
  #include <string>
56
56
  #include <chrono>
57
- #include <NitroModules/AnyMap.hpp>
58
57
  #include "SourceRevision.hpp"
59
58
  #include "Source.hpp"
60
59
  #include <optional>
61
60
  #include "Device.hpp"
61
+ #include <NitroModules/AnyMap.hpp>
62
62
  #include "QueryOptionsWithSortOrder.hpp"
63
63
  #include "FilterForSamples.hpp"
64
64
  #include <memory>