@kingstinct/react-native-healthkit 7.0.1 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/app.plugin.js +19 -16
- package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -1
- package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -1
- package/lib/commonjs/native-types.js +87 -2
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/utils/queryCategorySamples.js +2 -1
- package/lib/commonjs/utils/queryCategorySamples.js.map +1 -1
- package/lib/commonjs/utils/queryQuantitySamples.js +2 -1
- package/lib/commonjs/utils/queryQuantitySamples.js.map +1 -1
- package/lib/commonjs/utils/requestAuthorization.js +1 -0
- package/lib/commonjs/utils/requestAuthorization.js.map +1 -1
- package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -1
- package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -1
- package/lib/module/native-types.js +107 -2
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/utils/queryCategorySamples.js +2 -1
- package/lib/module/utils/queryCategorySamples.js.map +1 -1
- package/lib/module/utils/queryQuantitySamples.js +2 -1
- package/lib/module/utils/queryQuantitySamples.js.map +1 -1
- package/lib/module/utils/requestAuthorization.js +1 -0
- package/lib/module/utils/requestAuthorization.js.map +1 -1
- package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +3 -2
- package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +3 -2
- package/lib/typescript/src/native-types.d.ts +96 -1
- package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +1 -1
- package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +1 -1
- package/lib/typescript/src/utils/queryCategorySamples.d.ts +3 -3
- package/lib/typescript/src/utils/queryQuantitySamples.d.ts +3 -3
- package/lib/typescript/src/utils/requestAuthorization.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/useMostRecentCategorySample.ts +3 -2
- package/src/hooks/useMostRecentQuantitySample.ts +3 -2
- package/src/native-types.ts +102 -1
- package/src/utils/queryCategorySamples.ts +5 -4
- package/src/utils/queryQuantitySamples.ts +5 -4
- package/src/utils/requestAuthorization.ts +1 -0
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@ React Native bindings for HealthKit with full TypeScript and Promise support cov
|
|
|
8
8
|
|
|
9
9
|
| Data Types | Query | Save | Subscribe | Examples |
|
|
10
10
|
| ----------------------------|:------|:------|:----------|:---------------------------------------|
|
|
11
|
-
|
|
|
11
|
+
| 100+ Quantity Types | ✅ | ✅ | ✅ | Steps, energy burnt, blood glucose etc.. |
|
|
12
12
|
| 63 Category Types | ✅ | ✅ | ✅ | Sleep analysis, mindful sessions etc.. |
|
|
13
13
|
| 75+ Workout Activity Types | ✅ | ✅ | ✅ | Swimming, running, table tennis etc.. |
|
|
14
14
|
| Correlation Types | ✅ | ✅ | ✅ | Food and blood pressure |
|
|
15
15
|
| Document Types | ✅ | ❌ | ✅ | [CDA documents](https://developer.apple.com/documentation/healthkit/hkcdadocument) exposed as Base64 data |
|
|
16
|
-
| Clinical Records |
|
|
16
|
+
| Clinical Records | ⚠️ | ❌ | ⚠️ | Lab results etc in [FHIR JSON format](https://www.hl7.org/fhir/json.html) |
|
|
17
17
|
|
|
18
18
|
### Disclaimer
|
|
19
19
|
|
|
@@ -159,7 +159,7 @@ We're striving to do as straight a mapping as possible to the Native Libraries.
|
|
|
159
159
|
|
|
160
160
|
## Clinical Records
|
|
161
161
|
|
|
162
|
-
For accessing Clinical Records use old version (3.x) or use specific branch ""
|
|
162
|
+
For accessing Clinical Records use old version (3.x) or use specific branch "including-clinical-records"
|
|
163
163
|
|
|
164
164
|
## Android alternatives
|
|
165
165
|
|
|
@@ -169,6 +169,12 @@ For a similar library for Android, check out [react-native-health-connect](https
|
|
|
169
169
|
|
|
170
170
|
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
171
171
|
|
|
172
|
+
## Sponsorship and enterprise-grade support
|
|
173
|
+
|
|
174
|
+
If you're using @kingstinct/react-native-healthkit to build your production app [please consider funding its continued development](https://github.com/sponsors/Kingstinct). It helps us spend more time on keeping this library as good as it can be.
|
|
175
|
+
|
|
176
|
+
At Kingstinct we're also able to provide enterprise-grade support for this package, [find us here](https://kingstinct.com) or [drop an email](mailto:healthkit@kingstinct.com) for more information. Also feel free to join our [Discord community](https://discord.gg/EHScS93v).
|
|
177
|
+
|
|
172
178
|
## License
|
|
173
179
|
|
|
174
180
|
MIT
|
package/app.plugin.js
CHANGED
|
@@ -36,14 +36,20 @@ const {
|
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const withEntitlementsPlugin = (
|
|
39
|
+
* @type {ConfigPlugin<{background: BackgroundConfig}>}
|
|
40
|
+
*/
|
|
41
|
+
const withEntitlementsPlugin = (
|
|
42
|
+
config,
|
|
43
|
+
/**
|
|
44
|
+
* @type {{background: BackgroundConfig} | undefined}
|
|
45
|
+
* */
|
|
46
|
+
props,
|
|
47
|
+
) => withEntitlementsPlist(config, (config) => {
|
|
42
48
|
config.modResults['com.apple.developer.healthkit'] = true
|
|
43
49
|
|
|
44
50
|
// background is enabled by default, but possible to opt-out from
|
|
45
51
|
// (haven't seen any drawbacks from having it enabled)
|
|
46
|
-
if (background !== false) {
|
|
52
|
+
if (props?.background !== false) {
|
|
47
53
|
config.modResults['com.apple.developer.healthkit.background-delivery'] = true
|
|
48
54
|
}
|
|
49
55
|
|
|
@@ -55,18 +61,15 @@ const withEntitlementsPlugin = (config, { background }) => withEntitlementsPlist
|
|
|
55
61
|
*/
|
|
56
62
|
const withInfoPlistPlugin = (config,
|
|
57
63
|
/**
|
|
58
|
-
* @type {{NSHealthShareUsageDescription: string | boolean, NSHealthUpdateUsageDescription: string | boolean}}
|
|
64
|
+
* @type {{NSHealthShareUsageDescription: string | boolean, NSHealthUpdateUsageDescription: string | boolean} | undefined}
|
|
59
65
|
* */
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}) => withInfoPlist(config, (config) => {
|
|
64
|
-
if (NSHealthShareUsageDescription !== false) {
|
|
65
|
-
config.modResults.NSHealthShareUsageDescription = NSHealthShareUsageDescription ?? `${config.name} wants to read your health data`
|
|
66
|
+
props) => withInfoPlist(config, (config) => {
|
|
67
|
+
if (props?.NSHealthShareUsageDescription !== false) {
|
|
68
|
+
config.modResults.NSHealthShareUsageDescription = props.NSHealthShareUsageDescription ?? `${config.name} wants to read your health data`
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
if (NSHealthUpdateUsageDescription !== false) {
|
|
69
|
-
config.modResults.NSHealthUpdateUsageDescription = NSHealthUpdateUsageDescription ?? `${config.name} wants to update your health data`
|
|
71
|
+
if (props?.NSHealthUpdateUsageDescription !== false) {
|
|
72
|
+
config.modResults.NSHealthUpdateUsageDescription = props.NSHealthUpdateUsageDescription ?? `${config.name} wants to update your health data`
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
return config
|
|
@@ -77,9 +80,9 @@ const pkg = require('./package.json')
|
|
|
77
80
|
/**
|
|
78
81
|
* @type {ConfigPlugin<AppPluginConfig>}
|
|
79
82
|
*/
|
|
80
|
-
const healthkitAppPlugin = (config,
|
|
81
|
-
[withEntitlementsPlugin,
|
|
82
|
-
[withInfoPlistPlugin,
|
|
83
|
+
const healthkitAppPlugin = (config, props) => withPlugins(config, [
|
|
84
|
+
[withEntitlementsPlugin, props],
|
|
85
|
+
[withInfoPlistPlugin, props],
|
|
83
86
|
])
|
|
84
87
|
|
|
85
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_useSubscribeToChanges","_interopRequireDefault","_getMostRecentCategorySample","obj","__esModule","default","useMostRecentCategorySample","identifier","category","setCategory","useState","updater","useCallback","getMostRecentCategorySample","then","useSubscribeToChanges","_default","exports"],"sources":["useMostRecentCategorySample.ts"],"sourcesContent":["import { useCallback, useState } from 'react'\n\nimport useSubscribeToChanges from './useSubscribeToChanges'\nimport getMostRecentCategorySample from '../utils/getMostRecentCategorySample'\n\nimport type {
|
|
1
|
+
{"version":3,"names":["_react","require","_useSubscribeToChanges","_interopRequireDefault","_getMostRecentCategorySample","obj","__esModule","default","useMostRecentCategorySample","identifier","category","setCategory","useState","updater","useCallback","getMostRecentCategorySample","then","useSubscribeToChanges","_default","exports"],"sources":["useMostRecentCategorySample.ts"],"sourcesContent":["import { useCallback, useState } from 'react'\n\nimport useSubscribeToChanges from './useSubscribeToChanges'\nimport getMostRecentCategorySample from '../utils/getMostRecentCategorySample'\n\nimport type { HKCategoryTypeIdentifier } from '../native-types'\nimport type { HKCategorySample } from '../types'\n\nfunction useMostRecentCategorySample<\n TCategory extends HKCategoryTypeIdentifier\n>(identifier: TCategory) {\n const [category, setCategory] = useState<HKCategorySample<TCategory> | null>(\n null,\n )\n const updater = useCallback(() => {\n void getMostRecentCategorySample(identifier).then(setCategory)\n }, [identifier])\n\n useSubscribeToChanges(identifier, updater)\n\n return category\n}\n\nexport default useMostRecentCategorySample\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,4BAAA,GAAAD,sBAAA,CAAAF,OAAA;AAA8E,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAK9E,SAASG,2BAA2BA,CAElCC,UAAqB,EAAE;EACvB,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EACtC,IACF,CAAC;EACD,MAAMC,OAAO,GAAG,IAAAC,kBAAW,EAAC,MAAM;IAChC,KAAK,IAAAC,oCAA2B,EAACN,UAAU,CAAC,CAACO,IAAI,CAACL,WAAW,CAAC;EAChE,CAAC,EAAE,CAACF,UAAU,CAAC,CAAC;EAEhB,IAAAQ,8BAAqB,EAACR,UAAU,EAAEI,OAAO,CAAC;EAE1C,OAAOH,QAAQ;AACjB;AAAC,IAAAQ,QAAA,GAEcV,2BAA2B;AAAAW,OAAA,CAAAZ,OAAA,GAAAW,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_ensureUnit","_interopRequireDefault","_getMostRecentQuantitySample","_subscribeToChanges","obj","__esModule","default","useMostRecentQuantitySample","identifier","unit","lastSample","setLastSample","useState","useEffect","cancelSubscription","init","actualUnit","ensureUnit","subscribeToChanges","value","getMostRecentQuantitySample","_cancelSubscription","_default","exports"],"sources":["useMostRecentQuantitySample.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport ensureUnit from '../utils/ensureUnit'\nimport getMostRecentQuantitySample from '../utils/getMostRecentQuantitySample'\nimport subscribeToChanges from '../utils/subscribeToChanges'\n\nimport type {
|
|
1
|
+
{"version":3,"names":["_react","require","_ensureUnit","_interopRequireDefault","_getMostRecentQuantitySample","_subscribeToChanges","obj","__esModule","default","useMostRecentQuantitySample","identifier","unit","lastSample","setLastSample","useState","useEffect","cancelSubscription","init","actualUnit","ensureUnit","subscribeToChanges","value","getMostRecentQuantitySample","_cancelSubscription","_default","exports"],"sources":["useMostRecentQuantitySample.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport ensureUnit from '../utils/ensureUnit'\nimport getMostRecentQuantitySample from '../utils/getMostRecentQuantitySample'\nimport subscribeToChanges from '../utils/subscribeToChanges'\n\nimport type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types'\nimport type { HKQuantitySample } from '../types'\n\nfunction useMostRecentQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(identifier: TIdentifier, unit?: TUnit) {\n const [lastSample, setLastSample] = useState<HKQuantitySample<\n TIdentifier\n > | null>(null)\n\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n const actualUnit = await ensureUnit(identifier, unit)\n\n cancelSubscription = await subscribeToChanges(identifier, async () => {\n const value = await getMostRecentQuantitySample(identifier, actualUnit)\n setLastSample(value)\n })\n }\n void init()\n\n return () => {\n void cancelSubscription?.()\n }\n }, [identifier, unit])\n\n return lastSample\n}\n\nexport default useMostRecentQuantitySample\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,4BAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,mBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA4D,SAAAE,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAK5D,SAASG,2BAA2BA,CAGlCC,UAAuB,EAAEC,IAAY,EAAE;EACvC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAElC,IAAI,CAAC;EAEf,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIC,kBAAwD;IAE5D,MAAMC,IAAI,GAAG,MAAAA,CAAA,KAAY;MACvB,MAAMC,UAAU,GAAG,MAAM,IAAAC,mBAAU,EAACT,UAAU,EAAEC,IAAI,CAAC;MAErDK,kBAAkB,GAAG,MAAM,IAAAI,2BAAkB,EAACV,UAAU,EAAE,YAAY;QACpE,MAAMW,KAAK,GAAG,MAAM,IAAAC,oCAA2B,EAACZ,UAAU,EAAEQ,UAAU,CAAC;QACvEL,aAAa,CAACQ,KAAK,CAAC;MACtB,CAAC,CAAC;IACJ,CAAC;IACD,KAAKJ,IAAI,CAAC,CAAC;IAEX,OAAO,MAAM;MAAA,IAAAM,mBAAA;MACX,OAAAA,mBAAA,GAAKP,kBAAkB,cAAAO,mBAAA,uBAAlBA,mBAAA,CAAqB,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,CAACb,UAAU,EAAEC,IAAI,CAAC,CAAC;EAEtB,OAAOC,UAAU;AACnB;AAAC,IAAAY,QAAA,GAEcf,2BAA2B;AAAAgB,OAAA,CAAAjB,OAAA,GAAAgB,QAAA"}
|
|
@@ -5,15 +5,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.UnitOfVolume = exports.UnitOfTime = exports.UnitOfPressure = exports.UnitOfMass = exports.UnitOfLength = exports.UnitOfEnergy = exports.TemperatureUnit = exports.HKWorkoutTypeIdentifier = exports.HKWorkoutRouteTypeIdentifier = exports.HKWorkoutActivityType = exports.HKWheelchairUse = exports.HKWeatherCondition = exports.HKUpdateFrequency = exports.HKUnits = exports.HKUnitMetric = exports.HKStatisticsOptions = exports.HKQuantityTypeIdentifier = exports.HKMetricPrefix = exports.HKInsulinDeliveryReason = exports.HKHeartRateMotionContext = exports.HKFitzpatrickSkinType = exports.HKDataTypeIdentifierHeartbeatSeries = exports.HKCorrelationTypeIdentifier = exports.HKCharacteristicTypeIdentifier = exports.HKCategoryValueSleepAnalysis = exports.HKCategoryValueSeverity = exports.HKCategoryValuePresence = exports.HKCategoryValueOvulationTestResult = exports.HKCategoryValueNotApplicable = exports.HKCategoryValueMenstrualFlow = exports.HKCategoryValueLowCardioFitnessEvent = exports.HKCategoryValueCervicalMucusQuality = exports.HKCategoryValueAppleStandHour = exports.HKCategoryValueAppetiteChanges = exports.HKCategoryTypeIdentifier = exports.HKBloodType = exports.HKBiologicalSex = exports.HKAuthorizationStatus = exports.HKAuthorizationRequestStatus = exports.HKAudiogramTypeIdentifier = exports.EventEmitter = exports.BloodGlucoseUnit = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* See https://developer.apple.com/documentation/healthkit/hkworkouttypeidentifier
|
|
10
|
+
*/
|
|
8
11
|
const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier';
|
|
9
12
|
exports.HKWorkoutTypeIdentifier = HKWorkoutTypeIdentifier;
|
|
10
13
|
const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* See https://developer.apple.com/documentation/healthkit/hkworkoutroutetypeidentifier
|
|
17
|
+
*/
|
|
11
18
|
exports.HKAudiogramTypeIdentifier = HKAudiogramTypeIdentifier;
|
|
12
19
|
const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier';
|
|
13
20
|
exports.HKWorkoutRouteTypeIdentifier = HKWorkoutRouteTypeIdentifier;
|
|
14
21
|
const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries';
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
/**
|
|
24
|
+
* See https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier
|
|
25
|
+
*/
|
|
17
26
|
exports.HKDataTypeIdentifierHeartbeatSeries = HKDataTypeIdentifierHeartbeatSeries;
|
|
18
27
|
let HKQuantityTypeIdentifier = /*#__PURE__*/function (HKQuantityTypeIdentifier) {
|
|
19
28
|
HKQuantityTypeIdentifier["bodyMassIndex"] = "HKQuantityTypeIdentifierBodyMassIndex";
|
|
@@ -113,8 +122,14 @@ let HKQuantityTypeIdentifier = /*#__PURE__*/function (HKQuantityTypeIdentifier)
|
|
|
113
122
|
HKQuantityTypeIdentifier["underwaterDepth"] = "HKQuantityTypeIdentifierUnderwaterDepth";
|
|
114
123
|
HKQuantityTypeIdentifier["waterTemperature"] = "HKQuantityTypeIdentifierWaterTemperature";
|
|
115
124
|
HKQuantityTypeIdentifier["appleSleepingWristTemperature"] = "HKQuantityTypeIdentifierAppleSleepingWristTemperature";
|
|
125
|
+
HKQuantityTypeIdentifier["timeInDaylight"] = "HKQuantityTypeIdentifierTimeInDaylight";
|
|
126
|
+
HKQuantityTypeIdentifier["physicalEffort"] = "HKQuantityTypeIdentifierPhysicalEffort";
|
|
127
|
+
HKQuantityTypeIdentifier["cyclingSpeed"] = "HKQuantityTypeIdentifierCyclingSpeed";
|
|
128
|
+
HKQuantityTypeIdentifier["cyclingPower"] = "HKQuantityTypeIdentifierCyclingPower";
|
|
129
|
+
HKQuantityTypeIdentifier["cyclingFunctionalThresholdPower"] = "HKQuantityTypeIdentifierCyclingFunctionalThresholdPower";
|
|
130
|
+
HKQuantityTypeIdentifier["cyclingCadence"] = "HKQuantityTypeIdentifierCyclingCadence";
|
|
116
131
|
return HKQuantityTypeIdentifier;
|
|
117
|
-
}({}); //
|
|
132
|
+
}({}); // Scalar(Count)/Time, Discrete
|
|
118
133
|
exports.HKQuantityTypeIdentifier = HKQuantityTypeIdentifier;
|
|
119
134
|
let HKCategoryValueLowCardioFitnessEvent = /*#__PURE__*/function (HKCategoryValueLowCardioFitnessEvent) {
|
|
120
135
|
HKCategoryValueLowCardioFitnessEvent[HKCategoryValueLowCardioFitnessEvent["lowFitness"] = 1] = "lowFitness";
|
|
@@ -127,12 +142,18 @@ let HKHeartRateMotionContext = /*#__PURE__*/function (HKHeartRateMotionContext)
|
|
|
127
142
|
HKHeartRateMotionContext[HKHeartRateMotionContext["sedentary"] = 1] = "sedentary";
|
|
128
143
|
return HKHeartRateMotionContext;
|
|
129
144
|
}({});
|
|
145
|
+
/**
|
|
146
|
+
* See https://developer.apple.com/documentation/healthkit/hkcorrelationtypeidentifier
|
|
147
|
+
*/
|
|
130
148
|
exports.HKHeartRateMotionContext = HKHeartRateMotionContext;
|
|
131
149
|
let HKCorrelationTypeIdentifier = /*#__PURE__*/function (HKCorrelationTypeIdentifier) {
|
|
132
150
|
HKCorrelationTypeIdentifier["bloodPressure"] = "HKCorrelationTypeIdentifierBloodPressure";
|
|
133
151
|
HKCorrelationTypeIdentifier["food"] = "HKCorrelationTypeIdentifierFood";
|
|
134
152
|
return HKCorrelationTypeIdentifier;
|
|
135
153
|
}({});
|
|
154
|
+
/**
|
|
155
|
+
* See https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifier
|
|
156
|
+
*/
|
|
136
157
|
exports.HKCorrelationTypeIdentifier = HKCorrelationTypeIdentifier;
|
|
137
158
|
let HKCategoryTypeIdentifier = /*#__PURE__*/function (HKCategoryTypeIdentifier) {
|
|
138
159
|
HKCategoryTypeIdentifier["sleepAnalysis"] = "HKCategoryTypeIdentifierSleepAnalysis";
|
|
@@ -325,12 +346,18 @@ var HKIndoorWorkout = /*#__PURE__*/function (HKIndoorWorkout) {
|
|
|
325
346
|
HKIndoorWorkout[HKIndoorWorkout["true"] = 1] = "true";
|
|
326
347
|
return HKIndoorWorkout;
|
|
327
348
|
}(HKIndoorWorkout || {});
|
|
349
|
+
/**
|
|
350
|
+
* See https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus
|
|
351
|
+
*/
|
|
328
352
|
let HKAuthorizationRequestStatus = /*#__PURE__*/function (HKAuthorizationRequestStatus) {
|
|
329
353
|
HKAuthorizationRequestStatus[HKAuthorizationRequestStatus["unknown"] = 0] = "unknown";
|
|
330
354
|
HKAuthorizationRequestStatus[HKAuthorizationRequestStatus["shouldRequest"] = 1] = "shouldRequest";
|
|
331
355
|
HKAuthorizationRequestStatus[HKAuthorizationRequestStatus["unnecessary"] = 2] = "unnecessary";
|
|
332
356
|
return HKAuthorizationRequestStatus;
|
|
333
357
|
}({});
|
|
358
|
+
/**
|
|
359
|
+
* See https://developer.apple.com/documentation/healthkit/hkauthorizationstatus
|
|
360
|
+
*/
|
|
334
361
|
exports.HKAuthorizationRequestStatus = HKAuthorizationRequestStatus;
|
|
335
362
|
let HKAuthorizationStatus = /*#__PURE__*/function (HKAuthorizationStatus) {
|
|
336
363
|
HKAuthorizationStatus[HKAuthorizationStatus["notDetermined"] = 0] = "notDetermined";
|
|
@@ -339,6 +366,9 @@ let HKAuthorizationStatus = /*#__PURE__*/function (HKAuthorizationStatus) {
|
|
|
339
366
|
return HKAuthorizationStatus;
|
|
340
367
|
}({});
|
|
341
368
|
exports.HKAuthorizationStatus = HKAuthorizationStatus;
|
|
369
|
+
/**
|
|
370
|
+
* See https://developer.apple.com/documentation/healthkit/hkbloodtype
|
|
371
|
+
*/
|
|
342
372
|
let HKBloodType = /*#__PURE__*/function (HKBloodType) {
|
|
343
373
|
HKBloodType[HKBloodType["notSet"] = 0] = "notSet";
|
|
344
374
|
HKBloodType[HKBloodType["aPositive"] = 1] = "aPositive";
|
|
@@ -351,6 +381,9 @@ let HKBloodType = /*#__PURE__*/function (HKBloodType) {
|
|
|
351
381
|
HKBloodType[HKBloodType["oNegative"] = 8] = "oNegative";
|
|
352
382
|
return HKBloodType;
|
|
353
383
|
}({});
|
|
384
|
+
/**
|
|
385
|
+
* See https://developer.apple.com/documentation/healthkit/hkbiologicalsex
|
|
386
|
+
*/
|
|
354
387
|
exports.HKBloodType = HKBloodType;
|
|
355
388
|
let HKBiologicalSex = /*#__PURE__*/function (HKBiologicalSex) {
|
|
356
389
|
HKBiologicalSex[HKBiologicalSex["notSet"] = 0] = "notSet";
|
|
@@ -359,6 +392,9 @@ let HKBiologicalSex = /*#__PURE__*/function (HKBiologicalSex) {
|
|
|
359
392
|
HKBiologicalSex[HKBiologicalSex["other"] = 3] = "other";
|
|
360
393
|
return HKBiologicalSex;
|
|
361
394
|
}({});
|
|
395
|
+
/**
|
|
396
|
+
* See https://developer.apple.com/documentation/healthkit/hkfitzpatrickskintype
|
|
397
|
+
*/
|
|
362
398
|
exports.HKBiologicalSex = HKBiologicalSex;
|
|
363
399
|
let HKFitzpatrickSkinType = /*#__PURE__*/function (HKFitzpatrickSkinType) {
|
|
364
400
|
HKFitzpatrickSkinType[HKFitzpatrickSkinType["notSet"] = 0] = "notSet";
|
|
@@ -370,6 +406,9 @@ let HKFitzpatrickSkinType = /*#__PURE__*/function (HKFitzpatrickSkinType) {
|
|
|
370
406
|
HKFitzpatrickSkinType[HKFitzpatrickSkinType["VI"] = 6] = "VI";
|
|
371
407
|
return HKFitzpatrickSkinType;
|
|
372
408
|
}({});
|
|
409
|
+
/**
|
|
410
|
+
* See https://developer.apple.com/documentation/healthkit/hkstatisticsoptions
|
|
411
|
+
*/
|
|
373
412
|
exports.HKFitzpatrickSkinType = HKFitzpatrickSkinType;
|
|
374
413
|
let HKStatisticsOptions = /*#__PURE__*/function (HKStatisticsOptions) {
|
|
375
414
|
HKStatisticsOptions["cumulativeSum"] = "cumulativeSum";
|
|
@@ -383,6 +422,9 @@ let HKStatisticsOptions = /*#__PURE__*/function (HKStatisticsOptions) {
|
|
|
383
422
|
return HKStatisticsOptions;
|
|
384
423
|
}({});
|
|
385
424
|
exports.HKStatisticsOptions = HKStatisticsOptions;
|
|
425
|
+
/**
|
|
426
|
+
* https://developer.apple.com/documentation/healthkit/hkcategoryvaluecervicalmucusquality
|
|
427
|
+
*/
|
|
386
428
|
let HKCategoryValueCervicalMucusQuality = /*#__PURE__*/function (HKCategoryValueCervicalMucusQuality) {
|
|
387
429
|
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["dry"] = 1] = "dry";
|
|
388
430
|
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["sticky"] = 2] = "sticky";
|
|
@@ -391,6 +433,9 @@ let HKCategoryValueCervicalMucusQuality = /*#__PURE__*/function (HKCategoryValue
|
|
|
391
433
|
HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["eggWhite"] = 5] = "eggWhite";
|
|
392
434
|
return HKCategoryValueCervicalMucusQuality;
|
|
393
435
|
}({});
|
|
436
|
+
/**
|
|
437
|
+
* See https://developer.apple.com/documentation/healthkit/hkcategoryvaluemenstrualflow
|
|
438
|
+
*/
|
|
394
439
|
exports.HKCategoryValueCervicalMucusQuality = HKCategoryValueCervicalMucusQuality;
|
|
395
440
|
let HKCategoryValueMenstrualFlow = /*#__PURE__*/function (HKCategoryValueMenstrualFlow) {
|
|
396
441
|
HKCategoryValueMenstrualFlow[HKCategoryValueMenstrualFlow["unspecified"] = 1] = "unspecified";
|
|
@@ -400,6 +445,9 @@ let HKCategoryValueMenstrualFlow = /*#__PURE__*/function (HKCategoryValueMenstru
|
|
|
400
445
|
HKCategoryValueMenstrualFlow[HKCategoryValueMenstrualFlow["heavy"] = 4] = "heavy";
|
|
401
446
|
return HKCategoryValueMenstrualFlow;
|
|
402
447
|
}({});
|
|
448
|
+
/**
|
|
449
|
+
* See https://developer.apple.com/documentation/healthkit/hkcategoryvalueovulationtestresult
|
|
450
|
+
*/
|
|
403
451
|
exports.HKCategoryValueMenstrualFlow = HKCategoryValueMenstrualFlow;
|
|
404
452
|
let HKCategoryValueOvulationTestResult = /*#__PURE__*/function (HKCategoryValueOvulationTestResult) {
|
|
405
453
|
HKCategoryValueOvulationTestResult[HKCategoryValueOvulationTestResult["negative"] = 1] = "negative";
|
|
@@ -408,6 +456,9 @@ let HKCategoryValueOvulationTestResult = /*#__PURE__*/function (HKCategoryValueO
|
|
|
408
456
|
HKCategoryValueOvulationTestResult[HKCategoryValueOvulationTestResult["estrogenSurge"] = 4] = "estrogenSurge";
|
|
409
457
|
return HKCategoryValueOvulationTestResult;
|
|
410
458
|
}({});
|
|
459
|
+
/**
|
|
460
|
+
* See https://developer.apple.com/documentation/healthkit/hkcategoryvaluesleepanalysis
|
|
461
|
+
*/
|
|
411
462
|
exports.HKCategoryValueOvulationTestResult = HKCategoryValueOvulationTestResult;
|
|
412
463
|
let HKCategoryValueSleepAnalysis = /*#__PURE__*/function (HKCategoryValueSleepAnalysis) {
|
|
413
464
|
HKCategoryValueSleepAnalysis[HKCategoryValueSleepAnalysis["inBed"] = 0] = "inBed";
|
|
@@ -418,6 +469,9 @@ let HKCategoryValueSleepAnalysis = /*#__PURE__*/function (HKCategoryValueSleepAn
|
|
|
418
469
|
HKCategoryValueSleepAnalysis[HKCategoryValueSleepAnalysis["asleepREM"] = 5] = "asleepREM";
|
|
419
470
|
return HKCategoryValueSleepAnalysis;
|
|
420
471
|
}({});
|
|
472
|
+
/**
|
|
473
|
+
* https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges
|
|
474
|
+
*/
|
|
421
475
|
exports.HKCategoryValueSleepAnalysis = HKCategoryValueSleepAnalysis;
|
|
422
476
|
let HKCategoryValueAppetiteChanges = /*#__PURE__*/function (HKCategoryValueAppetiteChanges) {
|
|
423
477
|
HKCategoryValueAppetiteChanges[HKCategoryValueAppetiteChanges["decreased"] = 2] = "decreased";
|
|
@@ -426,12 +480,18 @@ let HKCategoryValueAppetiteChanges = /*#__PURE__*/function (HKCategoryValueAppet
|
|
|
426
480
|
HKCategoryValueAppetiteChanges[HKCategoryValueAppetiteChanges["unspecified"] = 0] = "unspecified";
|
|
427
481
|
return HKCategoryValueAppetiteChanges;
|
|
428
482
|
}({});
|
|
483
|
+
/**
|
|
484
|
+
* https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence
|
|
485
|
+
*/
|
|
429
486
|
exports.HKCategoryValueAppetiteChanges = HKCategoryValueAppetiteChanges;
|
|
430
487
|
let HKCategoryValuePresence = /*#__PURE__*/function (HKCategoryValuePresence) {
|
|
431
488
|
HKCategoryValuePresence[HKCategoryValuePresence["notPresent"] = 1] = "notPresent";
|
|
432
489
|
HKCategoryValuePresence[HKCategoryValuePresence["present"] = 0] = "present";
|
|
433
490
|
return HKCategoryValuePresence;
|
|
434
491
|
}({});
|
|
492
|
+
/**
|
|
493
|
+
* See https://developer.apple.com/documentation/healthkit/hkcategoryvalueseverity
|
|
494
|
+
*/
|
|
435
495
|
exports.HKCategoryValuePresence = HKCategoryValuePresence;
|
|
436
496
|
let HKCategoryValueSeverity = /*#__PURE__*/function (HKCategoryValueSeverity) {
|
|
437
497
|
HKCategoryValueSeverity[HKCategoryValueSeverity["notPresent"] = 1] = "notPresent";
|
|
@@ -441,18 +501,30 @@ let HKCategoryValueSeverity = /*#__PURE__*/function (HKCategoryValueSeverity) {
|
|
|
441
501
|
HKCategoryValueSeverity[HKCategoryValueSeverity["unspecified"] = 0] = "unspecified";
|
|
442
502
|
return HKCategoryValueSeverity;
|
|
443
503
|
}({});
|
|
504
|
+
/**
|
|
505
|
+
* See https://developer.apple.com/documentation/healthkit/hkcategoryvalue/notapplicable
|
|
506
|
+
*/
|
|
444
507
|
exports.HKCategoryValueSeverity = HKCategoryValueSeverity;
|
|
445
508
|
let HKCategoryValueNotApplicable = /*#__PURE__*/function (HKCategoryValueNotApplicable) {
|
|
446
509
|
HKCategoryValueNotApplicable[HKCategoryValueNotApplicable["notApplicable"] = 0] = "notApplicable";
|
|
447
510
|
return HKCategoryValueNotApplicable;
|
|
448
511
|
}({});
|
|
512
|
+
/**
|
|
513
|
+
* See https://developer.apple.com/documentation/healthkit/hkcategoryvalue
|
|
514
|
+
*/
|
|
449
515
|
exports.HKCategoryValueNotApplicable = HKCategoryValueNotApplicable;
|
|
516
|
+
/**
|
|
517
|
+
* See https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason
|
|
518
|
+
*/
|
|
450
519
|
let HKInsulinDeliveryReason = /*#__PURE__*/function (HKInsulinDeliveryReason) {
|
|
451
520
|
HKInsulinDeliveryReason[HKInsulinDeliveryReason["basal"] = 1] = "basal";
|
|
452
521
|
HKInsulinDeliveryReason[HKInsulinDeliveryReason["bolus"] = 2] = "bolus";
|
|
453
522
|
return HKInsulinDeliveryReason;
|
|
454
523
|
}({});
|
|
455
524
|
exports.HKInsulinDeliveryReason = HKInsulinDeliveryReason;
|
|
525
|
+
/**
|
|
526
|
+
* See https://developer.apple.com/documentation/healthkit/hkcategoryvaluepregnancytestresult
|
|
527
|
+
*/
|
|
456
528
|
var HKCategoryValuePregnancyTestResult = /*#__PURE__*/function (HKCategoryValuePregnancyTestResult) {
|
|
457
529
|
HKCategoryValuePregnancyTestResult[HKCategoryValuePregnancyTestResult["positive"] = 2] = "positive";
|
|
458
530
|
HKCategoryValuePregnancyTestResult[HKCategoryValuePregnancyTestResult["negative"] = 1] = "negative";
|
|
@@ -621,6 +693,18 @@ let BloodGlucoseUnit = /*#__PURE__*/function (BloodGlucoseUnit) {
|
|
|
621
693
|
BloodGlucoseUnit["GlucoseMgPerDl"] = "mg/dL";
|
|
622
694
|
return BloodGlucoseUnit;
|
|
623
695
|
}({});
|
|
696
|
+
/**
|
|
697
|
+
* See https://developer.apple.com/documentation/healthkit/hkdevice
|
|
698
|
+
*/
|
|
699
|
+
/**
|
|
700
|
+
* See https://developer.apple.com/documentation/healthkit/hkobject/1615781-source
|
|
701
|
+
*/
|
|
702
|
+
/**
|
|
703
|
+
* See https://developer.apple.com/documentation/healthkit/hkobject/1615483-sourcerevision
|
|
704
|
+
*/
|
|
705
|
+
/**
|
|
706
|
+
* See https://developer.apple.com/documentation/healthkit/hkquantitysample
|
|
707
|
+
*/
|
|
624
708
|
exports.BloodGlucoseUnit = BloodGlucoseUnit;
|
|
625
709
|
// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier
|
|
626
710
|
let HKCharacteristicTypeIdentifier = /*#__PURE__*/function (HKCharacteristicTypeIdentifier) {
|
|
@@ -633,6 +717,7 @@ let HKCharacteristicTypeIdentifier = /*#__PURE__*/function (HKCharacteristicType
|
|
|
633
717
|
return HKCharacteristicTypeIdentifier;
|
|
634
718
|
}({}); // HKActivityMoveModeObject
|
|
635
719
|
exports.HKCharacteristicTypeIdentifier = HKCharacteristicTypeIdentifier;
|
|
720
|
+
/** See https://developer.apple.com/documentation/healthkit/hkupdatefrequency */
|
|
636
721
|
let HKUpdateFrequency = /*#__PURE__*/function (HKUpdateFrequency) {
|
|
637
722
|
HKUpdateFrequency[HKUpdateFrequency["immediate"] = 1] = "immediate";
|
|
638
723
|
HKUpdateFrequency[HKUpdateFrequency["hourly"] = 2] = "hourly";
|