@kingstinct/react-native-healthkit 4.4.2 → 4.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/native-types.js +8 -14
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/native-types.js +7 -11
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/native-types.d.ts +17 -238
- package/lib/typescript/src/types.d.ts +5 -5
- package/package.json +1 -2
- package/src/index.ios.tsx +2 -2
- package/src/native-types.ts +34 -29
- package/src/types.ts +5 -5
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { NativeEventEmitter } from 'react-native';
|
|
2
2
|
import type { EmitterSubscription } from 'react-native';
|
|
3
|
-
import type { ValueOf } from 'type-fest';
|
|
4
3
|
export declare const HKWorkoutTypeIdentifier: "HKWorkoutTypeIdentifier";
|
|
5
4
|
export declare const HKAudiogramTypeIdentifier: "HKAudiogramTypeIdentifier";
|
|
6
5
|
export declare const HKWorkoutRouteTypeIdentifier: "HKWorkoutRouteTypeIdentifier";
|
|
@@ -124,120 +123,9 @@ export declare enum HKCategoryTypeIdentifier {
|
|
|
124
123
|
audioExposureEvent = "HKCategoryTypeIdentifierAudioExposureEvent",
|
|
125
124
|
toothbrushingEvent = "HKCategoryTypeIdentifierToothbrushingEvent"
|
|
126
125
|
}
|
|
127
|
-
export declare
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
workoutRoute: "HKWorkoutRouteTypeIdentifier";
|
|
131
|
-
workoute: "HKWorkoutTypeIdentifier";
|
|
132
|
-
bodyMassIndex: HKQuantityTypeIdentifier.bodyMassIndex;
|
|
133
|
-
bodyFatPercentage: HKQuantityTypeIdentifier.bodyFatPercentage;
|
|
134
|
-
height: HKQuantityTypeIdentifier.height;
|
|
135
|
-
bodyMass: HKQuantityTypeIdentifier.bodyMass;
|
|
136
|
-
leanBodyMass: HKQuantityTypeIdentifier.leanBodyMass;
|
|
137
|
-
waistCircumference: HKQuantityTypeIdentifier.waistCircumference;
|
|
138
|
-
stepCount: HKQuantityTypeIdentifier.stepCount;
|
|
139
|
-
distanceWalkingRunning: HKQuantityTypeIdentifier.distanceWalkingRunning;
|
|
140
|
-
distanceCycling: HKQuantityTypeIdentifier.distanceCycling;
|
|
141
|
-
distanceWheelchair: HKQuantityTypeIdentifier.distanceWheelchair;
|
|
142
|
-
basalEnergyBurned: HKQuantityTypeIdentifier.basalEnergyBurned;
|
|
143
|
-
activeEnergyBurned: HKQuantityTypeIdentifier.activeEnergyBurned;
|
|
144
|
-
flightsClimbed: HKQuantityTypeIdentifier.flightsClimbed;
|
|
145
|
-
nikeFuel: HKQuantityTypeIdentifier.nikeFuel;
|
|
146
|
-
appleExerciseTime: HKQuantityTypeIdentifier.appleExerciseTime;
|
|
147
|
-
pushCount: HKQuantityTypeIdentifier.pushCount;
|
|
148
|
-
distanceSwimming: HKQuantityTypeIdentifier.distanceSwimming;
|
|
149
|
-
swimmingStrokeCount: HKQuantityTypeIdentifier.swimmingStrokeCount;
|
|
150
|
-
vo2Max: HKQuantityTypeIdentifier.vo2Max;
|
|
151
|
-
distanceDownhillSnowSports: HKQuantityTypeIdentifier.distanceDownhillSnowSports;
|
|
152
|
-
appleStandTime: HKQuantityTypeIdentifier.appleStandTime;
|
|
153
|
-
heartRate: HKQuantityTypeIdentifier.heartRate;
|
|
154
|
-
bodyTemperature: HKQuantityTypeIdentifier.bodyTemperature;
|
|
155
|
-
basalBodyTemperature: HKQuantityTypeIdentifier.basalBodyTemperature;
|
|
156
|
-
bloodPressureSystolic: HKQuantityTypeIdentifier.bloodPressureSystolic;
|
|
157
|
-
bloodPressureDiastolic: HKQuantityTypeIdentifier.bloodPressureDiastolic;
|
|
158
|
-
respiratoryRate: HKQuantityTypeIdentifier.respiratoryRate;
|
|
159
|
-
restingHeartRate: HKQuantityTypeIdentifier.restingHeartRate;
|
|
160
|
-
walkingHeartRateAverage: HKQuantityTypeIdentifier.walkingHeartRateAverage;
|
|
161
|
-
heartRateVariabilitySDNN: HKQuantityTypeIdentifier.heartRateVariabilitySDNN;
|
|
162
|
-
oxygenSaturation: HKQuantityTypeIdentifier.oxygenSaturation;
|
|
163
|
-
peripheralPerfusionIndex: HKQuantityTypeIdentifier.peripheralPerfusionIndex;
|
|
164
|
-
bloodGlucose: HKQuantityTypeIdentifier.bloodGlucose;
|
|
165
|
-
numberOfTimesFallen: HKQuantityTypeIdentifier.numberOfTimesFallen;
|
|
166
|
-
electrodermalActivity: HKQuantityTypeIdentifier.electrodermalActivity;
|
|
167
|
-
inhalerUsage: HKQuantityTypeIdentifier.inhalerUsage;
|
|
168
|
-
insulinDelivery: HKQuantityTypeIdentifier.insulinDelivery;
|
|
169
|
-
bloodAlcoholContent: HKQuantityTypeIdentifier.bloodAlcoholContent;
|
|
170
|
-
forcedVitalCapacity: HKQuantityTypeIdentifier.forcedVitalCapacity;
|
|
171
|
-
forcedExpiratoryVolume1: HKQuantityTypeIdentifier.forcedExpiratoryVolume1;
|
|
172
|
-
peakExpiratoryFlowRate: HKQuantityTypeIdentifier.peakExpiratoryFlowRate;
|
|
173
|
-
environmentalAudioExposure: HKQuantityTypeIdentifier.environmentalAudioExposure;
|
|
174
|
-
headphoneAudioExposure: HKQuantityTypeIdentifier.headphoneAudioExposure;
|
|
175
|
-
dietaryFatTotal: HKQuantityTypeIdentifier.dietaryFatTotal;
|
|
176
|
-
dietaryFatPolyunsaturated: HKQuantityTypeIdentifier.dietaryFatPolyunsaturated;
|
|
177
|
-
dietaryFatMonounsaturated: HKQuantityTypeIdentifier.dietaryFatMonounsaturated;
|
|
178
|
-
dietaryFatSaturated: HKQuantityTypeIdentifier.dietaryFatSaturated;
|
|
179
|
-
dietaryCholesterol: HKQuantityTypeIdentifier.dietaryCholesterol;
|
|
180
|
-
dietarySodium: HKQuantityTypeIdentifier.dietarySodium;
|
|
181
|
-
dietaryCarbohydrates: HKQuantityTypeIdentifier.dietaryCarbohydrates;
|
|
182
|
-
dietaryFiber: HKQuantityTypeIdentifier.dietaryFiber;
|
|
183
|
-
dietarySugar: HKQuantityTypeIdentifier.dietarySugar;
|
|
184
|
-
dietaryEnergyConsumed: HKQuantityTypeIdentifier.dietaryEnergyConsumed;
|
|
185
|
-
dietaryProtein: HKQuantityTypeIdentifier.dietaryProtein;
|
|
186
|
-
dietaryVitaminA: HKQuantityTypeIdentifier.dietaryVitaminA;
|
|
187
|
-
dietaryVitaminB6: HKQuantityTypeIdentifier.dietaryVitaminB6;
|
|
188
|
-
dietaryVitaminB12: HKQuantityTypeIdentifier.dietaryVitaminB12;
|
|
189
|
-
dietaryVitaminC: HKQuantityTypeIdentifier.dietaryVitaminC;
|
|
190
|
-
dietaryVitaminD: HKQuantityTypeIdentifier.dietaryVitaminD;
|
|
191
|
-
dietaryVitaminE: HKQuantityTypeIdentifier.dietaryVitaminE;
|
|
192
|
-
dietaryVitaminK: HKQuantityTypeIdentifier.dietaryVitaminK;
|
|
193
|
-
dietaryCalcium: HKQuantityTypeIdentifier.dietaryCalcium;
|
|
194
|
-
dietaryIron: HKQuantityTypeIdentifier.dietaryIron;
|
|
195
|
-
dietaryThiamin: HKQuantityTypeIdentifier.dietaryThiamin;
|
|
196
|
-
dietaryRiboflavin: HKQuantityTypeIdentifier.dietaryRiboflavin;
|
|
197
|
-
dietaryNiacin: HKQuantityTypeIdentifier.dietaryNiacin;
|
|
198
|
-
dietaryFolate: HKQuantityTypeIdentifier.dietaryFolate;
|
|
199
|
-
dietaryBiotin: HKQuantityTypeIdentifier.dietaryBiotin;
|
|
200
|
-
dietaryPantothenicAcid: HKQuantityTypeIdentifier.dietaryPantothenicAcid;
|
|
201
|
-
dietaryPhosphorus: HKQuantityTypeIdentifier.dietaryPhosphorus;
|
|
202
|
-
dietaryIodine: HKQuantityTypeIdentifier.dietaryIodine;
|
|
203
|
-
dietaryMagnesium: HKQuantityTypeIdentifier.dietaryMagnesium;
|
|
204
|
-
dietaryZinc: HKQuantityTypeIdentifier.dietaryZinc;
|
|
205
|
-
dietarySelenium: HKQuantityTypeIdentifier.dietarySelenium;
|
|
206
|
-
dietaryCopper: HKQuantityTypeIdentifier.dietaryCopper;
|
|
207
|
-
dietaryManganese: HKQuantityTypeIdentifier.dietaryManganese;
|
|
208
|
-
dietaryChromium: HKQuantityTypeIdentifier.dietaryChromium;
|
|
209
|
-
dietaryMolybdenum: HKQuantityTypeIdentifier.dietaryMolybdenum;
|
|
210
|
-
dietaryChloride: HKQuantityTypeIdentifier.dietaryChloride;
|
|
211
|
-
dietaryPotassium: HKQuantityTypeIdentifier.dietaryPotassium;
|
|
212
|
-
dietaryCaffeine: HKQuantityTypeIdentifier.dietaryCaffeine;
|
|
213
|
-
dietaryWater: HKQuantityTypeIdentifier.dietaryWater;
|
|
214
|
-
sixMinuteWalkTestDistance: HKQuantityTypeIdentifier.sixMinuteWalkTestDistance;
|
|
215
|
-
walkingSpeed: HKQuantityTypeIdentifier.walkingSpeed;
|
|
216
|
-
walkingStepLength: HKQuantityTypeIdentifier.walkingStepLength;
|
|
217
|
-
walkingAsymmetryPercentage: HKQuantityTypeIdentifier.walkingAsymmetryPercentage;
|
|
218
|
-
walkingDoubleSupportPercentage: HKQuantityTypeIdentifier.walkingDoubleSupportPercentage;
|
|
219
|
-
stairAscentSpeed: HKQuantityTypeIdentifier.stairAscentSpeed;
|
|
220
|
-
stairDescentSpeed: HKQuantityTypeIdentifier.stairDescentSpeed;
|
|
221
|
-
uvExposure: HKQuantityTypeIdentifier.uvExposure;
|
|
222
|
-
bloodPressure: HKCorrelationTypeIdentifier.bloodPressure;
|
|
223
|
-
food: HKCorrelationTypeIdentifier.food;
|
|
224
|
-
sleepAnalysis: HKCategoryTypeIdentifier.sleepAnalysis;
|
|
225
|
-
appleStandHour: HKCategoryTypeIdentifier.appleStandHour;
|
|
226
|
-
cervicalMucusQuality: HKCategoryTypeIdentifier.cervicalMucusQuality;
|
|
227
|
-
ovulationTestResult: HKCategoryTypeIdentifier.ovulationTestResult;
|
|
228
|
-
menstrualFlow: HKCategoryTypeIdentifier.menstrualFlow;
|
|
229
|
-
intermenstrualBleeding: HKCategoryTypeIdentifier.intermenstrualBleeding;
|
|
230
|
-
sexualActivity: HKCategoryTypeIdentifier.sexualActivity;
|
|
231
|
-
mindfulSession: HKCategoryTypeIdentifier.mindfulSession;
|
|
232
|
-
highHeartRateEvent: HKCategoryTypeIdentifier.highHeartRateEvent;
|
|
233
|
-
lowHeartRateEvent: HKCategoryTypeIdentifier.lowHeartRateEvent;
|
|
234
|
-
irregularHeartRhythmEvent: HKCategoryTypeIdentifier.irregularHeartRhythmEvent;
|
|
235
|
-
audioExposureEvent: HKCategoryTypeIdentifier.audioExposureEvent;
|
|
236
|
-
toothbrushingEvent: HKCategoryTypeIdentifier.toothbrushingEvent;
|
|
237
|
-
};
|
|
238
|
-
export declare type SampleTypeIdentifier = ValueOf<typeof HKSampleTypeIdentifier>;
|
|
239
|
-
export declare type HealthkitReadAuthorization = ValueOf<typeof HealthkitAuthorization>;
|
|
240
|
-
export declare type HealthkitWriteAuthorization = ValueOf<typeof HealthkitAuthorization>;
|
|
126
|
+
export declare type HKSampleTypeIdentifier = HKCategoryTypeIdentifier | HKCorrelationTypeIdentifier | HKQuantityTypeIdentifier | typeof HKAudiogramTypeIdentifier | typeof HKDataTypeIdentifierHeartbeatSeries | typeof HKWorkoutRouteTypeIdentifier | typeof HKWorkoutTypeIdentifier | `${HKCategoryTypeIdentifier}` | `${HKCorrelationTypeIdentifier}` | `${HKQuantityTypeIdentifier}`;
|
|
127
|
+
export declare type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`;
|
|
128
|
+
export declare type HealthkitWriteAuthorization = HKSampleTypeIdentifier;
|
|
241
129
|
export declare enum HKCategoryValueAppleStandHour {
|
|
242
130
|
stood = 0,
|
|
243
131
|
idle = 1
|
|
@@ -368,9 +256,16 @@ export declare enum HKWeatherCondition {
|
|
|
368
256
|
hurricane = 26,
|
|
369
257
|
tornado = 27
|
|
370
258
|
}
|
|
259
|
+
declare enum HKIndoorWorkout {
|
|
260
|
+
false = 0,
|
|
261
|
+
true = 1
|
|
262
|
+
}
|
|
371
263
|
export interface HKWorkoutMetadata extends HKGenericMetadata {
|
|
372
264
|
readonly HKWeatherCondition?: HKWeatherCondition;
|
|
373
265
|
readonly HKWeatherHumidity?: HKQuantity<HKUnit.Percent>;
|
|
266
|
+
readonly HKAverageMETs?: HKQuantity<HKUnit>;
|
|
267
|
+
readonly HKElevationAscended?: HKQuantity<HKUnit.Meters>;
|
|
268
|
+
readonly HKIndoorWorkout?: HKIndoorWorkout;
|
|
374
269
|
}
|
|
375
270
|
export declare enum HKAuthorizationRequestStatus {
|
|
376
271
|
unknown = 0,
|
|
@@ -573,9 +468,9 @@ export declare enum HKUnit {
|
|
|
573
468
|
}
|
|
574
469
|
export declare type HKDevice = {
|
|
575
470
|
readonly name: string;
|
|
576
|
-
readonly firmwareVersion: string;
|
|
471
|
+
readonly firmwareVersion: string | null;
|
|
577
472
|
readonly hardwareVersion: string;
|
|
578
|
-
readonly localIdentifier: string;
|
|
473
|
+
readonly localIdentifier: string | null;
|
|
579
474
|
readonly manufacturer: string;
|
|
580
475
|
readonly model: string;
|
|
581
476
|
readonly softwareVersion: string;
|
|
@@ -667,122 +562,6 @@ export declare type WorkoutRoute = {
|
|
|
667
562
|
readonly HKMetadataKeySyncIdentifier?: string;
|
|
668
563
|
readonly HKMetadataKeySyncVersion?: number;
|
|
669
564
|
};
|
|
670
|
-
export declare const HealthkitAuthorization: {
|
|
671
|
-
audiogram: "HKAudiogramTypeIdentifier";
|
|
672
|
-
heartbeatSeries: "HKDataTypeIdentifierHeartbeatSeries";
|
|
673
|
-
workoutRoute: "HKWorkoutRouteTypeIdentifier";
|
|
674
|
-
workoute: "HKWorkoutTypeIdentifier";
|
|
675
|
-
bodyMassIndex: HKQuantityTypeIdentifier.bodyMassIndex;
|
|
676
|
-
bodyFatPercentage: HKQuantityTypeIdentifier.bodyFatPercentage;
|
|
677
|
-
height: HKQuantityTypeIdentifier.height;
|
|
678
|
-
bodyMass: HKQuantityTypeIdentifier.bodyMass;
|
|
679
|
-
leanBodyMass: HKQuantityTypeIdentifier.leanBodyMass;
|
|
680
|
-
waistCircumference: HKQuantityTypeIdentifier.waistCircumference;
|
|
681
|
-
stepCount: HKQuantityTypeIdentifier.stepCount;
|
|
682
|
-
distanceWalkingRunning: HKQuantityTypeIdentifier.distanceWalkingRunning;
|
|
683
|
-
distanceCycling: HKQuantityTypeIdentifier.distanceCycling;
|
|
684
|
-
distanceWheelchair: HKQuantityTypeIdentifier.distanceWheelchair;
|
|
685
|
-
basalEnergyBurned: HKQuantityTypeIdentifier.basalEnergyBurned;
|
|
686
|
-
activeEnergyBurned: HKQuantityTypeIdentifier.activeEnergyBurned;
|
|
687
|
-
flightsClimbed: HKQuantityTypeIdentifier.flightsClimbed;
|
|
688
|
-
nikeFuel: HKQuantityTypeIdentifier.nikeFuel;
|
|
689
|
-
appleExerciseTime: HKQuantityTypeIdentifier.appleExerciseTime;
|
|
690
|
-
pushCount: HKQuantityTypeIdentifier.pushCount;
|
|
691
|
-
distanceSwimming: HKQuantityTypeIdentifier.distanceSwimming;
|
|
692
|
-
swimmingStrokeCount: HKQuantityTypeIdentifier.swimmingStrokeCount;
|
|
693
|
-
vo2Max: HKQuantityTypeIdentifier.vo2Max;
|
|
694
|
-
distanceDownhillSnowSports: HKQuantityTypeIdentifier.distanceDownhillSnowSports;
|
|
695
|
-
appleStandTime: HKQuantityTypeIdentifier.appleStandTime;
|
|
696
|
-
heartRate: HKQuantityTypeIdentifier.heartRate;
|
|
697
|
-
bodyTemperature: HKQuantityTypeIdentifier.bodyTemperature;
|
|
698
|
-
basalBodyTemperature: HKQuantityTypeIdentifier.basalBodyTemperature;
|
|
699
|
-
bloodPressureSystolic: HKQuantityTypeIdentifier.bloodPressureSystolic;
|
|
700
|
-
bloodPressureDiastolic: HKQuantityTypeIdentifier.bloodPressureDiastolic;
|
|
701
|
-
respiratoryRate: HKQuantityTypeIdentifier.respiratoryRate;
|
|
702
|
-
restingHeartRate: HKQuantityTypeIdentifier.restingHeartRate;
|
|
703
|
-
walkingHeartRateAverage: HKQuantityTypeIdentifier.walkingHeartRateAverage;
|
|
704
|
-
heartRateVariabilitySDNN: HKQuantityTypeIdentifier.heartRateVariabilitySDNN;
|
|
705
|
-
oxygenSaturation: HKQuantityTypeIdentifier.oxygenSaturation;
|
|
706
|
-
peripheralPerfusionIndex: HKQuantityTypeIdentifier.peripheralPerfusionIndex;
|
|
707
|
-
bloodGlucose: HKQuantityTypeIdentifier.bloodGlucose;
|
|
708
|
-
numberOfTimesFallen: HKQuantityTypeIdentifier.numberOfTimesFallen;
|
|
709
|
-
electrodermalActivity: HKQuantityTypeIdentifier.electrodermalActivity;
|
|
710
|
-
inhalerUsage: HKQuantityTypeIdentifier.inhalerUsage;
|
|
711
|
-
insulinDelivery: HKQuantityTypeIdentifier.insulinDelivery;
|
|
712
|
-
bloodAlcoholContent: HKQuantityTypeIdentifier.bloodAlcoholContent;
|
|
713
|
-
forcedVitalCapacity: HKQuantityTypeIdentifier.forcedVitalCapacity;
|
|
714
|
-
forcedExpiratoryVolume1: HKQuantityTypeIdentifier.forcedExpiratoryVolume1;
|
|
715
|
-
peakExpiratoryFlowRate: HKQuantityTypeIdentifier.peakExpiratoryFlowRate;
|
|
716
|
-
environmentalAudioExposure: HKQuantityTypeIdentifier.environmentalAudioExposure;
|
|
717
|
-
headphoneAudioExposure: HKQuantityTypeIdentifier.headphoneAudioExposure;
|
|
718
|
-
dietaryFatTotal: HKQuantityTypeIdentifier.dietaryFatTotal;
|
|
719
|
-
dietaryFatPolyunsaturated: HKQuantityTypeIdentifier.dietaryFatPolyunsaturated;
|
|
720
|
-
dietaryFatMonounsaturated: HKQuantityTypeIdentifier.dietaryFatMonounsaturated;
|
|
721
|
-
dietaryFatSaturated: HKQuantityTypeIdentifier.dietaryFatSaturated;
|
|
722
|
-
dietaryCholesterol: HKQuantityTypeIdentifier.dietaryCholesterol;
|
|
723
|
-
dietarySodium: HKQuantityTypeIdentifier.dietarySodium;
|
|
724
|
-
dietaryCarbohydrates: HKQuantityTypeIdentifier.dietaryCarbohydrates;
|
|
725
|
-
dietaryFiber: HKQuantityTypeIdentifier.dietaryFiber;
|
|
726
|
-
dietarySugar: HKQuantityTypeIdentifier.dietarySugar;
|
|
727
|
-
dietaryEnergyConsumed: HKQuantityTypeIdentifier.dietaryEnergyConsumed;
|
|
728
|
-
dietaryProtein: HKQuantityTypeIdentifier.dietaryProtein;
|
|
729
|
-
dietaryVitaminA: HKQuantityTypeIdentifier.dietaryVitaminA;
|
|
730
|
-
dietaryVitaminB6: HKQuantityTypeIdentifier.dietaryVitaminB6;
|
|
731
|
-
dietaryVitaminB12: HKQuantityTypeIdentifier.dietaryVitaminB12;
|
|
732
|
-
dietaryVitaminC: HKQuantityTypeIdentifier.dietaryVitaminC;
|
|
733
|
-
dietaryVitaminD: HKQuantityTypeIdentifier.dietaryVitaminD;
|
|
734
|
-
dietaryVitaminE: HKQuantityTypeIdentifier.dietaryVitaminE;
|
|
735
|
-
dietaryVitaminK: HKQuantityTypeIdentifier.dietaryVitaminK;
|
|
736
|
-
dietaryCalcium: HKQuantityTypeIdentifier.dietaryCalcium;
|
|
737
|
-
dietaryIron: HKQuantityTypeIdentifier.dietaryIron;
|
|
738
|
-
dietaryThiamin: HKQuantityTypeIdentifier.dietaryThiamin;
|
|
739
|
-
dietaryRiboflavin: HKQuantityTypeIdentifier.dietaryRiboflavin;
|
|
740
|
-
dietaryNiacin: HKQuantityTypeIdentifier.dietaryNiacin;
|
|
741
|
-
dietaryFolate: HKQuantityTypeIdentifier.dietaryFolate;
|
|
742
|
-
dietaryBiotin: HKQuantityTypeIdentifier.dietaryBiotin;
|
|
743
|
-
dietaryPantothenicAcid: HKQuantityTypeIdentifier.dietaryPantothenicAcid;
|
|
744
|
-
dietaryPhosphorus: HKQuantityTypeIdentifier.dietaryPhosphorus;
|
|
745
|
-
dietaryIodine: HKQuantityTypeIdentifier.dietaryIodine;
|
|
746
|
-
dietaryMagnesium: HKQuantityTypeIdentifier.dietaryMagnesium;
|
|
747
|
-
dietaryZinc: HKQuantityTypeIdentifier.dietaryZinc;
|
|
748
|
-
dietarySelenium: HKQuantityTypeIdentifier.dietarySelenium;
|
|
749
|
-
dietaryCopper: HKQuantityTypeIdentifier.dietaryCopper;
|
|
750
|
-
dietaryManganese: HKQuantityTypeIdentifier.dietaryManganese;
|
|
751
|
-
dietaryChromium: HKQuantityTypeIdentifier.dietaryChromium;
|
|
752
|
-
dietaryMolybdenum: HKQuantityTypeIdentifier.dietaryMolybdenum;
|
|
753
|
-
dietaryChloride: HKQuantityTypeIdentifier.dietaryChloride;
|
|
754
|
-
dietaryPotassium: HKQuantityTypeIdentifier.dietaryPotassium;
|
|
755
|
-
dietaryCaffeine: HKQuantityTypeIdentifier.dietaryCaffeine;
|
|
756
|
-
dietaryWater: HKQuantityTypeIdentifier.dietaryWater;
|
|
757
|
-
sixMinuteWalkTestDistance: HKQuantityTypeIdentifier.sixMinuteWalkTestDistance;
|
|
758
|
-
walkingSpeed: HKQuantityTypeIdentifier.walkingSpeed;
|
|
759
|
-
walkingStepLength: HKQuantityTypeIdentifier.walkingStepLength;
|
|
760
|
-
walkingAsymmetryPercentage: HKQuantityTypeIdentifier.walkingAsymmetryPercentage;
|
|
761
|
-
walkingDoubleSupportPercentage: HKQuantityTypeIdentifier.walkingDoubleSupportPercentage;
|
|
762
|
-
stairAscentSpeed: HKQuantityTypeIdentifier.stairAscentSpeed;
|
|
763
|
-
stairDescentSpeed: HKQuantityTypeIdentifier.stairDescentSpeed;
|
|
764
|
-
uvExposure: HKQuantityTypeIdentifier.uvExposure;
|
|
765
|
-
bloodPressure: HKCorrelationTypeIdentifier.bloodPressure;
|
|
766
|
-
food: HKCorrelationTypeIdentifier.food;
|
|
767
|
-
sleepAnalysis: HKCategoryTypeIdentifier.sleepAnalysis;
|
|
768
|
-
appleStandHour: HKCategoryTypeIdentifier.appleStandHour;
|
|
769
|
-
cervicalMucusQuality: HKCategoryTypeIdentifier.cervicalMucusQuality;
|
|
770
|
-
ovulationTestResult: HKCategoryTypeIdentifier.ovulationTestResult;
|
|
771
|
-
menstrualFlow: HKCategoryTypeIdentifier.menstrualFlow;
|
|
772
|
-
intermenstrualBleeding: HKCategoryTypeIdentifier.intermenstrualBleeding;
|
|
773
|
-
sexualActivity: HKCategoryTypeIdentifier.sexualActivity;
|
|
774
|
-
mindfulSession: HKCategoryTypeIdentifier.mindfulSession;
|
|
775
|
-
highHeartRateEvent: HKCategoryTypeIdentifier.highHeartRateEvent;
|
|
776
|
-
lowHeartRateEvent: HKCategoryTypeIdentifier.lowHeartRateEvent;
|
|
777
|
-
irregularHeartRhythmEvent: HKCategoryTypeIdentifier.irregularHeartRhythmEvent;
|
|
778
|
-
audioExposureEvent: HKCategoryTypeIdentifier.audioExposureEvent;
|
|
779
|
-
toothbrushingEvent: HKCategoryTypeIdentifier.toothbrushingEvent;
|
|
780
|
-
fitzpatrickSkinType: HKCharacteristicTypeIdentifier.fitzpatrickSkinType;
|
|
781
|
-
biologicalSex: HKCharacteristicTypeIdentifier.biologicalSex;
|
|
782
|
-
bloodType: HKCharacteristicTypeIdentifier.bloodType;
|
|
783
|
-
dateOfBirth: HKCharacteristicTypeIdentifier.dateOfBirth;
|
|
784
|
-
wheelchairUse: HKCharacteristicTypeIdentifier.wheelchairUse;
|
|
785
|
-
};
|
|
786
565
|
declare type ReactNativeHealthkitTypeNative = {
|
|
787
566
|
isHealthDataAvailable(): Promise<boolean>;
|
|
788
567
|
getBloodType(): Promise<HKBloodType>;
|
|
@@ -790,15 +569,15 @@ declare type ReactNativeHealthkitTypeNative = {
|
|
|
790
569
|
getBiologicalSex(): Promise<HKBiologicalSex>;
|
|
791
570
|
getFitzpatrickSkinType(): Promise<HKFitzpatrickSkinType>;
|
|
792
571
|
readonly getWheelchairUse: () => Promise<HKWheelchairUse>;
|
|
793
|
-
readonly enableBackgroundDelivery: (typeIdentifier:
|
|
794
|
-
readonly disableBackgroundDelivery: (typeIdentifier:
|
|
572
|
+
readonly enableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier, updateFrequency: HKUpdateFrequency) => Promise<boolean>;
|
|
573
|
+
readonly disableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier) => Promise<boolean>;
|
|
795
574
|
readonly disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
796
575
|
readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, samples: readonly Omit<HKCategorySampleRaw | HKQuantitySampleRaw, 'device' | 'endDate' | 'startDate' | 'uuid'>[], start: string, end: string, metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>) => Promise<boolean>;
|
|
797
576
|
readonly saveWorkoutSample: (typeIdentifier: HKWorkoutActivityType, quantities: readonly Omit<HKQuantitySampleRaw, 'device' | 'endDate' | 'startDate' | 'uuid'>[], start: string, end: string, metadata: HKWorkoutMetadata) => Promise<boolean>;
|
|
798
577
|
readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, from: string, to: string) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;
|
|
799
|
-
subscribeToObserverQuery(identifier:
|
|
578
|
+
subscribeToObserverQuery(identifier: HKSampleTypeIdentifier): Promise<QueryId>;
|
|
800
579
|
unsubscribeQuery(queryId: QueryId): Promise<boolean>;
|
|
801
|
-
authorizationStatusFor(type:
|
|
580
|
+
authorizationStatusFor(type: HealthkitReadAuthorization): Promise<boolean>;
|
|
802
581
|
getRequestStatusForAuthorization(write: WritePermissions, read: ReadPermissions): Promise<HKAuthorizationRequestStatus>;
|
|
803
582
|
requestAuthorization(write: WritePermissions, read: ReadPermissions): Promise<boolean>;
|
|
804
583
|
readonly saveQuantitySample: (identifier: HKQuantityTypeIdentifier, unit: HKUnit, value: number, start: string, end: string, metadata: unknown) => Promise<boolean>;
|
|
@@ -812,7 +591,7 @@ declare type ReactNativeHealthkitTypeNative = {
|
|
|
812
591
|
};
|
|
813
592
|
declare const Native: ReactNativeHealthkitTypeNative;
|
|
814
593
|
declare type OnChangeCallback = ({ typeIdentifier, }: {
|
|
815
|
-
readonly typeIdentifier:
|
|
594
|
+
readonly typeIdentifier: HKSampleTypeIdentifier;
|
|
816
595
|
}) => void;
|
|
817
596
|
interface HealthkitEventEmitter extends NativeEventEmitter {
|
|
818
597
|
readonly addListener: (eventType: 'onChange', callback: OnChangeCallback) => EmitterSubscription;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HealthkitReadAuthorization, HealthkitWriteAuthorization, HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKCategorySampleRaw, HKCategoryTypeIdentifier, HKCategoryValueForIdentifier, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKFitzpatrickSkinType, HKQuantitySampleRaw, HKQuantityTypeIdentifier, HKStatisticsOptions, HKUnit, HKUnitSI, HKUnitSIPrefix, HKUpdateFrequency, HKWheelchairUse, HKWorkoutActivityType, HKWorkoutMetadata, HKWorkoutRaw, MetadataMapperForCategoryIdentifier, MetadataMapperForCorrelationIdentifier, MetadataMapperForQuantityIdentifier, QueryStatisticsResponseRaw,
|
|
1
|
+
import type { HealthkitReadAuthorization, HealthkitWriteAuthorization, HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKCategorySampleRaw, HKCategoryTypeIdentifier, HKCategoryValueForIdentifier, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKFitzpatrickSkinType, HKQuantitySampleRaw, HKQuantityTypeIdentifier, HKSampleTypeIdentifier, HKStatisticsOptions, HKUnit, HKUnitSI, HKUnitSIPrefix, HKUpdateFrequency, HKWheelchairUse, HKWorkoutActivityType, HKWorkoutMetadata, HKWorkoutRaw, MetadataMapperForCategoryIdentifier, MetadataMapperForCorrelationIdentifier, MetadataMapperForQuantityIdentifier, QueryStatisticsResponseRaw, WorkoutRoute } from './native-types';
|
|
2
2
|
export interface QueryWorkoutsOptions<TEnergy extends HKUnit, TDistance extends HKUnit> extends GenericQueryOptions {
|
|
3
3
|
readonly energyUnit?: TEnergy;
|
|
4
4
|
readonly distanceUnit?: TDistance;
|
|
@@ -48,7 +48,7 @@ export declare type SaveQuantitySampleFn = <TUnit extends HKQuantityTypeIdentifi
|
|
|
48
48
|
export declare type QueryQuantitySamplesFn = <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends HKUnit = HKUnit>(identifier: TIdentifier, options: GenericQueryOptions & {
|
|
49
49
|
readonly unit?: TUnit;
|
|
50
50
|
}) => Promise<readonly HKQuantitySample<TIdentifier, TUnit>[]>;
|
|
51
|
-
export declare type SubscribeToChangesFn = (identifier:
|
|
51
|
+
export declare type SubscribeToChangesFn = (identifier: HKSampleTypeIdentifier, callback: () => void) => Promise<UnsubscribeFunction>;
|
|
52
52
|
export declare type SaveCategorySampleFn = <T extends HKCategoryTypeIdentifier>(identifier: T, value: HKCategoryValueForIdentifier<T>, options?: {
|
|
53
53
|
readonly start?: Date;
|
|
54
54
|
readonly end?: Date;
|
|
@@ -78,7 +78,7 @@ export interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>
|
|
|
78
78
|
readonly endDate: Date;
|
|
79
79
|
}
|
|
80
80
|
export declare type QueryCorrelationSamplesFn = <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, options: Omit<GenericQueryOptions, 'ascending' | 'limit'>) => Promise<readonly HKCorrelation<TIdentifier>[]>;
|
|
81
|
-
export declare type SubscribeToChangesHook = <TIdentifier extends
|
|
81
|
+
export declare type SubscribeToChangesHook = <TIdentifier extends HKSampleTypeIdentifier>(identifier: TIdentifier, onChange: () => void, runInitialUpdate?: boolean) => void;
|
|
82
82
|
export declare type GetWorkoutRoutesFn = (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;
|
|
83
83
|
export declare type ReactNativeHealthkit = {
|
|
84
84
|
readonly authorizationStatusFor: AuthorizationStatusForFn;
|
|
@@ -106,8 +106,8 @@ export declare type ReactNativeHealthkit = {
|
|
|
106
106
|
readonly saveQuantitySample: SaveQuantitySampleFn;
|
|
107
107
|
readonly saveCorrelationSample: SaveCorrelationSampleFn;
|
|
108
108
|
readonly saveWorkoutSample: SaveWorkoutSampleFn;
|
|
109
|
-
readonly enableBackgroundDelivery: (typeIdentifier:
|
|
110
|
-
readonly disableBackgroundDelivery: (typeIdentifier:
|
|
109
|
+
readonly enableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier, updateFrequency: HKUpdateFrequency) => Promise<boolean>;
|
|
110
|
+
readonly disableBackgroundDelivery: (typeIdentifier: HKSampleTypeIdentifier) => Promise<boolean>;
|
|
111
111
|
readonly disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
112
112
|
readonly subscribeToChanges: SubscribeToChangesFn;
|
|
113
113
|
readonly useMostRecentWorkout: MostRecentWorkoutHook;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kingstinct/react-native-healthkit",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.3",
|
|
4
4
|
"description": "React Native bindings for HealthKit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -73,7 +73,6 @@
|
|
|
73
73
|
"react-native": "0.68",
|
|
74
74
|
"react-native-builder-bob": "^0.18.1",
|
|
75
75
|
"release-it": "14",
|
|
76
|
-
"type-fest": "^2.18.0",
|
|
77
76
|
"typescript": ">=4"
|
|
78
77
|
},
|
|
79
78
|
"peerDependencies": {
|
package/src/index.ios.tsx
CHANGED
|
@@ -21,8 +21,8 @@ import type {
|
|
|
21
21
|
HKWorkoutRaw,
|
|
22
22
|
MetadataMapperForCategoryIdentifier,
|
|
23
23
|
ReadPermissions,
|
|
24
|
-
SampleTypeIdentifier,
|
|
25
24
|
WritePermissions,
|
|
25
|
+
HKSampleTypeIdentifier,
|
|
26
26
|
} from './native-types'
|
|
27
27
|
import type {
|
|
28
28
|
GenericQueryOptions,
|
|
@@ -236,7 +236,7 @@ const getMostRecentCategorySample: GetMostRecentCategorySampleFn = async (
|
|
|
236
236
|
return samples[0]
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
function useSubscribeToChanges<TIdentifier extends
|
|
239
|
+
function useSubscribeToChanges<TIdentifier extends HKSampleTypeIdentifier>(
|
|
240
240
|
identifier: TIdentifier,
|
|
241
241
|
onChange: () => void,
|
|
242
242
|
): void {
|
package/src/native-types.ts
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
} from 'react-native'
|
|
5
5
|
|
|
6
6
|
import type { EmitterSubscription } from 'react-native'
|
|
7
|
-
import type { ValueOf } from 'type-fest'
|
|
8
7
|
|
|
9
8
|
export const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier' as const
|
|
10
9
|
export const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier' as const
|
|
@@ -151,20 +150,20 @@ export enum HKCategoryTypeIdentifier {
|
|
|
151
150
|
toothbrushingEvent = 'HKCategoryTypeIdentifierToothbrushingEvent',
|
|
152
151
|
}
|
|
153
152
|
|
|
154
|
-
export
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
export type HealthkitReadAuthorization =
|
|
167
|
-
export type HealthkitWriteAuthorization =
|
|
153
|
+
export type HKSampleTypeIdentifier =
|
|
154
|
+
HKCategoryTypeIdentifier
|
|
155
|
+
| HKCorrelationTypeIdentifier
|
|
156
|
+
| HKQuantityTypeIdentifier
|
|
157
|
+
| typeof HKAudiogramTypeIdentifier
|
|
158
|
+
| typeof HKDataTypeIdentifierHeartbeatSeries
|
|
159
|
+
| typeof HKWorkoutRouteTypeIdentifier
|
|
160
|
+
| typeof HKWorkoutTypeIdentifier
|
|
161
|
+
| `${HKCategoryTypeIdentifier}`
|
|
162
|
+
| `${HKCorrelationTypeIdentifier}`
|
|
163
|
+
| `${HKQuantityTypeIdentifier}`
|
|
164
|
+
|
|
165
|
+
export type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`
|
|
166
|
+
export type HealthkitWriteAuthorization = HKSampleTypeIdentifier
|
|
168
167
|
|
|
169
168
|
export enum HKCategoryValueAppleStandHour {
|
|
170
169
|
stood = 0,
|
|
@@ -301,11 +300,19 @@ export enum HKWeatherCondition {
|
|
|
301
300
|
tornado = 27,
|
|
302
301
|
}
|
|
303
302
|
|
|
303
|
+
enum HKIndoorWorkout {
|
|
304
|
+
false = 0,
|
|
305
|
+
true = 1,
|
|
306
|
+
}
|
|
307
|
+
|
|
304
308
|
export interface HKWorkoutMetadata
|
|
305
309
|
extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {
|
|
306
310
|
readonly HKWeatherCondition?: HKWeatherCondition;
|
|
307
311
|
readonly HKWeatherHumidity?: HKQuantity<HKUnit.Percent>;
|
|
308
312
|
// HKWeatherTemperature: HKQuantity<TTemperatureUnit>
|
|
313
|
+
readonly HKAverageMETs?: HKQuantity<HKUnit>,
|
|
314
|
+
readonly HKElevationAscended?: HKQuantity<HKUnit.Meters>,
|
|
315
|
+
readonly HKIndoorWorkout?: HKIndoorWorkout,
|
|
309
316
|
}
|
|
310
317
|
|
|
311
318
|
export enum HKAuthorizationRequestStatus {
|
|
@@ -581,13 +588,13 @@ export enum HKUnit {
|
|
|
581
588
|
}
|
|
582
589
|
|
|
583
590
|
export type HKDevice = {
|
|
584
|
-
readonly name: string;
|
|
585
|
-
readonly firmwareVersion: string;
|
|
586
|
-
readonly hardwareVersion: string;
|
|
587
|
-
readonly localIdentifier: string;
|
|
588
|
-
readonly manufacturer: string;
|
|
589
|
-
readonly model: string;
|
|
590
|
-
readonly softwareVersion: string;
|
|
591
|
+
readonly name: string; // ex: "Apple Watch"
|
|
592
|
+
readonly firmwareVersion: string | null;
|
|
593
|
+
readonly hardwareVersion: string; // ex: "Watch6,2",
|
|
594
|
+
readonly localIdentifier: string | null;
|
|
595
|
+
readonly manufacturer: string; // ex: "Apple Inc."
|
|
596
|
+
readonly model: string; // ex: "Watch"
|
|
597
|
+
readonly softwareVersion: string; // ex: "9.0"
|
|
591
598
|
};
|
|
592
599
|
|
|
593
600
|
export type HKSource = {
|
|
@@ -697,8 +704,6 @@ export type WorkoutRoute = {
|
|
|
697
704
|
readonly HKMetadataKeySyncVersion?: number;
|
|
698
705
|
};
|
|
699
706
|
|
|
700
|
-
export const HealthkitAuthorization = { ...HKCharacteristicTypeIdentifier, ...HKSampleTypeIdentifier }
|
|
701
|
-
|
|
702
707
|
type ReactNativeHealthkitTypeNative = {
|
|
703
708
|
isHealthDataAvailable(): Promise<boolean>;
|
|
704
709
|
getBloodType(): Promise<HKBloodType>;
|
|
@@ -708,11 +713,11 @@ type ReactNativeHealthkitTypeNative = {
|
|
|
708
713
|
readonly getWheelchairUse: () => Promise<HKWheelchairUse>;
|
|
709
714
|
|
|
710
715
|
readonly enableBackgroundDelivery: (
|
|
711
|
-
typeIdentifier:
|
|
716
|
+
typeIdentifier: HKSampleTypeIdentifier,
|
|
712
717
|
updateFrequency: HKUpdateFrequency
|
|
713
718
|
) => Promise<boolean>;
|
|
714
719
|
readonly disableBackgroundDelivery: (
|
|
715
|
-
typeIdentifier:
|
|
720
|
+
typeIdentifier: HKSampleTypeIdentifier,
|
|
716
721
|
) => Promise<boolean>;
|
|
717
722
|
readonly disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
718
723
|
|
|
@@ -745,11 +750,11 @@ type ReactNativeHealthkitTypeNative = {
|
|
|
745
750
|
) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;
|
|
746
751
|
|
|
747
752
|
subscribeToObserverQuery(
|
|
748
|
-
identifier:
|
|
753
|
+
identifier: HKSampleTypeIdentifier
|
|
749
754
|
): Promise<QueryId>;
|
|
750
755
|
unsubscribeQuery(queryId: QueryId): Promise<boolean>;
|
|
751
756
|
authorizationStatusFor(
|
|
752
|
-
type:
|
|
757
|
+
type: HealthkitReadAuthorization
|
|
753
758
|
): Promise<boolean>;
|
|
754
759
|
getRequestStatusForAuthorization(
|
|
755
760
|
write: WritePermissions,
|
|
@@ -818,7 +823,7 @@ const Native = NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNat
|
|
|
818
823
|
type OnChangeCallback = ({
|
|
819
824
|
typeIdentifier,
|
|
820
825
|
}: {
|
|
821
|
-
readonly typeIdentifier:
|
|
826
|
+
readonly typeIdentifier: HKSampleTypeIdentifier;
|
|
822
827
|
}) => void;
|
|
823
828
|
|
|
824
829
|
interface HealthkitEventEmitter extends NativeEventEmitter {
|
package/src/types.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
HKFitzpatrickSkinType,
|
|
13
13
|
HKQuantitySampleRaw,
|
|
14
14
|
HKQuantityTypeIdentifier,
|
|
15
|
+
HKSampleTypeIdentifier,
|
|
15
16
|
HKStatisticsOptions,
|
|
16
17
|
HKUnit,
|
|
17
18
|
HKUnitSI,
|
|
@@ -25,7 +26,6 @@ import type {
|
|
|
25
26
|
MetadataMapperForCorrelationIdentifier,
|
|
26
27
|
MetadataMapperForQuantityIdentifier,
|
|
27
28
|
QueryStatisticsResponseRaw,
|
|
28
|
-
SampleTypeIdentifier,
|
|
29
29
|
WorkoutRoute,
|
|
30
30
|
} from './native-types'
|
|
31
31
|
|
|
@@ -143,7 +143,7 @@ export type QueryQuantitySamplesFn = <
|
|
|
143
143
|
) => Promise<readonly HKQuantitySample<TIdentifier, TUnit>[]>;
|
|
144
144
|
|
|
145
145
|
export type SubscribeToChangesFn = (
|
|
146
|
-
identifier:
|
|
146
|
+
identifier: HKSampleTypeIdentifier,
|
|
147
147
|
callback: () => void
|
|
148
148
|
) => Promise<UnsubscribeFunction>;
|
|
149
149
|
|
|
@@ -263,7 +263,7 @@ export type QueryCorrelationSamplesFn = <
|
|
|
263
263
|
) => Promise<readonly HKCorrelation<TIdentifier>[]>;
|
|
264
264
|
|
|
265
265
|
export type SubscribeToChangesHook = <
|
|
266
|
-
TIdentifier extends
|
|
266
|
+
TIdentifier extends HKSampleTypeIdentifier
|
|
267
267
|
>(
|
|
268
268
|
identifier: TIdentifier,
|
|
269
269
|
onChange: () => void,
|
|
@@ -307,11 +307,11 @@ export type ReactNativeHealthkit = {
|
|
|
307
307
|
readonly saveCorrelationSample: SaveCorrelationSampleFn;
|
|
308
308
|
readonly saveWorkoutSample: SaveWorkoutSampleFn;
|
|
309
309
|
readonly enableBackgroundDelivery: (
|
|
310
|
-
typeIdentifier:
|
|
310
|
+
typeIdentifier: HKSampleTypeIdentifier,
|
|
311
311
|
updateFrequency: HKUpdateFrequency
|
|
312
312
|
) => Promise<boolean>;
|
|
313
313
|
readonly disableBackgroundDelivery: (
|
|
314
|
-
typeIdentifier:
|
|
314
|
+
typeIdentifier: HKSampleTypeIdentifier
|
|
315
315
|
) => Promise<boolean>;
|
|
316
316
|
readonly disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
317
317
|
|