@kingstinct/react-native-healthkit 14.1.0 → 16.0.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.
- package/README.md +37 -3
- package/ReactNativeHealthkit.podspec +11 -7
- package/app.plugin.js +33 -94
- package/app.plugin.ts +29 -104
- package/ios/CategoryTypeModule.swift +1 -0
- package/ios/CharacteristicTypeModule.swift +7 -6
- package/ios/Constants.swift +9 -10
- package/ios/CoreModule.swift +77 -42
- package/ios/CorrelationTypeModule.swift +3 -2
- package/ios/ElectrocardiogramModule.swift +4 -3
- package/ios/HeartbeatSeriesModule.swift +4 -3
- package/ios/Helpers.swift +11 -216
- package/ios/MedicationModule.swift +9 -8
- package/ios/MemoryEstimation.swift +84 -0
- package/ios/PredicateHelpers.swift +16 -86
- package/ios/QuantityTypeModule.swift +37 -28
- package/ios/Serializers.swift +34 -70
- package/ios/SourceProxy.swift +15 -5
- package/ios/StateOfMindModule.swift +3 -2
- package/ios/WorkoutProxy.swift +31 -13
- package/ios/WorkoutsModule.swift +4 -3
- package/lib/commonjs/generated/healthkit.generated.js +15 -3
- package/lib/commonjs/healthkit.ios.js +6 -2
- package/lib/commonjs/healthkit.js +24 -79
- package/lib/commonjs/types/Auth.js +3 -18
- package/lib/commonjs/types/Background.js +2 -10
- package/lib/commonjs/types/QueryOptions.js +2 -17
- package/lib/module/generated/healthkit.generated.js +14 -2
- package/lib/module/healthkit.ios.js +4 -0
- package/lib/module/healthkit.js +22 -77
- package/lib/module/types/Auth.js +1 -18
- package/lib/module/types/Background.js +1 -10
- package/lib/module/types/QueryOptions.js +1 -17
- package/lib/typescript/generated/healthkit.generated.d.ts +20 -7
- package/lib/typescript/healthkit.d.ts +4 -2
- package/lib/typescript/healthkit.ios.d.ts +13 -9
- package/lib/typescript/specs/CoreModule.nitro.d.ts +22 -4
- package/lib/typescript/specs/SourceProxy.nitro.d.ts +2 -5
- package/lib/typescript/types/Auth.d.ts +1 -16
- package/lib/typescript/types/Background.d.ts +1 -9
- package/lib/typescript/types/Device.d.ts +1 -13
- package/lib/typescript/types/QuantityType.d.ts +3 -3
- package/lib/typescript/types/QueryOptions.d.ts +3 -37
- package/lib/typescript/types/Shared.d.ts +2 -25
- package/lib/typescript/types/Source.d.ts +1 -10
- package/lib/typescript/types/Subscriptions.d.ts +2 -3
- package/lib/typescript/types/Units.d.ts +1 -1
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +24 -16
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +91 -12
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +8 -5
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +8 -0
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +8 -5
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +8 -5
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +8 -5
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +8 -5
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +8 -5
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +8 -5
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +3 -4
- package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +6 -3
- package/nitrogen/generated/ios/swift/CategorySample.swift +8 -8
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +8 -0
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifierWriteable.swift +8 -0
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +8 -8
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +8 -8
- package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__std__chrono__system_clock__time_point_.swift +54 -0
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +8 -8
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +25 -0
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +8 -8
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +12 -4
- package/nitrogen/generated/ios/swift/QuantitySample.swift +8 -8
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +4 -4
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +4 -4
- package/nitrogen/generated/ios/swift/QueryStatisticsResponse.swift +6 -13
- package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +4 -11
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +12 -4
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +12 -4
- package/nitrogen/generated/ios/swift/SourceRevision.swift +4 -11
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +8 -8
- package/nitrogen/generated/ios/swift/WorkoutActivityType.swift +8 -0
- package/nitrogen/generated/shared/c++/CategorySample.hpp +7 -7
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +67 -59
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifierWriteable.hpp +67 -59
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +7 -7
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +7 -7
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +7 -7
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +3 -1
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +7 -7
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +206 -198
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +7 -7
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +73 -73
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +73 -73
- package/nitrogen/generated/shared/c++/QueryStatisticsResponse.hpp +8 -9
- package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +8 -9
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +199 -191
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +193 -185
- package/nitrogen/generated/shared/c++/SourceRevision.hpp +8 -9
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +7 -7
- package/nitrogen/generated/shared/c++/WorkoutActivityType.hpp +4 -0
- package/package.json +8 -3
- package/src/generated/healthkit-schema.json +53 -8
- package/src/generated/healthkit.generated.ts +22 -6
- package/src/healthkit.ios.ts +6 -0
- package/src/healthkit.ts +32 -84
- package/src/specs/CoreModule.nitro.ts +25 -4
- package/src/specs/SourceProxy.nitro.ts +2 -4
- package/src/test-setup.ts +1 -0
- package/src/type-tests/generated-typing.ts +30 -8
- package/src/types/Auth.ts +4 -17
- package/src/types/Background.ts +1 -9
- package/src/types/Device.ts +1 -13
- package/src/types/QuantityType.ts +3 -3
- package/src/types/QueryOptions.ts +7 -65
- package/src/types/Shared.ts +7 -28
- package/src/types/Source.ts +1 -11
- package/src/types/Subscriptions.ts +2 -3
- package/src/types/Units.ts +1 -1
- package/ios/BackgroundDeliveryManager.swift +0 -277
- package/ios/Bridge.h +0 -10
- package/ios/ExceptionCatcher.h +0 -5
- package/ios/ExceptionCatcher.mm +0 -32
- package/ios/module.modulemap +0 -5
package/ios/WorkoutsModule.swift
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import CoreLocation
|
|
2
2
|
import HealthKit
|
|
3
3
|
import NitroModules
|
|
4
|
+
import ReactNativeHealthkitCore
|
|
4
5
|
|
|
5
6
|
#if canImport(WorkoutKit)
|
|
6
7
|
import WorkoutKit
|
|
@@ -42,7 +43,7 @@ class WorkoutsModule: HybridWorkoutsModuleSpec {
|
|
|
42
43
|
|
|
43
44
|
return Promise.async {
|
|
44
45
|
try await withCheckedThrowingContinuation { continuation in
|
|
45
|
-
|
|
46
|
+
healthStore.startWatchApp(with: configuration) { success, error in
|
|
46
47
|
DispatchQueue.main.async {
|
|
47
48
|
if let error {
|
|
48
49
|
continuation.resume(
|
|
@@ -193,12 +194,12 @@ class WorkoutsModule: HybridWorkoutsModuleSpec {
|
|
|
193
194
|
}
|
|
194
195
|
try await withCheckedThrowingContinuation({ continuation in
|
|
195
196
|
// saving workout, samples and route
|
|
196
|
-
|
|
197
|
+
healthStore.save(workout) { (_: Bool, error: Error?) in
|
|
197
198
|
DispatchQueue.main.async {
|
|
198
199
|
if let error = error {
|
|
199
200
|
return continuation.resume(throwing: error)
|
|
200
201
|
} else if !initializedSamples.isEmpty {
|
|
201
|
-
|
|
202
|
+
healthStore.add(initializedSamples, to: workout) { (_, error: Error?) in
|
|
202
203
|
DispatchQueue.main.async {
|
|
203
204
|
if let error = error {
|
|
204
205
|
return continuation.resume(throwing: error)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Source: scripts/generate-healthkit.ts
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.WorkoutSwimmingLocationType = exports.WorkoutEventType = exports.WorkoutActivityType = exports.WeatherCondition = exports.WaterSalinity = exports.VO2MaxTestType = exports.UserMotionContext = exports.SwimmingStrokeStyle = exports.PhysicalEffortEstimationType = exports.InsulinDeliveryReason = exports.HeartRateSensorLocation = exports.HeartRateRecoveryTestType = exports.HeartRateMotionContext = exports.DevicePlacementSide = exports.CyclingFunctionalThresholdPowerTestType = exports.CategoryValueVaginalBleeding = exports.CategoryValueSleepAnalysis = exports.CategoryValueSeverity = exports.CategoryValueProgesteroneTestResult = exports.CategoryValuePresence = exports.CategoryValuePregnancyTestResult = exports.CategoryValueOvulationTestResult = exports.CategoryValueMenstrualFlow = exports.CategoryValueLowCardioFitnessEvent = exports.CategoryValueHeadphoneAudioExposureEvent = exports.CategoryValueEnvironmentalAudioExposureEvent = exports.CategoryValueContraceptive = exports.CategoryValueCervicalMucusQuality = exports.CategoryValueAudioExposureEvent = exports.CategoryValueAppleWalkingSteadinessEvent = exports.CategoryValueAppleStandHour = exports.CategoryValueAppetiteChanges = exports.CategoryValue = exports.BodyTemperatureSensorLocation = exports.BloodGlucoseMealTime = exports.AppleECGAlgorithmVersion = exports.CATEGORY_IDENTIFIER_VALUE_ENUMS = exports.QUANTITY_IDENTIFIER_CANONICAL_UNITS = exports.CATEGORY_IDENTIFIER_IOS_AVAILABILITY = exports.QUANTITY_IDENTIFIER_IOS_AVAILABILITY = void 0;
|
|
7
|
+
exports.WorkoutSwimmingLocationType = exports.WorkoutEventType = exports.WorkoutActivityType = exports.WeatherCondition = exports.WaterSalinity = exports.VO2MaxTestType = exports.UserMotionContext = exports.SwimmingStrokeStyle = exports.PhysicalEffortEstimationType = exports.InsulinDeliveryReason = exports.HeartRateSensorLocation = exports.HeartRateRecoveryTestType = exports.HeartRateMotionContext = exports.DevicePlacementSide = exports.CyclingFunctionalThresholdPowerTestType = exports.CategoryValueVaginalBleeding = exports.CategoryValueSleepAnalysis = exports.CategoryValueSeverity = exports.CategoryValueProgesteroneTestResult = exports.CategoryValuePresence = exports.CategoryValuePregnancyTestResult = exports.CategoryValueOvulationTestResult = exports.CategoryValueMenstrualFlow = exports.CategoryValueMenopausalState = exports.CategoryValueLowCardioFitnessEvent = exports.CategoryValueHeadphoneAudioExposureEvent = exports.CategoryValueEnvironmentalAudioExposureEvent = exports.CategoryValueContraceptive = exports.CategoryValueCervicalMucusQuality = exports.CategoryValueAudioExposureEvent = exports.CategoryValueAppleWalkingSteadinessEvent = exports.CategoryValueAppleStandHour = exports.CategoryValueAppetiteChanges = exports.CategoryValue = exports.BodyTemperatureSensorLocation = exports.BloodGlucoseMealTime = exports.AppleECGAlgorithmVersion = exports.CATEGORY_IDENTIFIER_VALUE_ENUMS = exports.QUANTITY_IDENTIFIER_CANONICAL_UNITS = exports.CATEGORY_IDENTIFIER_IOS_AVAILABILITY = exports.QUANTITY_IDENTIFIER_IOS_AVAILABILITY = void 0;
|
|
8
8
|
exports.QUANTITY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
9
9
|
HKQuantityTypeIdentifierActiveEnergyBurned: '8.0',
|
|
10
10
|
HKQuantityTypeIdentifierAppleExerciseTime: '9.3',
|
|
@@ -18,7 +18,6 @@ exports.QUANTITY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
18
18
|
HKQuantityTypeIdentifierBasalEnergyBurned: '8.0',
|
|
19
19
|
HKQuantityTypeIdentifierBloodAlcoholContent: '8.0',
|
|
20
20
|
HKQuantityTypeIdentifierBloodGlucose: '8.0',
|
|
21
|
-
HKQuantityTypeIdentifierBloodKetones: '8.0',
|
|
22
21
|
HKQuantityTypeIdentifierBloodPressureDiastolic: '8.0',
|
|
23
22
|
HKQuantityTypeIdentifierBloodPressureSystolic: '8.0',
|
|
24
23
|
HKQuantityTypeIdentifierBodyFatPercentage: '8.0',
|
|
@@ -88,6 +87,7 @@ exports.QUANTITY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
88
87
|
HKQuantityTypeIdentifierHeadphoneAudioExposure: '13.0',
|
|
89
88
|
HKQuantityTypeIdentifierHeartRate: '8.0',
|
|
90
89
|
HKQuantityTypeIdentifierHeartRateRecoveryOneMinute: '16.0',
|
|
90
|
+
HKQuantityTypeIdentifierHeartRateVariabilityRMSSD: '27.0',
|
|
91
91
|
HKQuantityTypeIdentifierHeartRateVariabilitySDNN: '11.0',
|
|
92
92
|
HKQuantityTypeIdentifierHeight: '8.0',
|
|
93
93
|
HKQuantityTypeIdentifierInhalerUsage: '8.0',
|
|
@@ -136,6 +136,7 @@ exports.CATEGORY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
136
136
|
HKCategoryTypeIdentifierAppleWalkingSteadinessEvent: '15.0',
|
|
137
137
|
HKCategoryTypeIdentifierAudioExposureEvent: '13.0',
|
|
138
138
|
HKCategoryTypeIdentifierBladderIncontinence: '14.0',
|
|
139
|
+
HKCategoryTypeIdentifierBleedingAfterMenopause: '27.0',
|
|
139
140
|
HKCategoryTypeIdentifierBleedingAfterPregnancy: '18.0',
|
|
140
141
|
HKCategoryTypeIdentifierBleedingDuringPregnancy: '18.0',
|
|
141
142
|
HKCategoryTypeIdentifierBloating: '13.6',
|
|
@@ -173,6 +174,7 @@ exports.CATEGORY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
173
174
|
HKCategoryTypeIdentifierLowerBackPain: '13.6',
|
|
174
175
|
HKCategoryTypeIdentifierLowHeartRateEvent: '12.2',
|
|
175
176
|
HKCategoryTypeIdentifierMemoryLapse: '14.0',
|
|
177
|
+
HKCategoryTypeIdentifierMenopausalState: '27.0',
|
|
176
178
|
HKCategoryTypeIdentifierMenstrualFlow: '9.0',
|
|
177
179
|
HKCategoryTypeIdentifierMindfulSession: '10.0',
|
|
178
180
|
HKCategoryTypeIdentifierMoodChanges: '13.6',
|
|
@@ -213,7 +215,6 @@ exports.QUANTITY_IDENTIFIER_CANONICAL_UNITS = {
|
|
|
213
215
|
HKQuantityTypeIdentifierBasalEnergyBurned: 'kcal',
|
|
214
216
|
HKQuantityTypeIdentifierBloodAlcoholContent: '%',
|
|
215
217
|
HKQuantityTypeIdentifierBloodGlucose: 'mg/dL',
|
|
216
|
-
HKQuantityTypeIdentifierBloodKetones: 'mmol/L',
|
|
217
218
|
HKQuantityTypeIdentifierBloodPressureDiastolic: 'mmHg',
|
|
218
219
|
HKQuantityTypeIdentifierBloodPressureSystolic: 'mmHg',
|
|
219
220
|
HKQuantityTypeIdentifierBodyFatPercentage: '%',
|
|
@@ -283,6 +284,7 @@ exports.QUANTITY_IDENTIFIER_CANONICAL_UNITS = {
|
|
|
283
284
|
HKQuantityTypeIdentifierHeadphoneAudioExposure: 'dBASPL',
|
|
284
285
|
HKQuantityTypeIdentifierHeartRate: 'count/s',
|
|
285
286
|
HKQuantityTypeIdentifierHeartRateRecoveryOneMinute: 'count/min',
|
|
287
|
+
HKQuantityTypeIdentifierHeartRateVariabilityRMSSD: 'ms',
|
|
286
288
|
HKQuantityTypeIdentifierHeartRateVariabilitySDNN: 'ms',
|
|
287
289
|
HKQuantityTypeIdentifierHeight: 'm',
|
|
288
290
|
HKQuantityTypeIdentifierInhalerUsage: 'count',
|
|
@@ -331,6 +333,7 @@ exports.CATEGORY_IDENTIFIER_VALUE_ENUMS = {
|
|
|
331
333
|
HKCategoryTypeIdentifierAppleWalkingSteadinessEvent: 'CategoryValueAppleWalkingSteadinessEvent',
|
|
332
334
|
HKCategoryTypeIdentifierAudioExposureEvent: null,
|
|
333
335
|
HKCategoryTypeIdentifierBladderIncontinence: 'CategoryValueSeverity',
|
|
336
|
+
HKCategoryTypeIdentifierBleedingAfterMenopause: 'CategoryValueVaginalBleeding',
|
|
334
337
|
HKCategoryTypeIdentifierBleedingAfterPregnancy: 'CategoryValueVaginalBleeding',
|
|
335
338
|
HKCategoryTypeIdentifierBleedingDuringPregnancy: 'CategoryValueVaginalBleeding',
|
|
336
339
|
HKCategoryTypeIdentifierBloating: 'CategoryValueSeverity',
|
|
@@ -368,6 +371,7 @@ exports.CATEGORY_IDENTIFIER_VALUE_ENUMS = {
|
|
|
368
371
|
HKCategoryTypeIdentifierLowerBackPain: 'CategoryValueSeverity',
|
|
369
372
|
HKCategoryTypeIdentifierLowHeartRateEvent: 'CategoryValue',
|
|
370
373
|
HKCategoryTypeIdentifierMemoryLapse: 'CategoryValueSeverity',
|
|
374
|
+
HKCategoryTypeIdentifierMenopausalState: 'CategoryValueMenopausalState',
|
|
371
375
|
HKCategoryTypeIdentifierMenstrualFlow: 'CategoryValueMenstrualFlow',
|
|
372
376
|
HKCategoryTypeIdentifierMindfulSession: 'CategoryValue',
|
|
373
377
|
HKCategoryTypeIdentifierMoodChanges: 'CategoryValuePresence',
|
|
@@ -477,6 +481,12 @@ var CategoryValueLowCardioFitnessEvent;
|
|
|
477
481
|
(function (CategoryValueLowCardioFitnessEvent) {
|
|
478
482
|
CategoryValueLowCardioFitnessEvent[CategoryValueLowCardioFitnessEvent["lowFitness"] = 1] = "lowFitness";
|
|
479
483
|
})(CategoryValueLowCardioFitnessEvent || (exports.CategoryValueLowCardioFitnessEvent = CategoryValueLowCardioFitnessEvent = {}));
|
|
484
|
+
var CategoryValueMenopausalState;
|
|
485
|
+
(function (CategoryValueMenopausalState) {
|
|
486
|
+
CategoryValueMenopausalState[CategoryValueMenopausalState["menopause"] = 1] = "menopause";
|
|
487
|
+
CategoryValueMenopausalState[CategoryValueMenopausalState["perimenopause"] = 2] = "perimenopause";
|
|
488
|
+
CategoryValueMenopausalState[CategoryValueMenopausalState["none"] = 3] = "none";
|
|
489
|
+
})(CategoryValueMenopausalState || (exports.CategoryValueMenopausalState = CategoryValueMenopausalState = {}));
|
|
480
490
|
var CategoryValueMenstrualFlow;
|
|
481
491
|
(function (CategoryValueMenstrualFlow) {
|
|
482
492
|
CategoryValueMenstrualFlow[CategoryValueMenstrualFlow["unspecified"] = 1] = "unspecified";
|
|
@@ -726,6 +736,8 @@ var WorkoutActivityType;
|
|
|
726
736
|
WorkoutActivityType[WorkoutActivityType["swimBikeRun"] = 82] = "swimBikeRun";
|
|
727
737
|
WorkoutActivityType[WorkoutActivityType["transition"] = 83] = "transition";
|
|
728
738
|
WorkoutActivityType[WorkoutActivityType["underwaterDiving"] = 84] = "underwaterDiving";
|
|
739
|
+
WorkoutActivityType[WorkoutActivityType["rest"] = 2998] = "rest";
|
|
740
|
+
WorkoutActivityType[WorkoutActivityType["group"] = 2999] = "group";
|
|
729
741
|
WorkoutActivityType[WorkoutActivityType["other"] = 3000] = "other";
|
|
730
742
|
})(WorkoutActivityType || (exports.WorkoutActivityType = WorkoutActivityType = {}));
|
|
731
743
|
var WorkoutEventType;
|
|
@@ -17,8 +17,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
21
|
-
exports.getWheelchairUseAsync = exports.getFitzpatrickSkinTypeAsync = exports.getDateOfBirthAsync = exports.getBloodTypeAsync = exports.getBiologicalSexAsync = exports.currentAppSource = exports.queryMedicationEventsWithAnchor = exports.queryMedicationEvents = exports.queryMedications = exports.requestMedicationsAuthorization = exports.areObjectTypesAvailableAsync = exports.areObjectTypesAvailable = exports.isObjectTypeAvailableAsync = exports.isObjectTypeAvailable = exports.isQuantityCompatibleWithUnit = exports.saveStateOfMindSample = exports.queryStateOfMindSamplesWithAnchor = exports.queryStateOfMindSamples = exports.isProtectedDataAvailable = exports.startWatchApp = exports.saveWorkoutSample = exports.saveQuantitySample = exports.saveCorrelationSample = exports.saveCategorySample = exports.deleteObjects = exports.requestAuthorization = void 0;
|
|
20
|
+
exports.queryWorkoutSamplesWithAnchor = exports.queryWorkoutSamples = exports.queryStatisticsCollectionForQuantitySeparateBySource = exports.queryStatisticsForQuantitySeparateBySource = exports.queryStatisticsCollectionForQuantity = exports.queryStatisticsForQuantity = exports.queryQuantitySamplesWithAnchor = exports.queryQuantitySamples = exports.queryElectrocardiogramSamplesWithAnchor = exports.queryElectrocardiogramSamples = exports.queryHeartbeatSeriesSamplesWithAnchor = exports.queryHeartbeatSeriesSamples = exports.queryCorrelationSamplesWithAnchor = exports.queryCorrelationSamples = exports.queryCategorySamplesWithAnchor = exports.queryCategorySamples = exports.isHealthDataAvailableAsync = exports.isHealthDataAvailable = exports.getWheelchairUse = exports.getRequestStatusForAuthorization = exports.getPreferredUnits = exports.getFitzpatrickSkinType = exports.getDateOfBirth = exports.getBloodType = exports.getBiologicalSex = exports.clearBackgroundTypes = exports.configureBackgroundTypes = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = exports.getEarliestAuthorizedSampleDates = exports.requestPerObjectReadAuthorization = exports.authorizationStatusFor = exports.useSubscribeToQuantitySamples = exports.useSubscribeToChanges = exports.useSubscribeToCategorySamples = exports.useStatisticsForQuantity = exports.useSources = exports.useMostRecentWorkout = exports.useMostRecentQuantitySample = exports.useMostRecentCategorySample = exports.useIsHealthDataAvailable = exports.useHealthkitAuthorization = exports.subscribeToQuantitySamples = exports.subscribeToChanges = exports.subscribeToCategorySamples = exports.getPreferredUnit = exports.getMostRecentWorkout = exports.getMostRecentQuantitySample = exports.getMostRecentCategorySample = void 0;
|
|
21
|
+
exports.getWheelchairUseAsync = exports.getFitzpatrickSkinTypeAsync = exports.getDateOfBirthAsync = exports.getBloodTypeAsync = exports.getBiologicalSexAsync = exports.currentAppSource = exports.queryMedicationEventsWithAnchor = exports.queryMedicationEvents = exports.queryMedications = exports.requestMedicationsAuthorization = exports.areObjectTypesAvailableAsync = exports.areObjectTypesAvailable = exports.isObjectTypeAvailableAsync = exports.isObjectTypeAvailable = exports.isQuantityCompatibleWithUnit = exports.saveStateOfMindSample = exports.queryStateOfMindSamplesWithAnchor = exports.queryStateOfMindSamples = exports.isProtectedDataAvailableAsync = exports.isProtectedDataAvailable = exports.startWatchApp = exports.saveWorkoutSample = exports.saveQuantitySample = exports.saveCorrelationSample = exports.saveCategorySample = exports.deleteObjects = exports.requestAuthorization = exports.querySources = void 0;
|
|
22
22
|
const react_native_1 = require("react-native");
|
|
23
23
|
const useHealthkitAuthorization_1 = __importDefault(require("./hooks/useHealthkitAuthorization"));
|
|
24
24
|
exports.useHealthkitAuthorization = useHealthkitAuthorization_1.default;
|
|
@@ -90,6 +90,7 @@ const MedicationBindings = {
|
|
|
90
90
|
// Named exports - all functions bound to their respective modules
|
|
91
91
|
exports.authorizationStatusFor = modules_1.Core.authorizationStatusFor.bind(modules_1.Core);
|
|
92
92
|
exports.requestPerObjectReadAuthorization = modules_1.Core.requestPerObjectReadAuthorization.bind(modules_1.Core);
|
|
93
|
+
exports.getEarliestAuthorizedSampleDates = modules_1.Core.getEarliestAuthorizedSampleDates.bind(modules_1.Core);
|
|
93
94
|
exports.disableAllBackgroundDelivery = modules_1.Core.disableAllBackgroundDelivery.bind(modules_1.Core);
|
|
94
95
|
exports.disableBackgroundDelivery = modules_1.Core.disableBackgroundDelivery.bind(modules_1.Core);
|
|
95
96
|
exports.enableBackgroundDelivery = modules_1.Core.enableBackgroundDelivery.bind(modules_1.Core);
|
|
@@ -129,6 +130,7 @@ exports.saveQuantitySample = modules_1.QuantityTypes.saveQuantitySample.bind(mod
|
|
|
129
130
|
exports.saveWorkoutSample = WorkoutBindings.saveWorkoutSample;
|
|
130
131
|
exports.startWatchApp = modules_1.Workouts.startWatchAppWithWorkoutConfiguration.bind(modules_1.Workouts);
|
|
131
132
|
exports.isProtectedDataAvailable = modules_1.Core.isProtectedDataAvailable.bind(modules_1.Core);
|
|
133
|
+
exports.isProtectedDataAvailableAsync = modules_1.Core.isProtectedDataAvailableAsync.bind(modules_1.Core);
|
|
132
134
|
exports.queryStateOfMindSamples = StateOfMindBindings.queryStateOfMindSamples;
|
|
133
135
|
exports.queryStateOfMindSamplesWithAnchor = StateOfMindBindings.queryStateOfMindSamplesWithAnchor;
|
|
134
136
|
exports.saveStateOfMindSample = StateOfMindBindings.saveStateOfMindSample;
|
|
@@ -196,6 +198,7 @@ exports.default = {
|
|
|
196
198
|
querySources: exports.querySources,
|
|
197
199
|
requestAuthorization: exports.requestAuthorization,
|
|
198
200
|
requestPerObjectReadAuthorization: exports.requestPerObjectReadAuthorization,
|
|
201
|
+
getEarliestAuthorizedSampleDates: exports.getEarliestAuthorizedSampleDates,
|
|
199
202
|
deleteObjects: exports.deleteObjects,
|
|
200
203
|
saveCategorySample: exports.saveCategorySample,
|
|
201
204
|
saveCorrelationSample: exports.saveCorrelationSample,
|
|
@@ -205,6 +208,7 @@ exports.default = {
|
|
|
205
208
|
subscribeToQuantitySamples: subscribeToQuantitySamples_1.subscribeToQuantitySamples,
|
|
206
209
|
startWatchApp: exports.startWatchApp,
|
|
207
210
|
isProtectedDataAvailable: exports.isProtectedDataAvailable,
|
|
211
|
+
isProtectedDataAvailableAsync: exports.isProtectedDataAvailableAsync,
|
|
208
212
|
queryStateOfMindSamples: exports.queryStateOfMindSamples,
|
|
209
213
|
queryStateOfMindSamplesWithAnchor: exports.queryStateOfMindSamplesWithAnchor,
|
|
210
214
|
saveStateOfMindSample: exports.saveStateOfMindSample,
|
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.requestMedicationsAuthorization = exports.subscribeToCategorySamples = exports.requestPerObjectReadAuthorization = exports.useSubscribeToCategorySamples = exports.useSubscribeToQuantitySamples = exports.queryMedicationEventsWithAnchor = exports.queryMedicationEvents = exports.queryMedications = exports.currentAppSource = exports.subscribeToQuantitySamples = void 0;
|
|
17
|
+
exports.getFitzpatrickSkinTypeAsync = exports.getDateOfBirthAsync = exports.getBloodTypeAsync = exports.getBiologicalSexAsync = exports.useStatisticsForQuantity = exports.useSources = exports.useIsHealthDataAvailable = exports.useHealthkitAuthorization = exports.useSubscribeToChanges = exports.useMostRecentWorkout = exports.getMostRecentWorkout = exports.saveStateOfMindSample = exports.queryCorrelationSamplesWithAnchor = exports.queryStateOfMindSamplesWithAnchor = exports.queryStateOfMindSamples = exports.startWatchApp = exports.saveWorkoutSample = exports.queryWorkoutSamplesWithAnchor = exports.queryWorkoutSamples = exports.queryElectrocardiogramSamplesWithAnchor = exports.queryElectrocardiogramSamples = exports.queryHeartbeatSeriesSamplesWithAnchor = exports.queryHeartbeatSeriesSamples = exports.saveCorrelationSample = exports.queryCorrelationSamples = exports.getWheelchairUse = exports.getFitzpatrickSkinType = exports.getDateOfBirth = exports.getBloodType = exports.getBiologicalSex = exports.areObjectTypesAvailableAsync = exports.areObjectTypesAvailable = exports.isObjectTypeAvailableAsync = exports.isObjectTypeAvailable = exports.isProtectedDataAvailableAsync = exports.isProtectedDataAvailable = exports.subscribeToChanges = exports.deleteObjects = exports.requestAuthorization = exports.querySources = exports.isHealthDataAvailableAsync = exports.isHealthDataAvailable = exports.getRequestStatusForAuthorization = exports.getPreferredUnits = exports.clearBackgroundTypes = exports.configureBackgroundTypes = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = exports.authorizationStatusFor = void 0;
|
|
18
|
+
exports.requestMedicationsAuthorization = exports.subscribeToCategorySamples = exports.getEarliestAuthorizedSampleDates = exports.requestPerObjectReadAuthorization = exports.useSubscribeToCategorySamples = exports.useSubscribeToQuantitySamples = exports.queryMedicationEventsWithAnchor = exports.queryMedicationEvents = exports.queryMedications = exports.currentAppSource = exports.subscribeToQuantitySamples = exports.getWheelchairUseAsync = void 0;
|
|
19
19
|
exports.queryQuantitySamples = queryQuantitySamples;
|
|
20
20
|
exports.queryQuantitySamplesWithAnchor = queryQuantitySamplesWithAnchor;
|
|
21
21
|
exports.queryStatisticsForQuantity = queryStatisticsForQuantity;
|
|
@@ -32,22 +32,11 @@ exports.getMostRecentQuantitySample = getMostRecentQuantitySample;
|
|
|
32
32
|
exports.getPreferredUnit = getPreferredUnit;
|
|
33
33
|
exports.useMostRecentCategorySample = useMostRecentCategorySample;
|
|
34
34
|
exports.useMostRecentQuantitySample = useMostRecentQuantitySample;
|
|
35
|
-
const
|
|
35
|
+
const core_1 = require("@react-native-healthkit/core");
|
|
36
36
|
const Auth_1 = require("./types/Auth");
|
|
37
37
|
const Characteristics_1 = require("./types/Characteristics");
|
|
38
38
|
__exportStar(require("./types"), exports);
|
|
39
|
-
const
|
|
40
|
-
let hasWarned = false;
|
|
41
|
-
function UnavailableFnFromModule(_fn, defaultValue) {
|
|
42
|
-
// @ts-expect-error
|
|
43
|
-
return () => {
|
|
44
|
-
if (react_native_1.Platform.OS !== 'ios' && !hasWarned) {
|
|
45
|
-
console.warn(notAvailableError);
|
|
46
|
-
hasWarned = true;
|
|
47
|
-
}
|
|
48
|
-
return defaultValue;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
39
|
+
const { unavailableFn: UnavailableFnFromModule, warnIfUnavailable } = (0, core_1.createUnavailableHelpers)('@kingstinct/react-native-healthkit');
|
|
51
40
|
// --- Mock Implementations for exported functions ---
|
|
52
41
|
// CoreModule functions
|
|
53
42
|
exports.authorizationStatusFor = UnavailableFnFromModule('authorizationStatusFor', Auth_1.AuthorizationStatus.notDetermined);
|
|
@@ -67,6 +56,7 @@ exports.subscribeToChanges = UnavailableFnFromModule('subscribeToChanges', {
|
|
|
67
56
|
remove: () => false,
|
|
68
57
|
}); // Mocking the observer query UUID
|
|
69
58
|
exports.isProtectedDataAvailable = UnavailableFnFromModule('isProtectedDataAvailable', false);
|
|
59
|
+
exports.isProtectedDataAvailableAsync = UnavailableFnFromModule('isProtectedDataAvailableAsync', Promise.resolve(false));
|
|
70
60
|
exports.isObjectTypeAvailable = UnavailableFnFromModule('isObjectTypeAvailable', false);
|
|
71
61
|
exports.isObjectTypeAvailableAsync = UnavailableFnFromModule('isObjectTypeAvailableAsync', Promise.resolve(false));
|
|
72
62
|
exports.areObjectTypesAvailable = UnavailableFnFromModule('areObjectTypesAvailable', {});
|
|
@@ -79,17 +69,11 @@ exports.getFitzpatrickSkinType = UnavailableFnFromModule('getFitzpatrickSkinType
|
|
|
79
69
|
exports.getWheelchairUse = UnavailableFnFromModule('getWheelchairUse', Characteristics_1.WheelchairUse.notSet);
|
|
80
70
|
// QuantityTypeModule functions
|
|
81
71
|
function queryQuantitySamples(_identifier, _options) {
|
|
82
|
-
|
|
83
|
-
console.warn(notAvailableError);
|
|
84
|
-
hasWarned = true;
|
|
85
|
-
}
|
|
72
|
+
warnIfUnavailable();
|
|
86
73
|
return Promise.resolve([]);
|
|
87
74
|
}
|
|
88
75
|
function queryQuantitySamplesWithAnchor(_identifier, _options) {
|
|
89
|
-
|
|
90
|
-
console.warn(notAvailableError);
|
|
91
|
-
hasWarned = true;
|
|
92
|
-
}
|
|
76
|
+
warnIfUnavailable();
|
|
93
77
|
return Promise.resolve({
|
|
94
78
|
samples: [],
|
|
95
79
|
deletedSamples: [],
|
|
@@ -97,62 +81,38 @@ function queryQuantitySamplesWithAnchor(_identifier, _options) {
|
|
|
97
81
|
});
|
|
98
82
|
}
|
|
99
83
|
function queryStatisticsForQuantity(_identifier, _statistics, _options) {
|
|
100
|
-
|
|
101
|
-
console.warn(notAvailableError);
|
|
102
|
-
hasWarned = true;
|
|
103
|
-
}
|
|
84
|
+
warnIfUnavailable();
|
|
104
85
|
return Promise.resolve({
|
|
105
86
|
sources: [],
|
|
106
87
|
});
|
|
107
88
|
}
|
|
108
89
|
function queryStatisticsCollectionForQuantity(_identifier, _statistics, _anchorDate, _intervalComponents, _options) {
|
|
109
|
-
|
|
110
|
-
console.warn(notAvailableError);
|
|
111
|
-
hasWarned = true;
|
|
112
|
-
}
|
|
90
|
+
warnIfUnavailable();
|
|
113
91
|
return Promise.resolve([]);
|
|
114
92
|
}
|
|
115
93
|
function queryStatisticsForQuantitySeparateBySource(_identifier, _statistics, _options) {
|
|
116
|
-
|
|
117
|
-
console.warn(notAvailableError);
|
|
118
|
-
hasWarned = true;
|
|
119
|
-
}
|
|
94
|
+
warnIfUnavailable();
|
|
120
95
|
return Promise.resolve([]);
|
|
121
96
|
}
|
|
122
97
|
function queryStatisticsCollectionForQuantitySeparateBySource(_identifier, _statistics, _anchorDate, _intervalComponents, _options) {
|
|
123
|
-
|
|
124
|
-
console.warn(notAvailableError);
|
|
125
|
-
hasWarned = true;
|
|
126
|
-
}
|
|
98
|
+
warnIfUnavailable();
|
|
127
99
|
return Promise.resolve([]);
|
|
128
100
|
}
|
|
129
101
|
function saveQuantitySample(_identifier, _unit, _value, _start, _end, _metadata) {
|
|
130
|
-
|
|
131
|
-
console.warn(notAvailableError);
|
|
132
|
-
hasWarned = true;
|
|
133
|
-
}
|
|
102
|
+
warnIfUnavailable();
|
|
134
103
|
return Promise.resolve(undefined);
|
|
135
104
|
}
|
|
136
105
|
function isQuantityCompatibleWithUnit(_identifier, _unit) {
|
|
137
|
-
|
|
138
|
-
console.warn(notAvailableError);
|
|
139
|
-
hasWarned = true;
|
|
140
|
-
}
|
|
106
|
+
warnIfUnavailable();
|
|
141
107
|
return false;
|
|
142
108
|
}
|
|
143
109
|
// CategoryTypeModule functions
|
|
144
110
|
function queryCategorySamples(_categoryTypeIdentifier, _options) {
|
|
145
|
-
|
|
146
|
-
console.warn(notAvailableError);
|
|
147
|
-
hasWarned = true;
|
|
148
|
-
}
|
|
111
|
+
warnIfUnavailable();
|
|
149
112
|
return Promise.resolve([]);
|
|
150
113
|
}
|
|
151
114
|
function queryCategorySamplesWithAnchor(_categoryTypeIdentifier, _options) {
|
|
152
|
-
|
|
153
|
-
console.warn(notAvailableError);
|
|
154
|
-
hasWarned = true;
|
|
155
|
-
}
|
|
115
|
+
warnIfUnavailable();
|
|
156
116
|
return Promise.resolve({
|
|
157
117
|
samples: [],
|
|
158
118
|
deletedSamples: [],
|
|
@@ -160,10 +120,7 @@ function queryCategorySamplesWithAnchor(_categoryTypeIdentifier, _options) {
|
|
|
160
120
|
});
|
|
161
121
|
}
|
|
162
122
|
function saveCategorySample(_identifier, _value, _startDate, _endDate, _metadata) {
|
|
163
|
-
|
|
164
|
-
console.warn(notAvailableError);
|
|
165
|
-
hasWarned = true;
|
|
166
|
-
}
|
|
123
|
+
warnIfUnavailable();
|
|
167
124
|
return Promise.resolve(undefined);
|
|
168
125
|
}
|
|
169
126
|
// CorrelationTypeModule functions
|
|
@@ -208,42 +165,27 @@ exports.queryCorrelationSamplesWithAnchor = UnavailableFnFromModule('queryCorrel
|
|
|
208
165
|
exports.saveStateOfMindSample = UnavailableFnFromModule('saveStateOfMindSample', Promise.resolve(undefined));
|
|
209
166
|
// Utility functions (from original export list)
|
|
210
167
|
function getMostRecentCategorySample(_identifier) {
|
|
211
|
-
|
|
212
|
-
console.warn(notAvailableError);
|
|
213
|
-
hasWarned = true;
|
|
214
|
-
}
|
|
168
|
+
warnIfUnavailable();
|
|
215
169
|
return Promise.resolve(undefined);
|
|
216
170
|
}
|
|
217
171
|
function getMostRecentQuantitySample(_identifier, _unit) {
|
|
218
|
-
|
|
219
|
-
console.warn(notAvailableError);
|
|
220
|
-
hasWarned = true;
|
|
221
|
-
}
|
|
172
|
+
warnIfUnavailable();
|
|
222
173
|
return Promise.resolve(undefined);
|
|
223
174
|
}
|
|
224
175
|
exports.getMostRecentWorkout = UnavailableFnFromModule('getMostRecentWorkout',
|
|
225
176
|
// biome-ignore lint/suspicious/noExplicitAny: it works
|
|
226
177
|
Promise.resolve(undefined));
|
|
227
178
|
function getPreferredUnit(_quantityType) {
|
|
228
|
-
|
|
229
|
-
console.warn(notAvailableError);
|
|
230
|
-
hasWarned = true;
|
|
231
|
-
}
|
|
179
|
+
warnIfUnavailable();
|
|
232
180
|
return Promise.resolve('count');
|
|
233
181
|
}
|
|
234
182
|
// Hooks (from original export list)
|
|
235
183
|
function useMostRecentCategorySample(_categoryTypeIdentifier) {
|
|
236
|
-
|
|
237
|
-
console.warn(notAvailableError);
|
|
238
|
-
hasWarned = true;
|
|
239
|
-
}
|
|
184
|
+
warnIfUnavailable();
|
|
240
185
|
return undefined;
|
|
241
186
|
}
|
|
242
187
|
function useMostRecentQuantitySample(_identifier, _unit) {
|
|
243
|
-
|
|
244
|
-
console.warn(notAvailableError);
|
|
245
|
-
hasWarned = true;
|
|
246
|
-
}
|
|
188
|
+
warnIfUnavailable();
|
|
247
189
|
return undefined;
|
|
248
190
|
}
|
|
249
191
|
exports.useMostRecentWorkout = UnavailableFnFromModule('useMostRecentWorkout', undefined);
|
|
@@ -274,6 +216,7 @@ exports.queryMedicationEventsWithAnchor = UnavailableFnFromModule('queryMedicati
|
|
|
274
216
|
exports.useSubscribeToQuantitySamples = UnavailableFnFromModule('useSubscribeToQuantitySamples', undefined);
|
|
275
217
|
exports.useSubscribeToCategorySamples = UnavailableFnFromModule('useSubscribeToCategorySamples', undefined);
|
|
276
218
|
exports.requestPerObjectReadAuthorization = UnavailableFnFromModule('requestPerObjectReadAuthorization', Promise.resolve(undefined)); // Mocking callback structure
|
|
219
|
+
exports.getEarliestAuthorizedSampleDates = UnavailableFnFromModule('getEarliestAuthorizedSampleDates', Promise.resolve({}));
|
|
277
220
|
exports.subscribeToCategorySamples = UnavailableFnFromModule('subscribeToCategorySamples', {
|
|
278
221
|
remove: () => false,
|
|
279
222
|
}); // Mocking the observer query UUID
|
|
@@ -331,6 +274,7 @@ const HealthkitModule = {
|
|
|
331
274
|
subscribeToChanges: exports.subscribeToChanges,
|
|
332
275
|
startWatchApp: exports.startWatchApp,
|
|
333
276
|
isProtectedDataAvailable: exports.isProtectedDataAvailable,
|
|
277
|
+
isProtectedDataAvailableAsync: exports.isProtectedDataAvailableAsync,
|
|
334
278
|
queryStateOfMindSamples: exports.queryStateOfMindSamples,
|
|
335
279
|
queryStateOfMindSamplesWithAnchor: exports.queryStateOfMindSamplesWithAnchor,
|
|
336
280
|
saveStateOfMindSample: exports.saveStateOfMindSample,
|
|
@@ -342,6 +286,7 @@ const HealthkitModule = {
|
|
|
342
286
|
queryMedicationEventsWithAnchor: exports.queryMedicationEventsWithAnchor,
|
|
343
287
|
requestMedicationsAuthorization: exports.requestMedicationsAuthorization,
|
|
344
288
|
requestPerObjectReadAuthorization: exports.requestPerObjectReadAuthorization,
|
|
289
|
+
getEarliestAuthorizedSampleDates: exports.getEarliestAuthorizedSampleDates,
|
|
345
290
|
subscribeToCategorySamples: exports.subscribeToCategorySamples,
|
|
346
291
|
currentAppSource: exports.currentAppSource,
|
|
347
292
|
// Hooks
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthorizationStatus = exports.AuthorizationRequestStatus = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var AuthorizationRequestStatus;
|
|
8
|
-
(function (AuthorizationRequestStatus) {
|
|
9
|
-
AuthorizationRequestStatus[AuthorizationRequestStatus["unknown"] = 0] = "unknown";
|
|
10
|
-
AuthorizationRequestStatus[AuthorizationRequestStatus["shouldRequest"] = 1] = "shouldRequest";
|
|
11
|
-
AuthorizationRequestStatus[AuthorizationRequestStatus["unnecessary"] = 2] = "unnecessary";
|
|
12
|
-
})(AuthorizationRequestStatus || (exports.AuthorizationRequestStatus = AuthorizationRequestStatus = {}));
|
|
13
|
-
/**
|
|
14
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationstatus Apple Docs }
|
|
15
|
-
*/
|
|
16
|
-
var AuthorizationStatus;
|
|
17
|
-
(function (AuthorizationStatus) {
|
|
18
|
-
AuthorizationStatus[AuthorizationStatus["notDetermined"] = 0] = "notDetermined";
|
|
19
|
-
AuthorizationStatus[AuthorizationStatus["sharingDenied"] = 1] = "sharingDenied";
|
|
20
|
-
AuthorizationStatus[AuthorizationStatus["sharingAuthorized"] = 2] = "sharingAuthorized";
|
|
21
|
-
})(AuthorizationStatus || (exports.AuthorizationStatus = AuthorizationStatus = {}));
|
|
4
|
+
var core_1 = require("@react-native-healthkit/core");
|
|
5
|
+
Object.defineProperty(exports, "AuthorizationRequestStatus", { enumerable: true, get: function () { return core_1.AuthorizationRequestStatus; } });
|
|
6
|
+
Object.defineProperty(exports, "AuthorizationStatus", { enumerable: true, get: function () { return core_1.AuthorizationStatus; } });
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateFrequency = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
var UpdateFrequency;
|
|
8
|
-
(function (UpdateFrequency) {
|
|
9
|
-
UpdateFrequency[UpdateFrequency["immediate"] = 1] = "immediate";
|
|
10
|
-
UpdateFrequency[UpdateFrequency["hourly"] = 2] = "hourly";
|
|
11
|
-
UpdateFrequency[UpdateFrequency["daily"] = 3] = "daily";
|
|
12
|
-
UpdateFrequency[UpdateFrequency["weekly"] = 4] = "weekly";
|
|
13
|
-
})(UpdateFrequency || (exports.UpdateFrequency = UpdateFrequency = {}));
|
|
4
|
+
var core_1 = require("@react-native-healthkit/core");
|
|
5
|
+
Object.defineProperty(exports, "UpdateFrequency", { enumerable: true, get: function () { return core_1.UpdateFrequency; } });
|
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComparisonPredicateOperator = void 0;
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["lessThan"] = 0] = "lessThan";
|
|
7
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["lessThanOrEqualTo"] = 1] = "lessThanOrEqualTo";
|
|
8
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThan"] = 2] = "greaterThan";
|
|
9
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["greaterThanOrEqualTo"] = 3] = "greaterThanOrEqualTo";
|
|
10
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["equalTo"] = 4] = "equalTo";
|
|
11
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["notEqualTo"] = 5] = "notEqualTo";
|
|
12
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["matches"] = 6] = "matches";
|
|
13
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["like"] = 7] = "like";
|
|
14
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["beginsWith"] = 8] = "beginsWith";
|
|
15
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["endsWith"] = 9] = "endsWith";
|
|
16
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["IN"] = 10] = "IN";
|
|
17
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["customSelector"] = 11] = "customSelector";
|
|
18
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["contains"] = 99] = "contains";
|
|
19
|
-
ComparisonPredicateOperator[ComparisonPredicateOperator["between"] = 100] = "between";
|
|
20
|
-
})(ComparisonPredicateOperator || (exports.ComparisonPredicateOperator = ComparisonPredicateOperator = {}));
|
|
4
|
+
var core_1 = require("@react-native-healthkit/core");
|
|
5
|
+
Object.defineProperty(exports, "ComparisonPredicateOperator", { enumerable: true, get: function () { return core_1.ComparisonPredicateOperator; } });
|
|
@@ -15,7 +15,6 @@ export const QUANTITY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
15
15
|
HKQuantityTypeIdentifierBasalEnergyBurned: '8.0',
|
|
16
16
|
HKQuantityTypeIdentifierBloodAlcoholContent: '8.0',
|
|
17
17
|
HKQuantityTypeIdentifierBloodGlucose: '8.0',
|
|
18
|
-
HKQuantityTypeIdentifierBloodKetones: '8.0',
|
|
19
18
|
HKQuantityTypeIdentifierBloodPressureDiastolic: '8.0',
|
|
20
19
|
HKQuantityTypeIdentifierBloodPressureSystolic: '8.0',
|
|
21
20
|
HKQuantityTypeIdentifierBodyFatPercentage: '8.0',
|
|
@@ -85,6 +84,7 @@ export const QUANTITY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
85
84
|
HKQuantityTypeIdentifierHeadphoneAudioExposure: '13.0',
|
|
86
85
|
HKQuantityTypeIdentifierHeartRate: '8.0',
|
|
87
86
|
HKQuantityTypeIdentifierHeartRateRecoveryOneMinute: '16.0',
|
|
87
|
+
HKQuantityTypeIdentifierHeartRateVariabilityRMSSD: '27.0',
|
|
88
88
|
HKQuantityTypeIdentifierHeartRateVariabilitySDNN: '11.0',
|
|
89
89
|
HKQuantityTypeIdentifierHeight: '8.0',
|
|
90
90
|
HKQuantityTypeIdentifierInhalerUsage: '8.0',
|
|
@@ -133,6 +133,7 @@ export const CATEGORY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
133
133
|
HKCategoryTypeIdentifierAppleWalkingSteadinessEvent: '15.0',
|
|
134
134
|
HKCategoryTypeIdentifierAudioExposureEvent: '13.0',
|
|
135
135
|
HKCategoryTypeIdentifierBladderIncontinence: '14.0',
|
|
136
|
+
HKCategoryTypeIdentifierBleedingAfterMenopause: '27.0',
|
|
136
137
|
HKCategoryTypeIdentifierBleedingAfterPregnancy: '18.0',
|
|
137
138
|
HKCategoryTypeIdentifierBleedingDuringPregnancy: '18.0',
|
|
138
139
|
HKCategoryTypeIdentifierBloating: '13.6',
|
|
@@ -170,6 +171,7 @@ export const CATEGORY_IDENTIFIER_IOS_AVAILABILITY = {
|
|
|
170
171
|
HKCategoryTypeIdentifierLowerBackPain: '13.6',
|
|
171
172
|
HKCategoryTypeIdentifierLowHeartRateEvent: '12.2',
|
|
172
173
|
HKCategoryTypeIdentifierMemoryLapse: '14.0',
|
|
174
|
+
HKCategoryTypeIdentifierMenopausalState: '27.0',
|
|
173
175
|
HKCategoryTypeIdentifierMenstrualFlow: '9.0',
|
|
174
176
|
HKCategoryTypeIdentifierMindfulSession: '10.0',
|
|
175
177
|
HKCategoryTypeIdentifierMoodChanges: '13.6',
|
|
@@ -210,7 +212,6 @@ export const QUANTITY_IDENTIFIER_CANONICAL_UNITS = {
|
|
|
210
212
|
HKQuantityTypeIdentifierBasalEnergyBurned: 'kcal',
|
|
211
213
|
HKQuantityTypeIdentifierBloodAlcoholContent: '%',
|
|
212
214
|
HKQuantityTypeIdentifierBloodGlucose: 'mg/dL',
|
|
213
|
-
HKQuantityTypeIdentifierBloodKetones: 'mmol/L',
|
|
214
215
|
HKQuantityTypeIdentifierBloodPressureDiastolic: 'mmHg',
|
|
215
216
|
HKQuantityTypeIdentifierBloodPressureSystolic: 'mmHg',
|
|
216
217
|
HKQuantityTypeIdentifierBodyFatPercentage: '%',
|
|
@@ -280,6 +281,7 @@ export const QUANTITY_IDENTIFIER_CANONICAL_UNITS = {
|
|
|
280
281
|
HKQuantityTypeIdentifierHeadphoneAudioExposure: 'dBASPL',
|
|
281
282
|
HKQuantityTypeIdentifierHeartRate: 'count/s',
|
|
282
283
|
HKQuantityTypeIdentifierHeartRateRecoveryOneMinute: 'count/min',
|
|
284
|
+
HKQuantityTypeIdentifierHeartRateVariabilityRMSSD: 'ms',
|
|
283
285
|
HKQuantityTypeIdentifierHeartRateVariabilitySDNN: 'ms',
|
|
284
286
|
HKQuantityTypeIdentifierHeight: 'm',
|
|
285
287
|
HKQuantityTypeIdentifierInhalerUsage: 'count',
|
|
@@ -328,6 +330,7 @@ export const CATEGORY_IDENTIFIER_VALUE_ENUMS = {
|
|
|
328
330
|
HKCategoryTypeIdentifierAppleWalkingSteadinessEvent: 'CategoryValueAppleWalkingSteadinessEvent',
|
|
329
331
|
HKCategoryTypeIdentifierAudioExposureEvent: null,
|
|
330
332
|
HKCategoryTypeIdentifierBladderIncontinence: 'CategoryValueSeverity',
|
|
333
|
+
HKCategoryTypeIdentifierBleedingAfterMenopause: 'CategoryValueVaginalBleeding',
|
|
331
334
|
HKCategoryTypeIdentifierBleedingAfterPregnancy: 'CategoryValueVaginalBleeding',
|
|
332
335
|
HKCategoryTypeIdentifierBleedingDuringPregnancy: 'CategoryValueVaginalBleeding',
|
|
333
336
|
HKCategoryTypeIdentifierBloating: 'CategoryValueSeverity',
|
|
@@ -365,6 +368,7 @@ export const CATEGORY_IDENTIFIER_VALUE_ENUMS = {
|
|
|
365
368
|
HKCategoryTypeIdentifierLowerBackPain: 'CategoryValueSeverity',
|
|
366
369
|
HKCategoryTypeIdentifierLowHeartRateEvent: 'CategoryValue',
|
|
367
370
|
HKCategoryTypeIdentifierMemoryLapse: 'CategoryValueSeverity',
|
|
371
|
+
HKCategoryTypeIdentifierMenopausalState: 'CategoryValueMenopausalState',
|
|
368
372
|
HKCategoryTypeIdentifierMenstrualFlow: 'CategoryValueMenstrualFlow',
|
|
369
373
|
HKCategoryTypeIdentifierMindfulSession: 'CategoryValue',
|
|
370
374
|
HKCategoryTypeIdentifierMoodChanges: 'CategoryValuePresence',
|
|
@@ -474,6 +478,12 @@ export var CategoryValueLowCardioFitnessEvent;
|
|
|
474
478
|
(function (CategoryValueLowCardioFitnessEvent) {
|
|
475
479
|
CategoryValueLowCardioFitnessEvent[CategoryValueLowCardioFitnessEvent["lowFitness"] = 1] = "lowFitness";
|
|
476
480
|
})(CategoryValueLowCardioFitnessEvent || (CategoryValueLowCardioFitnessEvent = {}));
|
|
481
|
+
export var CategoryValueMenopausalState;
|
|
482
|
+
(function (CategoryValueMenopausalState) {
|
|
483
|
+
CategoryValueMenopausalState[CategoryValueMenopausalState["menopause"] = 1] = "menopause";
|
|
484
|
+
CategoryValueMenopausalState[CategoryValueMenopausalState["perimenopause"] = 2] = "perimenopause";
|
|
485
|
+
CategoryValueMenopausalState[CategoryValueMenopausalState["none"] = 3] = "none";
|
|
486
|
+
})(CategoryValueMenopausalState || (CategoryValueMenopausalState = {}));
|
|
477
487
|
export var CategoryValueMenstrualFlow;
|
|
478
488
|
(function (CategoryValueMenstrualFlow) {
|
|
479
489
|
CategoryValueMenstrualFlow[CategoryValueMenstrualFlow["unspecified"] = 1] = "unspecified";
|
|
@@ -723,6 +733,8 @@ export var WorkoutActivityType;
|
|
|
723
733
|
WorkoutActivityType[WorkoutActivityType["swimBikeRun"] = 82] = "swimBikeRun";
|
|
724
734
|
WorkoutActivityType[WorkoutActivityType["transition"] = 83] = "transition";
|
|
725
735
|
WorkoutActivityType[WorkoutActivityType["underwaterDiving"] = 84] = "underwaterDiving";
|
|
736
|
+
WorkoutActivityType[WorkoutActivityType["rest"] = 2998] = "rest";
|
|
737
|
+
WorkoutActivityType[WorkoutActivityType["group"] = 2999] = "group";
|
|
726
738
|
WorkoutActivityType[WorkoutActivityType["other"] = 3000] = "other";
|
|
727
739
|
})(WorkoutActivityType || (WorkoutActivityType = {}));
|
|
728
740
|
export var WorkoutEventType;
|
|
@@ -53,6 +53,7 @@ const MedicationBindings = {
|
|
|
53
53
|
// Named exports - all functions bound to their respective modules
|
|
54
54
|
export const authorizationStatusFor = Core.authorizationStatusFor.bind(Core);
|
|
55
55
|
export const requestPerObjectReadAuthorization = Core.requestPerObjectReadAuthorization.bind(Core);
|
|
56
|
+
export const getEarliestAuthorizedSampleDates = Core.getEarliestAuthorizedSampleDates.bind(Core);
|
|
56
57
|
export const disableAllBackgroundDelivery = Core.disableAllBackgroundDelivery.bind(Core);
|
|
57
58
|
export const disableBackgroundDelivery = Core.disableBackgroundDelivery.bind(Core);
|
|
58
59
|
export const enableBackgroundDelivery = Core.enableBackgroundDelivery.bind(Core);
|
|
@@ -92,6 +93,7 @@ export const saveQuantitySample = QuantityTypes.saveQuantitySample.bind(Quantity
|
|
|
92
93
|
export const saveWorkoutSample = WorkoutBindings.saveWorkoutSample;
|
|
93
94
|
export const startWatchApp = Workouts.startWatchAppWithWorkoutConfiguration.bind(Workouts);
|
|
94
95
|
export const isProtectedDataAvailable = Core.isProtectedDataAvailable.bind(Core);
|
|
96
|
+
export const isProtectedDataAvailableAsync = Core.isProtectedDataAvailableAsync.bind(Core);
|
|
95
97
|
export const queryStateOfMindSamples = StateOfMindBindings.queryStateOfMindSamples;
|
|
96
98
|
export const queryStateOfMindSamplesWithAnchor = StateOfMindBindings.queryStateOfMindSamplesWithAnchor;
|
|
97
99
|
export const saveStateOfMindSample = StateOfMindBindings.saveStateOfMindSample;
|
|
@@ -159,6 +161,7 @@ export default {
|
|
|
159
161
|
querySources,
|
|
160
162
|
requestAuthorization,
|
|
161
163
|
requestPerObjectReadAuthorization,
|
|
164
|
+
getEarliestAuthorizedSampleDates,
|
|
162
165
|
deleteObjects,
|
|
163
166
|
saveCategorySample,
|
|
164
167
|
saveCorrelationSample,
|
|
@@ -168,6 +171,7 @@ export default {
|
|
|
168
171
|
subscribeToQuantitySamples,
|
|
169
172
|
startWatchApp,
|
|
170
173
|
isProtectedDataAvailable,
|
|
174
|
+
isProtectedDataAvailableAsync,
|
|
171
175
|
queryStateOfMindSamples,
|
|
172
176
|
queryStateOfMindSamplesWithAnchor,
|
|
173
177
|
saveStateOfMindSample,
|