@kingstinct/react-native-healthkit 7.0.4 → 7.0.6
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 +7 -31
- package/ios/ReactNativeHealthkit.swift +3 -2
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js +5 -0
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -1
- package/lib/commonjs/index.ios.js +121 -15
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +3 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/jest.setup.js +1 -0
- package/lib/commonjs/jest.setup.js.map +1 -1
- package/lib/commonjs/native-types.js +36 -27
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/getMostRecentCategorySample.js +1 -1
- package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -1
- package/lib/commonjs/utils/getMostRecentQuantitySample.js +5 -1
- package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -1
- package/lib/module/hooks/useIsHealthDataAvailable.js +6 -0
- package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -1
- package/lib/module/index.ios.js +119 -15
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/jest.setup.js +1 -0
- package/lib/module/jest.setup.js.map +1 -1
- package/lib/module/native-types.js +36 -27
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js +59 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/getMostRecentCategorySample.js +1 -1
- package/lib/module/utils/getMostRecentCategorySample.js.map +1 -1
- package/lib/module/utils/getMostRecentQuantitySample.js +5 -1
- package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -1
- package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +5 -0
- package/lib/typescript/src/index.d.ts +50 -3
- package/lib/typescript/src/index.ios.d.ts +84 -3
- package/lib/typescript/src/native-types.d.ts +515 -34
- package/lib/typescript/src/types.d.ts +49 -0
- package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +2 -1
- package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +2 -1
- package/package.json +1 -1
- package/src/hooks/useIsHealthDataAvailable.ts +5 -0
- package/src/index.ios.tsx +132 -21
- package/src/index.tsx +6 -4
- package/src/jest.setup.ts +1 -0
- package/src/native-types.ts +615 -81
- package/src/types.ts +51 -2
- package/src/utils/getMostRecentCategorySample.ts +3 -2
- package/src/utils/getMostRecentQuantitySample.ts +9 -2
|
@@ -6,14 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.UnitOfVolume = exports.UnitOfTime = exports.UnitOfPressure = exports.UnitOfMass = exports.UnitOfLength = exports.UnitOfEnergy = exports.TemperatureUnit = exports.HKWorkoutTypeIdentifier = exports.HKWorkoutRouteTypeIdentifier = exports.HKWorkoutActivityType = exports.HKWheelchairUse = exports.HKWeatherCondition = exports.HKUpdateFrequency = exports.HKUnits = exports.HKUnitMetric = exports.HKStatisticsOptions = exports.HKQuantityTypeIdentifier = exports.HKMetricPrefix = exports.HKInsulinDeliveryReason = exports.HKHeartRateMotionContext = exports.HKFitzpatrickSkinType = exports.HKDataTypeIdentifierHeartbeatSeries = exports.HKCorrelationTypeIdentifier = exports.HKCharacteristicTypeIdentifier = exports.HKCategoryValueSleepAnalysis = exports.HKCategoryValueSeverity = exports.HKCategoryValuePresence = exports.HKCategoryValueOvulationTestResult = exports.HKCategoryValueNotApplicable = exports.HKCategoryValueMenstrualFlow = exports.HKCategoryValueLowCardioFitnessEvent = exports.HKCategoryValueCervicalMucusQuality = exports.HKCategoryValueAppleStandHour = exports.HKCategoryValueAppetiteChanges = exports.HKCategoryTypeIdentifier = exports.HKBloodType = exports.HKBiologicalSex = exports.HKAuthorizationStatus = exports.HKAuthorizationRequestStatus = exports.HKAudiogramTypeIdentifier = exports.EventEmitter = exports.BloodGlucoseUnit = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Represents a workout type identifier.
|
|
10
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkworkouttypeidentifier Apple Docs HKWorkoutTypeIdentifier}
|
|
10
11
|
*/
|
|
11
12
|
const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents an audiogram type identifier.
|
|
16
|
+
*/
|
|
12
17
|
exports.HKWorkoutTypeIdentifier = HKWorkoutTypeIdentifier;
|
|
13
18
|
const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier';
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
|
-
*
|
|
21
|
+
* Represents a workout route type identifier.
|
|
22
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutetypeidentifier Apple Docs HKWorkoutRouteTypeIdentifier}
|
|
17
23
|
*/
|
|
18
24
|
exports.HKAudiogramTypeIdentifier = HKAudiogramTypeIdentifier;
|
|
19
25
|
const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier';
|
|
@@ -21,7 +27,8 @@ exports.HKWorkoutRouteTypeIdentifier = HKWorkoutRouteTypeIdentifier;
|
|
|
21
27
|
const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries';
|
|
22
28
|
|
|
23
29
|
/**
|
|
24
|
-
*
|
|
30
|
+
* Represents a quantity type identifier.
|
|
31
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier Apple Docs HKQuantityTypeIdentifier}
|
|
25
32
|
*/
|
|
26
33
|
exports.HKDataTypeIdentifierHeartbeatSeries = HKDataTypeIdentifierHeartbeatSeries;
|
|
27
34
|
let HKQuantityTypeIdentifier = /*#__PURE__*/function (HKQuantityTypeIdentifier) {
|
|
@@ -145,7 +152,7 @@ let HKHeartRateMotionContext = /*#__PURE__*/function (HKHeartRateMotionContext)
|
|
|
145
152
|
return HKHeartRateMotionContext;
|
|
146
153
|
}({});
|
|
147
154
|
/**
|
|
148
|
-
*
|
|
155
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcorrelationtypeidentifier Apple Docs }
|
|
149
156
|
*/
|
|
150
157
|
exports.HKHeartRateMotionContext = HKHeartRateMotionContext;
|
|
151
158
|
let HKCorrelationTypeIdentifier = /*#__PURE__*/function (HKCorrelationTypeIdentifier) {
|
|
@@ -154,7 +161,7 @@ let HKCorrelationTypeIdentifier = /*#__PURE__*/function (HKCorrelationTypeIdenti
|
|
|
154
161
|
return HKCorrelationTypeIdentifier;
|
|
155
162
|
}({});
|
|
156
163
|
/**
|
|
157
|
-
*
|
|
164
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifier Apple Docs }
|
|
158
165
|
*/
|
|
159
166
|
exports.HKCorrelationTypeIdentifier = HKCorrelationTypeIdentifier;
|
|
160
167
|
let HKCategoryTypeIdentifier = /*#__PURE__*/function (HKCategoryTypeIdentifier) {
|
|
@@ -349,7 +356,7 @@ var HKIndoorWorkout = /*#__PURE__*/function (HKIndoorWorkout) {
|
|
|
349
356
|
return HKIndoorWorkout;
|
|
350
357
|
}(HKIndoorWorkout || {});
|
|
351
358
|
/**
|
|
352
|
-
*
|
|
359
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus Apple Docs }
|
|
353
360
|
*/
|
|
354
361
|
let HKAuthorizationRequestStatus = /*#__PURE__*/function (HKAuthorizationRequestStatus) {
|
|
355
362
|
HKAuthorizationRequestStatus[HKAuthorizationRequestStatus["unknown"] = 0] = "unknown";
|
|
@@ -358,7 +365,7 @@ let HKAuthorizationRequestStatus = /*#__PURE__*/function (HKAuthorizationRequest
|
|
|
358
365
|
return HKAuthorizationRequestStatus;
|
|
359
366
|
}({});
|
|
360
367
|
/**
|
|
361
|
-
*
|
|
368
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationstatus Apple Docs }
|
|
362
369
|
*/
|
|
363
370
|
exports.HKAuthorizationRequestStatus = HKAuthorizationRequestStatus;
|
|
364
371
|
let HKAuthorizationStatus = /*#__PURE__*/function (HKAuthorizationStatus) {
|
|
@@ -369,7 +376,7 @@ let HKAuthorizationStatus = /*#__PURE__*/function (HKAuthorizationStatus) {
|
|
|
369
376
|
}({});
|
|
370
377
|
exports.HKAuthorizationStatus = HKAuthorizationStatus;
|
|
371
378
|
/**
|
|
372
|
-
*
|
|
379
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkbloodtype Apple Docs }
|
|
373
380
|
*/
|
|
374
381
|
let HKBloodType = /*#__PURE__*/function (HKBloodType) {
|
|
375
382
|
HKBloodType[HKBloodType["notSet"] = 0] = "notSet";
|
|
@@ -384,7 +391,7 @@ let HKBloodType = /*#__PURE__*/function (HKBloodType) {
|
|
|
384
391
|
return HKBloodType;
|
|
385
392
|
}({});
|
|
386
393
|
/**
|
|
387
|
-
*
|
|
394
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkbiologicalsex Apple Docs }
|
|
388
395
|
*/
|
|
389
396
|
exports.HKBloodType = HKBloodType;
|
|
390
397
|
let HKBiologicalSex = /*#__PURE__*/function (HKBiologicalSex) {
|
|
@@ -395,7 +402,7 @@ let HKBiologicalSex = /*#__PURE__*/function (HKBiologicalSex) {
|
|
|
395
402
|
return HKBiologicalSex;
|
|
396
403
|
}({});
|
|
397
404
|
/**
|
|
398
|
-
*
|
|
405
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkfitzpatrickskintype Apple Docs }
|
|
399
406
|
*/
|
|
400
407
|
exports.HKBiologicalSex = HKBiologicalSex;
|
|
401
408
|
let HKFitzpatrickSkinType = /*#__PURE__*/function (HKFitzpatrickSkinType) {
|
|
@@ -409,7 +416,7 @@ let HKFitzpatrickSkinType = /*#__PURE__*/function (HKFitzpatrickSkinType) {
|
|
|
409
416
|
return HKFitzpatrickSkinType;
|
|
410
417
|
}({});
|
|
411
418
|
/**
|
|
412
|
-
*
|
|
419
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkstatisticsoptions Apple Docs }
|
|
413
420
|
*/
|
|
414
421
|
exports.HKFitzpatrickSkinType = HKFitzpatrickSkinType;
|
|
415
422
|
let HKStatisticsOptions = /*#__PURE__*/function (HKStatisticsOptions) {
|
|
@@ -425,7 +432,7 @@ let HKStatisticsOptions = /*#__PURE__*/function (HKStatisticsOptions) {
|
|
|
425
432
|
}({});
|
|
426
433
|
exports.HKStatisticsOptions = HKStatisticsOptions;
|
|
427
434
|
/**
|
|
428
|
-
* https://developer.apple.com/documentation/healthkit/hkcategoryvaluecervicalmucusquality
|
|
435
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluecervicalmucusquality Apple Docs }
|
|
429
436
|
*/
|
|
430
437
|
let HKCategoryValueCervicalMucusQuality = /*#__PURE__*/function (HKCategoryValueCervicalMucusQuality) {
|
|
431
438
|
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["dry"] = 1] = "dry";
|
|
@@ -436,7 +443,7 @@ let HKCategoryValueCervicalMucusQuality = /*#__PURE__*/function (HKCategoryValue
|
|
|
436
443
|
return HKCategoryValueCervicalMucusQuality;
|
|
437
444
|
}({});
|
|
438
445
|
/**
|
|
439
|
-
*
|
|
446
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluemenstrualflow Apple Docs }
|
|
440
447
|
*/
|
|
441
448
|
exports.HKCategoryValueCervicalMucusQuality = HKCategoryValueCervicalMucusQuality;
|
|
442
449
|
let HKCategoryValueMenstrualFlow = /*#__PURE__*/function (HKCategoryValueMenstrualFlow) {
|
|
@@ -448,7 +455,7 @@ let HKCategoryValueMenstrualFlow = /*#__PURE__*/function (HKCategoryValueMenstru
|
|
|
448
455
|
return HKCategoryValueMenstrualFlow;
|
|
449
456
|
}({});
|
|
450
457
|
/**
|
|
451
|
-
*
|
|
458
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueovulationtestresult Apple Docs }
|
|
452
459
|
*/
|
|
453
460
|
exports.HKCategoryValueMenstrualFlow = HKCategoryValueMenstrualFlow;
|
|
454
461
|
let HKCategoryValueOvulationTestResult = /*#__PURE__*/function (HKCategoryValueOvulationTestResult) {
|
|
@@ -459,7 +466,7 @@ let HKCategoryValueOvulationTestResult = /*#__PURE__*/function (HKCategoryValueO
|
|
|
459
466
|
return HKCategoryValueOvulationTestResult;
|
|
460
467
|
}({});
|
|
461
468
|
/**
|
|
462
|
-
*
|
|
469
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluesleepanalysis Apple Docs }
|
|
463
470
|
*/
|
|
464
471
|
exports.HKCategoryValueOvulationTestResult = HKCategoryValueOvulationTestResult;
|
|
465
472
|
let HKCategoryValueSleepAnalysis = /*#__PURE__*/function (HKCategoryValueSleepAnalysis) {
|
|
@@ -472,7 +479,7 @@ let HKCategoryValueSleepAnalysis = /*#__PURE__*/function (HKCategoryValueSleepAn
|
|
|
472
479
|
return HKCategoryValueSleepAnalysis;
|
|
473
480
|
}({});
|
|
474
481
|
/**
|
|
475
|
-
* https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges
|
|
482
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges
|
|
476
483
|
*/
|
|
477
484
|
exports.HKCategoryValueSleepAnalysis = HKCategoryValueSleepAnalysis;
|
|
478
485
|
let HKCategoryValueAppetiteChanges = /*#__PURE__*/function (HKCategoryValueAppetiteChanges) {
|
|
@@ -483,7 +490,7 @@ let HKCategoryValueAppetiteChanges = /*#__PURE__*/function (HKCategoryValueAppet
|
|
|
483
490
|
return HKCategoryValueAppetiteChanges;
|
|
484
491
|
}({});
|
|
485
492
|
/**
|
|
486
|
-
* https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence
|
|
493
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence
|
|
487
494
|
*/
|
|
488
495
|
exports.HKCategoryValueAppetiteChanges = HKCategoryValueAppetiteChanges;
|
|
489
496
|
let HKCategoryValuePresence = /*#__PURE__*/function (HKCategoryValuePresence) {
|
|
@@ -492,7 +499,7 @@ let HKCategoryValuePresence = /*#__PURE__*/function (HKCategoryValuePresence) {
|
|
|
492
499
|
return HKCategoryValuePresence;
|
|
493
500
|
}({});
|
|
494
501
|
/**
|
|
495
|
-
*
|
|
502
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueseverity Apple Docs }
|
|
496
503
|
*/
|
|
497
504
|
exports.HKCategoryValuePresence = HKCategoryValuePresence;
|
|
498
505
|
let HKCategoryValueSeverity = /*#__PURE__*/function (HKCategoryValueSeverity) {
|
|
@@ -504,7 +511,7 @@ let HKCategoryValueSeverity = /*#__PURE__*/function (HKCategoryValueSeverity) {
|
|
|
504
511
|
return HKCategoryValueSeverity;
|
|
505
512
|
}({});
|
|
506
513
|
/**
|
|
507
|
-
*
|
|
514
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalue/notapplicable Apple Docs }
|
|
508
515
|
*/
|
|
509
516
|
exports.HKCategoryValueSeverity = HKCategoryValueSeverity;
|
|
510
517
|
let HKCategoryValueNotApplicable = /*#__PURE__*/function (HKCategoryValueNotApplicable) {
|
|
@@ -512,11 +519,11 @@ let HKCategoryValueNotApplicable = /*#__PURE__*/function (HKCategoryValueNotAppl
|
|
|
512
519
|
return HKCategoryValueNotApplicable;
|
|
513
520
|
}({});
|
|
514
521
|
/**
|
|
515
|
-
*
|
|
522
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalue Apple Docs }
|
|
516
523
|
*/
|
|
517
524
|
exports.HKCategoryValueNotApplicable = HKCategoryValueNotApplicable;
|
|
518
525
|
/**
|
|
519
|
-
*
|
|
526
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason Apple Docs }
|
|
520
527
|
*/
|
|
521
528
|
let HKInsulinDeliveryReason = /*#__PURE__*/function (HKInsulinDeliveryReason) {
|
|
522
529
|
HKInsulinDeliveryReason[HKInsulinDeliveryReason["basal"] = 1] = "basal";
|
|
@@ -525,7 +532,7 @@ let HKInsulinDeliveryReason = /*#__PURE__*/function (HKInsulinDeliveryReason) {
|
|
|
525
532
|
}({});
|
|
526
533
|
exports.HKInsulinDeliveryReason = HKInsulinDeliveryReason;
|
|
527
534
|
/**
|
|
528
|
-
*
|
|
535
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepregnancytestresult Apple Docs }
|
|
529
536
|
*/
|
|
530
537
|
var HKCategoryValuePregnancyTestResult = /*#__PURE__*/function (HKCategoryValuePregnancyTestResult) {
|
|
531
538
|
HKCategoryValuePregnancyTestResult[HKCategoryValuePregnancyTestResult["positive"] = 2] = "positive";
|
|
@@ -696,16 +703,16 @@ let BloodGlucoseUnit = /*#__PURE__*/function (BloodGlucoseUnit) {
|
|
|
696
703
|
return BloodGlucoseUnit;
|
|
697
704
|
}({});
|
|
698
705
|
/**
|
|
699
|
-
*
|
|
706
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkdevice Apple Docs }
|
|
700
707
|
*/
|
|
701
708
|
/**
|
|
702
|
-
*
|
|
709
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615781-source Apple Docs }
|
|
703
710
|
*/
|
|
704
711
|
/**
|
|
705
|
-
*
|
|
712
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615483-sourcerevision Apple Docs }
|
|
706
713
|
*/
|
|
707
714
|
/**
|
|
708
|
-
*
|
|
715
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs }
|
|
709
716
|
*/
|
|
710
717
|
exports.BloodGlucoseUnit = BloodGlucoseUnit;
|
|
711
718
|
// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier
|
|
@@ -719,7 +726,9 @@ let HKCharacteristicTypeIdentifier = /*#__PURE__*/function (HKCharacteristicType
|
|
|
719
726
|
return HKCharacteristicTypeIdentifier;
|
|
720
727
|
}({}); // HKActivityMoveModeObject
|
|
721
728
|
exports.HKCharacteristicTypeIdentifier = HKCharacteristicTypeIdentifier;
|
|
722
|
-
/**
|
|
729
|
+
/**
|
|
730
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkupdatefrequency Apple Docs }
|
|
731
|
+
*/
|
|
723
732
|
let HKUpdateFrequency = /*#__PURE__*/function (HKUpdateFrequency) {
|
|
724
733
|
HKUpdateFrequency[HKUpdateFrequency["immediate"] = 1] = "immediate";
|
|
725
734
|
HKUpdateFrequency[HKUpdateFrequency["hourly"] = 2] = "hourly";
|