@solutionforest/android-health-connect 0.0.0-stage → 0.3.13
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/AndroidHealthConnect.podspec +20 -0
- package/CHANGELOG.md +202 -0
- package/LICENSE +20 -0
- package/README.md +847 -2
- package/SECURITY.md +99 -0
- package/android/build.gradle +104 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/androidhealthconnect/AggregateMapper.kt +521 -0
- package/android/src/main/java/com/androidhealthconnect/AndroidHealthConnectModule.kt +637 -0
- package/android/src/main/java/com/androidhealthconnect/AndroidHealthConnectPackage.kt +31 -0
- package/android/src/main/java/com/androidhealthconnect/AvailabilitySupport.kt +149 -0
- package/android/src/main/java/com/androidhealthconnect/ChangesMapper.kt +105 -0
- package/android/src/main/java/com/androidhealthconnect/ExtendedRecordMapper.kt +665 -0
- package/android/src/main/java/com/androidhealthconnect/FeatureSupport.kt +88 -0
- package/android/src/main/java/com/androidhealthconnect/PhrMapper.kt +187 -0
- package/android/src/main/java/com/androidhealthconnect/PlannedExerciseMapper.kt +242 -0
- package/android/src/main/java/com/androidhealthconnect/RecordMapper.kt +1222 -0
- package/app.plugin.js +1 -0
- package/docs/assets/logo.jpg +0 -0
- package/ios/AndroidHealthConnect.h +5 -0
- package/ios/AndroidHealthConnect.mm +21 -0
- package/lib/module/NativeAndroidHealthConnect.js +5 -0
- package/lib/module/NativeAndroidHealthConnect.js.map +1 -0
- package/lib/module/foreground.js +117 -0
- package/lib/module/foreground.js.map +1 -0
- package/lib/module/helpers.js +280 -0
- package/lib/module/helpers.js.map +1 -0
- package/lib/module/index.js +354 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +392 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/upgrade.js +101 -0
- package/lib/module/upgrade.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/plugin/src/index.d.ts +14 -0
- package/lib/typescript/plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/src/NativeAndroidHealthConnect.d.ts +95 -0
- package/lib/typescript/src/NativeAndroidHealthConnect.d.ts.map +1 -0
- package/lib/typescript/src/foreground.d.ts +43 -0
- package/lib/typescript/src/foreground.d.ts.map +1 -0
- package/lib/typescript/src/helpers.d.ts +108 -0
- package/lib/typescript/src/helpers.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +208 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +1209 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/upgrade.d.ts +26 -0
- package/lib/typescript/src/upgrade.d.ts.map +1 -0
- package/package.json +255 -4
- package/plugin/build/index.d.ts +13 -0
- package/plugin/build/index.js +57 -0
- package/plugin/src/index.ts +105 -0
- package/src/NativeAndroidHealthConnect.ts +133 -0
- package/src/foreground.ts +167 -0
- package/src/helpers.ts +373 -0
- package/src/index.tsx +623 -0
- package/src/types.ts +1525 -0
- package/src/upgrade.ts +155 -0
|
@@ -0,0 +1,1209 @@
|
|
|
1
|
+
/** Result of checking whether Health Connect is usable on the current device. */
|
|
2
|
+
export type HealthConnectAvailability = 'available' | 'notInstalled' | 'notSupported';
|
|
3
|
+
/**
|
|
4
|
+
* How Health Connect is delivered on this device.
|
|
5
|
+
* - `framework` — Android 14+ system Health Connect
|
|
6
|
+
* - `apk` — Play Store APK (Android 9–13)
|
|
7
|
+
* - `none` — below API 28 / no provider path
|
|
8
|
+
*/
|
|
9
|
+
export type HealthConnectProviderKind = 'framework' | 'apk' | 'none';
|
|
10
|
+
/**
|
|
11
|
+
* Detailed availability for UX (China / HMS / install vs built-in).
|
|
12
|
+
* Raw `sdkStatus`: 1 = SDK_UNAVAILABLE, 2 = PROVIDER_UPDATE_REQUIRED, 3 = SDK_AVAILABLE.
|
|
13
|
+
* Note: `3` is available — not “version too old”.
|
|
14
|
+
*/
|
|
15
|
+
export type HealthConnectAvailabilityInfo = {
|
|
16
|
+
status: HealthConnectAvailability;
|
|
17
|
+
sdkStatus: number;
|
|
18
|
+
sdkStatusName: string;
|
|
19
|
+
provider: HealthConnectProviderKind;
|
|
20
|
+
androidSdkInt: number;
|
|
21
|
+
googlePlayServicesAvailable: boolean;
|
|
22
|
+
playStoreAvailable: boolean;
|
|
23
|
+
advice: string;
|
|
24
|
+
};
|
|
25
|
+
export type HealthPermission = 'android.permission.health.READ_STEPS' | 'android.permission.health.WRITE_STEPS' | 'android.permission.health.READ_HEART_RATE' | 'android.permission.health.WRITE_HEART_RATE' | 'android.permission.health.READ_SLEEP' | 'android.permission.health.WRITE_SLEEP' | 'android.permission.health.READ_ACTIVE_CALORIES_BURNED' | 'android.permission.health.WRITE_ACTIVE_CALORIES_BURNED' | 'android.permission.health.READ_TOTAL_CALORIES_BURNED' | 'android.permission.health.WRITE_TOTAL_CALORIES_BURNED' | 'android.permission.health.READ_DISTANCE' | 'android.permission.health.WRITE_DISTANCE' | 'android.permission.health.READ_WEIGHT' | 'android.permission.health.WRITE_WEIGHT' | 'android.permission.health.READ_HEIGHT' | 'android.permission.health.WRITE_HEIGHT' | 'android.permission.health.READ_BLOOD_PRESSURE' | 'android.permission.health.WRITE_BLOOD_PRESSURE' | 'android.permission.health.READ_BLOOD_GLUCOSE' | 'android.permission.health.WRITE_BLOOD_GLUCOSE' | 'android.permission.health.READ_OXYGEN_SATURATION' | 'android.permission.health.WRITE_OXYGEN_SATURATION' | 'android.permission.health.READ_BODY_TEMPERATURE' | 'android.permission.health.WRITE_BODY_TEMPERATURE' | 'android.permission.health.READ_BODY_FAT' | 'android.permission.health.WRITE_BODY_FAT' | 'android.permission.health.READ_HYDRATION' | 'android.permission.health.WRITE_HYDRATION' | 'android.permission.health.READ_EXERCISE' | 'android.permission.health.WRITE_EXERCISE'
|
|
26
|
+
/** Plural — required to read routes on sessions you did not write. */
|
|
27
|
+
| 'android.permission.health.READ_EXERCISE_ROUTES'
|
|
28
|
+
/** Singular — required to insert/update a session with `exerciseRoute`. */
|
|
29
|
+
| 'android.permission.health.WRITE_EXERCISE_ROUTE'
|
|
30
|
+
/** Requires `getFeatureStatus('plannedExercise') === 'available'`. */
|
|
31
|
+
| 'android.permission.health.READ_PLANNED_EXERCISE' | 'android.permission.health.WRITE_PLANNED_EXERCISE' | 'android.permission.health.READ_RESTING_HEART_RATE' | 'android.permission.health.WRITE_RESTING_HEART_RATE' | 'android.permission.health.READ_RESPIRATORY_RATE' | 'android.permission.health.WRITE_RESPIRATORY_RATE' | 'android.permission.health.READ_FLOORS_CLIMBED' | 'android.permission.health.WRITE_FLOORS_CLIMBED' | 'android.permission.health.READ_ELEVATION_GAINED' | 'android.permission.health.WRITE_ELEVATION_GAINED' | 'android.permission.health.READ_MINDFULNESS' | 'android.permission.health.WRITE_MINDFULNESS' | 'android.permission.health.READ_SKIN_TEMPERATURE' | 'android.permission.health.WRITE_SKIN_TEMPERATURE' | 'android.permission.health.READ_ACTIVITY_INTENSITY' | 'android.permission.health.WRITE_ACTIVITY_INTENSITY' | 'android.permission.health.READ_NUTRITION' | 'android.permission.health.WRITE_NUTRITION' | 'android.permission.health.READ_VO2_MAX' | 'android.permission.health.WRITE_VO2_MAX' | 'android.permission.health.READ_SPEED' | 'android.permission.health.WRITE_SPEED' | 'android.permission.health.READ_POWER' | 'android.permission.health.WRITE_POWER' | 'android.permission.health.READ_WHEELCHAIR_PUSHES' | 'android.permission.health.WRITE_WHEELCHAIR_PUSHES' | 'android.permission.health.READ_MENSTRUATION' | 'android.permission.health.WRITE_MENSTRUATION' | 'android.permission.health.READ_OVULATION_TEST' | 'android.permission.health.WRITE_OVULATION_TEST' | 'android.permission.health.READ_CERVICAL_MUCUS' | 'android.permission.health.WRITE_CERVICAL_MUCUS' | 'android.permission.health.READ_INTERMENSTRUAL_BLEEDING' | 'android.permission.health.WRITE_INTERMENSTRUAL_BLEEDING' | 'android.permission.health.READ_SEXUAL_ACTIVITY' | 'android.permission.health.WRITE_SEXUAL_ACTIVITY' | 'android.permission.health.READ_BASAL_BODY_TEMPERATURE' | 'android.permission.health.WRITE_BASAL_BODY_TEMPERATURE' | 'android.permission.health.READ_LEAN_BODY_MASS' | 'android.permission.health.WRITE_LEAN_BODY_MASS' | 'android.permission.health.READ_BONE_MASS' | 'android.permission.health.WRITE_BONE_MASS' | 'android.permission.health.READ_BODY_WATER_MASS' | 'android.permission.health.WRITE_BODY_WATER_MASS' | 'android.permission.health.READ_BASAL_METABOLIC_RATE' | 'android.permission.health.WRITE_BASAL_METABOLIC_RATE' | 'android.permission.health.READ_HEART_RATE_VARIABILITY' | 'android.permission.health.WRITE_HEART_RATE_VARIABILITY'
|
|
32
|
+
/**
|
|
33
|
+
* Read data older than ~30 days before first grant.
|
|
34
|
+
* Check `getFeatureStatus('readHealthDataHistory')` first.
|
|
35
|
+
*/
|
|
36
|
+
| 'android.permission.health.READ_HEALTH_DATA_HISTORY'
|
|
37
|
+
/**
|
|
38
|
+
* Read while the app is in the background.
|
|
39
|
+
* Check `getFeatureStatus('readHealthDataInBackground')` first.
|
|
40
|
+
*/
|
|
41
|
+
| 'android.permission.health.READ_HEALTH_DATA_IN_BACKGROUND' | 'android.permission.health.WRITE_MEDICAL_DATA' | 'android.permission.health.READ_MEDICAL_DATA_ALLERGIES_INTOLERANCES' | 'android.permission.health.READ_MEDICAL_DATA_CONDITIONS' | 'android.permission.health.READ_MEDICAL_DATA_LABORATORY_RESULTS' | 'android.permission.health.READ_MEDICAL_DATA_MEDICATIONS' | 'android.permission.health.READ_MEDICAL_DATA_PERSONAL_DETAILS' | 'android.permission.health.READ_MEDICAL_DATA_PRACTITIONER_DETAILS' | 'android.permission.health.READ_MEDICAL_DATA_PREGNANCY' | 'android.permission.health.READ_MEDICAL_DATA_PROCEDURES' | 'android.permission.health.READ_MEDICAL_DATA_SOCIAL_HISTORY' | 'android.permission.health.READ_MEDICAL_DATA_VACCINES' | 'android.permission.health.READ_MEDICAL_DATA_VISITS' | 'android.permission.health.READ_MEDICAL_DATA_VITAL_SIGNS' | (string & {});
|
|
42
|
+
/**
|
|
43
|
+
* Typed Health Connect permission strings for autocomplete.
|
|
44
|
+
* Prefer these over hand-typed `android.permission.health.*` literals.
|
|
45
|
+
*/
|
|
46
|
+
export declare const Permission: {
|
|
47
|
+
readonly READ_STEPS: "android.permission.health.READ_STEPS";
|
|
48
|
+
readonly WRITE_STEPS: "android.permission.health.WRITE_STEPS";
|
|
49
|
+
readonly READ_HEART_RATE: "android.permission.health.READ_HEART_RATE";
|
|
50
|
+
readonly WRITE_HEART_RATE: "android.permission.health.WRITE_HEART_RATE";
|
|
51
|
+
readonly READ_SLEEP: "android.permission.health.READ_SLEEP";
|
|
52
|
+
readonly WRITE_SLEEP: "android.permission.health.WRITE_SLEEP";
|
|
53
|
+
readonly READ_ACTIVE_CALORIES_BURNED: "android.permission.health.READ_ACTIVE_CALORIES_BURNED";
|
|
54
|
+
readonly WRITE_ACTIVE_CALORIES_BURNED: "android.permission.health.WRITE_ACTIVE_CALORIES_BURNED";
|
|
55
|
+
readonly READ_TOTAL_CALORIES_BURNED: "android.permission.health.READ_TOTAL_CALORIES_BURNED";
|
|
56
|
+
readonly WRITE_TOTAL_CALORIES_BURNED: "android.permission.health.WRITE_TOTAL_CALORIES_BURNED";
|
|
57
|
+
readonly READ_DISTANCE: "android.permission.health.READ_DISTANCE";
|
|
58
|
+
readonly WRITE_DISTANCE: "android.permission.health.WRITE_DISTANCE";
|
|
59
|
+
readonly READ_WEIGHT: "android.permission.health.READ_WEIGHT";
|
|
60
|
+
readonly WRITE_WEIGHT: "android.permission.health.WRITE_WEIGHT";
|
|
61
|
+
readonly READ_HEIGHT: "android.permission.health.READ_HEIGHT";
|
|
62
|
+
readonly WRITE_HEIGHT: "android.permission.health.WRITE_HEIGHT";
|
|
63
|
+
readonly READ_BLOOD_PRESSURE: "android.permission.health.READ_BLOOD_PRESSURE";
|
|
64
|
+
readonly WRITE_BLOOD_PRESSURE: "android.permission.health.WRITE_BLOOD_PRESSURE";
|
|
65
|
+
readonly READ_BLOOD_GLUCOSE: "android.permission.health.READ_BLOOD_GLUCOSE";
|
|
66
|
+
readonly WRITE_BLOOD_GLUCOSE: "android.permission.health.WRITE_BLOOD_GLUCOSE";
|
|
67
|
+
readonly READ_OXYGEN_SATURATION: "android.permission.health.READ_OXYGEN_SATURATION";
|
|
68
|
+
readonly WRITE_OXYGEN_SATURATION: "android.permission.health.WRITE_OXYGEN_SATURATION";
|
|
69
|
+
readonly READ_BODY_TEMPERATURE: "android.permission.health.READ_BODY_TEMPERATURE";
|
|
70
|
+
readonly WRITE_BODY_TEMPERATURE: "android.permission.health.WRITE_BODY_TEMPERATURE";
|
|
71
|
+
readonly READ_BODY_FAT: "android.permission.health.READ_BODY_FAT";
|
|
72
|
+
readonly WRITE_BODY_FAT: "android.permission.health.WRITE_BODY_FAT";
|
|
73
|
+
readonly READ_HYDRATION: "android.permission.health.READ_HYDRATION";
|
|
74
|
+
readonly WRITE_HYDRATION: "android.permission.health.WRITE_HYDRATION";
|
|
75
|
+
readonly READ_EXERCISE: "android.permission.health.READ_EXERCISE";
|
|
76
|
+
readonly WRITE_EXERCISE: "android.permission.health.WRITE_EXERCISE";
|
|
77
|
+
readonly READ_EXERCISE_ROUTES: "android.permission.health.READ_EXERCISE_ROUTES";
|
|
78
|
+
readonly WRITE_EXERCISE_ROUTE: "android.permission.health.WRITE_EXERCISE_ROUTE";
|
|
79
|
+
readonly READ_PLANNED_EXERCISE: "android.permission.health.READ_PLANNED_EXERCISE";
|
|
80
|
+
readonly WRITE_PLANNED_EXERCISE: "android.permission.health.WRITE_PLANNED_EXERCISE";
|
|
81
|
+
readonly READ_RESTING_HEART_RATE: "android.permission.health.READ_RESTING_HEART_RATE";
|
|
82
|
+
readonly WRITE_RESTING_HEART_RATE: "android.permission.health.WRITE_RESTING_HEART_RATE";
|
|
83
|
+
readonly READ_RESPIRATORY_RATE: "android.permission.health.READ_RESPIRATORY_RATE";
|
|
84
|
+
readonly WRITE_RESPIRATORY_RATE: "android.permission.health.WRITE_RESPIRATORY_RATE";
|
|
85
|
+
readonly READ_FLOORS_CLIMBED: "android.permission.health.READ_FLOORS_CLIMBED";
|
|
86
|
+
readonly WRITE_FLOORS_CLIMBED: "android.permission.health.WRITE_FLOORS_CLIMBED";
|
|
87
|
+
readonly READ_ELEVATION_GAINED: "android.permission.health.READ_ELEVATION_GAINED";
|
|
88
|
+
readonly WRITE_ELEVATION_GAINED: "android.permission.health.WRITE_ELEVATION_GAINED";
|
|
89
|
+
readonly READ_MINDFULNESS: "android.permission.health.READ_MINDFULNESS";
|
|
90
|
+
readonly WRITE_MINDFULNESS: "android.permission.health.WRITE_MINDFULNESS";
|
|
91
|
+
readonly READ_SKIN_TEMPERATURE: "android.permission.health.READ_SKIN_TEMPERATURE";
|
|
92
|
+
readonly WRITE_SKIN_TEMPERATURE: "android.permission.health.WRITE_SKIN_TEMPERATURE";
|
|
93
|
+
readonly READ_ACTIVITY_INTENSITY: "android.permission.health.READ_ACTIVITY_INTENSITY";
|
|
94
|
+
readonly WRITE_ACTIVITY_INTENSITY: "android.permission.health.WRITE_ACTIVITY_INTENSITY";
|
|
95
|
+
readonly READ_NUTRITION: "android.permission.health.READ_NUTRITION";
|
|
96
|
+
readonly WRITE_NUTRITION: "android.permission.health.WRITE_NUTRITION";
|
|
97
|
+
readonly READ_VO2_MAX: "android.permission.health.READ_VO2_MAX";
|
|
98
|
+
readonly WRITE_VO2_MAX: "android.permission.health.WRITE_VO2_MAX";
|
|
99
|
+
readonly READ_SPEED: "android.permission.health.READ_SPEED";
|
|
100
|
+
readonly WRITE_SPEED: "android.permission.health.WRITE_SPEED";
|
|
101
|
+
readonly READ_POWER: "android.permission.health.READ_POWER";
|
|
102
|
+
readonly WRITE_POWER: "android.permission.health.WRITE_POWER";
|
|
103
|
+
readonly READ_WHEELCHAIR_PUSHES: "android.permission.health.READ_WHEELCHAIR_PUSHES";
|
|
104
|
+
readonly WRITE_WHEELCHAIR_PUSHES: "android.permission.health.WRITE_WHEELCHAIR_PUSHES";
|
|
105
|
+
readonly READ_MENSTRUATION: "android.permission.health.READ_MENSTRUATION";
|
|
106
|
+
readonly WRITE_MENSTRUATION: "android.permission.health.WRITE_MENSTRUATION";
|
|
107
|
+
readonly READ_OVULATION_TEST: "android.permission.health.READ_OVULATION_TEST";
|
|
108
|
+
readonly WRITE_OVULATION_TEST: "android.permission.health.WRITE_OVULATION_TEST";
|
|
109
|
+
readonly READ_CERVICAL_MUCUS: "android.permission.health.READ_CERVICAL_MUCUS";
|
|
110
|
+
readonly WRITE_CERVICAL_MUCUS: "android.permission.health.WRITE_CERVICAL_MUCUS";
|
|
111
|
+
readonly READ_INTERMENSTRUAL_BLEEDING: "android.permission.health.READ_INTERMENSTRUAL_BLEEDING";
|
|
112
|
+
readonly WRITE_INTERMENSTRUAL_BLEEDING: "android.permission.health.WRITE_INTERMENSTRUAL_BLEEDING";
|
|
113
|
+
readonly READ_SEXUAL_ACTIVITY: "android.permission.health.READ_SEXUAL_ACTIVITY";
|
|
114
|
+
readonly WRITE_SEXUAL_ACTIVITY: "android.permission.health.WRITE_SEXUAL_ACTIVITY";
|
|
115
|
+
readonly READ_BASAL_BODY_TEMPERATURE: "android.permission.health.READ_BASAL_BODY_TEMPERATURE";
|
|
116
|
+
readonly WRITE_BASAL_BODY_TEMPERATURE: "android.permission.health.WRITE_BASAL_BODY_TEMPERATURE";
|
|
117
|
+
readonly READ_LEAN_BODY_MASS: "android.permission.health.READ_LEAN_BODY_MASS";
|
|
118
|
+
readonly WRITE_LEAN_BODY_MASS: "android.permission.health.WRITE_LEAN_BODY_MASS";
|
|
119
|
+
readonly READ_BONE_MASS: "android.permission.health.READ_BONE_MASS";
|
|
120
|
+
readonly WRITE_BONE_MASS: "android.permission.health.WRITE_BONE_MASS";
|
|
121
|
+
readonly READ_BODY_WATER_MASS: "android.permission.health.READ_BODY_WATER_MASS";
|
|
122
|
+
readonly WRITE_BODY_WATER_MASS: "android.permission.health.WRITE_BODY_WATER_MASS";
|
|
123
|
+
readonly READ_BASAL_METABOLIC_RATE: "android.permission.health.READ_BASAL_METABOLIC_RATE";
|
|
124
|
+
readonly WRITE_BASAL_METABOLIC_RATE: "android.permission.health.WRITE_BASAL_METABOLIC_RATE";
|
|
125
|
+
readonly READ_HEART_RATE_VARIABILITY: "android.permission.health.READ_HEART_RATE_VARIABILITY";
|
|
126
|
+
readonly WRITE_HEART_RATE_VARIABILITY: "android.permission.health.WRITE_HEART_RATE_VARIABILITY";
|
|
127
|
+
readonly READ_HEALTH_DATA_HISTORY: "android.permission.health.READ_HEALTH_DATA_HISTORY";
|
|
128
|
+
readonly READ_HEALTH_DATA_IN_BACKGROUND: "android.permission.health.READ_HEALTH_DATA_IN_BACKGROUND";
|
|
129
|
+
readonly WRITE_MEDICAL_DATA: "android.permission.health.WRITE_MEDICAL_DATA";
|
|
130
|
+
readonly READ_MEDICAL_DATA_ALLERGIES_INTOLERANCES: "android.permission.health.READ_MEDICAL_DATA_ALLERGIES_INTOLERANCES";
|
|
131
|
+
readonly READ_MEDICAL_DATA_CONDITIONS: "android.permission.health.READ_MEDICAL_DATA_CONDITIONS";
|
|
132
|
+
readonly READ_MEDICAL_DATA_LABORATORY_RESULTS: "android.permission.health.READ_MEDICAL_DATA_LABORATORY_RESULTS";
|
|
133
|
+
readonly READ_MEDICAL_DATA_MEDICATIONS: "android.permission.health.READ_MEDICAL_DATA_MEDICATIONS";
|
|
134
|
+
readonly READ_MEDICAL_DATA_PERSONAL_DETAILS: "android.permission.health.READ_MEDICAL_DATA_PERSONAL_DETAILS";
|
|
135
|
+
readonly READ_MEDICAL_DATA_PRACTITIONER_DETAILS: "android.permission.health.READ_MEDICAL_DATA_PRACTITIONER_DETAILS";
|
|
136
|
+
readonly READ_MEDICAL_DATA_PREGNANCY: "android.permission.health.READ_MEDICAL_DATA_PREGNANCY";
|
|
137
|
+
readonly READ_MEDICAL_DATA_PROCEDURES: "android.permission.health.READ_MEDICAL_DATA_PROCEDURES";
|
|
138
|
+
readonly READ_MEDICAL_DATA_SOCIAL_HISTORY: "android.permission.health.READ_MEDICAL_DATA_SOCIAL_HISTORY";
|
|
139
|
+
readonly READ_MEDICAL_DATA_VACCINES: "android.permission.health.READ_MEDICAL_DATA_VACCINES";
|
|
140
|
+
readonly READ_MEDICAL_DATA_VISITS: "android.permission.health.READ_MEDICAL_DATA_VISITS";
|
|
141
|
+
readonly READ_MEDICAL_DATA_VITAL_SIGNS: "android.permission.health.READ_MEDICAL_DATA_VITAL_SIGNS";
|
|
142
|
+
};
|
|
143
|
+
export type PermissionKey = keyof typeof Permission;
|
|
144
|
+
export type DeviceInfo = {
|
|
145
|
+
/** Device.TYPE_* constant (0 = unknown, 1 = watch, 2 = phone, …). */
|
|
146
|
+
type: number;
|
|
147
|
+
manufacturer?: string | null;
|
|
148
|
+
model?: string | null;
|
|
149
|
+
};
|
|
150
|
+
export type RecordMetadata = {
|
|
151
|
+
/** Unique identifier assigned by Health Connect. Empty string for new records. */
|
|
152
|
+
id: string;
|
|
153
|
+
/** Optional caller-provided identifier; enables idempotent inserts. */
|
|
154
|
+
clientRecordId?: string | null;
|
|
155
|
+
clientRecordVersion?: number;
|
|
156
|
+
lastModifiedTime?: string;
|
|
157
|
+
dataOrigin?: string;
|
|
158
|
+
/**
|
|
159
|
+
* How the record was recorded. Compare against `RecordingMethod` constants.
|
|
160
|
+
* Use `RecordingMethod.MANUAL_ENTRY` to detect user-typed data regardless
|
|
161
|
+
* of which app (Health Connect, Google Fit, Samsung Health, etc.) wrote it.
|
|
162
|
+
*/
|
|
163
|
+
recordingMethod?: number;
|
|
164
|
+
/** Present on read when the writer set a device; optional on write. */
|
|
165
|
+
device?: DeviceInfo | null;
|
|
166
|
+
};
|
|
167
|
+
export type TimeRangeFilter = {
|
|
168
|
+
/** ISO 8601 start time (inclusive). */
|
|
169
|
+
startTime: string;
|
|
170
|
+
/** ISO 8601 end time (exclusive). */
|
|
171
|
+
endTime: string;
|
|
172
|
+
};
|
|
173
|
+
export type ReadRecordsOptions = {
|
|
174
|
+
timeRangeFilter?: TimeRangeFilter;
|
|
175
|
+
/** Filter by package names that wrote the records. */
|
|
176
|
+
dataOriginFilter?: string[];
|
|
177
|
+
/** Default: true (oldest first). */
|
|
178
|
+
ascendingOrder?: boolean;
|
|
179
|
+
/** Maximum number of records per page. Default: 1000. */
|
|
180
|
+
pageSize?: number;
|
|
181
|
+
/** Opaque token returned from a previous read; used for pagination. */
|
|
182
|
+
pageToken?: string;
|
|
183
|
+
};
|
|
184
|
+
export type ReadRecordsResponse<T> = {
|
|
185
|
+
records: T[];
|
|
186
|
+
/** Present when more pages are available. */
|
|
187
|
+
pageToken?: string | null;
|
|
188
|
+
};
|
|
189
|
+
/** Record types that support Health Connect aggregation in this library. */
|
|
190
|
+
export type AggregateRecordType = 'Steps' | 'Distance' | 'ActiveCaloriesBurned' | 'TotalCaloriesBurned' | 'HeartRate' | 'RestingHeartRate' | 'Weight' | 'Height' | 'Hydration' | 'FloorsClimbed' | 'ElevationGained' | 'ExerciseSession' | 'SleepSession' | 'BloodPressure' | 'MindfulnessSession' | 'ActivityIntensity' | 'Nutrition' | 'Speed' | 'Power' | 'StepsCadence' | 'CyclingPedalingCadence' | 'WheelchairPushes' | 'BasalMetabolicRate';
|
|
191
|
+
export type EnergyResult = {
|
|
192
|
+
inKilocalories: number;
|
|
193
|
+
inCalories: number;
|
|
194
|
+
inJoules: number;
|
|
195
|
+
};
|
|
196
|
+
export type LengthResult = {
|
|
197
|
+
inMeters: number;
|
|
198
|
+
inKilometers: number;
|
|
199
|
+
inMiles: number;
|
|
200
|
+
};
|
|
201
|
+
export type MassResult = {
|
|
202
|
+
inKilograms: number;
|
|
203
|
+
inGrams: number;
|
|
204
|
+
inPounds: number;
|
|
205
|
+
};
|
|
206
|
+
export type VolumeResult = {
|
|
207
|
+
inLiters: number;
|
|
208
|
+
inMilliliters: number;
|
|
209
|
+
};
|
|
210
|
+
export type PressureResult = {
|
|
211
|
+
inMillimetersOfMercury: number;
|
|
212
|
+
};
|
|
213
|
+
export type DurationResult = {
|
|
214
|
+
inSeconds: number;
|
|
215
|
+
};
|
|
216
|
+
export type VelocityResult = {
|
|
217
|
+
inMetersPerSecond: number;
|
|
218
|
+
inKilometersPerHour: number;
|
|
219
|
+
inMilesPerHour: number;
|
|
220
|
+
};
|
|
221
|
+
export type PowerResult = {
|
|
222
|
+
inWatts: number;
|
|
223
|
+
inKilocaloriesPerDay: number;
|
|
224
|
+
};
|
|
225
|
+
export type AggregateRequest = {
|
|
226
|
+
recordType: AggregateRecordType;
|
|
227
|
+
timeRangeFilter: TimeRangeFilter;
|
|
228
|
+
dataOriginFilter?: string[];
|
|
229
|
+
};
|
|
230
|
+
export type DurationRangeSlicer = {
|
|
231
|
+
unit: 'millis' | 'seconds' | 'minutes' | 'hours' | 'days';
|
|
232
|
+
value: number;
|
|
233
|
+
};
|
|
234
|
+
export type PeriodRangeSlicer = {
|
|
235
|
+
unit: 'days' | 'weeks' | 'months' | 'years';
|
|
236
|
+
value: number;
|
|
237
|
+
};
|
|
238
|
+
export type AggregateGroupByDurationRequest = AggregateRequest & {
|
|
239
|
+
timeRangeSlicer: DurationRangeSlicer;
|
|
240
|
+
};
|
|
241
|
+
export type AggregateGroupByPeriodRequest = AggregateRequest & {
|
|
242
|
+
timeRangeSlicer: PeriodRangeSlicer;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Aggregated metrics for a record type. Metric keys match Health Connect
|
|
246
|
+
* (e.g. `COUNT_TOTAL`, `BPM_AVG`). Missing data is `null`.
|
|
247
|
+
*/
|
|
248
|
+
export type AggregateMetricValue = number | EnergyResult | LengthResult | MassResult | VolumeResult | PressureResult | DurationResult | VelocityResult | PowerResult | null;
|
|
249
|
+
export type AggregateResult = {
|
|
250
|
+
recordType: AggregateRecordType;
|
|
251
|
+
dataOrigins: string[];
|
|
252
|
+
metrics: Record<string, AggregateMetricValue>;
|
|
253
|
+
};
|
|
254
|
+
export type AggregationResultGroupedByDuration = {
|
|
255
|
+
startTime: string;
|
|
256
|
+
endTime: string;
|
|
257
|
+
zoneOffset: string | null;
|
|
258
|
+
result: AggregateResult;
|
|
259
|
+
};
|
|
260
|
+
export type AggregationResultGroupedByPeriod = {
|
|
261
|
+
startTime: string;
|
|
262
|
+
endTime: string;
|
|
263
|
+
result: AggregateResult;
|
|
264
|
+
};
|
|
265
|
+
export type InsertRecordsResponse = {
|
|
266
|
+
recordIdsList: string[];
|
|
267
|
+
};
|
|
268
|
+
export type StepsRecord = {
|
|
269
|
+
recordType: 'Steps';
|
|
270
|
+
/** Number of steps. */
|
|
271
|
+
count: number;
|
|
272
|
+
startTime: string;
|
|
273
|
+
endTime: string;
|
|
274
|
+
startZoneOffset?: string;
|
|
275
|
+
endZoneOffset?: string;
|
|
276
|
+
metadata?: RecordMetadata;
|
|
277
|
+
};
|
|
278
|
+
export type HeartRateSample = {
|
|
279
|
+
time: string;
|
|
280
|
+
beatsPerMinute: number;
|
|
281
|
+
};
|
|
282
|
+
export type HeartRateRecord = {
|
|
283
|
+
recordType: 'HeartRate';
|
|
284
|
+
samples: HeartRateSample[];
|
|
285
|
+
startTime: string;
|
|
286
|
+
endTime: string;
|
|
287
|
+
startZoneOffset?: string;
|
|
288
|
+
endZoneOffset?: string;
|
|
289
|
+
metadata?: RecordMetadata;
|
|
290
|
+
};
|
|
291
|
+
export type SleepStage = {
|
|
292
|
+
startTime: string;
|
|
293
|
+
endTime: string;
|
|
294
|
+
/** See SleepStageType constants (0–7). */
|
|
295
|
+
stage: number;
|
|
296
|
+
};
|
|
297
|
+
export type SleepSessionRecord = {
|
|
298
|
+
recordType: 'SleepSession';
|
|
299
|
+
startTime: string;
|
|
300
|
+
endTime: string;
|
|
301
|
+
title?: string | null;
|
|
302
|
+
notes?: string | null;
|
|
303
|
+
stages?: SleepStage[];
|
|
304
|
+
startZoneOffset?: string;
|
|
305
|
+
endZoneOffset?: string;
|
|
306
|
+
metadata?: RecordMetadata;
|
|
307
|
+
};
|
|
308
|
+
export type ActiveCaloriesBurnedRecord = {
|
|
309
|
+
recordType: 'ActiveCaloriesBurned';
|
|
310
|
+
/** Energy in kilocalories. */
|
|
311
|
+
energy: number;
|
|
312
|
+
startTime: string;
|
|
313
|
+
endTime: string;
|
|
314
|
+
startZoneOffset?: string;
|
|
315
|
+
endZoneOffset?: string;
|
|
316
|
+
metadata?: RecordMetadata;
|
|
317
|
+
};
|
|
318
|
+
export type TotalCaloriesBurnedRecord = {
|
|
319
|
+
recordType: 'TotalCaloriesBurned';
|
|
320
|
+
/** Energy in kilocalories. */
|
|
321
|
+
energy: number;
|
|
322
|
+
startTime: string;
|
|
323
|
+
endTime: string;
|
|
324
|
+
startZoneOffset?: string;
|
|
325
|
+
endZoneOffset?: string;
|
|
326
|
+
metadata?: RecordMetadata;
|
|
327
|
+
};
|
|
328
|
+
export type DistanceRecord = {
|
|
329
|
+
recordType: 'Distance';
|
|
330
|
+
/** Distance in meters. */
|
|
331
|
+
distance: number;
|
|
332
|
+
startTime: string;
|
|
333
|
+
endTime: string;
|
|
334
|
+
startZoneOffset?: string;
|
|
335
|
+
endZoneOffset?: string;
|
|
336
|
+
metadata?: RecordMetadata;
|
|
337
|
+
};
|
|
338
|
+
export type WeightRecord = {
|
|
339
|
+
recordType: 'Weight';
|
|
340
|
+
/** Weight in kilograms. */
|
|
341
|
+
weight: number;
|
|
342
|
+
time: string;
|
|
343
|
+
zoneOffset?: string;
|
|
344
|
+
metadata?: RecordMetadata;
|
|
345
|
+
};
|
|
346
|
+
export type HeightRecord = {
|
|
347
|
+
recordType: 'Height';
|
|
348
|
+
/** Height in meters. */
|
|
349
|
+
height: number;
|
|
350
|
+
time: string;
|
|
351
|
+
zoneOffset?: string;
|
|
352
|
+
metadata?: RecordMetadata;
|
|
353
|
+
};
|
|
354
|
+
export type BloodPressureRecord = {
|
|
355
|
+
recordType: 'BloodPressure';
|
|
356
|
+
/** Systolic pressure in mmHg. */
|
|
357
|
+
systolic: number;
|
|
358
|
+
/** Diastolic pressure in mmHg. */
|
|
359
|
+
diastolic: number;
|
|
360
|
+
/** BloodPressureRecord.BODY_POSITION_* constant (0 = unknown). */
|
|
361
|
+
bodyPosition?: number;
|
|
362
|
+
/** BloodPressureRecord.MEASUREMENT_LOCATION_* constant (0 = unknown). */
|
|
363
|
+
measurementLocation?: number;
|
|
364
|
+
time: string;
|
|
365
|
+
zoneOffset?: string;
|
|
366
|
+
metadata?: RecordMetadata;
|
|
367
|
+
};
|
|
368
|
+
export type BloodGlucoseRecord = {
|
|
369
|
+
recordType: 'BloodGlucose';
|
|
370
|
+
/** Blood glucose level in mmol/L. */
|
|
371
|
+
level: number;
|
|
372
|
+
/** BloodGlucoseRecord.SPECIMEN_SOURCE_* (0 = unknown). */
|
|
373
|
+
specimenSource?: number;
|
|
374
|
+
/** MealType.MEAL_TYPE_* (0 = unknown). */
|
|
375
|
+
mealType?: number;
|
|
376
|
+
/** BloodGlucoseRecord.RELATION_TO_MEAL_* (0 = unknown). */
|
|
377
|
+
relationToMeal?: number;
|
|
378
|
+
time: string;
|
|
379
|
+
zoneOffset?: string;
|
|
380
|
+
metadata?: RecordMetadata;
|
|
381
|
+
};
|
|
382
|
+
export type OxygenSaturationRecord = {
|
|
383
|
+
recordType: 'OxygenSaturation';
|
|
384
|
+
/** Percentage value between 0 and 100. */
|
|
385
|
+
percentage: number;
|
|
386
|
+
time: string;
|
|
387
|
+
zoneOffset?: string;
|
|
388
|
+
metadata?: RecordMetadata;
|
|
389
|
+
};
|
|
390
|
+
export type BodyTemperatureRecord = {
|
|
391
|
+
recordType: 'BodyTemperature';
|
|
392
|
+
/** Temperature in Celsius. */
|
|
393
|
+
temperature: number;
|
|
394
|
+
/** BodyTemperatureRecord.MEASUREMENT_LOCATION_* (0 = unknown). */
|
|
395
|
+
measurementLocation?: number;
|
|
396
|
+
time: string;
|
|
397
|
+
zoneOffset?: string;
|
|
398
|
+
metadata?: RecordMetadata;
|
|
399
|
+
};
|
|
400
|
+
export type BodyFatRecord = {
|
|
401
|
+
recordType: 'BodyFat';
|
|
402
|
+
/** Body fat percentage between 0 and 100. */
|
|
403
|
+
percentage: number;
|
|
404
|
+
time: string;
|
|
405
|
+
zoneOffset?: string;
|
|
406
|
+
metadata?: RecordMetadata;
|
|
407
|
+
};
|
|
408
|
+
export type HydrationRecord = {
|
|
409
|
+
recordType: 'Hydration';
|
|
410
|
+
/** Volume of water consumed in liters. */
|
|
411
|
+
volume: number;
|
|
412
|
+
startTime: string;
|
|
413
|
+
endTime: string;
|
|
414
|
+
startZoneOffset?: string;
|
|
415
|
+
endZoneOffset?: string;
|
|
416
|
+
metadata?: RecordMetadata;
|
|
417
|
+
};
|
|
418
|
+
export type ExerciseSegment = {
|
|
419
|
+
startTime: string;
|
|
420
|
+
endTime: string;
|
|
421
|
+
/** {@link ExerciseSegmentType} constant. */
|
|
422
|
+
segmentType: number;
|
|
423
|
+
repetitions?: number;
|
|
424
|
+
};
|
|
425
|
+
export type ExerciseLap = {
|
|
426
|
+
startTime: string;
|
|
427
|
+
endTime: string;
|
|
428
|
+
/** Lap length in meters. */
|
|
429
|
+
length?: number;
|
|
430
|
+
};
|
|
431
|
+
/**
|
|
432
|
+
* Write-side route point. Optional accuracy/altitude are meters.
|
|
433
|
+
* Omit optional fields instead of sending empty objects.
|
|
434
|
+
*/
|
|
435
|
+
export type ExerciseRouteLocation = {
|
|
436
|
+
time: string;
|
|
437
|
+
latitude: number;
|
|
438
|
+
longitude: number;
|
|
439
|
+
/** Meters above WGS84 ellipsoid. */
|
|
440
|
+
altitude?: number;
|
|
441
|
+
horizontalAccuracy?: number;
|
|
442
|
+
verticalAccuracy?: number;
|
|
443
|
+
};
|
|
444
|
+
/** Read-side length fields use multi-unit result objects. */
|
|
445
|
+
export type ExerciseRouteLocationResult = {
|
|
446
|
+
time: string;
|
|
447
|
+
latitude: number;
|
|
448
|
+
longitude: number;
|
|
449
|
+
altitude?: LengthResult | null;
|
|
450
|
+
horizontalAccuracy?: LengthResult | null;
|
|
451
|
+
verticalAccuracy?: LengthResult | null;
|
|
452
|
+
};
|
|
453
|
+
export type ExerciseRouteWrite = {
|
|
454
|
+
route: ExerciseRouteLocation[];
|
|
455
|
+
};
|
|
456
|
+
export type ExerciseRouteRead = {
|
|
457
|
+
type: 'DATA' | 'NO_DATA' | 'CONSENT_REQUIRED';
|
|
458
|
+
route: ExerciseRouteLocationResult[];
|
|
459
|
+
};
|
|
460
|
+
export type ExerciseSessionRecord = {
|
|
461
|
+
recordType: 'ExerciseSession';
|
|
462
|
+
/** ExerciseSessionRecord.EXERCISE_TYPE_* constant — use {@link ExerciseType}. */
|
|
463
|
+
exerciseType: number;
|
|
464
|
+
startTime: string;
|
|
465
|
+
endTime: string;
|
|
466
|
+
title?: string | null;
|
|
467
|
+
notes?: string | null;
|
|
468
|
+
segments?: ExerciseSegment[];
|
|
469
|
+
laps?: ExerciseLap[];
|
|
470
|
+
/** Write: pass `{ route: [...] }`. Read: `{ type, route }` with LengthResult fields. */
|
|
471
|
+
exerciseRoute?: ExerciseRouteWrite | ExerciseRouteRead;
|
|
472
|
+
/**
|
|
473
|
+
* Link to a planned exercise session id.
|
|
474
|
+
* Requires `getFeatureStatus('exerciseSessionImprovements') === 'available'`.
|
|
475
|
+
*/
|
|
476
|
+
plannedExerciseSessionId?: string | null;
|
|
477
|
+
/**
|
|
478
|
+
* Rate of perceived exertion (typically 0–10).
|
|
479
|
+
* Requires `getFeatureStatus('exerciseSessionImprovements') === 'available'`.
|
|
480
|
+
*/
|
|
481
|
+
rateOfPerceivedExertion?: number | null;
|
|
482
|
+
startZoneOffset?: string;
|
|
483
|
+
endZoneOffset?: string;
|
|
484
|
+
metadata?: RecordMetadata;
|
|
485
|
+
};
|
|
486
|
+
export type RestingHeartRateRecord = {
|
|
487
|
+
recordType: 'RestingHeartRate';
|
|
488
|
+
beatsPerMinute: number;
|
|
489
|
+
time: string;
|
|
490
|
+
zoneOffset?: string;
|
|
491
|
+
metadata?: RecordMetadata;
|
|
492
|
+
};
|
|
493
|
+
export type RespiratoryRateRecord = {
|
|
494
|
+
recordType: 'RespiratoryRate';
|
|
495
|
+
/** Breaths per minute. */
|
|
496
|
+
rate: number;
|
|
497
|
+
time: string;
|
|
498
|
+
zoneOffset?: string;
|
|
499
|
+
metadata?: RecordMetadata;
|
|
500
|
+
};
|
|
501
|
+
export type FloorsClimbedRecord = {
|
|
502
|
+
recordType: 'FloorsClimbed';
|
|
503
|
+
floors: number;
|
|
504
|
+
startTime: string;
|
|
505
|
+
endTime: string;
|
|
506
|
+
startZoneOffset?: string;
|
|
507
|
+
endZoneOffset?: string;
|
|
508
|
+
metadata?: RecordMetadata;
|
|
509
|
+
};
|
|
510
|
+
export type ElevationGainedRecord = {
|
|
511
|
+
recordType: 'ElevationGained';
|
|
512
|
+
/** Elevation gained in meters. */
|
|
513
|
+
elevation: number;
|
|
514
|
+
startTime: string;
|
|
515
|
+
endTime: string;
|
|
516
|
+
startZoneOffset?: string;
|
|
517
|
+
endZoneOffset?: string;
|
|
518
|
+
metadata?: RecordMetadata;
|
|
519
|
+
};
|
|
520
|
+
/** Requires FEATURE_MINDFULNESS_SESSION on the device. */
|
|
521
|
+
export type MindfulnessSessionRecord = {
|
|
522
|
+
recordType: 'MindfulnessSession';
|
|
523
|
+
/** MindfulnessSessionType constant (0–5). */
|
|
524
|
+
mindfulnessSessionType: number;
|
|
525
|
+
startTime: string;
|
|
526
|
+
endTime: string;
|
|
527
|
+
title?: string | null;
|
|
528
|
+
notes?: string | null;
|
|
529
|
+
startZoneOffset?: string;
|
|
530
|
+
endZoneOffset?: string;
|
|
531
|
+
metadata?: RecordMetadata;
|
|
532
|
+
};
|
|
533
|
+
export type SkinTemperatureDelta = {
|
|
534
|
+
time: string;
|
|
535
|
+
/** Delta in Celsius degrees (−30 to 30). */
|
|
536
|
+
delta: number;
|
|
537
|
+
};
|
|
538
|
+
/** Requires FEATURE_SKIN_TEMPERATURE on the device. */
|
|
539
|
+
export type SkinTemperatureRecord = {
|
|
540
|
+
recordType: 'SkinTemperature';
|
|
541
|
+
deltas: SkinTemperatureDelta[];
|
|
542
|
+
/** Optional baseline in Celsius. */
|
|
543
|
+
baseline?: number | null;
|
|
544
|
+
/** SkinTemperatureMeasurementLocation (0–3). */
|
|
545
|
+
measurementLocation?: number;
|
|
546
|
+
startTime: string;
|
|
547
|
+
endTime: string;
|
|
548
|
+
startZoneOffset?: string;
|
|
549
|
+
endZoneOffset?: string;
|
|
550
|
+
metadata?: RecordMetadata;
|
|
551
|
+
};
|
|
552
|
+
/** Requires FEATURE_ACTIVITY_INTENSITY on the device. */
|
|
553
|
+
export type ActivityIntensityRecord = {
|
|
554
|
+
recordType: 'ActivityIntensity';
|
|
555
|
+
/** ActivityIntensityType: 0 = moderate, 1 = vigorous. */
|
|
556
|
+
activityIntensityType: number;
|
|
557
|
+
startTime: string;
|
|
558
|
+
endTime: string;
|
|
559
|
+
startZoneOffset?: string;
|
|
560
|
+
endZoneOffset?: string;
|
|
561
|
+
metadata?: RecordMetadata;
|
|
562
|
+
};
|
|
563
|
+
/**
|
|
564
|
+
* Nutrient masses are grams; `energy` and `energyFromFat` are kilocalories.
|
|
565
|
+
*/
|
|
566
|
+
export type NutritionRecord = {
|
|
567
|
+
recordType: 'Nutrition';
|
|
568
|
+
biotin?: number | null;
|
|
569
|
+
caffeine?: number | null;
|
|
570
|
+
calcium?: number | null;
|
|
571
|
+
energy?: number | null;
|
|
572
|
+
energyFromFat?: number | null;
|
|
573
|
+
chloride?: number | null;
|
|
574
|
+
cholesterol?: number | null;
|
|
575
|
+
chromium?: number | null;
|
|
576
|
+
copper?: number | null;
|
|
577
|
+
dietaryFiber?: number | null;
|
|
578
|
+
folate?: number | null;
|
|
579
|
+
folicAcid?: number | null;
|
|
580
|
+
iodine?: number | null;
|
|
581
|
+
iron?: number | null;
|
|
582
|
+
magnesium?: number | null;
|
|
583
|
+
manganese?: number | null;
|
|
584
|
+
molybdenum?: number | null;
|
|
585
|
+
monounsaturatedFat?: number | null;
|
|
586
|
+
niacin?: number | null;
|
|
587
|
+
pantothenicAcid?: number | null;
|
|
588
|
+
phosphorus?: number | null;
|
|
589
|
+
polyunsaturatedFat?: number | null;
|
|
590
|
+
potassium?: number | null;
|
|
591
|
+
protein?: number | null;
|
|
592
|
+
riboflavin?: number | null;
|
|
593
|
+
saturatedFat?: number | null;
|
|
594
|
+
selenium?: number | null;
|
|
595
|
+
sodium?: number | null;
|
|
596
|
+
sugar?: number | null;
|
|
597
|
+
thiamin?: number | null;
|
|
598
|
+
totalCarbohydrate?: number | null;
|
|
599
|
+
totalFat?: number | null;
|
|
600
|
+
transFat?: number | null;
|
|
601
|
+
unsaturatedFat?: number | null;
|
|
602
|
+
vitaminA?: number | null;
|
|
603
|
+
vitaminB12?: number | null;
|
|
604
|
+
vitaminB6?: number | null;
|
|
605
|
+
vitaminC?: number | null;
|
|
606
|
+
vitaminD?: number | null;
|
|
607
|
+
vitaminE?: number | null;
|
|
608
|
+
vitaminK?: number | null;
|
|
609
|
+
zinc?: number | null;
|
|
610
|
+
name?: string | null;
|
|
611
|
+
/** MealType.MEAL_TYPE_* constant. */
|
|
612
|
+
mealType?: number;
|
|
613
|
+
startTime: string;
|
|
614
|
+
endTime: string;
|
|
615
|
+
startZoneOffset?: string;
|
|
616
|
+
endZoneOffset?: string;
|
|
617
|
+
metadata?: RecordMetadata;
|
|
618
|
+
};
|
|
619
|
+
export type Vo2MaxRecord = {
|
|
620
|
+
recordType: 'Vo2Max';
|
|
621
|
+
vo2MillilitersPerMinuteKilogram: number;
|
|
622
|
+
/** Vo2MaxRecord.MEASUREMENT_METHOD_* constant (0–5). */
|
|
623
|
+
measurementMethod?: number;
|
|
624
|
+
time: string;
|
|
625
|
+
zoneOffset?: string;
|
|
626
|
+
metadata?: RecordMetadata;
|
|
627
|
+
};
|
|
628
|
+
export type SpeedSample = {
|
|
629
|
+
time: string;
|
|
630
|
+
metersPerSecond: number;
|
|
631
|
+
};
|
|
632
|
+
export type SpeedRecord = {
|
|
633
|
+
recordType: 'Speed';
|
|
634
|
+
samples: SpeedSample[];
|
|
635
|
+
startTime: string;
|
|
636
|
+
endTime: string;
|
|
637
|
+
startZoneOffset?: string;
|
|
638
|
+
endZoneOffset?: string;
|
|
639
|
+
metadata?: RecordMetadata;
|
|
640
|
+
};
|
|
641
|
+
export type PowerSample = {
|
|
642
|
+
time: string;
|
|
643
|
+
watts: number;
|
|
644
|
+
};
|
|
645
|
+
export type PowerRecord = {
|
|
646
|
+
recordType: 'Power';
|
|
647
|
+
samples: PowerSample[];
|
|
648
|
+
startTime: string;
|
|
649
|
+
endTime: string;
|
|
650
|
+
startZoneOffset?: string;
|
|
651
|
+
endZoneOffset?: string;
|
|
652
|
+
metadata?: RecordMetadata;
|
|
653
|
+
};
|
|
654
|
+
export type StepsCadenceSample = {
|
|
655
|
+
time: string;
|
|
656
|
+
/** Steps per minute. */
|
|
657
|
+
rate: number;
|
|
658
|
+
};
|
|
659
|
+
export type StepsCadenceRecord = {
|
|
660
|
+
recordType: 'StepsCadence';
|
|
661
|
+
samples: StepsCadenceSample[];
|
|
662
|
+
startTime: string;
|
|
663
|
+
endTime: string;
|
|
664
|
+
startZoneOffset?: string;
|
|
665
|
+
endZoneOffset?: string;
|
|
666
|
+
metadata?: RecordMetadata;
|
|
667
|
+
};
|
|
668
|
+
export type CyclingPedalingCadenceSample = {
|
|
669
|
+
time: string;
|
|
670
|
+
revolutionsPerMinute: number;
|
|
671
|
+
};
|
|
672
|
+
export type CyclingPedalingCadenceRecord = {
|
|
673
|
+
recordType: 'CyclingPedalingCadence';
|
|
674
|
+
samples: CyclingPedalingCadenceSample[];
|
|
675
|
+
startTime: string;
|
|
676
|
+
endTime: string;
|
|
677
|
+
startZoneOffset?: string;
|
|
678
|
+
endZoneOffset?: string;
|
|
679
|
+
metadata?: RecordMetadata;
|
|
680
|
+
};
|
|
681
|
+
export type WheelchairPushesRecord = {
|
|
682
|
+
recordType: 'WheelchairPushes';
|
|
683
|
+
count: number;
|
|
684
|
+
startTime: string;
|
|
685
|
+
endTime: string;
|
|
686
|
+
startZoneOffset?: string;
|
|
687
|
+
endZoneOffset?: string;
|
|
688
|
+
metadata?: RecordMetadata;
|
|
689
|
+
};
|
|
690
|
+
export type MenstruationFlowRecord = {
|
|
691
|
+
recordType: 'MenstruationFlow';
|
|
692
|
+
/** MenstruationFlowRecord.FLOW_* constant (0–3). */
|
|
693
|
+
flow?: number;
|
|
694
|
+
time: string;
|
|
695
|
+
zoneOffset?: string;
|
|
696
|
+
metadata?: RecordMetadata;
|
|
697
|
+
};
|
|
698
|
+
export type MenstruationPeriodRecord = {
|
|
699
|
+
recordType: 'MenstruationPeriod';
|
|
700
|
+
startTime: string;
|
|
701
|
+
endTime: string;
|
|
702
|
+
startZoneOffset?: string;
|
|
703
|
+
endZoneOffset?: string;
|
|
704
|
+
metadata?: RecordMetadata;
|
|
705
|
+
};
|
|
706
|
+
export type OvulationTestRecord = {
|
|
707
|
+
recordType: 'OvulationTest';
|
|
708
|
+
/** OvulationTestRecord.RESULT_* constant (0–3). */
|
|
709
|
+
result: number;
|
|
710
|
+
time: string;
|
|
711
|
+
zoneOffset?: string;
|
|
712
|
+
metadata?: RecordMetadata;
|
|
713
|
+
};
|
|
714
|
+
export type CervicalMucusRecord = {
|
|
715
|
+
recordType: 'CervicalMucus';
|
|
716
|
+
/** CervicalMucusRecord.APPEARANCE_* constant (0–6). */
|
|
717
|
+
appearance?: number;
|
|
718
|
+
/** CervicalMucusRecord.SENSATION_* constant (0–3). */
|
|
719
|
+
sensation?: number;
|
|
720
|
+
time: string;
|
|
721
|
+
zoneOffset?: string;
|
|
722
|
+
metadata?: RecordMetadata;
|
|
723
|
+
};
|
|
724
|
+
export type IntermenstrualBleedingRecord = {
|
|
725
|
+
recordType: 'IntermenstrualBleeding';
|
|
726
|
+
time: string;
|
|
727
|
+
zoneOffset?: string;
|
|
728
|
+
metadata?: RecordMetadata;
|
|
729
|
+
};
|
|
730
|
+
export type SexualActivityRecord = {
|
|
731
|
+
recordType: 'SexualActivity';
|
|
732
|
+
/** SexualActivityRecord.PROTECTION_USED_* constant (0–2). */
|
|
733
|
+
protectionUsed?: number;
|
|
734
|
+
time: string;
|
|
735
|
+
zoneOffset?: string;
|
|
736
|
+
metadata?: RecordMetadata;
|
|
737
|
+
};
|
|
738
|
+
export type BasalBodyTemperatureRecord = {
|
|
739
|
+
recordType: 'BasalBodyTemperature';
|
|
740
|
+
/** Celsius. */
|
|
741
|
+
temperature: number;
|
|
742
|
+
/** BodyTemperatureMeasurementLocation constant. */
|
|
743
|
+
measurementLocation?: number;
|
|
744
|
+
time: string;
|
|
745
|
+
zoneOffset?: string;
|
|
746
|
+
metadata?: RecordMetadata;
|
|
747
|
+
};
|
|
748
|
+
export type LeanBodyMassRecord = {
|
|
749
|
+
recordType: 'LeanBodyMass';
|
|
750
|
+
/** Kilograms. */
|
|
751
|
+
mass: number;
|
|
752
|
+
time: string;
|
|
753
|
+
zoneOffset?: string;
|
|
754
|
+
metadata?: RecordMetadata;
|
|
755
|
+
};
|
|
756
|
+
export type BoneMassRecord = {
|
|
757
|
+
recordType: 'BoneMass';
|
|
758
|
+
/** Kilograms. */
|
|
759
|
+
mass: number;
|
|
760
|
+
time: string;
|
|
761
|
+
zoneOffset?: string;
|
|
762
|
+
metadata?: RecordMetadata;
|
|
763
|
+
};
|
|
764
|
+
export type BodyWaterMassRecord = {
|
|
765
|
+
recordType: 'BodyWaterMass';
|
|
766
|
+
/** Kilograms. */
|
|
767
|
+
mass: number;
|
|
768
|
+
time: string;
|
|
769
|
+
zoneOffset?: string;
|
|
770
|
+
metadata?: RecordMetadata;
|
|
771
|
+
};
|
|
772
|
+
export type BasalMetabolicRateRecord = {
|
|
773
|
+
recordType: 'BasalMetabolicRate';
|
|
774
|
+
/** Kilocalories per day. */
|
|
775
|
+
basalMetabolicRate: number;
|
|
776
|
+
time: string;
|
|
777
|
+
zoneOffset?: string;
|
|
778
|
+
metadata?: RecordMetadata;
|
|
779
|
+
};
|
|
780
|
+
export type HeartRateVariabilityRmssdRecord = {
|
|
781
|
+
recordType: 'HeartRateVariabilityRmssd';
|
|
782
|
+
/** RMSSD in milliseconds. */
|
|
783
|
+
heartRateVariabilityMillis: number;
|
|
784
|
+
time: string;
|
|
785
|
+
zoneOffset?: string;
|
|
786
|
+
metadata?: RecordMetadata;
|
|
787
|
+
};
|
|
788
|
+
/** Requires `getFeatureStatus('plannedExercise') === 'available'`. */
|
|
789
|
+
export type ExerciseCompletionGoal = {
|
|
790
|
+
type: 'Distance';
|
|
791
|
+
distance: number;
|
|
792
|
+
} | {
|
|
793
|
+
type: 'Duration';
|
|
794
|
+
durationMillis: number;
|
|
795
|
+
} | {
|
|
796
|
+
type: 'Repetitions';
|
|
797
|
+
repetitions: number;
|
|
798
|
+
} | {
|
|
799
|
+
type: 'Steps';
|
|
800
|
+
steps: number;
|
|
801
|
+
} | {
|
|
802
|
+
type: 'ActiveCaloriesBurned';
|
|
803
|
+
energy: number;
|
|
804
|
+
} | {
|
|
805
|
+
type: 'TotalCaloriesBurned';
|
|
806
|
+
energy: number;
|
|
807
|
+
} | {
|
|
808
|
+
type: 'DistanceAndDuration';
|
|
809
|
+
distance: number;
|
|
810
|
+
durationMillis: number;
|
|
811
|
+
} | {
|
|
812
|
+
type: 'ManualCompletion';
|
|
813
|
+
} | {
|
|
814
|
+
type: 'Unknown';
|
|
815
|
+
};
|
|
816
|
+
export type ExercisePerformanceTarget = {
|
|
817
|
+
type: 'HeartRate';
|
|
818
|
+
minHeartRate: number;
|
|
819
|
+
maxHeartRate: number;
|
|
820
|
+
} | {
|
|
821
|
+
type: 'Speed';
|
|
822
|
+
minMetersPerSecond: number;
|
|
823
|
+
maxMetersPerSecond: number;
|
|
824
|
+
} | {
|
|
825
|
+
type: 'Power';
|
|
826
|
+
minWatts: number;
|
|
827
|
+
maxWatts: number;
|
|
828
|
+
} | {
|
|
829
|
+
type: 'Cadence';
|
|
830
|
+
minRpm: number;
|
|
831
|
+
maxRpm: number;
|
|
832
|
+
} | {
|
|
833
|
+
type: 'Weight';
|
|
834
|
+
mass: number;
|
|
835
|
+
} | {
|
|
836
|
+
type: 'RateOfPerceivedExertion';
|
|
837
|
+
rpe: number;
|
|
838
|
+
} | {
|
|
839
|
+
type: 'Amrap';
|
|
840
|
+
} | {
|
|
841
|
+
type: 'Unknown';
|
|
842
|
+
};
|
|
843
|
+
export type PlannedExerciseStep = {
|
|
844
|
+
/** Prefer {@link ExerciseSegmentType} (segment ids, not session ExerciseType). */
|
|
845
|
+
exerciseType: number;
|
|
846
|
+
/** {@link ExercisePhase} constant. */
|
|
847
|
+
exercisePhase: number;
|
|
848
|
+
completionGoal: ExerciseCompletionGoal;
|
|
849
|
+
performanceTargets?: ExercisePerformanceTarget[];
|
|
850
|
+
description?: string | null;
|
|
851
|
+
};
|
|
852
|
+
export type PlannedExerciseBlock = {
|
|
853
|
+
repetitions: number;
|
|
854
|
+
steps: PlannedExerciseStep[];
|
|
855
|
+
description?: string | null;
|
|
856
|
+
};
|
|
857
|
+
/** Requires FEATURE_PLANNED_EXERCISE on the device. */
|
|
858
|
+
export type PlannedExerciseSessionRecord = {
|
|
859
|
+
recordType: 'PlannedExerciseSession';
|
|
860
|
+
/** Session-level {@link ExerciseType}. */
|
|
861
|
+
exerciseType: number;
|
|
862
|
+
startTime: string;
|
|
863
|
+
endTime: string;
|
|
864
|
+
title?: string | null;
|
|
865
|
+
notes?: string | null;
|
|
866
|
+
blocks?: PlannedExerciseBlock[];
|
|
867
|
+
/** Read-only link filled when a related ExerciseSession completes. */
|
|
868
|
+
completedExerciseSessionId?: string | null;
|
|
869
|
+
hasExplicitTime?: boolean;
|
|
870
|
+
startZoneOffset?: string;
|
|
871
|
+
endZoneOffset?: string;
|
|
872
|
+
metadata?: RecordMetadata;
|
|
873
|
+
};
|
|
874
|
+
export type HealthRecord = StepsRecord | HeartRateRecord | SleepSessionRecord | ActiveCaloriesBurnedRecord | TotalCaloriesBurnedRecord | DistanceRecord | WeightRecord | HeightRecord | BloodPressureRecord | BloodGlucoseRecord | OxygenSaturationRecord | BodyTemperatureRecord | BodyFatRecord | HydrationRecord | ExerciseSessionRecord | RestingHeartRateRecord | RespiratoryRateRecord | FloorsClimbedRecord | ElevationGainedRecord | MindfulnessSessionRecord | SkinTemperatureRecord | ActivityIntensityRecord | NutritionRecord | Vo2MaxRecord | SpeedRecord | PowerRecord | StepsCadenceRecord | CyclingPedalingCadenceRecord | WheelchairPushesRecord | MenstruationFlowRecord | MenstruationPeriodRecord | OvulationTestRecord | CervicalMucusRecord | IntermenstrualBleedingRecord | SexualActivityRecord | BasalBodyTemperatureRecord | LeanBodyMassRecord | BoneMassRecord | BodyWaterMassRecord | BasalMetabolicRateRecord | HeartRateVariabilityRmssdRecord | PlannedExerciseSessionRecord;
|
|
875
|
+
export type RecordType = HealthRecord['recordType'];
|
|
876
|
+
export type GetChangesTokenRequest = {
|
|
877
|
+
/** Prefer one type per token so a revoked permission cannot invalidate others. */
|
|
878
|
+
recordTypes: RecordType[];
|
|
879
|
+
/** Optional package-name filters (data origins). */
|
|
880
|
+
dataOriginFilters?: string[];
|
|
881
|
+
};
|
|
882
|
+
export type UpsertionChange = {
|
|
883
|
+
record: HealthRecord;
|
|
884
|
+
};
|
|
885
|
+
export type DeletionChange = {
|
|
886
|
+
recordId: string;
|
|
887
|
+
};
|
|
888
|
+
export type GetChangesOptions = {
|
|
889
|
+
/** Soft page size hint (1–5000). Omit for platform default. */
|
|
890
|
+
pageSize?: number;
|
|
891
|
+
};
|
|
892
|
+
export type GetChangesResponse = {
|
|
893
|
+
upsertionChanges: UpsertionChange[];
|
|
894
|
+
deletionChanges: DeletionChange[];
|
|
895
|
+
/** Persist and pass to the next {@link getChanges} call. */
|
|
896
|
+
nextChangesToken: string;
|
|
897
|
+
/** Call {@link getChanges} again with `nextChangesToken` until false. */
|
|
898
|
+
hasMore: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* Token older than ~30 days. Re-sync with `readRecords` then call
|
|
901
|
+
* {@link getChangesToken} for a fresh token.
|
|
902
|
+
*/
|
|
903
|
+
changesTokenExpired: boolean;
|
|
904
|
+
};
|
|
905
|
+
export declare const SleepStageType: {
|
|
906
|
+
readonly UNKNOWN: 0;
|
|
907
|
+
readonly AWAKE: 1;
|
|
908
|
+
readonly SLEEPING: 2;
|
|
909
|
+
readonly OUT_OF_BED: 3;
|
|
910
|
+
readonly LIGHT: 4;
|
|
911
|
+
readonly DEEP: 5;
|
|
912
|
+
readonly REM: 6;
|
|
913
|
+
readonly AWAKE_IN_BED: 7;
|
|
914
|
+
};
|
|
915
|
+
/**
|
|
916
|
+
* `ExerciseSessionRecord.EXERCISE_TYPE_*` — values match connect-client 1.2.
|
|
917
|
+
* Gaps in numbering are intentional (removed / reserved platform ids).
|
|
918
|
+
* Segment-level types belong in {@link ExerciseSegmentType}, not here.
|
|
919
|
+
*/
|
|
920
|
+
export declare const ExerciseType: {
|
|
921
|
+
readonly OTHER_WORKOUT: 0;
|
|
922
|
+
readonly BADMINTON: 2;
|
|
923
|
+
readonly BASEBALL: 4;
|
|
924
|
+
readonly BASKETBALL: 5;
|
|
925
|
+
readonly BIKING: 8;
|
|
926
|
+
readonly BIKING_STATIONARY: 9;
|
|
927
|
+
readonly BOOT_CAMP: 10;
|
|
928
|
+
readonly BOXING: 11;
|
|
929
|
+
readonly CALISTHENICS: 13;
|
|
930
|
+
readonly CRICKET: 14;
|
|
931
|
+
readonly DANCING: 16;
|
|
932
|
+
readonly ELLIPTICAL: 25;
|
|
933
|
+
readonly EXERCISE_CLASS: 26;
|
|
934
|
+
readonly FENCING: 27;
|
|
935
|
+
readonly FOOTBALL_AMERICAN: 28;
|
|
936
|
+
readonly FOOTBALL_AUSTRALIAN: 29;
|
|
937
|
+
readonly FRISBEE_DISC: 31;
|
|
938
|
+
readonly GOLF: 32;
|
|
939
|
+
readonly GUIDED_BREATHING: 33;
|
|
940
|
+
readonly GYMNASTICS: 34;
|
|
941
|
+
readonly HANDBALL: 35;
|
|
942
|
+
readonly HIGH_INTENSITY_INTERVAL_TRAINING: 36;
|
|
943
|
+
readonly HIKING: 37;
|
|
944
|
+
readonly ICE_HOCKEY: 38;
|
|
945
|
+
readonly ICE_SKATING: 39;
|
|
946
|
+
readonly MARTIAL_ARTS: 44;
|
|
947
|
+
readonly PADDLING: 46;
|
|
948
|
+
readonly PARAGLIDING: 47;
|
|
949
|
+
readonly PILATES: 48;
|
|
950
|
+
readonly RACQUETBALL: 50;
|
|
951
|
+
readonly ROCK_CLIMBING: 51;
|
|
952
|
+
readonly ROLLER_HOCKEY: 52;
|
|
953
|
+
readonly ROWING: 53;
|
|
954
|
+
readonly ROWING_MACHINE: 54;
|
|
955
|
+
readonly RUGBY: 55;
|
|
956
|
+
readonly RUNNING: 56;
|
|
957
|
+
readonly RUNNING_TREADMILL: 57;
|
|
958
|
+
readonly SAILING: 58;
|
|
959
|
+
readonly SCUBA_DIVING: 59;
|
|
960
|
+
readonly SKATING: 60;
|
|
961
|
+
readonly SKIING: 61;
|
|
962
|
+
readonly SNOWBOARDING: 62;
|
|
963
|
+
readonly SNOWSHOEING: 63;
|
|
964
|
+
readonly SOCCER: 64;
|
|
965
|
+
readonly SOFTBALL: 65;
|
|
966
|
+
readonly SQUASH: 66;
|
|
967
|
+
readonly STAIR_CLIMBING: 68;
|
|
968
|
+
readonly STAIR_CLIMBING_MACHINE: 69;
|
|
969
|
+
readonly STRENGTH_TRAINING: 70;
|
|
970
|
+
readonly STRETCHING: 71;
|
|
971
|
+
readonly SURFING: 72;
|
|
972
|
+
readonly SWIMMING_OPEN_WATER: 73;
|
|
973
|
+
readonly SWIMMING_POOL: 74;
|
|
974
|
+
readonly TABLE_TENNIS: 75;
|
|
975
|
+
readonly TENNIS: 76;
|
|
976
|
+
readonly VOLLEYBALL: 78;
|
|
977
|
+
readonly WALKING: 79;
|
|
978
|
+
readonly WATER_POLO: 80;
|
|
979
|
+
readonly WEIGHTLIFTING: 81;
|
|
980
|
+
readonly WHEELCHAIR: 82;
|
|
981
|
+
/** @deprecated Use {@link ExerciseType.WHEELCHAIR}. */
|
|
982
|
+
readonly WHEEL_CHAIR: 82;
|
|
983
|
+
readonly YOGA: 83;
|
|
984
|
+
};
|
|
985
|
+
/**
|
|
986
|
+
* `ExerciseSegment.EXERCISE_SEGMENT_TYPE_*` — values match connect-client 1.2.
|
|
987
|
+
* Use on `ExerciseSession.segments[].segmentType`, not `exerciseType`.
|
|
988
|
+
*/
|
|
989
|
+
/** `PlannedExerciseStep.EXERCISE_PHASE_*` */
|
|
990
|
+
export declare const ExercisePhase: {
|
|
991
|
+
readonly UNKNOWN: 0;
|
|
992
|
+
readonly WARMUP: 1;
|
|
993
|
+
readonly REST: 2;
|
|
994
|
+
readonly ACTIVE: 3;
|
|
995
|
+
readonly COOLDOWN: 4;
|
|
996
|
+
readonly RECOVERY: 5;
|
|
997
|
+
};
|
|
998
|
+
export declare const ExerciseSegmentType: {
|
|
999
|
+
readonly UNKNOWN: 0;
|
|
1000
|
+
readonly ARM_CURL: 1;
|
|
1001
|
+
readonly BACK_EXTENSION: 2;
|
|
1002
|
+
readonly BALL_SLAM: 3;
|
|
1003
|
+
readonly BARBELL_SHOULDER_PRESS: 4;
|
|
1004
|
+
readonly BENCH_PRESS: 5;
|
|
1005
|
+
readonly BENCH_SIT_UP: 6;
|
|
1006
|
+
readonly BIKING: 7;
|
|
1007
|
+
readonly BIKING_STATIONARY: 8;
|
|
1008
|
+
readonly BURPEE: 9;
|
|
1009
|
+
readonly CRUNCH: 10;
|
|
1010
|
+
readonly DEADLIFT: 11;
|
|
1011
|
+
readonly DOUBLE_ARM_TRICEPS_EXTENSION: 12;
|
|
1012
|
+
readonly DUMBBELL_CURL_LEFT_ARM: 13;
|
|
1013
|
+
readonly DUMBBELL_CURL_RIGHT_ARM: 14;
|
|
1014
|
+
readonly DUMBBELL_FRONT_RAISE: 15;
|
|
1015
|
+
readonly DUMBBELL_LATERAL_RAISE: 16;
|
|
1016
|
+
readonly DUMBBELL_ROW: 17;
|
|
1017
|
+
readonly DUMBBELL_TRICEPS_EXTENSION_LEFT_ARM: 18;
|
|
1018
|
+
readonly DUMBBELL_TRICEPS_EXTENSION_RIGHT_ARM: 19;
|
|
1019
|
+
readonly DUMBBELL_TRICEPS_EXTENSION_TWO_ARM: 20;
|
|
1020
|
+
readonly ELLIPTICAL: 21;
|
|
1021
|
+
readonly FORWARD_TWIST: 22;
|
|
1022
|
+
readonly FRONT_RAISE: 23;
|
|
1023
|
+
readonly HIGH_INTENSITY_INTERVAL_TRAINING: 24;
|
|
1024
|
+
readonly HIP_THRUST: 25;
|
|
1025
|
+
readonly HULA_HOOP: 26;
|
|
1026
|
+
readonly JUMPING_JACK: 27;
|
|
1027
|
+
readonly JUMP_ROPE: 28;
|
|
1028
|
+
readonly KETTLEBELL_SWING: 29;
|
|
1029
|
+
readonly LATERAL_RAISE: 30;
|
|
1030
|
+
readonly LAT_PULL_DOWN: 31;
|
|
1031
|
+
readonly LEG_CURL: 32;
|
|
1032
|
+
readonly LEG_EXTENSION: 33;
|
|
1033
|
+
readonly LEG_PRESS: 34;
|
|
1034
|
+
readonly LEG_RAISE: 35;
|
|
1035
|
+
readonly LUNGE: 36;
|
|
1036
|
+
readonly MOUNTAIN_CLIMBER: 37;
|
|
1037
|
+
readonly OTHER_WORKOUT: 38;
|
|
1038
|
+
readonly PAUSE: 39;
|
|
1039
|
+
readonly PILATES: 40;
|
|
1040
|
+
readonly PLANK: 41;
|
|
1041
|
+
readonly PULL_UP: 42;
|
|
1042
|
+
readonly PUNCH: 43;
|
|
1043
|
+
readonly REST: 44;
|
|
1044
|
+
readonly ROWING_MACHINE: 45;
|
|
1045
|
+
readonly RUNNING: 46;
|
|
1046
|
+
readonly RUNNING_TREADMILL: 47;
|
|
1047
|
+
readonly SHOULDER_PRESS: 48;
|
|
1048
|
+
readonly SINGLE_ARM_TRICEPS_EXTENSION: 49;
|
|
1049
|
+
readonly SIT_UP: 50;
|
|
1050
|
+
readonly SQUAT: 51;
|
|
1051
|
+
readonly STAIR_CLIMBING: 52;
|
|
1052
|
+
readonly STAIR_CLIMBING_MACHINE: 53;
|
|
1053
|
+
readonly STRETCHING: 54;
|
|
1054
|
+
readonly SWIMMING_BACKSTROKE: 55;
|
|
1055
|
+
readonly SWIMMING_BREASTSTROKE: 56;
|
|
1056
|
+
readonly SWIMMING_BUTTERFLY: 57;
|
|
1057
|
+
readonly SWIMMING_FREESTYLE: 58;
|
|
1058
|
+
readonly SWIMMING_MIXED: 59;
|
|
1059
|
+
readonly SWIMMING_OPEN_WATER: 60;
|
|
1060
|
+
readonly SWIMMING_OTHER: 61;
|
|
1061
|
+
readonly SWIMMING_POOL: 62;
|
|
1062
|
+
readonly UPPER_TWIST: 63;
|
|
1063
|
+
readonly WALKING: 64;
|
|
1064
|
+
readonly WEIGHTLIFTING: 65;
|
|
1065
|
+
readonly WHEELCHAIR: 66;
|
|
1066
|
+
readonly YOGA: 67;
|
|
1067
|
+
};
|
|
1068
|
+
export declare const RecordingMethod: {
|
|
1069
|
+
readonly UNKNOWN: 0;
|
|
1070
|
+
/** Data was actively recorded by a sensor or wearable device. */
|
|
1071
|
+
readonly ACTIVELY_RECORDED: 1;
|
|
1072
|
+
/** Data was inferred or recorded automatically in the background. */
|
|
1073
|
+
readonly AUTOMATICALLY_RECORDED: 2;
|
|
1074
|
+
/**
|
|
1075
|
+
* Data was manually entered by the user.
|
|
1076
|
+
* This is true regardless of which app was used (Health Connect, Google Fit,
|
|
1077
|
+
* Samsung Health, etc.).
|
|
1078
|
+
*/
|
|
1079
|
+
readonly MANUAL_ENTRY: 3;
|
|
1080
|
+
};
|
|
1081
|
+
/**
|
|
1082
|
+
* Feature names accepted by {@link getFeatureStatus}.
|
|
1083
|
+
* Maps to `HealthConnectFeatures.FEATURE_*` on Android.
|
|
1084
|
+
*/
|
|
1085
|
+
export type HealthConnectFeature = 'activityIntensity' | 'matchmaking' | 'mindfulnessSession' | 'personalHealthRecord' | 'plannedExercise' | 'readHealthDataHistory' | 'readHealthDataInBackground' | 'skinTemperature' | 'extendedDeviceTypes' | 'exerciseSessionImprovements';
|
|
1086
|
+
export type FeatureStatus = 'available' | 'unavailable';
|
|
1087
|
+
export declare const MindfulnessSessionType: {
|
|
1088
|
+
readonly UNKNOWN: 0;
|
|
1089
|
+
readonly MEDITATION: 1;
|
|
1090
|
+
readonly BREATHING: 2;
|
|
1091
|
+
readonly MUSIC: 3;
|
|
1092
|
+
readonly MOVEMENT: 4;
|
|
1093
|
+
readonly UNGUIDED: 5;
|
|
1094
|
+
};
|
|
1095
|
+
export declare const SkinTemperatureMeasurementLocation: {
|
|
1096
|
+
readonly UNKNOWN: 0;
|
|
1097
|
+
readonly FINGER: 1;
|
|
1098
|
+
readonly TOE: 2;
|
|
1099
|
+
readonly WRIST: 3;
|
|
1100
|
+
};
|
|
1101
|
+
export declare const ActivityIntensityType: {
|
|
1102
|
+
readonly MODERATE: 0;
|
|
1103
|
+
readonly VIGOROUS: 1;
|
|
1104
|
+
};
|
|
1105
|
+
export type MatchmakingRequest = {
|
|
1106
|
+
/**
|
|
1107
|
+
* Record type names the app can read (e.g. `'Steps'`).
|
|
1108
|
+
* Empty / omitted → all record types the app has read permission for.
|
|
1109
|
+
*/
|
|
1110
|
+
recordTypes?: RecordType[];
|
|
1111
|
+
/** Package names to exclusively include as data sources. */
|
|
1112
|
+
includedDataSources?: string[];
|
|
1113
|
+
/** Package names to exclude as data sources. */
|
|
1114
|
+
excludedDataSources?: string[];
|
|
1115
|
+
};
|
|
1116
|
+
export type MatchmakingPossibleResponse = {
|
|
1117
|
+
isMatchmakingPossible: boolean;
|
|
1118
|
+
};
|
|
1119
|
+
export declare const MedicalResourceType: {
|
|
1120
|
+
readonly VACCINES: 1;
|
|
1121
|
+
readonly ALLERGIES_INTOLERANCES: 2;
|
|
1122
|
+
readonly PREGNANCY: 3;
|
|
1123
|
+
readonly SOCIAL_HISTORY: 4;
|
|
1124
|
+
readonly VITAL_SIGNS: 5;
|
|
1125
|
+
readonly LABORATORY_RESULTS: 6;
|
|
1126
|
+
readonly CONDITIONS: 7;
|
|
1127
|
+
readonly PROCEDURES: 8;
|
|
1128
|
+
readonly MEDICATIONS: 9;
|
|
1129
|
+
readonly PERSONAL_DETAILS: 10;
|
|
1130
|
+
readonly PRACTITIONER_DETAILS: 11;
|
|
1131
|
+
readonly VISITS: 12;
|
|
1132
|
+
};
|
|
1133
|
+
export type FhirVersion = {
|
|
1134
|
+
major: number;
|
|
1135
|
+
minor: number;
|
|
1136
|
+
patch: number;
|
|
1137
|
+
};
|
|
1138
|
+
export type MedicalDataSource = {
|
|
1139
|
+
id: string;
|
|
1140
|
+
displayName: string;
|
|
1141
|
+
fhirBaseUri: string;
|
|
1142
|
+
fhirVersion: FhirVersion;
|
|
1143
|
+
packageName?: string;
|
|
1144
|
+
};
|
|
1145
|
+
export type CreateMedicalDataSourceRequest = {
|
|
1146
|
+
displayName: string;
|
|
1147
|
+
/** e.g. `https://example.com/fhir/` or `myapp://source`. */
|
|
1148
|
+
fhirBaseUri: string;
|
|
1149
|
+
fhirVersion: FhirVersion;
|
|
1150
|
+
};
|
|
1151
|
+
export type UpsertMedicalResourceRequest = {
|
|
1152
|
+
dataSourceId: string;
|
|
1153
|
+
fhirVersion: FhirVersion;
|
|
1154
|
+
/** Valid FHIR resource JSON string. */
|
|
1155
|
+
data: string;
|
|
1156
|
+
};
|
|
1157
|
+
export type MedicalResourceId = {
|
|
1158
|
+
dataSourceId: string;
|
|
1159
|
+
/** `FhirResource` type constant (int). */
|
|
1160
|
+
fhirResourceType: number;
|
|
1161
|
+
fhirResourceId: string;
|
|
1162
|
+
};
|
|
1163
|
+
export type FhirResource = {
|
|
1164
|
+
/** `FhirResource` type constant (int). */
|
|
1165
|
+
type: number;
|
|
1166
|
+
id: string;
|
|
1167
|
+
/** FHIR resource JSON string. */
|
|
1168
|
+
data: string;
|
|
1169
|
+
};
|
|
1170
|
+
export type MedicalResource = {
|
|
1171
|
+
type: number;
|
|
1172
|
+
id: MedicalResourceId;
|
|
1173
|
+
dataSourceId: string;
|
|
1174
|
+
fhirVersion: FhirVersion;
|
|
1175
|
+
fhirResource: FhirResource;
|
|
1176
|
+
};
|
|
1177
|
+
export type ReadMedicalResourcesRequest = {
|
|
1178
|
+
/**
|
|
1179
|
+
* Initial page: set `medicalResourceType`.
|
|
1180
|
+
* Subsequent pages: set `pageToken` from the previous response.
|
|
1181
|
+
*/
|
|
1182
|
+
medicalResourceType?: number;
|
|
1183
|
+
medicalDataSourceIds?: string[];
|
|
1184
|
+
pageSize?: number;
|
|
1185
|
+
pageToken?: string | null;
|
|
1186
|
+
};
|
|
1187
|
+
export type ReadMedicalResourcesResponse = {
|
|
1188
|
+
medicalResources: MedicalResource[];
|
|
1189
|
+
nextPageToken?: string | null;
|
|
1190
|
+
};
|
|
1191
|
+
export type DeleteMedicalResourcesRequest = {
|
|
1192
|
+
/** Delete by IDs (takes precedence when non-empty). */
|
|
1193
|
+
ids?: MedicalResourceId[];
|
|
1194
|
+
dataSourceIds?: string[];
|
|
1195
|
+
medicalResourceTypes?: number[];
|
|
1196
|
+
};
|
|
1197
|
+
export type GetMedicalDataSourcesRequest = {
|
|
1198
|
+
/**
|
|
1199
|
+
* When set, fetch these data sources by ID
|
|
1200
|
+
* (`HealthConnectClient.getMedicalDataSources(ids)`).
|
|
1201
|
+
*/
|
|
1202
|
+
medicalDataSourceIds?: string[];
|
|
1203
|
+
/**
|
|
1204
|
+
* When IDs are omitted, filter by writing-app package names
|
|
1205
|
+
* (`GetMedicalDataSourcesRequest`). Empty / omitted → all visible sources.
|
|
1206
|
+
*/
|
|
1207
|
+
packageNames?: string[];
|
|
1208
|
+
};
|
|
1209
|
+
//# sourceMappingURL=types.d.ts.map
|