@kingstinct/react-native-healthkit 4.2.0 → 4.3.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 +1 -1
- package/ios/ReactNativeHealthkit.m +6 -1
- package/ios/ReactNativeHealthkit.swift +363 -174
- package/lib/commonjs/index.ios.js +9 -4
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +9 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-types.js +10 -1
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js +4 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/example/App.js +197 -0
- package/lib/index.ios.js +310 -0
- package/lib/index.js +44 -0
- package/lib/module/index.ios.js +9 -4
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-types.js +9 -1
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/native-types.js +447 -0
- package/lib/src/index.ios.js +314 -0
- package/lib/src/index.js +45 -0
- package/lib/src/native-types.js +453 -0
- package/lib/src/types.js +1 -0
- package/lib/types.js +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.ios.d.ts +1 -1
- package/lib/typescript/src/native-types.d.ts +22 -1
- package/lib/typescript/src/types.d.ts +3 -1
- package/package.json +1 -1
- package/src/index.ios.tsx +9 -2
- package/src/index.tsx +2 -1
- package/src/native-types.ts +26 -2
- package/src/types.ts +8 -2
- package/.DS_Store +0 -0
- package/.circleci/config.yml +0 -98
- package/.editorconfig +0 -15
- package/.gitattributes +0 -3
- package/.github/workflows/main.yml +0 -32
- package/.gitignore +0 -60
- package/CONTRIBUTING.md +0 -184
- package/babel.config.js +0 -3
- package/example-expo/.expo/README.md +0 -15
- package/example-expo/.expo/devices.json +0 -8
- package/example-expo/.expo/packager-info.json +0 -5
- package/example-expo/.expo/settings.json +0 -9
- package/example-expo/.expo-shared/assets.json +0 -4
- package/example-expo/.gitignore +0 -14
- package/example-expo/App.tsx +0 -376
- package/example-expo/app.json +0 -43
- package/example-expo/assets/adaptive-icon.png +0 -0
- package/example-expo/assets/favicon.png +0 -0
- package/example-expo/assets/icon.png +0 -0
- package/example-expo/assets/splash.png +0 -0
- package/example-expo/babel.config.js +0 -8
- package/example-expo/build-1653040579600.ipa +0 -0
- package/example-expo/build-1653041063216.ipa +0 -0
- package/example-expo/eas.json +0 -18
- package/example-expo/package.json +0 -32
- package/example-expo/tsconfig.json +0 -6
- package/example-expo/yarn.lock +0 -6857
- package/lib/typescript/example-expo/App.d.ts +0 -3
- package/lib/typescript/src/__tests__/index.test.d.ts +0 -0
- package/src/__tests__/index.test.tsx +0 -1
- package/tsconfig.json +0 -27
- package/yarn.lock +0 -10241
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import { NativeEventEmitter, NativeModules, } from 'react-native';
|
|
2
|
+
export var HKHeartRateMotionContext;
|
|
3
|
+
(function (HKHeartRateMotionContext) {
|
|
4
|
+
HKHeartRateMotionContext[HKHeartRateMotionContext["active"] = 2] = "active";
|
|
5
|
+
HKHeartRateMotionContext[HKHeartRateMotionContext["notSet"] = 0] = "notSet";
|
|
6
|
+
HKHeartRateMotionContext[HKHeartRateMotionContext["sedentary"] = 1] = "sedentary";
|
|
7
|
+
})(HKHeartRateMotionContext || (HKHeartRateMotionContext = {}));
|
|
8
|
+
export var HKCategoryTypeIdentifier;
|
|
9
|
+
(function (HKCategoryTypeIdentifier) {
|
|
10
|
+
HKCategoryTypeIdentifier["sleepAnalysis"] = "HKCategoryTypeIdentifierSleepAnalysis";
|
|
11
|
+
HKCategoryTypeIdentifier["appleStandHour"] = "HKCategoryTypeIdentifierAppleStandHour";
|
|
12
|
+
HKCategoryTypeIdentifier["cervicalMucusQuality"] = "HKCategoryTypeIdentifierCervicalMucusQuality";
|
|
13
|
+
HKCategoryTypeIdentifier["ovulationTestResult"] = "HKCategoryTypeIdentifierOvulationTestResult";
|
|
14
|
+
HKCategoryTypeIdentifier["menstrualFlow"] = "HKCategoryTypeIdentifierMenstrualFlow";
|
|
15
|
+
HKCategoryTypeIdentifier["intermenstrualBleeding"] = "HKCategoryTypeIdentifierIntermenstrualBleeding";
|
|
16
|
+
HKCategoryTypeIdentifier["sexualActivity"] = "HKCategoryTypeIdentifierSexualActivity";
|
|
17
|
+
HKCategoryTypeIdentifier["mindfulSession"] = "HKCategoryTypeIdentifierMindfulSession";
|
|
18
|
+
HKCategoryTypeIdentifier["highHeartRateEvent"] = "HKCategoryTypeIdentifierHighHeartRateEvent";
|
|
19
|
+
HKCategoryTypeIdentifier["lowHeartRateEvent"] = "HKCategoryTypeIdentifierLowHeartRateEvent";
|
|
20
|
+
HKCategoryTypeIdentifier["irregularHeartRhythmEvent"] = "HKCategoryTypeIdentifierIrregularHeartRhythmEvent";
|
|
21
|
+
HKCategoryTypeIdentifier["audioExposureEvent"] = "HKCategoryTypeIdentifierAudioExposureEvent";
|
|
22
|
+
HKCategoryTypeIdentifier["toothbrushingEvent"] = "HKCategoryTypeIdentifierToothbrushingEvent";
|
|
23
|
+
})(HKCategoryTypeIdentifier || (HKCategoryTypeIdentifier = {}));
|
|
24
|
+
export var HKCategoryValueAppleStandHour;
|
|
25
|
+
(function (HKCategoryValueAppleStandHour) {
|
|
26
|
+
HKCategoryValueAppleStandHour[HKCategoryValueAppleStandHour["stood"] = 0] = "stood";
|
|
27
|
+
HKCategoryValueAppleStandHour[HKCategoryValueAppleStandHour["idle"] = 1] = "idle";
|
|
28
|
+
})(HKCategoryValueAppleStandHour || (HKCategoryValueAppleStandHour = {}));
|
|
29
|
+
export var HKWorkoutActivityType;
|
|
30
|
+
(function (HKWorkoutActivityType) {
|
|
31
|
+
HKWorkoutActivityType[HKWorkoutActivityType["americanFootball"] = 1] = "americanFootball";
|
|
32
|
+
HKWorkoutActivityType[HKWorkoutActivityType["archery"] = 2] = "archery";
|
|
33
|
+
HKWorkoutActivityType[HKWorkoutActivityType["australianFootball"] = 3] = "australianFootball";
|
|
34
|
+
HKWorkoutActivityType[HKWorkoutActivityType["badminton"] = 4] = "badminton";
|
|
35
|
+
HKWorkoutActivityType[HKWorkoutActivityType["baseball"] = 5] = "baseball";
|
|
36
|
+
HKWorkoutActivityType[HKWorkoutActivityType["basketball"] = 6] = "basketball";
|
|
37
|
+
HKWorkoutActivityType[HKWorkoutActivityType["bowling"] = 7] = "bowling";
|
|
38
|
+
HKWorkoutActivityType[HKWorkoutActivityType["boxing"] = 8] = "boxing";
|
|
39
|
+
HKWorkoutActivityType[HKWorkoutActivityType["climbing"] = 9] = "climbing";
|
|
40
|
+
HKWorkoutActivityType[HKWorkoutActivityType["cricket"] = 10] = "cricket";
|
|
41
|
+
HKWorkoutActivityType[HKWorkoutActivityType["crossTraining"] = 11] = "crossTraining";
|
|
42
|
+
HKWorkoutActivityType[HKWorkoutActivityType["curling"] = 12] = "curling";
|
|
43
|
+
HKWorkoutActivityType[HKWorkoutActivityType["cycling"] = 13] = "cycling";
|
|
44
|
+
HKWorkoutActivityType[HKWorkoutActivityType["dance"] = 14] = "dance";
|
|
45
|
+
HKWorkoutActivityType[HKWorkoutActivityType["danceInspiredTraining"] = 15] = "danceInspiredTraining";
|
|
46
|
+
HKWorkoutActivityType[HKWorkoutActivityType["elliptical"] = 16] = "elliptical";
|
|
47
|
+
HKWorkoutActivityType[HKWorkoutActivityType["equestrianSports"] = 17] = "equestrianSports";
|
|
48
|
+
HKWorkoutActivityType[HKWorkoutActivityType["fencing"] = 18] = "fencing";
|
|
49
|
+
HKWorkoutActivityType[HKWorkoutActivityType["fishing"] = 19] = "fishing";
|
|
50
|
+
HKWorkoutActivityType[HKWorkoutActivityType["functionalStrengthTraining"] = 20] = "functionalStrengthTraining";
|
|
51
|
+
HKWorkoutActivityType[HKWorkoutActivityType["golf"] = 21] = "golf";
|
|
52
|
+
HKWorkoutActivityType[HKWorkoutActivityType["gymnastics"] = 22] = "gymnastics";
|
|
53
|
+
HKWorkoutActivityType[HKWorkoutActivityType["handball"] = 23] = "handball";
|
|
54
|
+
HKWorkoutActivityType[HKWorkoutActivityType["hiking"] = 24] = "hiking";
|
|
55
|
+
HKWorkoutActivityType[HKWorkoutActivityType["hockey"] = 25] = "hockey";
|
|
56
|
+
HKWorkoutActivityType[HKWorkoutActivityType["hunting"] = 26] = "hunting";
|
|
57
|
+
HKWorkoutActivityType[HKWorkoutActivityType["lacrosse"] = 27] = "lacrosse";
|
|
58
|
+
HKWorkoutActivityType[HKWorkoutActivityType["martialArts"] = 28] = "martialArts";
|
|
59
|
+
HKWorkoutActivityType[HKWorkoutActivityType["mindAndBody"] = 29] = "mindAndBody";
|
|
60
|
+
HKWorkoutActivityType[HKWorkoutActivityType["mixedMetabolicCardioTraining"] = 30] = "mixedMetabolicCardioTraining";
|
|
61
|
+
HKWorkoutActivityType[HKWorkoutActivityType["paddleSports"] = 31] = "paddleSports";
|
|
62
|
+
HKWorkoutActivityType[HKWorkoutActivityType["play"] = 32] = "play";
|
|
63
|
+
HKWorkoutActivityType[HKWorkoutActivityType["preparationAndRecovery"] = 33] = "preparationAndRecovery";
|
|
64
|
+
HKWorkoutActivityType[HKWorkoutActivityType["racquetball"] = 34] = "racquetball";
|
|
65
|
+
HKWorkoutActivityType[HKWorkoutActivityType["rowing"] = 35] = "rowing";
|
|
66
|
+
HKWorkoutActivityType[HKWorkoutActivityType["rugby"] = 36] = "rugby";
|
|
67
|
+
HKWorkoutActivityType[HKWorkoutActivityType["running"] = 37] = "running";
|
|
68
|
+
HKWorkoutActivityType[HKWorkoutActivityType["sailing"] = 38] = "sailing";
|
|
69
|
+
HKWorkoutActivityType[HKWorkoutActivityType["skatingSports"] = 39] = "skatingSports";
|
|
70
|
+
HKWorkoutActivityType[HKWorkoutActivityType["snowSports"] = 40] = "snowSports";
|
|
71
|
+
HKWorkoutActivityType[HKWorkoutActivityType["soccer"] = 41] = "soccer";
|
|
72
|
+
HKWorkoutActivityType[HKWorkoutActivityType["softball"] = 42] = "softball";
|
|
73
|
+
HKWorkoutActivityType[HKWorkoutActivityType["squash"] = 43] = "squash";
|
|
74
|
+
HKWorkoutActivityType[HKWorkoutActivityType["stairClimbing"] = 44] = "stairClimbing";
|
|
75
|
+
HKWorkoutActivityType[HKWorkoutActivityType["surfingSports"] = 45] = "surfingSports";
|
|
76
|
+
HKWorkoutActivityType[HKWorkoutActivityType["swimming"] = 46] = "swimming";
|
|
77
|
+
HKWorkoutActivityType[HKWorkoutActivityType["tableTennis"] = 47] = "tableTennis";
|
|
78
|
+
HKWorkoutActivityType[HKWorkoutActivityType["tennis"] = 48] = "tennis";
|
|
79
|
+
HKWorkoutActivityType[HKWorkoutActivityType["trackAndField"] = 49] = "trackAndField";
|
|
80
|
+
HKWorkoutActivityType[HKWorkoutActivityType["traditionalStrengthTraining"] = 50] = "traditionalStrengthTraining";
|
|
81
|
+
HKWorkoutActivityType[HKWorkoutActivityType["volleyball"] = 51] = "volleyball";
|
|
82
|
+
HKWorkoutActivityType[HKWorkoutActivityType["walking"] = 52] = "walking";
|
|
83
|
+
HKWorkoutActivityType[HKWorkoutActivityType["waterFitness"] = 53] = "waterFitness";
|
|
84
|
+
HKWorkoutActivityType[HKWorkoutActivityType["waterPolo"] = 54] = "waterPolo";
|
|
85
|
+
HKWorkoutActivityType[HKWorkoutActivityType["waterSports"] = 55] = "waterSports";
|
|
86
|
+
HKWorkoutActivityType[HKWorkoutActivityType["wrestling"] = 56] = "wrestling";
|
|
87
|
+
HKWorkoutActivityType[HKWorkoutActivityType["yoga"] = 57] = "yoga";
|
|
88
|
+
HKWorkoutActivityType[HKWorkoutActivityType["barre"] = 58] = "barre";
|
|
89
|
+
HKWorkoutActivityType[HKWorkoutActivityType["coreTraining"] = 59] = "coreTraining";
|
|
90
|
+
HKWorkoutActivityType[HKWorkoutActivityType["crossCountrySkiing"] = 60] = "crossCountrySkiing";
|
|
91
|
+
HKWorkoutActivityType[HKWorkoutActivityType["downhillSkiing"] = 61] = "downhillSkiing";
|
|
92
|
+
HKWorkoutActivityType[HKWorkoutActivityType["flexibility"] = 62] = "flexibility";
|
|
93
|
+
HKWorkoutActivityType[HKWorkoutActivityType["highIntensityIntervalTraining"] = 63] = "highIntensityIntervalTraining";
|
|
94
|
+
HKWorkoutActivityType[HKWorkoutActivityType["jumpRope"] = 64] = "jumpRope";
|
|
95
|
+
HKWorkoutActivityType[HKWorkoutActivityType["kickboxing"] = 65] = "kickboxing";
|
|
96
|
+
HKWorkoutActivityType[HKWorkoutActivityType["pilates"] = 66] = "pilates";
|
|
97
|
+
HKWorkoutActivityType[HKWorkoutActivityType["snowboarding"] = 67] = "snowboarding";
|
|
98
|
+
HKWorkoutActivityType[HKWorkoutActivityType["stairs"] = 68] = "stairs";
|
|
99
|
+
HKWorkoutActivityType[HKWorkoutActivityType["stepTraining"] = 69] = "stepTraining";
|
|
100
|
+
HKWorkoutActivityType[HKWorkoutActivityType["wheelchairWalkPace"] = 70] = "wheelchairWalkPace";
|
|
101
|
+
HKWorkoutActivityType[HKWorkoutActivityType["wheelchairRunPace"] = 71] = "wheelchairRunPace";
|
|
102
|
+
HKWorkoutActivityType[HKWorkoutActivityType["taiChi"] = 72] = "taiChi";
|
|
103
|
+
HKWorkoutActivityType[HKWorkoutActivityType["mixedCardio"] = 73] = "mixedCardio";
|
|
104
|
+
HKWorkoutActivityType[HKWorkoutActivityType["handCycling"] = 74] = "handCycling";
|
|
105
|
+
HKWorkoutActivityType[HKWorkoutActivityType["discSports"] = 75] = "discSports";
|
|
106
|
+
HKWorkoutActivityType[HKWorkoutActivityType["fitnessGaming"] = 76] = "fitnessGaming";
|
|
107
|
+
HKWorkoutActivityType[HKWorkoutActivityType["other"] = 3000] = "other";
|
|
108
|
+
})(HKWorkoutActivityType || (HKWorkoutActivityType = {}));
|
|
109
|
+
// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition
|
|
110
|
+
export var HKWeatherCondition;
|
|
111
|
+
(function (HKWeatherCondition) {
|
|
112
|
+
HKWeatherCondition[HKWeatherCondition["none"] = 0] = "none";
|
|
113
|
+
HKWeatherCondition[HKWeatherCondition["clear"] = 1] = "clear";
|
|
114
|
+
HKWeatherCondition[HKWeatherCondition["fair"] = 2] = "fair";
|
|
115
|
+
HKWeatherCondition[HKWeatherCondition["partlyCloudy"] = 3] = "partlyCloudy";
|
|
116
|
+
HKWeatherCondition[HKWeatherCondition["mostlyCloudy"] = 4] = "mostlyCloudy";
|
|
117
|
+
HKWeatherCondition[HKWeatherCondition["cloudy"] = 5] = "cloudy";
|
|
118
|
+
HKWeatherCondition[HKWeatherCondition["foggy"] = 6] = "foggy";
|
|
119
|
+
HKWeatherCondition[HKWeatherCondition["haze"] = 7] = "haze";
|
|
120
|
+
HKWeatherCondition[HKWeatherCondition["windy"] = 8] = "windy";
|
|
121
|
+
HKWeatherCondition[HKWeatherCondition["blustery"] = 9] = "blustery";
|
|
122
|
+
HKWeatherCondition[HKWeatherCondition["smoky"] = 10] = "smoky";
|
|
123
|
+
HKWeatherCondition[HKWeatherCondition["dust"] = 11] = "dust";
|
|
124
|
+
HKWeatherCondition[HKWeatherCondition["snow"] = 12] = "snow";
|
|
125
|
+
HKWeatherCondition[HKWeatherCondition["hail"] = 13] = "hail";
|
|
126
|
+
HKWeatherCondition[HKWeatherCondition["sleet"] = 14] = "sleet";
|
|
127
|
+
HKWeatherCondition[HKWeatherCondition["freezingDrizzle"] = 15] = "freezingDrizzle";
|
|
128
|
+
HKWeatherCondition[HKWeatherCondition["freezingRain"] = 16] = "freezingRain";
|
|
129
|
+
HKWeatherCondition[HKWeatherCondition["mixedRainAndHail"] = 17] = "mixedRainAndHail";
|
|
130
|
+
HKWeatherCondition[HKWeatherCondition["mixedRainAndSnow"] = 18] = "mixedRainAndSnow";
|
|
131
|
+
HKWeatherCondition[HKWeatherCondition["mixedRainAndSleet"] = 19] = "mixedRainAndSleet";
|
|
132
|
+
HKWeatherCondition[HKWeatherCondition["mixedSnowAndSleet"] = 20] = "mixedSnowAndSleet";
|
|
133
|
+
HKWeatherCondition[HKWeatherCondition["drizzle"] = 21] = "drizzle";
|
|
134
|
+
HKWeatherCondition[HKWeatherCondition["scatteredShowers"] = 22] = "scatteredShowers";
|
|
135
|
+
HKWeatherCondition[HKWeatherCondition["showers"] = 23] = "showers";
|
|
136
|
+
HKWeatherCondition[HKWeatherCondition["thunderstorms"] = 24] = "thunderstorms";
|
|
137
|
+
HKWeatherCondition[HKWeatherCondition["tropicalStorm"] = 25] = "tropicalStorm";
|
|
138
|
+
HKWeatherCondition[HKWeatherCondition["hurricane"] = 26] = "hurricane";
|
|
139
|
+
HKWeatherCondition[HKWeatherCondition["tornado"] = 27] = "tornado";
|
|
140
|
+
})(HKWeatherCondition || (HKWeatherCondition = {}));
|
|
141
|
+
// Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier
|
|
142
|
+
export var HKQuantityTypeIdentifier;
|
|
143
|
+
(function (HKQuantityTypeIdentifier) {
|
|
144
|
+
HKQuantityTypeIdentifier["bodyMassIndex"] = "HKQuantityTypeIdentifierBodyMassIndex";
|
|
145
|
+
HKQuantityTypeIdentifier["bodyFatPercentage"] = "HKQuantityTypeIdentifierBodyFatPercentage";
|
|
146
|
+
HKQuantityTypeIdentifier["height"] = "HKQuantityTypeIdentifierHeight";
|
|
147
|
+
HKQuantityTypeIdentifier["bodyMass"] = "HKQuantityTypeIdentifierBodyMass";
|
|
148
|
+
HKQuantityTypeIdentifier["leanBodyMass"] = "HKQuantityTypeIdentifierLeanBodyMass";
|
|
149
|
+
HKQuantityTypeIdentifier["waistCircumference"] = "HKQuantityTypeIdentifierWaistCircumference";
|
|
150
|
+
// Fitness
|
|
151
|
+
HKQuantityTypeIdentifier["stepCount"] = "HKQuantityTypeIdentifierStepCount";
|
|
152
|
+
HKQuantityTypeIdentifier["distanceWalkingRunning"] = "HKQuantityTypeIdentifierDistanceWalkingRunning";
|
|
153
|
+
HKQuantityTypeIdentifier["distanceCycling"] = "HKQuantityTypeIdentifierDistanceCycling";
|
|
154
|
+
HKQuantityTypeIdentifier["distanceWheelchair"] = "HKQuantityTypeIdentifierDistanceWheelchair";
|
|
155
|
+
HKQuantityTypeIdentifier["basalEnergyBurned"] = "HKQuantityTypeIdentifierBasalEnergyBurned";
|
|
156
|
+
HKQuantityTypeIdentifier["activeEnergyBurned"] = "HKQuantityTypeIdentifierActiveEnergyBurned";
|
|
157
|
+
HKQuantityTypeIdentifier["flightsClimbed"] = "HKQuantityTypeIdentifierFlightsClimbed";
|
|
158
|
+
HKQuantityTypeIdentifier["nikeFuel"] = "HKQuantityTypeIdentifierNikeFuel";
|
|
159
|
+
HKQuantityTypeIdentifier["appleExerciseTime"] = "HKQuantityTypeIdentifierAppleExerciseTime";
|
|
160
|
+
HKQuantityTypeIdentifier["pushCount"] = "HKQuantityTypeIdentifierPushCount";
|
|
161
|
+
HKQuantityTypeIdentifier["distanceSwimming"] = "HKQuantityTypeIdentifierDistanceSwimming";
|
|
162
|
+
HKQuantityTypeIdentifier["swimmingStrokeCount"] = "HKQuantityTypeIdentifierSwimmingStrokeCount";
|
|
163
|
+
HKQuantityTypeIdentifier["vo2Max"] = "HKQuantityTypeIdentifierVo2Max";
|
|
164
|
+
HKQuantityTypeIdentifier["distanceDownhillSnowSports"] = "HKQuantityTypeIdentifierDistanceDownhillSnowSports";
|
|
165
|
+
HKQuantityTypeIdentifier["appleStandTime"] = "HKQuantityTypeIdentifierAppleStandTime";
|
|
166
|
+
// Vitals
|
|
167
|
+
HKQuantityTypeIdentifier["heartRate"] = "HKQuantityTypeIdentifierHeartRate";
|
|
168
|
+
HKQuantityTypeIdentifier["bodyTemperature"] = "HKQuantityTypeIdentifierBodyTemperature";
|
|
169
|
+
HKQuantityTypeIdentifier["basalBodyTemperature"] = "HKQuantityTypeIdentifierBasalBodyTemperature";
|
|
170
|
+
HKQuantityTypeIdentifier["bloodPressureSystolic"] = "HKQuantityTypeIdentifierBloodPressureSystolic";
|
|
171
|
+
HKQuantityTypeIdentifier["bloodPressureDiastolic"] = "HKQuantityTypeIdentifierBloodPressureDiastolic";
|
|
172
|
+
HKQuantityTypeIdentifier["respiratoryRate"] = "HKQuantityTypeIdentifierRespiratoryRate";
|
|
173
|
+
// Beats per minute estimate of a user's lowest heart rate while at rest
|
|
174
|
+
HKQuantityTypeIdentifier["restingHeartRate"] = "HKQuantityTypeIdentifierRestingHeartRate";
|
|
175
|
+
// Average heartbeats per minute captured by an Apple Watch while a user is walking
|
|
176
|
+
HKQuantityTypeIdentifier["walkingHeartRateAverage"] = "HKQuantityTypeIdentifierWalkingHeartRateAverage";
|
|
177
|
+
// The standard deviation of heart beat-to-beat intevals (Standard Deviation of Normal to Normal)
|
|
178
|
+
HKQuantityTypeIdentifier["heartRateVariabilitySDNN"] = "HKQuantityTypeIdentifierHeartRateVariabilitySDNN";
|
|
179
|
+
// Results
|
|
180
|
+
HKQuantityTypeIdentifier["oxygenSaturation"] = "HKQuantityTypeIdentifierOxygenSaturation";
|
|
181
|
+
HKQuantityTypeIdentifier["peripheralPerfusionIndex"] = "HKQuantityTypeIdentifierPeripheralPerfusionIndex";
|
|
182
|
+
HKQuantityTypeIdentifier["bloodGlucose"] = "HKQuantityTypeIdentifierBloodGlucose";
|
|
183
|
+
HKQuantityTypeIdentifier["numberOfTimesFallen"] = "HKQuantityTypeIdentifierNumberOfTimesFallen";
|
|
184
|
+
HKQuantityTypeIdentifier["electrodermalActivity"] = "HKQuantityTypeIdentifierElectrodermalActivity";
|
|
185
|
+
HKQuantityTypeIdentifier["inhalerUsage"] = "HKQuantityTypeIdentifierInhalerUsage";
|
|
186
|
+
HKQuantityTypeIdentifier["insulinDelivery"] = "HKQuantityTypeIdentifierInsulinDelivery";
|
|
187
|
+
HKQuantityTypeIdentifier["bloodAlcoholContent"] = "HKQuantityTypeIdentifierBloodAlcoholContent";
|
|
188
|
+
HKQuantityTypeIdentifier["forcedVitalCapacity"] = "HKQuantityTypeIdentifierForcedVitalCapacity";
|
|
189
|
+
HKQuantityTypeIdentifier["forcedExpiratoryVolume1"] = "HKQuantityTypeIdentifierForcedExpiratoryVolume1";
|
|
190
|
+
HKQuantityTypeIdentifier["peakExpiratoryFlowRate"] = "HKQuantityTypeIdentifierPeakExpiratoryFlowRate";
|
|
191
|
+
HKQuantityTypeIdentifier["environmentalAudioExposure"] = "HKQuantityTypeIdentifierEnvironmentalAudioExposure";
|
|
192
|
+
HKQuantityTypeIdentifier["headphoneAudioExposure"] = "HKQuantityTypeIdentifierHeadphoneAudioExposure";
|
|
193
|
+
// Nutrition
|
|
194
|
+
HKQuantityTypeIdentifier["dietaryFatTotal"] = "HKQuantityTypeIdentifierDietaryFatTotal";
|
|
195
|
+
HKQuantityTypeIdentifier["dietaryFatPolyunsaturated"] = "HKQuantityTypeIdentifierDietaryFatPolyunsaturated";
|
|
196
|
+
HKQuantityTypeIdentifier["dietaryFatMonounsaturated"] = "HKQuantityTypeIdentifierDietaryFatMonounsaturated";
|
|
197
|
+
HKQuantityTypeIdentifier["dietaryFatSaturated"] = "HKQuantityTypeIdentifierDietaryFatSaturated";
|
|
198
|
+
HKQuantityTypeIdentifier["dietaryCholesterol"] = "HKQuantityTypeIdentifierDietaryCholesterol";
|
|
199
|
+
HKQuantityTypeIdentifier["dietarySodium"] = "HKQuantityTypeIdentifierDietarySodium";
|
|
200
|
+
HKQuantityTypeIdentifier["dietaryCarbohydrates"] = "HKQuantityTypeIdentifierDietaryCarbohydrates";
|
|
201
|
+
HKQuantityTypeIdentifier["dietaryFiber"] = "HKQuantityTypeIdentifierDietaryFiber";
|
|
202
|
+
HKQuantityTypeIdentifier["dietarySugar"] = "HKQuantityTypeIdentifierDietarySugar";
|
|
203
|
+
HKQuantityTypeIdentifier["dietaryEnergyConsumed"] = "HKQuantityTypeIdentifierDietaryEnergyConsumed";
|
|
204
|
+
HKQuantityTypeIdentifier["dietaryProtein"] = "HKQuantityTypeIdentifierDietaryProtein";
|
|
205
|
+
HKQuantityTypeIdentifier["dietaryVitaminA"] = "HKQuantityTypeIdentifierDietaryVitaminA";
|
|
206
|
+
HKQuantityTypeIdentifier["dietaryVitaminB6"] = "HKQuantityTypeIdentifierDietaryVitaminB6";
|
|
207
|
+
HKQuantityTypeIdentifier["dietaryVitaminB12"] = "HKQuantityTypeIdentifierDietaryVitaminB12";
|
|
208
|
+
HKQuantityTypeIdentifier["dietaryVitaminC"] = "HKQuantityTypeIdentifierDietaryVitaminC";
|
|
209
|
+
HKQuantityTypeIdentifier["dietaryVitaminD"] = "HKQuantityTypeIdentifierDietaryVitaminD";
|
|
210
|
+
HKQuantityTypeIdentifier["dietaryVitaminE"] = "HKQuantityTypeIdentifierDietaryVitaminE";
|
|
211
|
+
HKQuantityTypeIdentifier["dietaryVitaminK"] = "HKQuantityTypeIdentifierDietaryVitaminK";
|
|
212
|
+
HKQuantityTypeIdentifier["dietaryCalcium"] = "HKQuantityTypeIdentifierDietaryCalcium";
|
|
213
|
+
HKQuantityTypeIdentifier["dietaryIron"] = "HKQuantityTypeIdentifierDietaryIron";
|
|
214
|
+
HKQuantityTypeIdentifier["dietaryThiamin"] = "HKQuantityTypeIdentifierDietaryThiamin";
|
|
215
|
+
HKQuantityTypeIdentifier["dietaryRiboflavin"] = "HKQuantityTypeIdentifierDietaryRiboflavin";
|
|
216
|
+
HKQuantityTypeIdentifier["dietaryNiacin"] = "HKQuantityTypeIdentifierDietaryNiacin";
|
|
217
|
+
HKQuantityTypeIdentifier["dietaryFolate"] = "HKQuantityTypeIdentifierDietaryFolate";
|
|
218
|
+
HKQuantityTypeIdentifier["dietaryBiotin"] = "HKQuantityTypeIdentifierDietaryBiotin";
|
|
219
|
+
HKQuantityTypeIdentifier["dietaryPantothenicAcid"] = "HKQuantityTypeIdentifierDietaryPantothenicAcid";
|
|
220
|
+
HKQuantityTypeIdentifier["dietaryPhosphorus"] = "HKQuantityTypeIdentifierDietaryPhosphorus";
|
|
221
|
+
HKQuantityTypeIdentifier["dietaryIodine"] = "HKQuantityTypeIdentifierDietaryIodine";
|
|
222
|
+
HKQuantityTypeIdentifier["dietaryMagnesium"] = "HKQuantityTypeIdentifierDietaryMagnesium";
|
|
223
|
+
HKQuantityTypeIdentifier["dietaryZinc"] = "HKQuantityTypeIdentifierDietaryZinc";
|
|
224
|
+
HKQuantityTypeIdentifier["dietarySelenium"] = "HKQuantityTypeIdentifierDietarySelenium";
|
|
225
|
+
HKQuantityTypeIdentifier["dietaryCopper"] = "HKQuantityTypeIdentifierDietaryCopper";
|
|
226
|
+
HKQuantityTypeIdentifier["dietaryManganese"] = "HKQuantityTypeIdentifierDietaryManganese";
|
|
227
|
+
HKQuantityTypeIdentifier["dietaryChromium"] = "HKQuantityTypeIdentifierDietaryChromium";
|
|
228
|
+
HKQuantityTypeIdentifier["dietaryMolybdenum"] = "HKQuantityTypeIdentifierDietaryMolybdenum";
|
|
229
|
+
HKQuantityTypeIdentifier["dietaryChloride"] = "HKQuantityTypeIdentifierDietaryChloride";
|
|
230
|
+
HKQuantityTypeIdentifier["dietaryPotassium"] = "HKQuantityTypeIdentifierDietaryPotassium";
|
|
231
|
+
HKQuantityTypeIdentifier["dietaryCaffeine"] = "HKQuantityTypeIdentifierDietaryCaffeine";
|
|
232
|
+
HKQuantityTypeIdentifier["dietaryWater"] = "HKQuantityTypeIdentifierDietaryWater";
|
|
233
|
+
// Mobility
|
|
234
|
+
HKQuantityTypeIdentifier["sixMinuteWalkTestDistance"] = "HKQuantityTypeIdentifierSixMinuteWalkTestDistance";
|
|
235
|
+
HKQuantityTypeIdentifier["walkingSpeed"] = "HKQuantityTypeIdentifierWalkingSpeed";
|
|
236
|
+
HKQuantityTypeIdentifier["walkingStepLength"] = "HKQuantityTypeIdentifierWalkingStepLength";
|
|
237
|
+
HKQuantityTypeIdentifier["walkingAsymmetryPercentage"] = "HKQuantityTypeIdentifierWalkingAsymmetryPercentage";
|
|
238
|
+
HKQuantityTypeIdentifier["walkingDoubleSupportPercentage"] = "HKQuantityTypeIdentifierWalkingDoubleSupportPercentage";
|
|
239
|
+
HKQuantityTypeIdentifier["stairAscentSpeed"] = "HKQuantityTypeIdentifierStairAscentSpeed";
|
|
240
|
+
HKQuantityTypeIdentifier["stairDescentSpeed"] = "HKQuantityTypeIdentifierStairDescentSpeed";
|
|
241
|
+
HKQuantityTypeIdentifier["uvExposure"] = "HKQuantityTypeIdentifierUvExposure";
|
|
242
|
+
})(HKQuantityTypeIdentifier || (HKQuantityTypeIdentifier = {}));
|
|
243
|
+
export var HKAuthorizationRequestStatus;
|
|
244
|
+
(function (HKAuthorizationRequestStatus) {
|
|
245
|
+
HKAuthorizationRequestStatus[HKAuthorizationRequestStatus["unknown"] = 0] = "unknown";
|
|
246
|
+
HKAuthorizationRequestStatus[HKAuthorizationRequestStatus["shouldRequest"] = 1] = "shouldRequest";
|
|
247
|
+
HKAuthorizationRequestStatus[HKAuthorizationRequestStatus["unnecessary"] = 2] = "unnecessary";
|
|
248
|
+
})(HKAuthorizationRequestStatus || (HKAuthorizationRequestStatus = {}));
|
|
249
|
+
export var HKAuthorizationStatus;
|
|
250
|
+
(function (HKAuthorizationStatus) {
|
|
251
|
+
HKAuthorizationStatus[HKAuthorizationStatus["notDetermined"] = 0] = "notDetermined";
|
|
252
|
+
HKAuthorizationStatus[HKAuthorizationStatus["sharingDenied"] = 1] = "sharingDenied";
|
|
253
|
+
HKAuthorizationStatus[HKAuthorizationStatus["sharingAuthorized"] = 2] = "sharingAuthorized";
|
|
254
|
+
})(HKAuthorizationStatus || (HKAuthorizationStatus = {}));
|
|
255
|
+
export var HKBloodType;
|
|
256
|
+
(function (HKBloodType) {
|
|
257
|
+
HKBloodType[HKBloodType["notSet"] = 0] = "notSet";
|
|
258
|
+
HKBloodType[HKBloodType["aPositive"] = 1] = "aPositive";
|
|
259
|
+
HKBloodType[HKBloodType["aNegative"] = 2] = "aNegative";
|
|
260
|
+
HKBloodType[HKBloodType["bPositive"] = 3] = "bPositive";
|
|
261
|
+
HKBloodType[HKBloodType["bNegative"] = 4] = "bNegative";
|
|
262
|
+
HKBloodType[HKBloodType["abPositive"] = 5] = "abPositive";
|
|
263
|
+
HKBloodType[HKBloodType["abNegative"] = 6] = "abNegative";
|
|
264
|
+
HKBloodType[HKBloodType["oPositive"] = 7] = "oPositive";
|
|
265
|
+
HKBloodType[HKBloodType["oNegative"] = 8] = "oNegative";
|
|
266
|
+
})(HKBloodType || (HKBloodType = {}));
|
|
267
|
+
export var HKBiologicalSex;
|
|
268
|
+
(function (HKBiologicalSex) {
|
|
269
|
+
HKBiologicalSex[HKBiologicalSex["notSet"] = 0] = "notSet";
|
|
270
|
+
HKBiologicalSex[HKBiologicalSex["female"] = 1] = "female";
|
|
271
|
+
HKBiologicalSex[HKBiologicalSex["male"] = 2] = "male";
|
|
272
|
+
HKBiologicalSex[HKBiologicalSex["other"] = 3] = "other";
|
|
273
|
+
})(HKBiologicalSex || (HKBiologicalSex = {}));
|
|
274
|
+
export var HKFitzpatrickSkinType;
|
|
275
|
+
(function (HKFitzpatrickSkinType) {
|
|
276
|
+
HKFitzpatrickSkinType[HKFitzpatrickSkinType["notSet"] = 0] = "notSet";
|
|
277
|
+
HKFitzpatrickSkinType[HKFitzpatrickSkinType["I"] = 1] = "I";
|
|
278
|
+
HKFitzpatrickSkinType[HKFitzpatrickSkinType["II"] = 2] = "II";
|
|
279
|
+
HKFitzpatrickSkinType[HKFitzpatrickSkinType["III"] = 3] = "III";
|
|
280
|
+
HKFitzpatrickSkinType[HKFitzpatrickSkinType["IV"] = 4] = "IV";
|
|
281
|
+
HKFitzpatrickSkinType[HKFitzpatrickSkinType["V"] = 5] = "V";
|
|
282
|
+
HKFitzpatrickSkinType[HKFitzpatrickSkinType["VI"] = 6] = "VI";
|
|
283
|
+
})(HKFitzpatrickSkinType || (HKFitzpatrickSkinType = {}));
|
|
284
|
+
export var HKStatisticsOptions;
|
|
285
|
+
(function (HKStatisticsOptions) {
|
|
286
|
+
HKStatisticsOptions["cumulativeSum"] = "cumulativeSum";
|
|
287
|
+
HKStatisticsOptions["discreteAverage"] = "discreteAverage";
|
|
288
|
+
HKStatisticsOptions["discreteMax"] = "discreteMax";
|
|
289
|
+
HKStatisticsOptions["discreteMin"] = "discreteMin";
|
|
290
|
+
HKStatisticsOptions["discreteMostRecent"] = "discreteMostRecent";
|
|
291
|
+
HKStatisticsOptions["duration"] = "duration";
|
|
292
|
+
HKStatisticsOptions["mostRecent"] = "mostRecent";
|
|
293
|
+
HKStatisticsOptions["separateBySource"] = "separateBySource";
|
|
294
|
+
})(HKStatisticsOptions || (HKStatisticsOptions = {}));
|
|
295
|
+
export var HKCategoryValueCervicalMucusQuality;
|
|
296
|
+
(function (HKCategoryValueCervicalMucusQuality) {
|
|
297
|
+
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["dry"] = 1] = "dry";
|
|
298
|
+
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["sticky"] = 2] = "sticky";
|
|
299
|
+
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["creamy"] = 3] = "creamy";
|
|
300
|
+
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["watery"] = 4] = "watery";
|
|
301
|
+
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["eggWhite"] = 5] = "eggWhite";
|
|
302
|
+
})(HKCategoryValueCervicalMucusQuality || (HKCategoryValueCervicalMucusQuality = {}));
|
|
303
|
+
export var HKCategoryValueMenstrualFlow;
|
|
304
|
+
(function (HKCategoryValueMenstrualFlow) {
|
|
305
|
+
HKCategoryValueMenstrualFlow[HKCategoryValueMenstrualFlow["unspecified"] = 1] = "unspecified";
|
|
306
|
+
HKCategoryValueMenstrualFlow[HKCategoryValueMenstrualFlow["none"] = 5] = "none";
|
|
307
|
+
HKCategoryValueMenstrualFlow[HKCategoryValueMenstrualFlow["light"] = 2] = "light";
|
|
308
|
+
HKCategoryValueMenstrualFlow[HKCategoryValueMenstrualFlow["medium"] = 3] = "medium";
|
|
309
|
+
HKCategoryValueMenstrualFlow[HKCategoryValueMenstrualFlow["heavy"] = 4] = "heavy";
|
|
310
|
+
})(HKCategoryValueMenstrualFlow || (HKCategoryValueMenstrualFlow = {}));
|
|
311
|
+
export var HKCategoryValueOvulationTestResult;
|
|
312
|
+
(function (HKCategoryValueOvulationTestResult) {
|
|
313
|
+
HKCategoryValueOvulationTestResult[HKCategoryValueOvulationTestResult["negative"] = 1] = "negative";
|
|
314
|
+
HKCategoryValueOvulationTestResult[HKCategoryValueOvulationTestResult["luteinizingHormoneSurge"] = 2] = "luteinizingHormoneSurge";
|
|
315
|
+
HKCategoryValueOvulationTestResult[HKCategoryValueOvulationTestResult["indeterminate"] = 3] = "indeterminate";
|
|
316
|
+
HKCategoryValueOvulationTestResult[HKCategoryValueOvulationTestResult["estrogenSurge"] = 4] = "estrogenSurge";
|
|
317
|
+
})(HKCategoryValueOvulationTestResult || (HKCategoryValueOvulationTestResult = {}));
|
|
318
|
+
export var HKCategoryValueSleepAnalysis;
|
|
319
|
+
(function (HKCategoryValueSleepAnalysis) {
|
|
320
|
+
HKCategoryValueSleepAnalysis[HKCategoryValueSleepAnalysis["inBed"] = 0] = "inBed";
|
|
321
|
+
HKCategoryValueSleepAnalysis[HKCategoryValueSleepAnalysis["asleep"] = 1] = "asleep";
|
|
322
|
+
HKCategoryValueSleepAnalysis[HKCategoryValueSleepAnalysis["awake"] = 2] = "awake";
|
|
323
|
+
})(HKCategoryValueSleepAnalysis || (HKCategoryValueSleepAnalysis = {}));
|
|
324
|
+
export var HKCategoryValueAppetiteChanges;
|
|
325
|
+
(function (HKCategoryValueAppetiteChanges) {
|
|
326
|
+
HKCategoryValueAppetiteChanges[HKCategoryValueAppetiteChanges["decreased"] = 2] = "decreased";
|
|
327
|
+
HKCategoryValueAppetiteChanges[HKCategoryValueAppetiteChanges["increased"] = 3] = "increased";
|
|
328
|
+
HKCategoryValueAppetiteChanges[HKCategoryValueAppetiteChanges["noChange"] = 1] = "noChange";
|
|
329
|
+
HKCategoryValueAppetiteChanges[HKCategoryValueAppetiteChanges["unspecified"] = 0] = "unspecified";
|
|
330
|
+
})(HKCategoryValueAppetiteChanges || (HKCategoryValueAppetiteChanges = {}));
|
|
331
|
+
export var HKCategoryValuePresence;
|
|
332
|
+
(function (HKCategoryValuePresence) {
|
|
333
|
+
HKCategoryValuePresence[HKCategoryValuePresence["notPresent"] = 1] = "notPresent";
|
|
334
|
+
HKCategoryValuePresence[HKCategoryValuePresence["present"] = 0] = "present";
|
|
335
|
+
})(HKCategoryValuePresence || (HKCategoryValuePresence = {}));
|
|
336
|
+
export var HKCategoryValueSeverity;
|
|
337
|
+
(function (HKCategoryValueSeverity) {
|
|
338
|
+
HKCategoryValueSeverity[HKCategoryValueSeverity["notPresent"] = 1] = "notPresent";
|
|
339
|
+
HKCategoryValueSeverity[HKCategoryValueSeverity["mild"] = 2] = "mild";
|
|
340
|
+
HKCategoryValueSeverity[HKCategoryValueSeverity["moderate"] = 3] = "moderate";
|
|
341
|
+
HKCategoryValueSeverity[HKCategoryValueSeverity["severe"] = 4] = "severe";
|
|
342
|
+
HKCategoryValueSeverity[HKCategoryValueSeverity["unspecified"] = 0] = "unspecified";
|
|
343
|
+
})(HKCategoryValueSeverity || (HKCategoryValueSeverity = {}));
|
|
344
|
+
export var HKCategoryValueNotApplicable;
|
|
345
|
+
(function (HKCategoryValueNotApplicable) {
|
|
346
|
+
HKCategoryValueNotApplicable[HKCategoryValueNotApplicable["notApplicable"] = 0] = "notApplicable";
|
|
347
|
+
})(HKCategoryValueNotApplicable || (HKCategoryValueNotApplicable = {}));
|
|
348
|
+
export var HKInsulinDeliveryReason;
|
|
349
|
+
(function (HKInsulinDeliveryReason) {
|
|
350
|
+
HKInsulinDeliveryReason[HKInsulinDeliveryReason["basal"] = 1] = "basal";
|
|
351
|
+
HKInsulinDeliveryReason[HKInsulinDeliveryReason["bolus"] = 2] = "bolus";
|
|
352
|
+
})(HKInsulinDeliveryReason || (HKInsulinDeliveryReason = {}));
|
|
353
|
+
// Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse
|
|
354
|
+
export var HKWheelchairUse;
|
|
355
|
+
(function (HKWheelchairUse) {
|
|
356
|
+
HKWheelchairUse[HKWheelchairUse["notSet"] = 0] = "notSet";
|
|
357
|
+
HKWheelchairUse[HKWheelchairUse["no"] = 1] = "no";
|
|
358
|
+
HKWheelchairUse[HKWheelchairUse["yes"] = 2] = "yes";
|
|
359
|
+
})(HKWheelchairUse || (HKWheelchairUse = {}));
|
|
360
|
+
// Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init
|
|
361
|
+
export var HKUnitSIPrefix;
|
|
362
|
+
(function (HKUnitSIPrefix) {
|
|
363
|
+
HKUnitSIPrefix["Pico"] = "p";
|
|
364
|
+
HKUnitSIPrefix["Nano"] = "n";
|
|
365
|
+
HKUnitSIPrefix["Micro"] = "mc";
|
|
366
|
+
HKUnitSIPrefix["Milli"] = "m";
|
|
367
|
+
HKUnitSIPrefix["Centi"] = "c";
|
|
368
|
+
HKUnitSIPrefix["Deci"] = "d";
|
|
369
|
+
HKUnitSIPrefix["Deca"] = "da";
|
|
370
|
+
HKUnitSIPrefix["Hecto"] = "h";
|
|
371
|
+
HKUnitSIPrefix["Kilo"] = "k";
|
|
372
|
+
HKUnitSIPrefix["Mega"] = "M";
|
|
373
|
+
HKUnitSIPrefix["Giga"] = "G";
|
|
374
|
+
HKUnitSIPrefix["Tera"] = "T";
|
|
375
|
+
})(HKUnitSIPrefix || (HKUnitSIPrefix = {}));
|
|
376
|
+
export var HKUnitSI;
|
|
377
|
+
(function (HKUnitSI) {
|
|
378
|
+
HKUnitSI["Grams"] = "g";
|
|
379
|
+
HKUnitSI["Joules"] = "J";
|
|
380
|
+
HKUnitSI["Kelvin"] = "K";
|
|
381
|
+
HKUnitSI["Liters"] = "l";
|
|
382
|
+
HKUnitSI["Meters"] = "m";
|
|
383
|
+
HKUnitSI["Pascals"] = "Pa";
|
|
384
|
+
HKUnitSI["Seconds"] = "s";
|
|
385
|
+
HKUnitSI["Siemens"] = "S";
|
|
386
|
+
})(HKUnitSI || (HKUnitSI = {}));
|
|
387
|
+
export var HKUnit;
|
|
388
|
+
(function (HKUnit) {
|
|
389
|
+
HKUnit["Grams"] = "g";
|
|
390
|
+
HKUnit["Joules"] = "J";
|
|
391
|
+
HKUnit["Kelvin"] = "K";
|
|
392
|
+
HKUnit["Liters"] = "l";
|
|
393
|
+
HKUnit["Meters"] = "m";
|
|
394
|
+
HKUnit["Pascals"] = "Pa";
|
|
395
|
+
HKUnit["Seconds"] = "s";
|
|
396
|
+
HKUnit["Siemens"] = "S";
|
|
397
|
+
HKUnit["Atmospheres"] = "atm";
|
|
398
|
+
HKUnit["CentimetersOfWater"] = "cmAq";
|
|
399
|
+
HKUnit["Count"] = "count";
|
|
400
|
+
HKUnit["Days"] = "d";
|
|
401
|
+
HKUnit["DecibelHearingLevel"] = "dBHL";
|
|
402
|
+
HKUnit["DecibelSoundPressureLevel"] = "dBASPL";
|
|
403
|
+
HKUnit["DegreesCelsius"] = "degC";
|
|
404
|
+
HKUnit["DegreesFahrenheit"] = "degF";
|
|
405
|
+
HKUnit["Feet"] = "ft";
|
|
406
|
+
HKUnit["Hertz"] = "Hz";
|
|
407
|
+
HKUnit["Hours"] = "hr";
|
|
408
|
+
HKUnit["ImperialCup"] = "cup_imp";
|
|
409
|
+
HKUnit["ImperialFluidOunces"] = "fl_oz_imp";
|
|
410
|
+
HKUnit["ImperialPint"] = "pt_imp";
|
|
411
|
+
HKUnit["Inches"] = "in";
|
|
412
|
+
HKUnit["InternationalUnit"] = "IU";
|
|
413
|
+
HKUnit["Kilocalories"] = "kcal";
|
|
414
|
+
HKUnit["LargeCalories"] = "Cal";
|
|
415
|
+
HKUnit["Miles"] = "mi";
|
|
416
|
+
HKUnit["MillimetersOfMercury"] = "mmHg";
|
|
417
|
+
HKUnit["Minutes"] = "min";
|
|
418
|
+
HKUnit["Ounces"] = "oz";
|
|
419
|
+
HKUnit["Percent"] = "%";
|
|
420
|
+
HKUnit["Pounds"] = "lb";
|
|
421
|
+
HKUnit["SmallCalories"] = "cal";
|
|
422
|
+
HKUnit["Stones"] = "st";
|
|
423
|
+
HKUnit["USCup"] = "cup_us";
|
|
424
|
+
HKUnit["USFluidOunces"] = "fl_oz_us";
|
|
425
|
+
HKUnit["USPint"] = "pt_us";
|
|
426
|
+
HKUnit["Yard"] = "yd";
|
|
427
|
+
HKUnit["GlucoseMmolPerL"] = "mmol<180.15588000005408>/l";
|
|
428
|
+
HKUnit["GlucoseMgPerDl"] = "mg/dL";
|
|
429
|
+
})(HKUnit || (HKUnit = {}));
|
|
430
|
+
// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier
|
|
431
|
+
export var HKCharacteristicTypeIdentifier;
|
|
432
|
+
(function (HKCharacteristicTypeIdentifier) {
|
|
433
|
+
HKCharacteristicTypeIdentifier["fitzpatrickSkinType"] = "HKCharacteristicTypeIdentifierFitzpatrickSkinType";
|
|
434
|
+
HKCharacteristicTypeIdentifier["biologicalSex"] = "HKCharacteristicTypeIdentifierBiologicalSex";
|
|
435
|
+
HKCharacteristicTypeIdentifier["bloodType"] = "HKCharacteristicTypeIdentifierBloodType";
|
|
436
|
+
HKCharacteristicTypeIdentifier["dateOfBirth"] = "HKCharacteristicTypeIdentifierDateOfBirth";
|
|
437
|
+
HKCharacteristicTypeIdentifier["wheelchairUse"] = "HKCharacteristicTypeIdentifierWheelchairUse";
|
|
438
|
+
})(HKCharacteristicTypeIdentifier || (HKCharacteristicTypeIdentifier = {}));
|
|
439
|
+
export var HKCorrelationTypeIdentifier;
|
|
440
|
+
(function (HKCorrelationTypeIdentifier) {
|
|
441
|
+
HKCorrelationTypeIdentifier["bloodPressure"] = "HKCorrelationTypeIdentifierBloodPressure";
|
|
442
|
+
HKCorrelationTypeIdentifier["food"] = "HKCorrelationTypeIdentifierFood";
|
|
443
|
+
})(HKCorrelationTypeIdentifier || (HKCorrelationTypeIdentifier = {}));
|
|
444
|
+
export var HKUpdateFrequency;
|
|
445
|
+
(function (HKUpdateFrequency) {
|
|
446
|
+
HKUpdateFrequency[HKUpdateFrequency["immediate"] = 1] = "immediate";
|
|
447
|
+
HKUpdateFrequency[HKUpdateFrequency["hourly"] = 2] = "hourly";
|
|
448
|
+
HKUpdateFrequency[HKUpdateFrequency["daily"] = 3] = "daily";
|
|
449
|
+
HKUpdateFrequency[HKUpdateFrequency["weekly"] = 4] = "weekly";
|
|
450
|
+
})(HKUpdateFrequency || (HKUpdateFrequency = {}));
|
|
451
|
+
const Native = NativeModules.ReactNativeHealthkit;
|
|
452
|
+
export const EventEmitter = new NativeEventEmitter(NativeModules.ReactNativeHealthkit);
|
|
453
|
+
export default Native;
|
package/lib/src/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EmitterSubscription, NativeEventEmitter } from 'react-native';
|
|
2
2
|
export declare type HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier';
|
|
3
3
|
export declare type HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier';
|
|
4
4
|
export declare type HKSampleTypeIdentifier = HKWorkoutTypeIdentifier | HKQuantityTypeIdentifier | HKCategoryTypeIdentifier | HKAudiogramTypeIdentifier | HKCorrelationTypeIdentifier;
|
|
@@ -256,6 +256,11 @@ export declare enum HKAuthorizationRequestStatus {
|
|
|
256
256
|
shouldRequest = 1,
|
|
257
257
|
unnecessary = 2
|
|
258
258
|
}
|
|
259
|
+
export declare enum HKAuthorizationStatus {
|
|
260
|
+
notDetermined = 0,
|
|
261
|
+
sharingDenied = 1,
|
|
262
|
+
sharingAuthorized = 2
|
|
263
|
+
}
|
|
259
264
|
export declare type HKQuantity<T extends HKUnit = HKUnit> = {
|
|
260
265
|
unit: T;
|
|
261
266
|
quantity: number;
|
|
@@ -528,6 +533,21 @@ export declare enum HKUpdateFrequency {
|
|
|
528
533
|
daily = 3,
|
|
529
534
|
weekly = 4
|
|
530
535
|
}
|
|
536
|
+
export declare type WorkoutLocation = {
|
|
537
|
+
longitude: number;
|
|
538
|
+
latitude: number;
|
|
539
|
+
altitude: number;
|
|
540
|
+
speed: number;
|
|
541
|
+
timestamp: number;
|
|
542
|
+
horizontalAccuracy: number;
|
|
543
|
+
speedAccuracy: number;
|
|
544
|
+
verticalAccuracy: number;
|
|
545
|
+
};
|
|
546
|
+
export declare type WorkoutRoute = {
|
|
547
|
+
locations: WorkoutLocation[];
|
|
548
|
+
HKMetadataKeySyncIdentifier?: string;
|
|
549
|
+
HKMetadataKeySyncVersion?: number;
|
|
550
|
+
};
|
|
531
551
|
declare type ReactNativeHealthkitTypeNative = {
|
|
532
552
|
isHealthDataAvailable(): Promise<boolean>;
|
|
533
553
|
getBloodType(): Promise<HKBloodType>;
|
|
@@ -553,6 +573,7 @@ declare type ReactNativeHealthkitTypeNative = {
|
|
|
553
573
|
saveCategorySample: <T extends HKCategoryTypeIdentifier>(identifier: T, value: HKCategoryValueForIdentifier<T>, start: string, end: string, metadata: Object) => Promise<boolean>;
|
|
554
574
|
queryStatisticsForQuantity: <TUnit extends HKUnit>(identifier: HKQuantityTypeIdentifier, unit: TUnit, from: string, to: string, options: HKStatisticsOptions[]) => Promise<QueryStatisticsResponseRaw<TUnit>>;
|
|
555
575
|
getPreferredUnits: (identifiers: HKQuantityTypeIdentifier[]) => Promise<TypeToUnitMapping>;
|
|
576
|
+
getWorkoutRoutes: (workoutUUID: string) => Promise<WorkoutRoute[]>;
|
|
556
577
|
};
|
|
557
578
|
declare const Native: ReactNativeHealthkitTypeNative;
|
|
558
579
|
declare type OnChangeCallback = ({ typeIdentifier, }: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKCategorySampleRaw, HKCategoryTypeIdentifier, HKCategoryValueForIdentifier, HKCharacteristicTypeIdentifier, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKFitzpatrickSkinType,
|
|
1
|
+
import type { HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKCategorySampleRaw, HKCategoryTypeIdentifier, HKCategoryValueForIdentifier, HKCharacteristicTypeIdentifier, 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
|
energyUnit?: TEnergy;
|
|
4
4
|
distanceUnit?: TDistance;
|
|
@@ -79,6 +79,7 @@ export interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>
|
|
|
79
79
|
}
|
|
80
80
|
export declare type QueryCorrelationSamplesFn = <TIdentifier extends HKCorrelationTypeIdentifier>(typeIdentifier: TIdentifier, options: Omit<GenericQueryOptions, 'limit' | 'ascending'>) => Promise<HKCorrelation<TIdentifier>[]>;
|
|
81
81
|
export declare type SubscribeToChangesHook = <TIdentifier extends HKSampleTypeIdentifier>(identifier: TIdentifier, onChange: () => void, runInitialUpdate?: boolean) => void;
|
|
82
|
+
export declare type GetWorkoutRoutesFn = (workoutUUID: string) => Promise<WorkoutRoute[]>;
|
|
82
83
|
export declare type ReactNativeHealthkit = {
|
|
83
84
|
authorizationStatusFor: AuthorizationStatusForFn;
|
|
84
85
|
getBiologicalSex: GetBiologicalSexFn;
|
|
@@ -92,6 +93,7 @@ export declare type ReactNativeHealthkit = {
|
|
|
92
93
|
getPreferredUnits: GetPreferredUnitsFn;
|
|
93
94
|
getRequestStatusForAuthorization: GetRequestStatusForAuthorizationFn;
|
|
94
95
|
getWheelchairUse: GetWheelchairUseFn;
|
|
96
|
+
getWorkoutRoutes: GetWorkoutRoutesFn;
|
|
95
97
|
buildUnitWithPrefix: (prefix: HKUnitSIPrefix, unit: HKUnitSI) => HKUnit;
|
|
96
98
|
isHealthDataAvailable: IsHealthDataAvailableFn;
|
|
97
99
|
queryCategorySamples: QueryCategorySamplesFn;
|
package/package.json
CHANGED
package/src/index.ios.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import Native, {
|
|
3
3
|
EventEmitter,
|
|
4
4
|
HKCategorySampleRaw,
|
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
GetMostRecentWorkoutFn,
|
|
24
24
|
GetPreferredUnitFn,
|
|
25
25
|
GetPreferredUnitsFn,
|
|
26
|
+
GetWorkoutRoutesFn,
|
|
26
27
|
HKCategorySample,
|
|
27
28
|
HKCorrelation,
|
|
28
29
|
HKQuantitySample,
|
|
@@ -529,6 +530,10 @@ const saveWorkoutSample: SaveWorkoutSampleFn = (
|
|
|
529
530
|
);
|
|
530
531
|
};
|
|
531
532
|
|
|
533
|
+
const getWorkoutRoutes: GetWorkoutRoutesFn = (workoutUUID: string) => {
|
|
534
|
+
return Native.getWorkoutRoutes(workoutUUID);
|
|
535
|
+
};
|
|
536
|
+
|
|
532
537
|
const Healthkit: ReactNativeHealthkit = {
|
|
533
538
|
authorizationStatusFor: Native.authorizationStatusFor,
|
|
534
539
|
|
|
@@ -555,6 +560,8 @@ const Healthkit: ReactNativeHealthkit = {
|
|
|
555
560
|
getPreferredUnits,
|
|
556
561
|
getRequestStatusForAuthorization,
|
|
557
562
|
|
|
563
|
+
getWorkoutRoutes,
|
|
564
|
+
|
|
558
565
|
// query methods
|
|
559
566
|
queryCategorySamples,
|
|
560
567
|
queryCorrelationSamples,
|
|
@@ -582,7 +589,7 @@ const Healthkit: ReactNativeHealthkit = {
|
|
|
582
589
|
useSubscribeToChanges,
|
|
583
590
|
};
|
|
584
591
|
|
|
585
|
-
export * from './types';
|
|
586
592
|
export * from './native-types';
|
|
593
|
+
export * from './types';
|
|
587
594
|
|
|
588
595
|
export default Healthkit;
|
package/src/index.tsx
CHANGED
|
@@ -27,6 +27,7 @@ const Healthkit: ReactNativeHealthkit = {
|
|
|
27
27
|
getPreferredUnits: UnavailableFn,
|
|
28
28
|
getRequestStatusForAuthorization: UnavailableFn,
|
|
29
29
|
getWheelchairUse: UnavailableFn,
|
|
30
|
+
getWorkoutRoutes: UnavailableFn,
|
|
30
31
|
isHealthDataAvailable: () => Promise.resolve(false),
|
|
31
32
|
queryCategorySamples: UnavailableFn,
|
|
32
33
|
queryCorrelationSamples: UnavailableFn,
|
|
@@ -45,7 +46,7 @@ const Healthkit: ReactNativeHealthkit = {
|
|
|
45
46
|
useSubscribeToChanges: UnavailableFn,
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
export * from './types';
|
|
49
49
|
export * from './native-types';
|
|
50
|
+
export * from './types';
|
|
50
51
|
|
|
51
52
|
export default Healthkit;
|