@kingstinct/react-native-healthkit 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/ReactNativeHealthkit.m +6 -0
- package/ios/ReactNativeHealthkit.swift +23 -0
- package/lib/commonjs/index.ios.js +4 -0
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +1 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/utils/deleteQuantitySample.js +16 -0
- package/lib/commonjs/utils/deleteQuantitySample.js.map +1 -0
- package/lib/module/index.ios.js +3 -0
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/utils/deleteQuantitySample.js +6 -0
- package/lib/module/utils/deleteQuantitySample.js.map +1 -0
- package/lib/typescript/src/index.ios.d.ts +1 -0
- package/lib/typescript/src/native-types.d.ts +1 -0
- package/lib/typescript/src/utils/deleteQuantitySample.d.ts +4 -0
- package/package.json +1 -1
- package/src/index.ios.tsx +4 -0
- package/src/index.tsx +1 -0
- package/src/native-types.ts +4 -0
- package/src/utils/deleteQuantitySample.ts +14 -0
|
@@ -62,6 +62,12 @@ RCT_EXTERN_METHOD(saveQuantitySample:(NSString)typeIdentifier
|
|
|
62
62
|
reject:(RCTPromiseRejectBlock)reject
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
+
RCT_EXTERN_METHOD(deleteQuantitySample:(NSString)typeIdentifier
|
|
66
|
+
uuid:(NSString)uuid
|
|
67
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
68
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
69
|
+
)
|
|
70
|
+
|
|
65
71
|
RCT_EXTERN_METHOD(subscribeToObserverQuery:(NSString)typeIdentifier
|
|
66
72
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
67
73
|
reject:(RCTPromiseRejectBlock)reject
|
|
@@ -379,6 +379,29 @@ class ReactNativeHealthkit: RCTEventEmitter {
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
+
@objc(deleteQuantitySample:uuid:resolve:reject:)
|
|
383
|
+
func deleteQuantitySample(typeIdentifier: String, uuid: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock){
|
|
384
|
+
guard let store = _store else {
|
|
385
|
+
return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
let identifier = HKQuantityTypeIdentifier.init(rawValue: typeIdentifier);
|
|
389
|
+
let sampleUuid = UUID.init(uuidString: uuid) as! UUID;
|
|
390
|
+
|
|
391
|
+
guard let sampleType = HKObjectType.quantityType(forIdentifier: identifier) else {
|
|
392
|
+
return reject(TYPE_IDENTIFIER_ERROR, typeIdentifier, nil);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
let samplePredicate = HKQuery.predicateForObject(with: sampleUuid);
|
|
396
|
+
|
|
397
|
+
store.deleteObjects(of: sampleType, predicate: samplePredicate) { (success: Bool, deletedObjectCount: Int, error: Error?) in
|
|
398
|
+
guard let err = error else {
|
|
399
|
+
return resolve(success);
|
|
400
|
+
}
|
|
401
|
+
reject(GENERIC_ERROR, err.localizedDescription, error);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
382
405
|
@objc(saveCorrelationSample:samples:start:end:metadata:resolve:reject:)
|
|
383
406
|
func saveCorrelationSample(typeIdentifier: String, samples: Array<Dictionary<String, Any>>, start: Date, end: Date, metadata: Dictionary<String, Any>, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock){
|
|
384
407
|
guard let store = _store else {
|
|
@@ -20,6 +20,8 @@ var _useSubscribeToChanges = _interopRequireDefault(require("./hooks/useSubscrib
|
|
|
20
20
|
|
|
21
21
|
var _nativeTypes = _interopRequireDefault(require("./native-types"));
|
|
22
22
|
|
|
23
|
+
var _deleteQuantitySample = _interopRequireDefault(require("./utils/deleteQuantitySample"));
|
|
24
|
+
|
|
23
25
|
var _getDateOfBirth = _interopRequireDefault(require("./utils/getDateOfBirth"));
|
|
24
26
|
|
|
25
27
|
var _getMostRecentCategorySample = _interopRequireDefault(require("./utils/getMostRecentCategorySample"));
|
|
@@ -98,6 +100,8 @@ const Healthkit = {
|
|
|
98
100
|
queryStatisticsForQuantity: _queryStatisticsForQuantity.default,
|
|
99
101
|
queryWorkouts: _queryWorkouts.default,
|
|
100
102
|
requestAuthorization: _requestAuthorization.default,
|
|
103
|
+
// delete methods
|
|
104
|
+
deleteQuantitySample: _deleteQuantitySample.default,
|
|
101
105
|
// save methods
|
|
102
106
|
saveCategorySample: _saveCategorySample.default,
|
|
103
107
|
saveCorrelationSample: _saveCorrelationSample.default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Healthkit","authorizationStatusFor","Native","bind","isHealthDataAvailable","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization"],"sources":["index.ios.tsx"],"sourcesContent":["import useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native from './native-types'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst Healthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n\n disableAllBackgroundDelivery: Native.disableAllBackgroundDelivery.bind(Native),\n disableBackgroundDelivery: Native.disableBackgroundDelivery.bind(Native),\n enableBackgroundDelivery: Native.enableBackgroundDelivery.bind(Native),\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse.bind(Native),\n getBloodType: Native.getBloodType.bind(Native),\n\n getWorkoutRoutes: Native.getWorkoutRoutes.bind(Native),\n\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCorrelationSamples,\n queryQuantitySamples,\n queryStatisticsForQuantity,\n queryWorkouts,\n\n requestAuthorization,\n\n // save methods\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n\n // subscriptions\n subscribeToChanges,\n\n // hooks\n useMostRecentCategorySample,\n\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n\n useSubscribeToChanges,\n\n useIsHealthDataAvailable,\n useHealthkitAuthorization,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"names":["Healthkit","authorizationStatusFor","Native","bind","isHealthDataAvailable","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","queryWorkouts","requestAuthorization","deleteQuantitySample","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization"],"sources":["index.ios.tsx"],"sourcesContent":["import useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst Healthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n\n disableAllBackgroundDelivery: Native.disableAllBackgroundDelivery.bind(Native),\n disableBackgroundDelivery: Native.disableBackgroundDelivery.bind(Native),\n enableBackgroundDelivery: Native.enableBackgroundDelivery.bind(Native),\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse.bind(Native),\n getBloodType: Native.getBloodType.bind(Native),\n\n getWorkoutRoutes: Native.getWorkoutRoutes.bind(Native),\n\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCorrelationSamples,\n queryQuantitySamples,\n queryStatisticsForQuantity,\n queryWorkouts,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n\n // save methods\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n\n // subscriptions\n subscribeToChanges,\n\n // hooks\n useMostRecentCategorySample,\n\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n\n useSubscribeToChanges,\n\n useIsHealthDataAvailable,\n useHealthkitAuthorization,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA8DA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AA5DA,MAAMA,SAAS,GAAG;EAChBC,sBAAsB,EAAEC,oBAAA,CAAOD,sBAAP,CAA8BE,IAA9B,CAAmCD,oBAAnC,CADR;EAGhBE,qBAAqB,EAAEF,oBAAA,CAAOE,qBAAP,CAA6BD,IAA7B,CAAkCD,oBAAlC,CAHP;EAKhBG,4BAA4B,EAAEH,oBAAA,CAAOG,4BAAP,CAAoCF,IAApC,CAAyCD,oBAAzC,CALd;EAMhBI,yBAAyB,EAAEJ,oBAAA,CAAOI,yBAAP,CAAiCH,IAAjC,CAAsCD,oBAAtC,CANX;EAOhBK,wBAAwB,EAAEL,oBAAA,CAAOK,wBAAP,CAAgCJ,IAAhC,CAAqCD,oBAArC,CAPV;EAShB;EACAM,gBAAgB,EAAEN,oBAAA,CAAOM,gBAAP,CAAwBL,IAAxB,CAA6BD,oBAA7B,CAVF;EAWhBO,sBAAsB,EAAEP,oBAAA,CAAOO,sBAAP,CAA8BN,IAA9B,CAAmCD,oBAAn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
|
|
69
69
|
})),
|
|
70
70
|
queryWorkouts: UnavailableFn(Promise.resolve([])),
|
|
71
71
|
requestAuthorization: UnavailableFn(Promise.resolve(false)),
|
|
72
|
+
deleteQuantitySample: UnavailableFn(Promise.resolve(false)),
|
|
72
73
|
saveCategorySample: UnavailableFn(Promise.resolve(false)),
|
|
73
74
|
saveCorrelationSample: UnavailableFn(Promise.resolve(false)),
|
|
74
75
|
saveQuantitySample: UnavailableFn(Promise.resolve(false)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["notAvailableError","Platform","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","HKUnits","Count","getPreferredUnits","getRequestStatusForAuthorization","HKAuthorizationRequestStatus","unknown","getWheelchairUse","HKWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve([])),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryQuantitySamples: UnavailableFn(Promise.resolve([])),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;
|
|
1
|
+
{"version":3,"names":["notAvailableError","Platform","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","HKUnits","Count","getPreferredUnits","getRequestStatusForAuthorization","HKAuthorizationRequestStatus","unknown","getWheelchairUse","HKWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","requestAuthorization","deleteQuantitySample","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve([])),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryQuantitySamples: UnavailableFn(Promise.resolve([])),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n deleteQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;AAoEA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AA9DA,MAAMA,iBAAiB,GAAI,kDACzBC,qBAAA,CAASC,EACV,iBAFD;AAIA,IAAIC,SAAS,GAAG,KAAhB;;AAEA,SAASC,aAAT,CAAoCC,MAApC,EAA+C;EAC7C,OAAO,MAAM;IACX,IAAI,CAACF,SAAL,EAAgB;MACdG,OAAO,CAACC,IAAR,CAAaP,iBAAb;MACAG,SAAS,GAAG,IAAZ;IACD;;IACD,OAAOE,MAAP;EACD,CAND;AAOD;;AAED,MAAMG,SAAsC,GAAG;EAC7CC,sBAAsB,EAAEL,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CADQ;EAE7CC,4BAA4B,EAAER,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CAFE;EAG7C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D,CApCa;EAqC7C8C,kBAAkB,EAAErD,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,YAAYD,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAA5B,CAAD,CArCY;EAsC7C+C,2BAA2B,EAAEtD,aAAa,CAAC,IAAD,CAtCG;EAuC7CuD,2BAA2B,EAAEvD,aAAa,CAAC,IAAD,CAvCG;EAwC7CwD,oBAAoB,EAAExD,aAAa,CAAC,IAAD,CAxCU;EAyC7CyD,qBAAqB,EAAEzD,aAAa,CAAC,CAAC,IAAD,EAAO,MAAM,IAAb,CAAD,CAzCS;EA0C7C0D,yBAAyB,EAAE1D,aAAa,CAAC,CAAC,IAAD,EAAO,YAAYM,OAAO,CAACC,OAAR,CAAgBqB,yCAAA,CAA6BC,OAA7C,CAAnB,CAAD,CA1CK;EA2C7C8B,wBAAwB,EAAE,MAAM;AA3Ca,CAA/C;eAgDevD,S"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HKWorkoutTypeIdentifier","HKAudiogramTypeIdentifier","HKWorkoutRouteTypeIdentifier","HKDataTypeIdentifierHeartbeatSeries","HKQuantityTypeIdentifier","HKCategoryValueLowCardioFitnessEvent","HKHeartRateMotionContext","HKCorrelationTypeIdentifier","HKCategoryTypeIdentifier","HKCategoryValueAppleStandHour","HKWorkoutActivityType","HKWeatherCondition","HKIndoorWorkout","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBloodType","HKBiologicalSex","HKFitzpatrickSkinType","HKStatisticsOptions","HKCategoryValueCervicalMucusQuality","HKCategoryValueMenstrualFlow","HKCategoryValueOvulationTestResult","HKCategoryValueSleepAnalysis","HKCategoryValueAppetiteChanges","HKCategoryValuePresence","HKCategoryValueSeverity","HKCategoryValueNotApplicable","HKInsulinDeliveryReason","HKCategoryValuePregnancyTestResult","HKWheelchairUse","HKMetricPrefix","HKUnitMetric","HKUnits","UnitOfLength","UnitOfVolume","UnitOfMass","UnitOfPressure","UnitOfTime","TemperatureUnit","UnitOfEnergy","BloodGlucoseUnit","HKCharacteristicTypeIdentifier","HKUpdateFrequency","Native","NativeModules","ReactNativeHealthkit","EventEmitter","NativeEventEmitter"],"sources":["native-types.ts"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n} from 'react-native'\n\nimport type { EmitterSubscription } from 'react-native'\n\nexport const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier' as const\nexport const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier' as const\nexport const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier' as const\nexport const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries' as const\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier\nexport enum HKQuantityTypeIdentifier {\n bodyMassIndex = 'HKQuantityTypeIdentifierBodyMassIndex',\n bodyFatPercentage = 'HKQuantityTypeIdentifierBodyFatPercentage', // Scalar(Percent, 0.0 - 1.0), Discrete\n height = 'HKQuantityTypeIdentifierHeight', // Length, Discrete\n bodyMass = 'HKQuantityTypeIdentifierBodyMass', // Mass, Discrete\n leanBodyMass = 'HKQuantityTypeIdentifierLeanBodyMass', // Mass, Discrete\n\n waistCircumference = 'HKQuantityTypeIdentifierWaistCircumference', // Length, Discrete\n // Fitness\n stepCount = 'HKQuantityTypeIdentifierStepCount', // Scalar(Count), Cumulative\n distanceWalkingRunning = 'HKQuantityTypeIdentifierDistanceWalkingRunning', // Length, Cumulative\n distanceCycling = 'HKQuantityTypeIdentifierDistanceCycling', // Length, Cumulative\n distanceWheelchair = 'HKQuantityTypeIdentifierDistanceWheelchair', // Length, Cumulative\n basalEnergyBurned = 'HKQuantityTypeIdentifierBasalEnergyBurned', // Energy, Cumulative\n activeEnergyBurned = 'HKQuantityTypeIdentifierActiveEnergyBurned', // Energy, Cumulative\n flightsClimbed = 'HKQuantityTypeIdentifierFlightsClimbed', // Scalar(Count), Cumulative\n nikeFuel = 'HKQuantityTypeIdentifierNikeFuel', // Scalar(Count), Cumulative\n appleExerciseTime = 'HKQuantityTypeIdentifierAppleExerciseTime', // Time Cumulative\n pushCount = 'HKQuantityTypeIdentifierPushCount', // Scalar(Count), Cumulative\n distanceSwimming = 'HKQuantityTypeIdentifierDistanceSwimming', // Length, Cumulative\n swimmingStrokeCount = 'HKQuantityTypeIdentifierSwimmingStrokeCount', // Scalar(Count), Cumulative\n vo2Max = 'HKQuantityTypeIdentifierVo2Max', // ml/(kg*min) Discrete\n distanceDownhillSnowSports = 'HKQuantityTypeIdentifierDistanceDownhillSnowSports', // Length, Cumulative\n\n appleStandTime = 'HKQuantityTypeIdentifierAppleStandTime', // Time, Cumulative\n // Vitals\n heartRate = 'HKQuantityTypeIdentifierHeartRate', // Scalar(Count)/Time, Discrete\n bodyTemperature = 'HKQuantityTypeIdentifierBodyTemperature', // Temperature, Discrete\n basalBodyTemperature = 'HKQuantityTypeIdentifierBasalBodyTemperature', // Basal Body Temperature, Discrete\n bloodPressureSystolic = 'HKQuantityTypeIdentifierBloodPressureSystolic', // Pressure, Discrete\n bloodPressureDiastolic = 'HKQuantityTypeIdentifierBloodPressureDiastolic', // Pressure, Discrete\n respiratoryRate = 'HKQuantityTypeIdentifierRespiratoryRate', // Scalar(Count)/Time, Discrete\n // Beats per minute estimate of a user's lowest heart rate while at rest\n restingHeartRate = 'HKQuantityTypeIdentifierRestingHeartRate', // Scalar(Count)/Time, Discrete\n // Average heartbeats per minute captured by an Apple Watch while a user is walking\n walkingHeartRateAverage = 'HKQuantityTypeIdentifierWalkingHeartRateAverage', // Scalar(Count)/Time, Discrete\n // The standard deviation of heart beat-to-beat intevals (Standard Deviation of Normal to Normal)\n\n heartRateVariabilitySDNN = 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN', // Time (ms), Discrete\n // Results\n oxygenSaturation = 'HKQuantityTypeIdentifierOxygenSaturation', // Scalar (Percent, 0.0 - 1.0, Discrete\n peripheralPerfusionIndex = 'HKQuantityTypeIdentifierPeripheralPerfusionIndex', // Scalar(Percent, 0.0 - 1.0), Discrete\n bloodGlucose = 'HKQuantityTypeIdentifierBloodGlucose', // Mass/Volume, Discrete\n numberOfTimesFallen = 'HKQuantityTypeIdentifierNumberOfTimesFallen', // Scalar(Count), Cumulative\n electrodermalActivity = 'HKQuantityTypeIdentifierElectrodermalActivity', // Conductance, Discrete\n inhalerUsage = 'HKQuantityTypeIdentifierInhalerUsage', // Scalar(Count), Cumulative\n insulinDelivery = 'HKQuantityTypeIdentifierInsulinDelivery', // Pharmacology (IU) Cumulative\n bloodAlcoholContent = 'HKQuantityTypeIdentifierBloodAlcoholContent', // Scalar(Percent, 0.0 - 1.0), Discrete\n forcedVitalCapacity = 'HKQuantityTypeIdentifierForcedVitalCapacity', // Volume, Discrete\n forcedExpiratoryVolume1 = 'HKQuantityTypeIdentifierForcedExpiratoryVolume1', // Volume, Discrete\n peakExpiratoryFlowRate = 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate', // Volume/Time, Discrete\n environmentalAudioExposure = 'HKQuantityTypeIdentifierEnvironmentalAudioExposure', // Pressure, Cumulative\n\n headphoneAudioExposure = 'HKQuantityTypeIdentifierHeadphoneAudioExposure', // Pressure, Cumulative\n // Nutrition\n dietaryFatTotal = 'HKQuantityTypeIdentifierDietaryFatTotal', // Mass, Cumulative\n dietaryFatPolyunsaturated = 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated', // Mass, Cumulative\n dietaryFatMonounsaturated = 'HKQuantityTypeIdentifierDietaryFatMonounsaturated', // Mass, Cumulative\n dietaryFatSaturated = 'HKQuantityTypeIdentifierDietaryFatSaturated', // Mass, Cumulative\n dietaryCholesterol = 'HKQuantityTypeIdentifierDietaryCholesterol', // Mass, Cumulative\n dietarySodium = 'HKQuantityTypeIdentifierDietarySodium', // Mass, Cumulative\n dietaryCarbohydrates = 'HKQuantityTypeIdentifierDietaryCarbohydrates', // Mass, Cumulative\n dietaryFiber = 'HKQuantityTypeIdentifierDietaryFiber', // Mass, Cumulative\n dietarySugar = 'HKQuantityTypeIdentifierDietarySugar', // Mass, Cumulative\n dietaryEnergyConsumed = 'HKQuantityTypeIdentifierDietaryEnergyConsumed', // Energy, Cumulative\n dietaryProtein = 'HKQuantityTypeIdentifierDietaryProtein', // Mass, Cumulative\n\n dietaryVitaminA = 'HKQuantityTypeIdentifierDietaryVitaminA', // Mass, Cumulative\n dietaryVitaminB6 = 'HKQuantityTypeIdentifierDietaryVitaminB6', // Mass, Cumulative\n dietaryVitaminB12 = 'HKQuantityTypeIdentifierDietaryVitaminB12', // Mass, Cumulative\n dietaryVitaminC = 'HKQuantityTypeIdentifierDietaryVitaminC', // Mass, Cumulative\n dietaryVitaminD = 'HKQuantityTypeIdentifierDietaryVitaminD', // Mass, Cumulative\n dietaryVitaminE = 'HKQuantityTypeIdentifierDietaryVitaminE', // Mass, Cumulative\n dietaryVitaminK = 'HKQuantityTypeIdentifierDietaryVitaminK', // Mass, Cumulative\n dietaryCalcium = 'HKQuantityTypeIdentifierDietaryCalcium', // Mass, Cumulative\n dietaryIron = 'HKQuantityTypeIdentifierDietaryIron', // Mass, Cumulative\n dietaryThiamin = 'HKQuantityTypeIdentifierDietaryThiamin', // Mass, Cumulative\n dietaryRiboflavin = 'HKQuantityTypeIdentifierDietaryRiboflavin', // Mass, Cumulative\n dietaryNiacin = 'HKQuantityTypeIdentifierDietaryNiacin', // Mass, Cumulative\n dietaryFolate = 'HKQuantityTypeIdentifierDietaryFolate', // Mass, Cumulative\n dietaryBiotin = 'HKQuantityTypeIdentifierDietaryBiotin', // Mass, Cumulative\n dietaryPantothenicAcid = 'HKQuantityTypeIdentifierDietaryPantothenicAcid', // Mass, Cumulative\n dietaryPhosphorus = 'HKQuantityTypeIdentifierDietaryPhosphorus', // Mass, Cumulative\n dietaryIodine = 'HKQuantityTypeIdentifierDietaryIodine', // Mass, Cumulative\n dietaryMagnesium = 'HKQuantityTypeIdentifierDietaryMagnesium', // Mass, Cumulative\n dietaryZinc = 'HKQuantityTypeIdentifierDietaryZinc', // Mass, Cumulative\n dietarySelenium = 'HKQuantityTypeIdentifierDietarySelenium', // Mass, Cumulative\n dietaryCopper = 'HKQuantityTypeIdentifierDietaryCopper', // Mass, Cumulative\n dietaryManganese = 'HKQuantityTypeIdentifierDietaryManganese', // Mass, Cumulative\n dietaryChromium = 'HKQuantityTypeIdentifierDietaryChromium', // Mass, Cumulative\n dietaryMolybdenum = 'HKQuantityTypeIdentifierDietaryMolybdenum', // Mass, Cumulative\n dietaryChloride = 'HKQuantityTypeIdentifierDietaryChloride', // Mass, Cumulative\n dietaryPotassium = 'HKQuantityTypeIdentifierDietaryPotassium', // Mass, Cumulative\n dietaryCaffeine = 'HKQuantityTypeIdentifierDietaryCaffeine', // Mass, Cumulative\n dietaryWater = 'HKQuantityTypeIdentifierDietaryWater', // Volume, Cumulative\n\n // Mobility\n sixMinuteWalkTestDistance = 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance',\n walkingSpeed = 'HKQuantityTypeIdentifierWalkingSpeed',\n walkingStepLength = 'HKQuantityTypeIdentifierWalkingStepLength',\n walkingAsymmetryPercentage = 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage',\n walkingDoubleSupportPercentage = 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage',\n stairAscentSpeed = 'HKQuantityTypeIdentifierStairAscentSpeed',\n stairDescentSpeed = 'HKQuantityTypeIdentifierStairDescentSpeed',\n\n uvExposure = 'HKQuantityTypeIdentifierUvExposure', // Scalar (Count), Discrete\n\n appleMoveTime = 'HKQuantityTypeIdentifierAppleMoveTime', // Time, Cumulative\n appleWalkingSteadiness = 'HKQuantityTypeIdentifierAppleWalkingSteadiness', // Scalar(Percent, 0.0 - 1.0), Discrete\n\n numberOfAlcoholicBeverages = 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages', // Scalar(Count), Cumulative\n}\n\nexport type TypeToUnitMapping = { readonly\n [key in HKQuantityTypeIdentifier]: HKUnit;\n};\n\nexport enum HKCategoryValueLowCardioFitnessEvent {\n lowFitness = 1,\n}\n\nexport enum HKHeartRateMotionContext {\n active = 2,\n notSet = 0,\n sedentary = 1,\n}\n\nexport enum HKCorrelationTypeIdentifier {\n bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',\n food = 'HKCorrelationTypeIdentifierFood',\n}\n\nexport enum HKCategoryTypeIdentifier {\n sleepAnalysis = 'HKCategoryTypeIdentifierSleepAnalysis',\n appleStandHour = 'HKCategoryTypeIdentifierAppleStandHour',\n cervicalMucusQuality = 'HKCategoryTypeIdentifierCervicalMucusQuality',\n ovulationTestResult = 'HKCategoryTypeIdentifierOvulationTestResult',\n menstrualFlow = 'HKCategoryTypeIdentifierMenstrualFlow',\n intermenstrualBleeding = 'HKCategoryTypeIdentifierIntermenstrualBleeding',\n sexualActivity = 'HKCategoryTypeIdentifierSexualActivity',\n mindfulSession = 'HKCategoryTypeIdentifierMindfulSession',\n highHeartRateEvent = 'HKCategoryTypeIdentifierHighHeartRateEvent',\n lowHeartRateEvent = 'HKCategoryTypeIdentifierLowHeartRateEvent',\n irregularHeartRhythmEvent = 'HKCategoryTypeIdentifierIrregularHeartRhythmEvent',\n audioExposureEvent = 'HKCategoryTypeIdentifierAudioExposureEvent',\n toothbrushingEvent = 'HKCategoryTypeIdentifierToothbrushingEvent',\n lowCardioFitnessEvent = 'HKCategoryTypeIdentifierLowCardioFitnessEvent',\n contraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n pregnancyTestResult = 'HKCategoryTypeIdentifierPregnancyTestResult',\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue\n\n // Symptoms\n abdominalCramps = 'HKCategoryTypeIdentifierAbdominalCramps', // HKCategoryValueSeverity\n acne = 'HKCategoryTypeIdentifierAcne', // HKCategoryValueSeverity\n appetiteChanges = 'HKCategoryTypeIdentifierAppetiteChanges', // HKCategoryValueAppetiteChanges\n bladderIncontinence = 'HKCategoryTypeIdentifierBladderIncontinence', // HKCategoryValueSeverity\n bloating = 'HKCategoryTypeIdentifierBloating', // HKCategoryValueSeverity\n breastPain = 'HKCategoryTypeIdentifierBreastPain', // HKCategoryValueSeverity\n chestTightnessOrPain = 'HKCategoryTypeIdentifierChestTightnessOrPain', // HKCategoryValueSeverity\n chills = 'HKCategoryTypeIdentifierChills', // HKCategoryValueSeverity\n constipation = 'HKCategoryTypeIdentifierConstipation', // HKCategoryValueSeverity\n coughing = 'HKCategoryTypeIdentifierCoughing', // HKCategoryValueSeverity\n diarrhea = 'HKCategoryTypeIdentifierDiarrhea', // HKCategoryValueSeverity\n dizziness = 'HKCategoryTypeIdentifierDizziness', // HKCategoryValueSeverity\n drySkin = 'HKCategoryTypeIdentifierDrySkin', // HKCategoryValueSeverity\n fainting = 'HKCategoryTypeIdentifierFainting', // HKCategoryValueSeverity\n fatigue = 'HKCategoryTypeIdentifierFatigue', // HKCategoryValueSeverity\n fever = 'HKCategoryTypeIdentifierFever', // HKCategoryValueSeverity\n generalizedBodyAche = 'HKCategoryTypeIdentifierGeneralizedBodyAche', // HKCategoryValueSeverity\n hairLoss = 'HKCategoryTypeIdentifierHairLoss', // HKCategoryValueSeverity\n headache = 'HKCategoryTypeIdentifierHeadache', // HKCategoryValueSeverity\n heartburn = 'HKCategoryTypeIdentifierHeartburn', // HKCategoryValueSeverity\n hotFlashes = 'HKCategoryTypeIdentifierHotFlashes', // HKCategoryValueSeverity\n lossOfSmell = 'HKCategoryTypeIdentifierLossOfSmell', // HKCategoryValueSeverity\n lossOfTaste = 'HKCategoryTypeIdentifierLossOfTaste', // HKCategoryValueSeverity\n lowerBackPain = 'HKCategoryTypeIdentifierLowerBackPain', // HKCategoryValueSeverity\n memoryLapse = 'HKCategoryTypeIdentifierMemoryLapse', // HKCategoryValueSeverity\n moodChanges = 'HKCategoryTypeIdentifierMoodChanges', // HKCategoryValuePresence\n nausea = 'HKCategoryTypeIdentifierNausea', // HKCategoryValueSeverity\n nightSweats = 'HKCategoryTypeIdentifierNightSweats', // HKCategoryValueSeverity\n pelvicPain = 'HKCategoryTypeIdentifierPelvicPain', // HKCategoryValueSeverity\n rapidPoundingOrFlutteringHeartbeat = 'HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat', // HKCategoryValueSeverity\n runnyNose = 'HKCategoryTypeIdentifierRunnyNose', // HKCategoryValueSeverity\n shortnessOfBreath = 'HKCategoryTypeIdentifierShortnessOfBreath', // HKCategoryValueSeverity\n sinusCongestion = 'HKCategoryTypeIdentifierSinusCongestion', // HKCategoryValueSeverity\n skippedHeartbeat = 'HKCategoryTypeIdentifierSkippedHeartbeat', // HKCategoryValueSeverity\n sleepChanges = 'HKCategoryTypeIdentifierSleepChanges', // HKCategoryValuePresence\n soreThroat = 'HKCategoryTypeIdentifierSoreThroat', // HKCategoryValueSeverity\n vaginalDryness = 'HKCategoryTypeIdentifierVaginalDryness', // HKCategoryValueSeverity\n vomiting = 'HKCategoryTypeIdentifierVomiting', // HKCategoryValueSeverity\n wheezing = 'HKCategoryTypeIdentifierWheezing', // HKCategoryValueSeverity\n\n}\n\nexport type HKSampleTypeIdentifier =\nHKCategoryTypeIdentifier\n| HKCorrelationTypeIdentifier\n| HKQuantityTypeIdentifier\n| typeof HKAudiogramTypeIdentifier\n| typeof HKDataTypeIdentifierHeartbeatSeries\n| typeof HKWorkoutRouteTypeIdentifier\n| typeof HKWorkoutTypeIdentifier\n| `${HKCategoryTypeIdentifier}`\n| `${HKCorrelationTypeIdentifier}`\n| `${HKQuantityTypeIdentifier}`\n\nexport type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`\nexport type HealthkitWriteAuthorization = HKSampleTypeIdentifier\n\nexport enum HKCategoryValueAppleStandHour {\n stood = 0,\n idle = 1,\n}\n\nexport enum HKWorkoutActivityType {\n americanFootball = 1,\n archery = 2,\n australianFootball = 3,\n badminton = 4,\n baseball = 5,\n basketball = 6,\n bowling = 7,\n boxing = 8, // See also HKWorkoutActivityTypeKickboxing.,\n climbing = 9,\n cricket = 10,\n crossTraining = 11, // Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,\n curling = 12,\n cycling = 13,\n dance = 14,\n danceInspiredTraining = 15, // This enum remains available to access older data.,\n elliptical = 16,\n equestrianSports = 17, // Polo, Horse Racing, Horse Riding, etc.,\n fencing = 18,\n fishing = 19,\n functionalStrengthTraining = 20, // Primarily free weights and/or body weight and/or accessories,\n golf = 21,\n gymnastics = 22,\n handball = 23,\n hiking = 24,\n hockey = 25, // Ice Hockey, Field Hockey, etc.,\n hunting = 26,\n lacrosse = 27,\n martialArts = 28,\n mindAndBody = 29, // Qigong, meditation, etc.,\n mixedMetabolicCardioTraining = 30, // This enum remains available to access older data.,\n paddleSports = 31, // Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,\n play = 32, // Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,\n preparationAndRecovery = 33, // Foam rolling, stretching, etc.,\n racquetball = 34,\n rowing = 35,\n rugby = 36,\n running = 37,\n sailing = 38,\n skatingSports = 39, // Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,\n snowSports = 40, // Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,\n soccer = 41,\n softball = 42,\n squash = 43,\n stairClimbing = 44, // See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,\n surfingSports = 45, // Traditional Surfing, Kite Surfing, Wind Surfing, etc.,\n swimming = 46,\n tableTennis = 47,\n tennis = 48,\n trackAndField = 49, // Shot Put, Javelin, Pole Vaulting, etc.,\n traditionalStrengthTraining = 50, // Primarily machines and/or free weights,\n volleyball = 51,\n walking = 52,\n waterFitness = 53,\n waterPolo = 54,\n waterSports = 55, // Water Skiing, Wake Boarding, etc.,\n wrestling = 56,\n yoga = 57,\n barre = 58, // HKWorkoutActivityTypeDanceInspiredTraining,\n coreTraining = 59,\n crossCountrySkiing = 60,\n downhillSkiing = 61,\n flexibility = 62,\n highIntensityIntervalTraining = 63,\n jumpRope = 64,\n kickboxing = 65,\n pilates = 66, // HKWorkoutActivityTypeDanceInspiredTraining,\n snowboarding = 67,\n stairs = 68,\n stepTraining = 69,\n wheelchairWalkPace = 70,\n wheelchairRunPace = 71,\n taiChi = 72,\n mixedCardio = 73, // HKWorkoutActivityTypeMixedMetabolicCardioTraining,\n handCycling = 74,\n discSports = 75,\n fitnessGaming = 76,\n other = 3000,\n}\n\nexport type HKGenericMetadata = {\n readonly [key: string]: HKQuantity | boolean | number | string | undefined;\n readonly HKExternalUUID?: string;\n readonly HKTimeZone?: string;\n readonly HKWasUserEntered?: boolean;\n readonly HKDeviceSerialNumber?: string;\n readonly HKUDIDeviceIdentifier?: string;\n readonly HKUDIProductionIdentifier?: string;\n readonly HKDigitalSignature?: string;\n readonly HKDeviceName?: string;\n readonly HKDeviceManufacturerName?: string;\n readonly HKSyncIdentifier?: string;\n readonly HKSyncVersion?: number;\n readonly HKWasTakenInLab?: boolean;\n readonly HKReferenceRangeLowerLimit?: number;\n readonly HKReferenceRangeUpperLimit?: number;\n};\n\n// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition\nexport enum HKWeatherCondition {\n none = 0,\n clear = 1,\n fair = 2,\n partlyCloudy = 3,\n mostlyCloudy = 4,\n cloudy = 5,\n foggy = 6,\n haze = 7,\n windy = 8,\n blustery = 9,\n smoky = 10,\n dust = 11,\n snow = 12,\n hail = 13,\n sleet = 14,\n freezingDrizzle = 15,\n freezingRain = 16,\n mixedRainAndHail = 17,\n mixedRainAndSnow = 18,\n mixedRainAndSleet = 19,\n mixedSnowAndSleet = 20,\n drizzle = 21,\n scatteredShowers = 22,\n showers = 23,\n thunderstorms = 24,\n tropicalStorm = 25,\n hurricane = 26,\n tornado = 27,\n}\n\nenum HKIndoorWorkout {\n false = 0,\n true = 1,\n}\n\nexport interface HKWorkoutMetadata\n extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {\n readonly HKWeatherCondition?: HKWeatherCondition;\n readonly HKWeatherHumidity?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Percent>;\n // HKWeatherTemperature: HKQuantity<TTemperatureUnit>\n readonly HKAverageMETs?: HKQuantity<HKQuantityTypeIdentifier, HKUnit>,\n readonly HKElevationAscended?: HKQuantity<HKQuantityTypeIdentifier, LengthUnit>,\n readonly HKIndoorWorkout?: HKIndoorWorkout,\n}\n\nexport enum HKAuthorizationRequestStatus {\n unknown = 0,\n shouldRequest = 1,\n unnecessary = 2,\n}\n\nexport enum HKAuthorizationStatus {\n notDetermined = 0,\n sharingDenied = 1,\n sharingAuthorized = 2,\n}\n\nexport type HKQuantity<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> = {\n readonly unit: TUnit;\n readonly quantity: number;\n};\n\nexport enum HKBloodType {\n notSet = 0,\n aPositive = 1,\n aNegative = 2,\n bPositive = 3,\n bNegative = 4,\n abPositive = 5,\n abNegative = 6,\n oPositive = 7,\n oNegative = 8,\n}\n\nexport enum HKBiologicalSex {\n notSet = 0,\n female = 1,\n male = 2,\n other = 3,\n}\n\nexport enum HKFitzpatrickSkinType {\n notSet = 0,\n I = 1,\n II = 2,\n III = 3,\n IV = 4,\n V = 5,\n VI = 6,\n}\n\nexport enum HKStatisticsOptions {\n cumulativeSum = 'cumulativeSum',\n discreteAverage = 'discreteAverage',\n discreteMax = 'discreteMax',\n discreteMin = 'discreteMin',\n discreteMostRecent = 'discreteMostRecent',\n duration = 'duration',\n mostRecent = 'mostRecent',\n separateBySource = 'separateBySource',\n}\n\nexport type QueryStatisticsResponseRaw<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>> = {\n readonly averageQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly maximumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly minimumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly sumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantityDateInterval?: { readonly from: string; readonly to: string };\n readonly duration?: HKQuantity<HKQuantityTypeIdentifier, TimeUnit>;\n};\n\nexport enum HKCategoryValueCervicalMucusQuality {\n dry = 1,\n sticky = 2,\n creamy = 3,\n watery = 4,\n eggWhite = 5,\n}\n\nexport enum HKCategoryValueMenstrualFlow {\n unspecified = 1,\n none = 5,\n light = 2,\n medium = 3,\n heavy = 4,\n}\n\nexport enum HKCategoryValueOvulationTestResult {\n negative = 1,\n luteinizingHormoneSurge = 2,\n indeterminate = 3,\n estrogenSurge = 4,\n}\n\nexport enum HKCategoryValueSleepAnalysis {\n inBed = 0,\n asleep = 1,\n awake = 2,\n}\n\nexport enum HKCategoryValueAppetiteChanges {\n decreased = 2,\n increased = 3,\n noChange = 1,\n unspecified = 0,\n}\n\nexport enum HKCategoryValuePresence {\n notPresent = 1,\n present = 0,\n}\n\nexport enum HKCategoryValueSeverity {\n notPresent = 1,\n mild = 2,\n moderate = 3,\n severe = 4,\n unspecified = 0,\n}\n\nexport enum HKCategoryValueNotApplicable {\n notApplicable = 0,\n}\n\nexport type HKCategoryValue =\n HKCategoryValueAppetiteChanges | HKCategoryValueCervicalMucusQuality |\n HKCategoryValueLowCardioFitnessEvent | HKCategoryValueMenstrualFlow |\n HKCategoryValueOvulationTestResult | HKCategoryValuePresence |\n HKCategoryValueSeverity | HKCategoryValueSleepAnalysis | number;\n\nexport enum HKInsulinDeliveryReason {\n basal = 1,\n bolus = 2,\n}\n\nexport type MetadataMapperForQuantityIdentifier<\n TQuantityTypeIdentifier = HKQuantityTypeIdentifier\n> = TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.insulinDelivery\n ? HKGenericMetadata & {\n readonly HKInsulinDeliveryReason: HKInsulinDeliveryReason;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.bloodGlucose\n ? HKGenericMetadata & {\n readonly HKBloodGlucoseMealTime?: number;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.heartRate\n ? HKGenericMetadata & {\n readonly HKHeartRateMotionContext?: HKHeartRateMotionContext;\n }\n : HKGenericMetadata;\n\nexport type MetadataMapperForCorrelationIdentifier<\n TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier\n> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food\n ? HKGenericMetadata & {\n readonly HKFoodType?: string;\n }\n : HKGenericMetadata;\n\nexport type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit\n : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit\n : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit\n : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit\n : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent\n : T extends HKQuantityTypeIdentifier.basalBodyTemperature | HKQuantityTypeIdentifier.basalBodyTemperature ? TemperatureUnit\n : T extends HKQuantityTypeIdentifier.stairAscentSpeed | HKQuantityTypeIdentifier.stairDescentSpeed | HKQuantityTypeIdentifier.walkingSpeed | HKQuantityTypeIdentifier.walkingSpeed ? SpeedUnit<LengthUnit, TimeUnit>\n : T extends HKQuantityTypeIdentifier.flightsClimbed | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages | HKQuantityTypeIdentifier.numberOfTimesFallen | HKQuantityTypeIdentifier.pushCount | HKQuantityTypeIdentifier.stepCount | HKQuantityTypeIdentifier.swimmingStrokeCount ? HKUnits.Count\n : T extends HKQuantityTypeIdentifier.dietaryBiotin | HKQuantityTypeIdentifier.dietaryCaffeine | HKQuantityTypeIdentifier.dietaryCalcium | HKQuantityTypeIdentifier.dietaryCarbohydrates | HKQuantityTypeIdentifier.dietaryChloride | HKQuantityTypeIdentifier.dietaryCholesterol | HKQuantityTypeIdentifier.dietaryChromium | HKQuantityTypeIdentifier.dietaryCopper | HKQuantityTypeIdentifier.dietaryFatMonounsaturated | HKQuantityTypeIdentifier.dietaryFatPolyunsaturated | HKQuantityTypeIdentifier.dietaryFatSaturated | HKQuantityTypeIdentifier.dietaryFatTotal | HKQuantityTypeIdentifier.dietaryFiber | HKQuantityTypeIdentifier.dietaryFolate | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIron | HKQuantityTypeIdentifier.dietaryMagnesium | HKQuantityTypeIdentifier.dietaryManganese | HKQuantityTypeIdentifier.dietaryMolybdenum | HKQuantityTypeIdentifier.dietaryNiacin | HKQuantityTypeIdentifier.dietaryPantothenicAcid | HKQuantityTypeIdentifier.dietaryPhosphorus | HKQuantityTypeIdentifier.dietaryPotassium | HKQuantityTypeIdentifier.dietaryProtein | HKQuantityTypeIdentifier.dietaryRiboflavin | HKQuantityTypeIdentifier.dietarySelenium | HKQuantityTypeIdentifier.dietarySodium | HKQuantityTypeIdentifier.dietarySugar | HKQuantityTypeIdentifier.dietaryThiamin | HKQuantityTypeIdentifier.dietaryVitaminA | HKQuantityTypeIdentifier.dietaryVitaminB6 | HKQuantityTypeIdentifier.dietaryVitaminB12 | HKQuantityTypeIdentifier.dietaryVitaminC | HKQuantityTypeIdentifier.dietaryVitaminD | HKQuantityTypeIdentifier.dietaryVitaminE | HKQuantityTypeIdentifier.dietaryVitaminK | HKQuantityTypeIdentifier.dietaryZinc ? MassUnit\n : T extends HKQuantityTypeIdentifier.dietaryWater ? VolumeUnit\n : T extends HKQuantityTypeIdentifier.insulinDelivery ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}`\n : T extends HKQuantityTypeIdentifier.heartRate | HKQuantityTypeIdentifier.restingHeartRate | HKQuantityTypeIdentifier.walkingHeartRateAverage ? CountPerTime<TimeUnit>\n : HKUnit\n\nexport type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> =\n T extends HKCategoryTypeIdentifier.cervicalMucusQuality\n ? HKCategoryValueCervicalMucusQuality\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKCategoryValueMenstrualFlow\n : T extends HKCategoryTypeIdentifier.ovulationTestResult\n ? HKCategoryValueOvulationTestResult\n : T extends HKCategoryTypeIdentifier.sleepAnalysis\n ? HKCategoryValueSleepAnalysis\n : T extends (HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding\n | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity)\n ? HKCategoryValueNotApplicable\n : T extends (HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.acne\n | HKCategoryTypeIdentifier.bladderIncontinence\n | HKCategoryTypeIdentifier.bloating| HKCategoryTypeIdentifier.breastPain\n | HKCategoryTypeIdentifier.chestTightnessOrPain| HKCategoryTypeIdentifier.chills| HKCategoryTypeIdentifier.constipation\n | HKCategoryTypeIdentifier.coughing| HKCategoryTypeIdentifier.diarrhea| HKCategoryTypeIdentifier.dizziness| HKCategoryTypeIdentifier.drySkin| HKCategoryTypeIdentifier.fainting\n | HKCategoryTypeIdentifier.fatigue| HKCategoryTypeIdentifier.fever| HKCategoryTypeIdentifier.generalizedBodyAche| HKCategoryTypeIdentifier.hairLoss\n | HKCategoryTypeIdentifier.headache| HKCategoryTypeIdentifier.heartburn\n | HKCategoryTypeIdentifier.hotFlashes| HKCategoryTypeIdentifier.lossOfSmell| HKCategoryTypeIdentifier.lossOfTaste\n | HKCategoryTypeIdentifier.lowerBackPain| HKCategoryTypeIdentifier.memoryLapse| HKCategoryTypeIdentifier.moodChanges\n | HKCategoryTypeIdentifier.nausea| HKCategoryTypeIdentifier.nightSweats| HKCategoryTypeIdentifier.pelvicPain\n | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat| HKCategoryTypeIdentifier.runnyNose\n | HKCategoryTypeIdentifier.shortnessOfBreath| HKCategoryTypeIdentifier.sinusCongestion| HKCategoryTypeIdentifier.skippedHeartbeat\n | HKCategoryTypeIdentifier.soreThroat| HKCategoryTypeIdentifier.vaginalDryness\n | HKCategoryTypeIdentifier.vomiting| HKCategoryTypeIdentifier.wheezing)\n ? HKCategoryValueSeverity\n : T extends (HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges)\n ? HKCategoryValuePresence\n : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.appleStandHour\n ? HKCategoryValueAppleStandHour\n : number;\n\nenum HKCategoryValuePregnancyTestResult {\n positive = 2,\n negative = 1,\n indeterminate = 3\n}\n/* needs further mapping\n\ncontraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue */\n\nexport type MetadataMapperForCategoryIdentifier<\n T extends HKCategoryTypeIdentifier\n> = T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKGenericMetadata & {\n readonly HKSexualActivityProtectionUsed: boolean;\n }\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKGenericMetadata & {\n readonly HKMenstrualCycleStart: boolean;\n }\n : HKGenericMetadata;\n\n// Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse\nexport enum HKWheelchairUse {\n notSet = 0,\n no = 1,\n yes = 2,\n}\n\n// Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init\nexport enum HKMetricPrefix {\n None = '',\n Pico = 'p',\n Nano = 'n',\n Micro = 'mc',\n Milli = 'm',\n Centi = 'c',\n Deci = 'd',\n Deca = 'da',\n Hecto = 'h',\n Kilo = 'k',\n Mega = 'M',\n Giga = 'G',\n Tera = 'T',\n Femto = 'f',\n}\n\nexport enum HKUnitMetric {\n Gram = 'g',\n Joule = 'J',\n Kelvin = 'K',\n Liter = 'l',\n Meter = 'm',\n Pascal = 'Pa',\n Second = 's',\n Siemen = 'S',\n Hertz = 'Hz',\n Volt = 'V',\n}\n\nexport enum HKUnits {\n\n DecibelHearingLevel = 'dBHL',\n DecibelSoundPressureLevel = 'dBASPL',\n\n Percent = '%',\n Count = 'count',\n InternationalUnit = 'IU',\n\n}\n\nexport type MeterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Meter}`;\nexport type LiterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Liter}`;\nexport type GramUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Gram}`;\nexport type PascalUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Pascal}`;\nexport type SecondUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Second}`;\nexport type JouleUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Joule}`;\nexport type HertzUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Hertz}`;\nexport type VoltUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Volt}`;\nexport type SiemenUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Siemen}`;\n\n// not 100% sure about these\nexport type MoleUnit<MolarMass extends number> =`mol<${MolarMass}>`;\nexport type MoleUnitWith<MolarMass extends number, Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}mol<${MolarMass}>`;\n\nexport type FrequencyUnit = HertzUnit<HKMetricPrefix>\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\nexport enum UnitOfLength {\n Feet = 'ft',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\n Meter = 'm',\n Inches = 'in',\n Yards = 'yd',\n Miles = 'mi',\n}\nexport type LengthUnit = MeterUnit<HKMetricPrefix> | UnitOfLength\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\nexport enum UnitOfVolume {\n ImperialCup = 'cup_imp',\n ImperialFluidOunces = 'fl_oz_imp',\n ImperialPint = 'pt_imp',\n USCup = 'cup_us',\n USFluidOunces = 'fl_oz_us',\n USPint = 'pt_us',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\n Liter = 'l',\n}\nexport type VolumeUnit = LiterUnit<HKMetricPrefix> | UnitOfVolume;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport enum UnitOfMass {\n Ounces = 'oz',\n Stones = 'st',\n Pounds = 'lb',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\n Gram = 'g'\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport type MassUnit = GramUnit<HKMetricPrefix> | UnitOfMass\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport enum UnitOfPressure {\n Atmospheres = 'atm',\n CentimetersOfWater = 'cmAq',\n MillimetersOfMercury = 'mmHg',\n InchesOfMercury = 'inHg',\n DecibelAWeightedSoundPressureLevel = 'dBASPL',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\n Pascals = 'Pa',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport type PressureUnit = PascalUnit<HKMetricPrefix> | UnitOfPressure;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport enum UnitOfTime {\n Days = 'd',\n Minutes = 'min',\n Hours = 'hr',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\n Seconds = 's',\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport type TimeUnit = SecondUnit<HKMetricPrefix> | UnitOfTime\nexport enum TemperatureUnit {\n DegreesCelsius = 'degC',\n DegreesFahrenheit = 'degF',\n Kelvin = 'K',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\nexport enum UnitOfEnergy {\n Kilocalories = 'kcal',\n LargeCalories = 'Cal',\n SmallCalories = 'cal',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\n Joules = 'J',\n}\nexport type EnergyUnit = JouleUnit<HKMetricPrefix> | UnitOfEnergy\nexport enum BloodGlucoseUnit {\n GlucoseMmolPerL = 'mmol<180.15588000005408>/l',\n GlucoseMgPerDl = 'mg/dL',\n}\n\nexport type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> =`${TLength}/${TTime}`;\nexport type CountPerTime<TTime extends TimeUnit> =`count/${TTime}`;\n\nexport type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit\n| `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${FrequencyUnit}` | `${HKUnits}` | `${LengthUnit}` | `${MassUnit}` | `${PressureUnit}` | `${TemperatureUnit}` | `${TimeUnit}` | `${VolumeUnit}`;\n\nexport type HKDevice = {\n readonly name: string; // ex: \"Apple Watch\"\n readonly firmwareVersion: string | null;\n readonly hardwareVersion: string; // ex: \"Watch6,2\",\n readonly localIdentifier: string | null;\n readonly manufacturer: string; // ex: \"Apple Inc.\"\n readonly model: string; // ex: \"Watch\"\n readonly softwareVersion: string; // ex: \"9.0\"\n};\n\nexport type HKSource = {\n readonly name: string;\n readonly bundleIdentifier: string;\n};\n\nexport type HKSourceRevision = {\n readonly source: HKSource;\n readonly version: string;\n readonly operatingSystemVersion?: string;\n readonly productType?: string;\n};\n\nexport type HKQuantitySampleRaw<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TQuantityIdentifier;\n readonly startDate: string;\n readonly endDate: string;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKQuantitySampleRawForSaving<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = Omit<\nHKQuantitySampleRaw<TQuantityIdentifier, TUnit>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKCategorySampleRawForSaving<\n TCategory extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier,\n> = Omit<\nHKCategorySampleRaw<TCategory>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKWorkoutRaw<TEnergy extends EnergyUnit, TDistance extends LengthUnit> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly workoutActivityType: HKWorkoutActivityType;\n readonly duration: number;\n readonly totalDistance?: HKQuantity<HKQuantityTypeIdentifier, TDistance>;\n readonly totalEnergyBurned?: HKQuantity<HKQuantityTypeIdentifier, TEnergy>;\n readonly totalSwimmingStrokeCount?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly totalFlightsClimbed?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly startDate: string;\n readonly endDate: string;\n readonly metadata?: HKWorkoutMetadata;\n readonly sourceRevision?: HKSourceRevision;\n};\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier\nexport enum HKCharacteristicTypeIdentifier {\n fitzpatrickSkinType = 'HKCharacteristicTypeIdentifierFitzpatrickSkinType',\n biologicalSex = 'HKCharacteristicTypeIdentifierBiologicalSex',\n bloodType = 'HKCharacteristicTypeIdentifierBloodType',\n dateOfBirth = 'HKCharacteristicTypeIdentifierDateOfBirth',\n wheelchairUse = 'HKCharacteristicTypeIdentifierWheelchairUse',\n activityMoveMode = 'HKCharacteristicTypeIdentifierActivityMoveMode', // HKActivityMoveModeObject\n}\n\nexport type WritePermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type ReadPermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type HKCategorySampleRaw<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly categoryType: T;\n readonly startDate: string;\n readonly endDate: string;\n readonly value: HKCategoryValueForIdentifier<T>;\n readonly metadata: MetadataMapperForCategoryIdentifier<T>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKCorrelationRaw<TIdentifier extends HKCorrelationTypeIdentifier> =\n {\n readonly correlationType: HKCorrelationTypeIdentifier;\n readonly objects: readonly (HKCategorySampleRaw | HKQuantitySampleRaw)[];\n readonly metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n readonly startDate: string;\n readonly endDate: string;\n };\n\ntype QueryId = string;\n\nexport enum HKUpdateFrequency {\n immediate = 1,\n hourly = 2,\n daily = 3,\n weekly = 4,\n}\n\nexport type WorkoutLocation = {\n readonly longitude: number;\n readonly latitude: number;\n readonly altitude: number;\n readonly speed: number;\n readonly timestamp: number;\n readonly horizontalAccuracy: number;\n readonly speedAccuracy: number;\n readonly verticalAccuracy: number;\n};\n\nexport type WorkoutRoute = {\n readonly locations: readonly WorkoutLocation[];\n readonly HKMetadataKeySyncIdentifier?: string;\n readonly HKMetadataKeySyncVersion?: number;\n};\n\ntype ReactNativeHealthkitTypeNative = {\n isHealthDataAvailable(): Promise<boolean>;\n getBloodType(): Promise<HKBloodType>;\n getDateOfBirth(): Promise<string>;\n getBiologicalSex(): Promise<HKBiologicalSex>;\n getFitzpatrickSkinType(): Promise<HKFitzpatrickSkinType>;\n readonly getWheelchairUse: () => Promise<HKWheelchairUse>;\n\n readonly enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n readonly disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n ) => Promise<boolean>;\n readonly disableAllBackgroundDelivery: () => Promise<boolean>;\n\n readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier, TSamples extends readonly (HKCategorySampleRawForSaving | HKQuantitySampleRawForSaving)[]>(\n typeIdentifier: TIdentifier,\n samples: TSamples,\n start: string,\n end: string,\n metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>\n ) => Promise<boolean>;\n\n readonly saveWorkoutSample: (\n typeIdentifier: HKWorkoutActivityType,\n quantities: readonly HKQuantitySampleRawForSaving[],\n start: string,\n end: string,\n metadata: HKWorkoutMetadata\n ) => Promise<boolean>;\n\n readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n from: string,\n to: string\n ) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;\n\n subscribeToObserverQuery(\n identifier: HKSampleTypeIdentifier\n ): Promise<QueryId>;\n unsubscribeQuery(queryId: QueryId): Promise<boolean>;\n authorizationStatusFor(\n type: HealthkitReadAuthorization\n ): Promise<boolean>;\n getRequestStatusForAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<HKAuthorizationRequestStatus>;\n requestAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<boolean>;\n readonly saveQuantitySample: <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>> (\n identifier: TType,\n unit: TUnit,\n value: number,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(\n energyUnit: TEnergy,\n distanceUnit: TDistance,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;\n readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKCategorySampleRaw<T>[]>;\n readonly queryQuantitySamples: <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>,\n >(\n identifier: TIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;\n readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryStatisticsForQuantity: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(\n identifier: HKQuantityTypeIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n options: readonly HKStatisticsOptions[]\n ) => Promise<QueryStatisticsResponseRaw<TIdentifier, TUnit>>;\n readonly getPreferredUnits: (\n identifiers: readonly HKQuantityTypeIdentifier[]\n ) => Promise<TypeToUnitMapping>;\n readonly getWorkoutRoutes: (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;\n};\n\nconst Native = NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNative\n\ntype OnChangeCallback = ({\n typeIdentifier,\n}: {\n readonly typeIdentifier: HKSampleTypeIdentifier;\n}) => void;\n\ninterface HealthkitEventEmitter extends NativeEventEmitter {\n readonly addListener: (\n eventType: 'onChange',\n callback: OnChangeCallback\n ) => EmitterSubscription;\n}\n\nexport const EventEmitter = new NativeEventEmitter(\n NativeModules.ReactNativeHealthkit,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A,iB;EAAAA,iB,CAAAA,iB;GAAAA,iB,iCAAAA,iB;;AAoIZ,MAAMC,MAAM,GAAGC,0BAAA,CAAcC,oBAA7B;AAeO,MAAMC,YAAY,GAAG,IAAIC,+BAAJ,CAC1BH,0BAAA,CAAcC,oBADY,CAArB;;eAIQF,M"}
|
|
1
|
+
{"version":3,"names":["HKWorkoutTypeIdentifier","HKAudiogramTypeIdentifier","HKWorkoutRouteTypeIdentifier","HKDataTypeIdentifierHeartbeatSeries","HKQuantityTypeIdentifier","HKCategoryValueLowCardioFitnessEvent","HKHeartRateMotionContext","HKCorrelationTypeIdentifier","HKCategoryTypeIdentifier","HKCategoryValueAppleStandHour","HKWorkoutActivityType","HKWeatherCondition","HKIndoorWorkout","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBloodType","HKBiologicalSex","HKFitzpatrickSkinType","HKStatisticsOptions","HKCategoryValueCervicalMucusQuality","HKCategoryValueMenstrualFlow","HKCategoryValueOvulationTestResult","HKCategoryValueSleepAnalysis","HKCategoryValueAppetiteChanges","HKCategoryValuePresence","HKCategoryValueSeverity","HKCategoryValueNotApplicable","HKInsulinDeliveryReason","HKCategoryValuePregnancyTestResult","HKWheelchairUse","HKMetricPrefix","HKUnitMetric","HKUnits","UnitOfLength","UnitOfVolume","UnitOfMass","UnitOfPressure","UnitOfTime","TemperatureUnit","UnitOfEnergy","BloodGlucoseUnit","HKCharacteristicTypeIdentifier","HKUpdateFrequency","Native","NativeModules","ReactNativeHealthkit","EventEmitter","NativeEventEmitter"],"sources":["native-types.ts"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n} from 'react-native'\n\nimport type { EmitterSubscription } from 'react-native'\n\nexport const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier' as const\nexport const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier' as const\nexport const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier' as const\nexport const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries' as const\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier\nexport enum HKQuantityTypeIdentifier {\n bodyMassIndex = 'HKQuantityTypeIdentifierBodyMassIndex',\n bodyFatPercentage = 'HKQuantityTypeIdentifierBodyFatPercentage', // Scalar(Percent, 0.0 - 1.0), Discrete\n height = 'HKQuantityTypeIdentifierHeight', // Length, Discrete\n bodyMass = 'HKQuantityTypeIdentifierBodyMass', // Mass, Discrete\n leanBodyMass = 'HKQuantityTypeIdentifierLeanBodyMass', // Mass, Discrete\n\n waistCircumference = 'HKQuantityTypeIdentifierWaistCircumference', // Length, Discrete\n // Fitness\n stepCount = 'HKQuantityTypeIdentifierStepCount', // Scalar(Count), Cumulative\n distanceWalkingRunning = 'HKQuantityTypeIdentifierDistanceWalkingRunning', // Length, Cumulative\n distanceCycling = 'HKQuantityTypeIdentifierDistanceCycling', // Length, Cumulative\n distanceWheelchair = 'HKQuantityTypeIdentifierDistanceWheelchair', // Length, Cumulative\n basalEnergyBurned = 'HKQuantityTypeIdentifierBasalEnergyBurned', // Energy, Cumulative\n activeEnergyBurned = 'HKQuantityTypeIdentifierActiveEnergyBurned', // Energy, Cumulative\n flightsClimbed = 'HKQuantityTypeIdentifierFlightsClimbed', // Scalar(Count), Cumulative\n nikeFuel = 'HKQuantityTypeIdentifierNikeFuel', // Scalar(Count), Cumulative\n appleExerciseTime = 'HKQuantityTypeIdentifierAppleExerciseTime', // Time Cumulative\n pushCount = 'HKQuantityTypeIdentifierPushCount', // Scalar(Count), Cumulative\n distanceSwimming = 'HKQuantityTypeIdentifierDistanceSwimming', // Length, Cumulative\n swimmingStrokeCount = 'HKQuantityTypeIdentifierSwimmingStrokeCount', // Scalar(Count), Cumulative\n vo2Max = 'HKQuantityTypeIdentifierVo2Max', // ml/(kg*min) Discrete\n distanceDownhillSnowSports = 'HKQuantityTypeIdentifierDistanceDownhillSnowSports', // Length, Cumulative\n\n appleStandTime = 'HKQuantityTypeIdentifierAppleStandTime', // Time, Cumulative\n // Vitals\n heartRate = 'HKQuantityTypeIdentifierHeartRate', // Scalar(Count)/Time, Discrete\n bodyTemperature = 'HKQuantityTypeIdentifierBodyTemperature', // Temperature, Discrete\n basalBodyTemperature = 'HKQuantityTypeIdentifierBasalBodyTemperature', // Basal Body Temperature, Discrete\n bloodPressureSystolic = 'HKQuantityTypeIdentifierBloodPressureSystolic', // Pressure, Discrete\n bloodPressureDiastolic = 'HKQuantityTypeIdentifierBloodPressureDiastolic', // Pressure, Discrete\n respiratoryRate = 'HKQuantityTypeIdentifierRespiratoryRate', // Scalar(Count)/Time, Discrete\n // Beats per minute estimate of a user's lowest heart rate while at rest\n restingHeartRate = 'HKQuantityTypeIdentifierRestingHeartRate', // Scalar(Count)/Time, Discrete\n // Average heartbeats per minute captured by an Apple Watch while a user is walking\n walkingHeartRateAverage = 'HKQuantityTypeIdentifierWalkingHeartRateAverage', // Scalar(Count)/Time, Discrete\n // The standard deviation of heart beat-to-beat intevals (Standard Deviation of Normal to Normal)\n\n heartRateVariabilitySDNN = 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN', // Time (ms), Discrete\n // Results\n oxygenSaturation = 'HKQuantityTypeIdentifierOxygenSaturation', // Scalar (Percent, 0.0 - 1.0, Discrete\n peripheralPerfusionIndex = 'HKQuantityTypeIdentifierPeripheralPerfusionIndex', // Scalar(Percent, 0.0 - 1.0), Discrete\n bloodGlucose = 'HKQuantityTypeIdentifierBloodGlucose', // Mass/Volume, Discrete\n numberOfTimesFallen = 'HKQuantityTypeIdentifierNumberOfTimesFallen', // Scalar(Count), Cumulative\n electrodermalActivity = 'HKQuantityTypeIdentifierElectrodermalActivity', // Conductance, Discrete\n inhalerUsage = 'HKQuantityTypeIdentifierInhalerUsage', // Scalar(Count), Cumulative\n insulinDelivery = 'HKQuantityTypeIdentifierInsulinDelivery', // Pharmacology (IU) Cumulative\n bloodAlcoholContent = 'HKQuantityTypeIdentifierBloodAlcoholContent', // Scalar(Percent, 0.0 - 1.0), Discrete\n forcedVitalCapacity = 'HKQuantityTypeIdentifierForcedVitalCapacity', // Volume, Discrete\n forcedExpiratoryVolume1 = 'HKQuantityTypeIdentifierForcedExpiratoryVolume1', // Volume, Discrete\n peakExpiratoryFlowRate = 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate', // Volume/Time, Discrete\n environmentalAudioExposure = 'HKQuantityTypeIdentifierEnvironmentalAudioExposure', // Pressure, Cumulative\n\n headphoneAudioExposure = 'HKQuantityTypeIdentifierHeadphoneAudioExposure', // Pressure, Cumulative\n // Nutrition\n dietaryFatTotal = 'HKQuantityTypeIdentifierDietaryFatTotal', // Mass, Cumulative\n dietaryFatPolyunsaturated = 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated', // Mass, Cumulative\n dietaryFatMonounsaturated = 'HKQuantityTypeIdentifierDietaryFatMonounsaturated', // Mass, Cumulative\n dietaryFatSaturated = 'HKQuantityTypeIdentifierDietaryFatSaturated', // Mass, Cumulative\n dietaryCholesterol = 'HKQuantityTypeIdentifierDietaryCholesterol', // Mass, Cumulative\n dietarySodium = 'HKQuantityTypeIdentifierDietarySodium', // Mass, Cumulative\n dietaryCarbohydrates = 'HKQuantityTypeIdentifierDietaryCarbohydrates', // Mass, Cumulative\n dietaryFiber = 'HKQuantityTypeIdentifierDietaryFiber', // Mass, Cumulative\n dietarySugar = 'HKQuantityTypeIdentifierDietarySugar', // Mass, Cumulative\n dietaryEnergyConsumed = 'HKQuantityTypeIdentifierDietaryEnergyConsumed', // Energy, Cumulative\n dietaryProtein = 'HKQuantityTypeIdentifierDietaryProtein', // Mass, Cumulative\n\n dietaryVitaminA = 'HKQuantityTypeIdentifierDietaryVitaminA', // Mass, Cumulative\n dietaryVitaminB6 = 'HKQuantityTypeIdentifierDietaryVitaminB6', // Mass, Cumulative\n dietaryVitaminB12 = 'HKQuantityTypeIdentifierDietaryVitaminB12', // Mass, Cumulative\n dietaryVitaminC = 'HKQuantityTypeIdentifierDietaryVitaminC', // Mass, Cumulative\n dietaryVitaminD = 'HKQuantityTypeIdentifierDietaryVitaminD', // Mass, Cumulative\n dietaryVitaminE = 'HKQuantityTypeIdentifierDietaryVitaminE', // Mass, Cumulative\n dietaryVitaminK = 'HKQuantityTypeIdentifierDietaryVitaminK', // Mass, Cumulative\n dietaryCalcium = 'HKQuantityTypeIdentifierDietaryCalcium', // Mass, Cumulative\n dietaryIron = 'HKQuantityTypeIdentifierDietaryIron', // Mass, Cumulative\n dietaryThiamin = 'HKQuantityTypeIdentifierDietaryThiamin', // Mass, Cumulative\n dietaryRiboflavin = 'HKQuantityTypeIdentifierDietaryRiboflavin', // Mass, Cumulative\n dietaryNiacin = 'HKQuantityTypeIdentifierDietaryNiacin', // Mass, Cumulative\n dietaryFolate = 'HKQuantityTypeIdentifierDietaryFolate', // Mass, Cumulative\n dietaryBiotin = 'HKQuantityTypeIdentifierDietaryBiotin', // Mass, Cumulative\n dietaryPantothenicAcid = 'HKQuantityTypeIdentifierDietaryPantothenicAcid', // Mass, Cumulative\n dietaryPhosphorus = 'HKQuantityTypeIdentifierDietaryPhosphorus', // Mass, Cumulative\n dietaryIodine = 'HKQuantityTypeIdentifierDietaryIodine', // Mass, Cumulative\n dietaryMagnesium = 'HKQuantityTypeIdentifierDietaryMagnesium', // Mass, Cumulative\n dietaryZinc = 'HKQuantityTypeIdentifierDietaryZinc', // Mass, Cumulative\n dietarySelenium = 'HKQuantityTypeIdentifierDietarySelenium', // Mass, Cumulative\n dietaryCopper = 'HKQuantityTypeIdentifierDietaryCopper', // Mass, Cumulative\n dietaryManganese = 'HKQuantityTypeIdentifierDietaryManganese', // Mass, Cumulative\n dietaryChromium = 'HKQuantityTypeIdentifierDietaryChromium', // Mass, Cumulative\n dietaryMolybdenum = 'HKQuantityTypeIdentifierDietaryMolybdenum', // Mass, Cumulative\n dietaryChloride = 'HKQuantityTypeIdentifierDietaryChloride', // Mass, Cumulative\n dietaryPotassium = 'HKQuantityTypeIdentifierDietaryPotassium', // Mass, Cumulative\n dietaryCaffeine = 'HKQuantityTypeIdentifierDietaryCaffeine', // Mass, Cumulative\n dietaryWater = 'HKQuantityTypeIdentifierDietaryWater', // Volume, Cumulative\n\n // Mobility\n sixMinuteWalkTestDistance = 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance',\n walkingSpeed = 'HKQuantityTypeIdentifierWalkingSpeed',\n walkingStepLength = 'HKQuantityTypeIdentifierWalkingStepLength',\n walkingAsymmetryPercentage = 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage',\n walkingDoubleSupportPercentage = 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage',\n stairAscentSpeed = 'HKQuantityTypeIdentifierStairAscentSpeed',\n stairDescentSpeed = 'HKQuantityTypeIdentifierStairDescentSpeed',\n\n uvExposure = 'HKQuantityTypeIdentifierUvExposure', // Scalar (Count), Discrete\n\n appleMoveTime = 'HKQuantityTypeIdentifierAppleMoveTime', // Time, Cumulative\n appleWalkingSteadiness = 'HKQuantityTypeIdentifierAppleWalkingSteadiness', // Scalar(Percent, 0.0 - 1.0), Discrete\n\n numberOfAlcoholicBeverages = 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages', // Scalar(Count), Cumulative\n}\n\nexport type TypeToUnitMapping = { readonly\n [key in HKQuantityTypeIdentifier]: HKUnit;\n};\n\nexport enum HKCategoryValueLowCardioFitnessEvent {\n lowFitness = 1,\n}\n\nexport enum HKHeartRateMotionContext {\n active = 2,\n notSet = 0,\n sedentary = 1,\n}\n\nexport enum HKCorrelationTypeIdentifier {\n bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',\n food = 'HKCorrelationTypeIdentifierFood',\n}\n\nexport enum HKCategoryTypeIdentifier {\n sleepAnalysis = 'HKCategoryTypeIdentifierSleepAnalysis',\n appleStandHour = 'HKCategoryTypeIdentifierAppleStandHour',\n cervicalMucusQuality = 'HKCategoryTypeIdentifierCervicalMucusQuality',\n ovulationTestResult = 'HKCategoryTypeIdentifierOvulationTestResult',\n menstrualFlow = 'HKCategoryTypeIdentifierMenstrualFlow',\n intermenstrualBleeding = 'HKCategoryTypeIdentifierIntermenstrualBleeding',\n sexualActivity = 'HKCategoryTypeIdentifierSexualActivity',\n mindfulSession = 'HKCategoryTypeIdentifierMindfulSession',\n highHeartRateEvent = 'HKCategoryTypeIdentifierHighHeartRateEvent',\n lowHeartRateEvent = 'HKCategoryTypeIdentifierLowHeartRateEvent',\n irregularHeartRhythmEvent = 'HKCategoryTypeIdentifierIrregularHeartRhythmEvent',\n audioExposureEvent = 'HKCategoryTypeIdentifierAudioExposureEvent',\n toothbrushingEvent = 'HKCategoryTypeIdentifierToothbrushingEvent',\n lowCardioFitnessEvent = 'HKCategoryTypeIdentifierLowCardioFitnessEvent',\n contraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n pregnancyTestResult = 'HKCategoryTypeIdentifierPregnancyTestResult',\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue\n\n // Symptoms\n abdominalCramps = 'HKCategoryTypeIdentifierAbdominalCramps', // HKCategoryValueSeverity\n acne = 'HKCategoryTypeIdentifierAcne', // HKCategoryValueSeverity\n appetiteChanges = 'HKCategoryTypeIdentifierAppetiteChanges', // HKCategoryValueAppetiteChanges\n bladderIncontinence = 'HKCategoryTypeIdentifierBladderIncontinence', // HKCategoryValueSeverity\n bloating = 'HKCategoryTypeIdentifierBloating', // HKCategoryValueSeverity\n breastPain = 'HKCategoryTypeIdentifierBreastPain', // HKCategoryValueSeverity\n chestTightnessOrPain = 'HKCategoryTypeIdentifierChestTightnessOrPain', // HKCategoryValueSeverity\n chills = 'HKCategoryTypeIdentifierChills', // HKCategoryValueSeverity\n constipation = 'HKCategoryTypeIdentifierConstipation', // HKCategoryValueSeverity\n coughing = 'HKCategoryTypeIdentifierCoughing', // HKCategoryValueSeverity\n diarrhea = 'HKCategoryTypeIdentifierDiarrhea', // HKCategoryValueSeverity\n dizziness = 'HKCategoryTypeIdentifierDizziness', // HKCategoryValueSeverity\n drySkin = 'HKCategoryTypeIdentifierDrySkin', // HKCategoryValueSeverity\n fainting = 'HKCategoryTypeIdentifierFainting', // HKCategoryValueSeverity\n fatigue = 'HKCategoryTypeIdentifierFatigue', // HKCategoryValueSeverity\n fever = 'HKCategoryTypeIdentifierFever', // HKCategoryValueSeverity\n generalizedBodyAche = 'HKCategoryTypeIdentifierGeneralizedBodyAche', // HKCategoryValueSeverity\n hairLoss = 'HKCategoryTypeIdentifierHairLoss', // HKCategoryValueSeverity\n headache = 'HKCategoryTypeIdentifierHeadache', // HKCategoryValueSeverity\n heartburn = 'HKCategoryTypeIdentifierHeartburn', // HKCategoryValueSeverity\n hotFlashes = 'HKCategoryTypeIdentifierHotFlashes', // HKCategoryValueSeverity\n lossOfSmell = 'HKCategoryTypeIdentifierLossOfSmell', // HKCategoryValueSeverity\n lossOfTaste = 'HKCategoryTypeIdentifierLossOfTaste', // HKCategoryValueSeverity\n lowerBackPain = 'HKCategoryTypeIdentifierLowerBackPain', // HKCategoryValueSeverity\n memoryLapse = 'HKCategoryTypeIdentifierMemoryLapse', // HKCategoryValueSeverity\n moodChanges = 'HKCategoryTypeIdentifierMoodChanges', // HKCategoryValuePresence\n nausea = 'HKCategoryTypeIdentifierNausea', // HKCategoryValueSeverity\n nightSweats = 'HKCategoryTypeIdentifierNightSweats', // HKCategoryValueSeverity\n pelvicPain = 'HKCategoryTypeIdentifierPelvicPain', // HKCategoryValueSeverity\n rapidPoundingOrFlutteringHeartbeat = 'HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat', // HKCategoryValueSeverity\n runnyNose = 'HKCategoryTypeIdentifierRunnyNose', // HKCategoryValueSeverity\n shortnessOfBreath = 'HKCategoryTypeIdentifierShortnessOfBreath', // HKCategoryValueSeverity\n sinusCongestion = 'HKCategoryTypeIdentifierSinusCongestion', // HKCategoryValueSeverity\n skippedHeartbeat = 'HKCategoryTypeIdentifierSkippedHeartbeat', // HKCategoryValueSeverity\n sleepChanges = 'HKCategoryTypeIdentifierSleepChanges', // HKCategoryValuePresence\n soreThroat = 'HKCategoryTypeIdentifierSoreThroat', // HKCategoryValueSeverity\n vaginalDryness = 'HKCategoryTypeIdentifierVaginalDryness', // HKCategoryValueSeverity\n vomiting = 'HKCategoryTypeIdentifierVomiting', // HKCategoryValueSeverity\n wheezing = 'HKCategoryTypeIdentifierWheezing', // HKCategoryValueSeverity\n\n}\n\nexport type HKSampleTypeIdentifier =\nHKCategoryTypeIdentifier\n| HKCorrelationTypeIdentifier\n| HKQuantityTypeIdentifier\n| typeof HKAudiogramTypeIdentifier\n| typeof HKDataTypeIdentifierHeartbeatSeries\n| typeof HKWorkoutRouteTypeIdentifier\n| typeof HKWorkoutTypeIdentifier\n| `${HKCategoryTypeIdentifier}`\n| `${HKCorrelationTypeIdentifier}`\n| `${HKQuantityTypeIdentifier}`\n\nexport type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`\nexport type HealthkitWriteAuthorization = HKSampleTypeIdentifier\n\nexport enum HKCategoryValueAppleStandHour {\n stood = 0,\n idle = 1,\n}\n\nexport enum HKWorkoutActivityType {\n americanFootball = 1,\n archery = 2,\n australianFootball = 3,\n badminton = 4,\n baseball = 5,\n basketball = 6,\n bowling = 7,\n boxing = 8, // See also HKWorkoutActivityTypeKickboxing.,\n climbing = 9,\n cricket = 10,\n crossTraining = 11, // Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,\n curling = 12,\n cycling = 13,\n dance = 14,\n danceInspiredTraining = 15, // This enum remains available to access older data.,\n elliptical = 16,\n equestrianSports = 17, // Polo, Horse Racing, Horse Riding, etc.,\n fencing = 18,\n fishing = 19,\n functionalStrengthTraining = 20, // Primarily free weights and/or body weight and/or accessories,\n golf = 21,\n gymnastics = 22,\n handball = 23,\n hiking = 24,\n hockey = 25, // Ice Hockey, Field Hockey, etc.,\n hunting = 26,\n lacrosse = 27,\n martialArts = 28,\n mindAndBody = 29, // Qigong, meditation, etc.,\n mixedMetabolicCardioTraining = 30, // This enum remains available to access older data.,\n paddleSports = 31, // Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,\n play = 32, // Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,\n preparationAndRecovery = 33, // Foam rolling, stretching, etc.,\n racquetball = 34,\n rowing = 35,\n rugby = 36,\n running = 37,\n sailing = 38,\n skatingSports = 39, // Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,\n snowSports = 40, // Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,\n soccer = 41,\n softball = 42,\n squash = 43,\n stairClimbing = 44, // See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,\n surfingSports = 45, // Traditional Surfing, Kite Surfing, Wind Surfing, etc.,\n swimming = 46,\n tableTennis = 47,\n tennis = 48,\n trackAndField = 49, // Shot Put, Javelin, Pole Vaulting, etc.,\n traditionalStrengthTraining = 50, // Primarily machines and/or free weights,\n volleyball = 51,\n walking = 52,\n waterFitness = 53,\n waterPolo = 54,\n waterSports = 55, // Water Skiing, Wake Boarding, etc.,\n wrestling = 56,\n yoga = 57,\n barre = 58, // HKWorkoutActivityTypeDanceInspiredTraining,\n coreTraining = 59,\n crossCountrySkiing = 60,\n downhillSkiing = 61,\n flexibility = 62,\n highIntensityIntervalTraining = 63,\n jumpRope = 64,\n kickboxing = 65,\n pilates = 66, // HKWorkoutActivityTypeDanceInspiredTraining,\n snowboarding = 67,\n stairs = 68,\n stepTraining = 69,\n wheelchairWalkPace = 70,\n wheelchairRunPace = 71,\n taiChi = 72,\n mixedCardio = 73, // HKWorkoutActivityTypeMixedMetabolicCardioTraining,\n handCycling = 74,\n discSports = 75,\n fitnessGaming = 76,\n other = 3000,\n}\n\nexport type HKGenericMetadata = {\n readonly [key: string]: HKQuantity | boolean | number | string | undefined;\n readonly HKExternalUUID?: string;\n readonly HKTimeZone?: string;\n readonly HKWasUserEntered?: boolean;\n readonly HKDeviceSerialNumber?: string;\n readonly HKUDIDeviceIdentifier?: string;\n readonly HKUDIProductionIdentifier?: string;\n readonly HKDigitalSignature?: string;\n readonly HKDeviceName?: string;\n readonly HKDeviceManufacturerName?: string;\n readonly HKSyncIdentifier?: string;\n readonly HKSyncVersion?: number;\n readonly HKWasTakenInLab?: boolean;\n readonly HKReferenceRangeLowerLimit?: number;\n readonly HKReferenceRangeUpperLimit?: number;\n};\n\n// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition\nexport enum HKWeatherCondition {\n none = 0,\n clear = 1,\n fair = 2,\n partlyCloudy = 3,\n mostlyCloudy = 4,\n cloudy = 5,\n foggy = 6,\n haze = 7,\n windy = 8,\n blustery = 9,\n smoky = 10,\n dust = 11,\n snow = 12,\n hail = 13,\n sleet = 14,\n freezingDrizzle = 15,\n freezingRain = 16,\n mixedRainAndHail = 17,\n mixedRainAndSnow = 18,\n mixedRainAndSleet = 19,\n mixedSnowAndSleet = 20,\n drizzle = 21,\n scatteredShowers = 22,\n showers = 23,\n thunderstorms = 24,\n tropicalStorm = 25,\n hurricane = 26,\n tornado = 27,\n}\n\nenum HKIndoorWorkout {\n false = 0,\n true = 1,\n}\n\nexport interface HKWorkoutMetadata\n extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {\n readonly HKWeatherCondition?: HKWeatherCondition;\n readonly HKWeatherHumidity?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Percent>;\n // HKWeatherTemperature: HKQuantity<TTemperatureUnit>\n readonly HKAverageMETs?: HKQuantity<HKQuantityTypeIdentifier, HKUnit>,\n readonly HKElevationAscended?: HKQuantity<HKQuantityTypeIdentifier, LengthUnit>,\n readonly HKIndoorWorkout?: HKIndoorWorkout,\n}\n\nexport enum HKAuthorizationRequestStatus {\n unknown = 0,\n shouldRequest = 1,\n unnecessary = 2,\n}\n\nexport enum HKAuthorizationStatus {\n notDetermined = 0,\n sharingDenied = 1,\n sharingAuthorized = 2,\n}\n\nexport type HKQuantity<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> = {\n readonly unit: TUnit;\n readonly quantity: number;\n};\n\nexport enum HKBloodType {\n notSet = 0,\n aPositive = 1,\n aNegative = 2,\n bPositive = 3,\n bNegative = 4,\n abPositive = 5,\n abNegative = 6,\n oPositive = 7,\n oNegative = 8,\n}\n\nexport enum HKBiologicalSex {\n notSet = 0,\n female = 1,\n male = 2,\n other = 3,\n}\n\nexport enum HKFitzpatrickSkinType {\n notSet = 0,\n I = 1,\n II = 2,\n III = 3,\n IV = 4,\n V = 5,\n VI = 6,\n}\n\nexport enum HKStatisticsOptions {\n cumulativeSum = 'cumulativeSum',\n discreteAverage = 'discreteAverage',\n discreteMax = 'discreteMax',\n discreteMin = 'discreteMin',\n discreteMostRecent = 'discreteMostRecent',\n duration = 'duration',\n mostRecent = 'mostRecent',\n separateBySource = 'separateBySource',\n}\n\nexport type QueryStatisticsResponseRaw<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>> = {\n readonly averageQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly maximumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly minimumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly sumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantityDateInterval?: { readonly from: string; readonly to: string };\n readonly duration?: HKQuantity<HKQuantityTypeIdentifier, TimeUnit>;\n};\n\nexport enum HKCategoryValueCervicalMucusQuality {\n dry = 1,\n sticky = 2,\n creamy = 3,\n watery = 4,\n eggWhite = 5,\n}\n\nexport enum HKCategoryValueMenstrualFlow {\n unspecified = 1,\n none = 5,\n light = 2,\n medium = 3,\n heavy = 4,\n}\n\nexport enum HKCategoryValueOvulationTestResult {\n negative = 1,\n luteinizingHormoneSurge = 2,\n indeterminate = 3,\n estrogenSurge = 4,\n}\n\nexport enum HKCategoryValueSleepAnalysis {\n inBed = 0,\n asleep = 1,\n awake = 2,\n}\n\nexport enum HKCategoryValueAppetiteChanges {\n decreased = 2,\n increased = 3,\n noChange = 1,\n unspecified = 0,\n}\n\nexport enum HKCategoryValuePresence {\n notPresent = 1,\n present = 0,\n}\n\nexport enum HKCategoryValueSeverity {\n notPresent = 1,\n mild = 2,\n moderate = 3,\n severe = 4,\n unspecified = 0,\n}\n\nexport enum HKCategoryValueNotApplicable {\n notApplicable = 0,\n}\n\nexport type HKCategoryValue =\n HKCategoryValueAppetiteChanges | HKCategoryValueCervicalMucusQuality |\n HKCategoryValueLowCardioFitnessEvent | HKCategoryValueMenstrualFlow |\n HKCategoryValueOvulationTestResult | HKCategoryValuePresence |\n HKCategoryValueSeverity | HKCategoryValueSleepAnalysis | number;\n\nexport enum HKInsulinDeliveryReason {\n basal = 1,\n bolus = 2,\n}\n\nexport type MetadataMapperForQuantityIdentifier<\n TQuantityTypeIdentifier = HKQuantityTypeIdentifier\n> = TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.insulinDelivery\n ? HKGenericMetadata & {\n readonly HKInsulinDeliveryReason: HKInsulinDeliveryReason;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.bloodGlucose\n ? HKGenericMetadata & {\n readonly HKBloodGlucoseMealTime?: number;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.heartRate\n ? HKGenericMetadata & {\n readonly HKHeartRateMotionContext?: HKHeartRateMotionContext;\n }\n : HKGenericMetadata;\n\nexport type MetadataMapperForCorrelationIdentifier<\n TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier\n> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food\n ? HKGenericMetadata & {\n readonly HKFoodType?: string;\n }\n : HKGenericMetadata;\n\nexport type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit\n : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit\n : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit\n : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit\n : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent\n : T extends HKQuantityTypeIdentifier.basalBodyTemperature | HKQuantityTypeIdentifier.basalBodyTemperature ? TemperatureUnit\n : T extends HKQuantityTypeIdentifier.stairAscentSpeed | HKQuantityTypeIdentifier.stairDescentSpeed | HKQuantityTypeIdentifier.walkingSpeed | HKQuantityTypeIdentifier.walkingSpeed ? SpeedUnit<LengthUnit, TimeUnit>\n : T extends HKQuantityTypeIdentifier.flightsClimbed | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages | HKQuantityTypeIdentifier.numberOfTimesFallen | HKQuantityTypeIdentifier.pushCount | HKQuantityTypeIdentifier.stepCount | HKQuantityTypeIdentifier.swimmingStrokeCount ? HKUnits.Count\n : T extends HKQuantityTypeIdentifier.dietaryBiotin | HKQuantityTypeIdentifier.dietaryCaffeine | HKQuantityTypeIdentifier.dietaryCalcium | HKQuantityTypeIdentifier.dietaryCarbohydrates | HKQuantityTypeIdentifier.dietaryChloride | HKQuantityTypeIdentifier.dietaryCholesterol | HKQuantityTypeIdentifier.dietaryChromium | HKQuantityTypeIdentifier.dietaryCopper | HKQuantityTypeIdentifier.dietaryFatMonounsaturated | HKQuantityTypeIdentifier.dietaryFatPolyunsaturated | HKQuantityTypeIdentifier.dietaryFatSaturated | HKQuantityTypeIdentifier.dietaryFatTotal | HKQuantityTypeIdentifier.dietaryFiber | HKQuantityTypeIdentifier.dietaryFolate | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIron | HKQuantityTypeIdentifier.dietaryMagnesium | HKQuantityTypeIdentifier.dietaryManganese | HKQuantityTypeIdentifier.dietaryMolybdenum | HKQuantityTypeIdentifier.dietaryNiacin | HKQuantityTypeIdentifier.dietaryPantothenicAcid | HKQuantityTypeIdentifier.dietaryPhosphorus | HKQuantityTypeIdentifier.dietaryPotassium | HKQuantityTypeIdentifier.dietaryProtein | HKQuantityTypeIdentifier.dietaryRiboflavin | HKQuantityTypeIdentifier.dietarySelenium | HKQuantityTypeIdentifier.dietarySodium | HKQuantityTypeIdentifier.dietarySugar | HKQuantityTypeIdentifier.dietaryThiamin | HKQuantityTypeIdentifier.dietaryVitaminA | HKQuantityTypeIdentifier.dietaryVitaminB6 | HKQuantityTypeIdentifier.dietaryVitaminB12 | HKQuantityTypeIdentifier.dietaryVitaminC | HKQuantityTypeIdentifier.dietaryVitaminD | HKQuantityTypeIdentifier.dietaryVitaminE | HKQuantityTypeIdentifier.dietaryVitaminK | HKQuantityTypeIdentifier.dietaryZinc ? MassUnit\n : T extends HKQuantityTypeIdentifier.dietaryWater ? VolumeUnit\n : T extends HKQuantityTypeIdentifier.insulinDelivery ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}`\n : T extends HKQuantityTypeIdentifier.heartRate | HKQuantityTypeIdentifier.restingHeartRate | HKQuantityTypeIdentifier.walkingHeartRateAverage ? CountPerTime<TimeUnit>\n : HKUnit\n\nexport type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> =\n T extends HKCategoryTypeIdentifier.cervicalMucusQuality\n ? HKCategoryValueCervicalMucusQuality\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKCategoryValueMenstrualFlow\n : T extends HKCategoryTypeIdentifier.ovulationTestResult\n ? HKCategoryValueOvulationTestResult\n : T extends HKCategoryTypeIdentifier.sleepAnalysis\n ? HKCategoryValueSleepAnalysis\n : T extends (HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding\n | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity)\n ? HKCategoryValueNotApplicable\n : T extends (HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.acne\n | HKCategoryTypeIdentifier.bladderIncontinence\n | HKCategoryTypeIdentifier.bloating| HKCategoryTypeIdentifier.breastPain\n | HKCategoryTypeIdentifier.chestTightnessOrPain| HKCategoryTypeIdentifier.chills| HKCategoryTypeIdentifier.constipation\n | HKCategoryTypeIdentifier.coughing| HKCategoryTypeIdentifier.diarrhea| HKCategoryTypeIdentifier.dizziness| HKCategoryTypeIdentifier.drySkin| HKCategoryTypeIdentifier.fainting\n | HKCategoryTypeIdentifier.fatigue| HKCategoryTypeIdentifier.fever| HKCategoryTypeIdentifier.generalizedBodyAche| HKCategoryTypeIdentifier.hairLoss\n | HKCategoryTypeIdentifier.headache| HKCategoryTypeIdentifier.heartburn\n | HKCategoryTypeIdentifier.hotFlashes| HKCategoryTypeIdentifier.lossOfSmell| HKCategoryTypeIdentifier.lossOfTaste\n | HKCategoryTypeIdentifier.lowerBackPain| HKCategoryTypeIdentifier.memoryLapse| HKCategoryTypeIdentifier.moodChanges\n | HKCategoryTypeIdentifier.nausea| HKCategoryTypeIdentifier.nightSweats| HKCategoryTypeIdentifier.pelvicPain\n | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat| HKCategoryTypeIdentifier.runnyNose\n | HKCategoryTypeIdentifier.shortnessOfBreath| HKCategoryTypeIdentifier.sinusCongestion| HKCategoryTypeIdentifier.skippedHeartbeat\n | HKCategoryTypeIdentifier.soreThroat| HKCategoryTypeIdentifier.vaginalDryness\n | HKCategoryTypeIdentifier.vomiting| HKCategoryTypeIdentifier.wheezing)\n ? HKCategoryValueSeverity\n : T extends (HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges)\n ? HKCategoryValuePresence\n : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.appleStandHour\n ? HKCategoryValueAppleStandHour\n : number;\n\nenum HKCategoryValuePregnancyTestResult {\n positive = 2,\n negative = 1,\n indeterminate = 3\n}\n/* needs further mapping\n\ncontraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue */\n\nexport type MetadataMapperForCategoryIdentifier<\n T extends HKCategoryTypeIdentifier\n> = T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKGenericMetadata & {\n readonly HKSexualActivityProtectionUsed: boolean;\n }\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKGenericMetadata & {\n readonly HKMenstrualCycleStart: boolean;\n }\n : HKGenericMetadata;\n\n// Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse\nexport enum HKWheelchairUse {\n notSet = 0,\n no = 1,\n yes = 2,\n}\n\n// Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init\nexport enum HKMetricPrefix {\n None = '',\n Pico = 'p',\n Nano = 'n',\n Micro = 'mc',\n Milli = 'm',\n Centi = 'c',\n Deci = 'd',\n Deca = 'da',\n Hecto = 'h',\n Kilo = 'k',\n Mega = 'M',\n Giga = 'G',\n Tera = 'T',\n Femto = 'f',\n}\n\nexport enum HKUnitMetric {\n Gram = 'g',\n Joule = 'J',\n Kelvin = 'K',\n Liter = 'l',\n Meter = 'm',\n Pascal = 'Pa',\n Second = 's',\n Siemen = 'S',\n Hertz = 'Hz',\n Volt = 'V',\n}\n\nexport enum HKUnits {\n\n DecibelHearingLevel = 'dBHL',\n DecibelSoundPressureLevel = 'dBASPL',\n\n Percent = '%',\n Count = 'count',\n InternationalUnit = 'IU',\n\n}\n\nexport type MeterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Meter}`;\nexport type LiterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Liter}`;\nexport type GramUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Gram}`;\nexport type PascalUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Pascal}`;\nexport type SecondUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Second}`;\nexport type JouleUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Joule}`;\nexport type HertzUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Hertz}`;\nexport type VoltUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Volt}`;\nexport type SiemenUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Siemen}`;\n\n// not 100% sure about these\nexport type MoleUnit<MolarMass extends number> =`mol<${MolarMass}>`;\nexport type MoleUnitWith<MolarMass extends number, Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}mol<${MolarMass}>`;\n\nexport type FrequencyUnit = HertzUnit<HKMetricPrefix>\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\nexport enum UnitOfLength {\n Feet = 'ft',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\n Meter = 'm',\n Inches = 'in',\n Yards = 'yd',\n Miles = 'mi',\n}\nexport type LengthUnit = MeterUnit<HKMetricPrefix> | UnitOfLength\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\nexport enum UnitOfVolume {\n ImperialCup = 'cup_imp',\n ImperialFluidOunces = 'fl_oz_imp',\n ImperialPint = 'pt_imp',\n USCup = 'cup_us',\n USFluidOunces = 'fl_oz_us',\n USPint = 'pt_us',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\n Liter = 'l',\n}\nexport type VolumeUnit = LiterUnit<HKMetricPrefix> | UnitOfVolume;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport enum UnitOfMass {\n Ounces = 'oz',\n Stones = 'st',\n Pounds = 'lb',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\n Gram = 'g'\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport type MassUnit = GramUnit<HKMetricPrefix> | UnitOfMass\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport enum UnitOfPressure {\n Atmospheres = 'atm',\n CentimetersOfWater = 'cmAq',\n MillimetersOfMercury = 'mmHg',\n InchesOfMercury = 'inHg',\n DecibelAWeightedSoundPressureLevel = 'dBASPL',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\n Pascals = 'Pa',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport type PressureUnit = PascalUnit<HKMetricPrefix> | UnitOfPressure;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport enum UnitOfTime {\n Days = 'd',\n Minutes = 'min',\n Hours = 'hr',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\n Seconds = 's',\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport type TimeUnit = SecondUnit<HKMetricPrefix> | UnitOfTime\nexport enum TemperatureUnit {\n DegreesCelsius = 'degC',\n DegreesFahrenheit = 'degF',\n Kelvin = 'K',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\nexport enum UnitOfEnergy {\n Kilocalories = 'kcal',\n LargeCalories = 'Cal',\n SmallCalories = 'cal',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\n Joules = 'J',\n}\nexport type EnergyUnit = JouleUnit<HKMetricPrefix> | UnitOfEnergy\nexport enum BloodGlucoseUnit {\n GlucoseMmolPerL = 'mmol<180.15588000005408>/l',\n GlucoseMgPerDl = 'mg/dL',\n}\n\nexport type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> =`${TLength}/${TTime}`;\nexport type CountPerTime<TTime extends TimeUnit> =`count/${TTime}`;\n\nexport type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit\n| `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${FrequencyUnit}` | `${HKUnits}` | `${LengthUnit}` | `${MassUnit}` | `${PressureUnit}` | `${TemperatureUnit}` | `${TimeUnit}` | `${VolumeUnit}`;\n\nexport type HKDevice = {\n readonly name: string; // ex: \"Apple Watch\"\n readonly firmwareVersion: string | null;\n readonly hardwareVersion: string; // ex: \"Watch6,2\",\n readonly localIdentifier: string | null;\n readonly manufacturer: string; // ex: \"Apple Inc.\"\n readonly model: string; // ex: \"Watch\"\n readonly softwareVersion: string; // ex: \"9.0\"\n};\n\nexport type HKSource = {\n readonly name: string;\n readonly bundleIdentifier: string;\n};\n\nexport type HKSourceRevision = {\n readonly source: HKSource;\n readonly version: string;\n readonly operatingSystemVersion?: string;\n readonly productType?: string;\n};\n\nexport type HKQuantitySampleRaw<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TQuantityIdentifier;\n readonly startDate: string;\n readonly endDate: string;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKQuantitySampleRawForSaving<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = Omit<\nHKQuantitySampleRaw<TQuantityIdentifier, TUnit>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKCategorySampleRawForSaving<\n TCategory extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier,\n> = Omit<\nHKCategorySampleRaw<TCategory>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKWorkoutRaw<TEnergy extends EnergyUnit, TDistance extends LengthUnit> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly workoutActivityType: HKWorkoutActivityType;\n readonly duration: number;\n readonly totalDistance?: HKQuantity<HKQuantityTypeIdentifier, TDistance>;\n readonly totalEnergyBurned?: HKQuantity<HKQuantityTypeIdentifier, TEnergy>;\n readonly totalSwimmingStrokeCount?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly totalFlightsClimbed?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly startDate: string;\n readonly endDate: string;\n readonly metadata?: HKWorkoutMetadata;\n readonly sourceRevision?: HKSourceRevision;\n};\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier\nexport enum HKCharacteristicTypeIdentifier {\n fitzpatrickSkinType = 'HKCharacteristicTypeIdentifierFitzpatrickSkinType',\n biologicalSex = 'HKCharacteristicTypeIdentifierBiologicalSex',\n bloodType = 'HKCharacteristicTypeIdentifierBloodType',\n dateOfBirth = 'HKCharacteristicTypeIdentifierDateOfBirth',\n wheelchairUse = 'HKCharacteristicTypeIdentifierWheelchairUse',\n activityMoveMode = 'HKCharacteristicTypeIdentifierActivityMoveMode', // HKActivityMoveModeObject\n}\n\nexport type WritePermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type ReadPermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type HKCategorySampleRaw<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly categoryType: T;\n readonly startDate: string;\n readonly endDate: string;\n readonly value: HKCategoryValueForIdentifier<T>;\n readonly metadata: MetadataMapperForCategoryIdentifier<T>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKCorrelationRaw<TIdentifier extends HKCorrelationTypeIdentifier> =\n {\n readonly correlationType: HKCorrelationTypeIdentifier;\n readonly objects: readonly (HKCategorySampleRaw | HKQuantitySampleRaw)[];\n readonly metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n readonly startDate: string;\n readonly endDate: string;\n };\n\ntype QueryId = string;\n\nexport enum HKUpdateFrequency {\n immediate = 1,\n hourly = 2,\n daily = 3,\n weekly = 4,\n}\n\nexport type WorkoutLocation = {\n readonly longitude: number;\n readonly latitude: number;\n readonly altitude: number;\n readonly speed: number;\n readonly timestamp: number;\n readonly horizontalAccuracy: number;\n readonly speedAccuracy: number;\n readonly verticalAccuracy: number;\n};\n\nexport type WorkoutRoute = {\n readonly locations: readonly WorkoutLocation[];\n readonly HKMetadataKeySyncIdentifier?: string;\n readonly HKMetadataKeySyncVersion?: number;\n};\n\ntype ReactNativeHealthkitTypeNative = {\n isHealthDataAvailable(): Promise<boolean>;\n getBloodType(): Promise<HKBloodType>;\n getDateOfBirth(): Promise<string>;\n getBiologicalSex(): Promise<HKBiologicalSex>;\n getFitzpatrickSkinType(): Promise<HKFitzpatrickSkinType>;\n readonly getWheelchairUse: () => Promise<HKWheelchairUse>;\n\n readonly enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n readonly disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n ) => Promise<boolean>;\n readonly disableAllBackgroundDelivery: () => Promise<boolean>;\n\n readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier, TSamples extends readonly (HKCategorySampleRawForSaving | HKQuantitySampleRawForSaving)[]>(\n typeIdentifier: TIdentifier,\n samples: TSamples,\n start: string,\n end: string,\n metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>\n ) => Promise<boolean>;\n\n readonly saveWorkoutSample: (\n typeIdentifier: HKWorkoutActivityType,\n quantities: readonly HKQuantitySampleRawForSaving[],\n start: string,\n end: string,\n metadata: HKWorkoutMetadata\n ) => Promise<boolean>;\n\n readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n from: string,\n to: string\n ) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;\n\n subscribeToObserverQuery(\n identifier: HKSampleTypeIdentifier\n ): Promise<QueryId>;\n unsubscribeQuery(queryId: QueryId): Promise<boolean>;\n authorizationStatusFor(\n type: HealthkitReadAuthorization\n ): Promise<boolean>;\n getRequestStatusForAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<HKAuthorizationRequestStatus>;\n requestAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<boolean>;\n readonly saveQuantitySample: <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>> (\n identifier: TType,\n unit: TUnit,\n value: number,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly deleteQuantitySample: <TIdentifier extends HKQuantityTypeIdentifier>(\n typeIdentifier: TIdentifier,\n uuid: string\n ) => Promise<boolean>;\n readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(\n energyUnit: TEnergy,\n distanceUnit: TDistance,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;\n readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKCategorySampleRaw<T>[]>;\n readonly queryQuantitySamples: <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>,\n >(\n identifier: TIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;\n readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryStatisticsForQuantity: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(\n identifier: HKQuantityTypeIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n options: readonly HKStatisticsOptions[]\n ) => Promise<QueryStatisticsResponseRaw<TIdentifier, TUnit>>;\n readonly getPreferredUnits: (\n identifiers: readonly HKQuantityTypeIdentifier[]\n ) => Promise<TypeToUnitMapping>;\n readonly getWorkoutRoutes: (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;\n};\n\nconst Native = NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNative\n\ntype OnChangeCallback = ({\n typeIdentifier,\n}: {\n readonly typeIdentifier: HKSampleTypeIdentifier;\n}) => void;\n\ninterface HealthkitEventEmitter extends NativeEventEmitter {\n readonly addListener: (\n eventType: 'onChange',\n callback: OnChangeCallback\n ) => EmitterSubscription;\n}\n\nexport const EventEmitter = new NativeEventEmitter(\n NativeModules.ReactNativeHealthkit,\n) as HealthkitEventEmitter\n\nexport default Native\n"],"mappings":";;;;;;;AAAA;;AAOO,MAAMA,uBAAuB,GAAG,yBAAhC;;AACA,MAAMC,yBAAyB,GAAG,2BAAlC;;AACA,MAAMC,4BAA4B,GAAG,8BAArC;;AACA,MAAMC,mCAAmC,GAAG,qCAA5C,C,CAEP;;;IACYC,wB;;;WAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA,wB;EAAAA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|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _nativeTypes = _interopRequireDefault(require("../native-types"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const deleteQuantitySample = async (identifier, uuid) => _nativeTypes.default.deleteQuantitySample(identifier, uuid);
|
|
13
|
+
|
|
14
|
+
var _default = deleteQuantitySample;
|
|
15
|
+
exports.default = _default;
|
|
16
|
+
//# sourceMappingURL=deleteQuantitySample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["deleteQuantitySample","identifier","uuid","Native"],"sources":["deleteQuantitySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier } from '../native-types'\n\nexport type DeleteQuantitySampleFn = <\n TIdentifier extends HKQuantityTypeIdentifier\n>(\n identifier: TIdentifier,\n uuid: string\n) => Promise<boolean>\n\nconst deleteQuantitySample: DeleteQuantitySampleFn = async (identifier, uuid) => Native.deleteQuantitySample(identifier, uuid)\n\nexport default deleteQuantitySample\n"],"mappings":";;;;;;;AAAA;;;;AAWA,MAAMA,oBAA4C,GAAG,OAAOC,UAAP,EAAmBC,IAAnB,KAA4BC,oBAAA,CAAOH,oBAAP,CAA4BC,UAA5B,EAAwCC,IAAxC,CAAjF;;eAEeF,oB"}
|
package/lib/module/index.ios.js
CHANGED
|
@@ -5,6 +5,7 @@ import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
|
|
|
5
5
|
import useMostRecentWorkout from './hooks/useMostRecentWorkout';
|
|
6
6
|
import useSubscribeToChanges from './hooks/useSubscribeToChanges';
|
|
7
7
|
import Native from './native-types';
|
|
8
|
+
import deleteQuantitySample from './utils/deleteQuantitySample';
|
|
8
9
|
import getDateOfBirth from './utils/getDateOfBirth';
|
|
9
10
|
import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
|
|
10
11
|
import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
|
|
@@ -49,6 +50,8 @@ const Healthkit = {
|
|
|
49
50
|
queryStatisticsForQuantity,
|
|
50
51
|
queryWorkouts,
|
|
51
52
|
requestAuthorization,
|
|
53
|
+
// delete methods
|
|
54
|
+
deleteQuantitySample,
|
|
52
55
|
// save methods
|
|
53
56
|
saveCategorySample,
|
|
54
57
|
saveCorrelationSample,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useHealthkitAuthorization","useIsHealthDataAvailable","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","Native","getDateOfBirth","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","Healthkit","authorizationStatusFor","bind","isHealthDataAvailable","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes"],"sources":["index.ios.tsx"],"sourcesContent":["import useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native from './native-types'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst Healthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n\n disableAllBackgroundDelivery: Native.disableAllBackgroundDelivery.bind(Native),\n disableBackgroundDelivery: Native.disableBackgroundDelivery.bind(Native),\n enableBackgroundDelivery: Native.enableBackgroundDelivery.bind(Native),\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse.bind(Native),\n getBloodType: Native.getBloodType.bind(Native),\n\n getWorkoutRoutes: Native.getWorkoutRoutes.bind(Native),\n\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCorrelationSamples,\n queryQuantitySamples,\n queryStatisticsForQuantity,\n queryWorkouts,\n\n requestAuthorization,\n\n // save methods\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n\n // subscriptions\n subscribeToChanges,\n\n // hooks\n useMostRecentCategorySample,\n\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n\n useSubscribeToChanges,\n\n useIsHealthDataAvailable,\n useHealthkitAuthorization,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":"AAAA,OAAOA,yBAAP,MAAsC,mCAAtC;AACA,OAAOC,wBAAP,MAAqC,kCAArC;AACA,OAAOC,2BAAP,MAAwC,qCAAxC;AACA,OAAOC,2BAAP,MAAwC,qCAAxC;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,qBAAP,MAAkC,+BAAlC;AACA,OAAOC,MAAP,MAAmB,gBAAnB;AACA,OAAOC,cAAP,MAA2B,wBAA3B;AACA,OAAOC,2BAAP,MAAwC,qCAAxC;AACA,OAAOC,2BAAP,MAAwC,qCAAxC;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,gBAAP,MAA6B,0BAA7B;AACA,OAAOC,iBAAP,MAA8B,2BAA9B;AACA,OAAOC,gCAAP,MAA6C,0CAA7C;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,uBAAP,MAAoC,iCAApC;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,0BAAP,MAAuC,oCAAvC;AACA,OAAOC,aAAP,MAA0B,uBAA1B;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,kBAAP,MAA+B,4BAA/B;AACA,OAAOC,qBAAP,MAAkC,+BAAlC;AACA,OAAOC,kBAAP,MAA+B,4BAA/B;AACA,OAAOC,iBAAP,MAA8B,2BAA9B;AACA,OAAOC,kBAAP,MAA+B,4BAA/B;AAEA,MAAMC,SAAS,GAAG;EAChBC,sBAAsB,
|
|
1
|
+
{"version":3,"names":["useHealthkitAuthorization","useIsHealthDataAvailable","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","Native","deleteQuantitySample","getDateOfBirth","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","Healthkit","authorizationStatusFor","bind","isHealthDataAvailable","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes"],"sources":["index.ios.tsx"],"sourcesContent":["import useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst Healthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n\n disableAllBackgroundDelivery: Native.disableAllBackgroundDelivery.bind(Native),\n disableBackgroundDelivery: Native.disableBackgroundDelivery.bind(Native),\n enableBackgroundDelivery: Native.enableBackgroundDelivery.bind(Native),\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse.bind(Native),\n getBloodType: Native.getBloodType.bind(Native),\n\n getWorkoutRoutes: Native.getWorkoutRoutes.bind(Native),\n\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCorrelationSamples,\n queryQuantitySamples,\n queryStatisticsForQuantity,\n queryWorkouts,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n\n // save methods\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n\n // subscriptions\n subscribeToChanges,\n\n // hooks\n useMostRecentCategorySample,\n\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n\n useSubscribeToChanges,\n\n useIsHealthDataAvailable,\n useHealthkitAuthorization,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":"AAAA,OAAOA,yBAAP,MAAsC,mCAAtC;AACA,OAAOC,wBAAP,MAAqC,kCAArC;AACA,OAAOC,2BAAP,MAAwC,qCAAxC;AACA,OAAOC,2BAAP,MAAwC,qCAAxC;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,qBAAP,MAAkC,+BAAlC;AACA,OAAOC,MAAP,MAAmB,gBAAnB;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,cAAP,MAA2B,wBAA3B;AACA,OAAOC,2BAAP,MAAwC,qCAAxC;AACA,OAAOC,2BAAP,MAAwC,qCAAxC;AACA,OA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Y,EAAE9B,MAAM,CAAC8B,YAAP,CAAoBR,IAApB,CAAyBtB,MAAzB,CAbE;EAehB+B,gBAAgB,EAAE/B,MAAM,CAAC+B,gBAAP,CAAwBT,IAAxB,CAA6BtB,MAA7B,CAfF;EAiBhBE,cAjBgB;EAmBhBE,2BAnBgB;EAoBhBD,2BApBgB;EAqBhBE,oBArBgB;EAuBhBC,gBAvBgB;EAwBhBC,iBAxBgB;EAyBhBC,gCAzBgB;EA2BhB;EACAC,oBA5BgB;EA6BhBC,uBA7BgB;EA8BhBC,oBA9BgB;EA+BhBC,0BA/BgB;EAgChBC,aAhCgB;EAkChBC,oBAlCgB;EAoChB;EACAb,oBArCgB;EAuChB;EACAc,kBAxCgB;EAyChBC,qBAzCgB;EA0ChBC,kBA1CgB;EA2ChBC,iBA3CgB;EA6ChB;EACAC,kBA9CgB;EAgDhB;EACAvB,2BAjDgB;EAmDhBC,2BAnDgB;EAoDhBC,oBApDgB;EAsDhBC,qBAtDgB;EAwDhBJ,wBAxDgB;EAyDhBD;AAzDgB,CAAlB;AA4DA,cAAc,SAAd;AAEA,eAAe0B,SAAf"}
|
package/lib/module/index.js
CHANGED
|
@@ -46,6 +46,7 @@ const Healthkit = {
|
|
|
46
46
|
})),
|
|
47
47
|
queryWorkouts: UnavailableFn(Promise.resolve([])),
|
|
48
48
|
requestAuthorization: UnavailableFn(Promise.resolve(false)),
|
|
49
|
+
deleteQuantitySample: UnavailableFn(Promise.resolve(false)),
|
|
49
50
|
saveCategorySample: UnavailableFn(Promise.resolve(false)),
|
|
50
51
|
saveCorrelationSample: UnavailableFn(Promise.resolve(false)),
|
|
51
52
|
saveQuantitySample: UnavailableFn(Promise.resolve(false)),
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","HKAuthorizationRequestStatus","HKBiologicalSex","HKBloodType","HKFitzpatrickSkinType","HKUnits","HKWheelchairUse","notAvailableError","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","notSet","getBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","Count","getPreferredUnits","getRequestStatusForAuthorization","unknown","getWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve([])),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryQuantitySamples: UnavailableFn(Promise.resolve([])),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":"AAAA,S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AhB,CAAD,CArBI;EA8B7CO,aAAa,EAAExC,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,EAAhB,CAAD,CA9BiB;EA+B7CkC,oBAAoB,EAAEzC,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CA/BU;EAgC7CmC,
|
|
1
|
+
{"version":3,"names":["Platform","HKAuthorizationRequestStatus","HKBiologicalSex","HKBloodType","HKFitzpatrickSkinType","HKUnits","HKWheelchairUse","notAvailableError","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","notSet","getBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","Count","getPreferredUnits","getRequestStatusForAuthorization","unknown","getWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","queryCorrelationSamples","queryQuantitySamples","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","requestAuthorization","deleteQuantitySample","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve([])),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryQuantitySamples: UnavailableFn(Promise.resolve([])),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n deleteQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAEA,SACEC,4BADF,EACgCC,eADhC,EACiDC,WADjD,EAC8DC,qBAD9D,EACqFC,OADrF,EAC8FC,eAD9F,QAEO,gBAFP;AAMA,MAAMC,iBAAiB,GAAI,kDACzBP,QAAQ,CAACQ,EACV,iBAFD;AAIA,IAAIC,SAAS,GAAG,KAAhB;;AAEA,SAASC,aAAT,CAAoCC,MAApC,EAA+C;EAC7C,OAAO,MAAM;IACX,IAAI,CAACF,SAAL,EAAgB;MACdG,OAAO,CAACC,IAAR,CAAaN,iBAAb;MACAE,SAAS,GAAG,IAAZ;IACD;;IACD,OAAOE,MAAP;EACD,CAND;AAOD;;AAED,MAAMG,SAAsC,GAAG;EAC7CC,sBAAsB,EAAEL,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CADQ;EAE7CC,4BAA4B,EAAER,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CAFE;EAG7CE,yBAAyB,EAAET,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CAHK;EAI7CG,wBAAwB,EAAEV,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CAJM;EAK7CI,gBAAgB,EAAEX,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgBf,eAAe,CAACoB,MAAhC,C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D,oBAAoB,EAAElD,aAAa,CAAC,IAAD,CAxCU;EAyC7CmD,qBAAqB,EAAEnD,aAAa,CAAC,CAAC,IAAD,EAAO,MAAM,IAAb,CAAD,CAzCS;EA0C7CoD,yBAAyB,EAAEpD,aAAa,CAAC,CAAC,IAAD,EAAO,YAAYM,OAAO,CAACC,OAAR,CAAgBhB,4BAA4B,CAACiC,OAA7C,CAAnB,CAAD,CA1CK;EA2C7C6B,wBAAwB,EAAE,MAAM;AA3Ca,CAA/C;AA8CA,cAAc,SAAd;AAEA,eAAejD,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","HKWorkoutTypeIdentifier","HKAudiogramTypeIdentifier","HKWorkoutRouteTypeIdentifier","HKDataTypeIdentifierHeartbeatSeries","HKQuantityTypeIdentifier","HKCategoryValueLowCardioFitnessEvent","HKHeartRateMotionContext","HKCorrelationTypeIdentifier","HKCategoryTypeIdentifier","HKCategoryValueAppleStandHour","HKWorkoutActivityType","HKWeatherCondition","HKIndoorWorkout","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBloodType","HKBiologicalSex","HKFitzpatrickSkinType","HKStatisticsOptions","HKCategoryValueCervicalMucusQuality","HKCategoryValueMenstrualFlow","HKCategoryValueOvulationTestResult","HKCategoryValueSleepAnalysis","HKCategoryValueAppetiteChanges","HKCategoryValuePresence","HKCategoryValueSeverity","HKCategoryValueNotApplicable","HKInsulinDeliveryReason","HKCategoryValuePregnancyTestResult","HKWheelchairUse","HKMetricPrefix","HKUnitMetric","HKUnits","UnitOfLength","UnitOfVolume","UnitOfMass","UnitOfPressure","UnitOfTime","TemperatureUnit","UnitOfEnergy","BloodGlucoseUnit","HKCharacteristicTypeIdentifier","HKUpdateFrequency","Native","ReactNativeHealthkit","EventEmitter"],"sources":["native-types.ts"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n} from 'react-native'\n\nimport type { EmitterSubscription } from 'react-native'\n\nexport const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier' as const\nexport const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier' as const\nexport const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier' as const\nexport const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries' as const\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier\nexport enum HKQuantityTypeIdentifier {\n bodyMassIndex = 'HKQuantityTypeIdentifierBodyMassIndex',\n bodyFatPercentage = 'HKQuantityTypeIdentifierBodyFatPercentage', // Scalar(Percent, 0.0 - 1.0), Discrete\n height = 'HKQuantityTypeIdentifierHeight', // Length, Discrete\n bodyMass = 'HKQuantityTypeIdentifierBodyMass', // Mass, Discrete\n leanBodyMass = 'HKQuantityTypeIdentifierLeanBodyMass', // Mass, Discrete\n\n waistCircumference = 'HKQuantityTypeIdentifierWaistCircumference', // Length, Discrete\n // Fitness\n stepCount = 'HKQuantityTypeIdentifierStepCount', // Scalar(Count), Cumulative\n distanceWalkingRunning = 'HKQuantityTypeIdentifierDistanceWalkingRunning', // Length, Cumulative\n distanceCycling = 'HKQuantityTypeIdentifierDistanceCycling', // Length, Cumulative\n distanceWheelchair = 'HKQuantityTypeIdentifierDistanceWheelchair', // Length, Cumulative\n basalEnergyBurned = 'HKQuantityTypeIdentifierBasalEnergyBurned', // Energy, Cumulative\n activeEnergyBurned = 'HKQuantityTypeIdentifierActiveEnergyBurned', // Energy, Cumulative\n flightsClimbed = 'HKQuantityTypeIdentifierFlightsClimbed', // Scalar(Count), Cumulative\n nikeFuel = 'HKQuantityTypeIdentifierNikeFuel', // Scalar(Count), Cumulative\n appleExerciseTime = 'HKQuantityTypeIdentifierAppleExerciseTime', // Time Cumulative\n pushCount = 'HKQuantityTypeIdentifierPushCount', // Scalar(Count), Cumulative\n distanceSwimming = 'HKQuantityTypeIdentifierDistanceSwimming', // Length, Cumulative\n swimmingStrokeCount = 'HKQuantityTypeIdentifierSwimmingStrokeCount', // Scalar(Count), Cumulative\n vo2Max = 'HKQuantityTypeIdentifierVo2Max', // ml/(kg*min) Discrete\n distanceDownhillSnowSports = 'HKQuantityTypeIdentifierDistanceDownhillSnowSports', // Length, Cumulative\n\n appleStandTime = 'HKQuantityTypeIdentifierAppleStandTime', // Time, Cumulative\n // Vitals\n heartRate = 'HKQuantityTypeIdentifierHeartRate', // Scalar(Count)/Time, Discrete\n bodyTemperature = 'HKQuantityTypeIdentifierBodyTemperature', // Temperature, Discrete\n basalBodyTemperature = 'HKQuantityTypeIdentifierBasalBodyTemperature', // Basal Body Temperature, Discrete\n bloodPressureSystolic = 'HKQuantityTypeIdentifierBloodPressureSystolic', // Pressure, Discrete\n bloodPressureDiastolic = 'HKQuantityTypeIdentifierBloodPressureDiastolic', // Pressure, Discrete\n respiratoryRate = 'HKQuantityTypeIdentifierRespiratoryRate', // Scalar(Count)/Time, Discrete\n // Beats per minute estimate of a user's lowest heart rate while at rest\n restingHeartRate = 'HKQuantityTypeIdentifierRestingHeartRate', // Scalar(Count)/Time, Discrete\n // Average heartbeats per minute captured by an Apple Watch while a user is walking\n walkingHeartRateAverage = 'HKQuantityTypeIdentifierWalkingHeartRateAverage', // Scalar(Count)/Time, Discrete\n // The standard deviation of heart beat-to-beat intevals (Standard Deviation of Normal to Normal)\n\n heartRateVariabilitySDNN = 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN', // Time (ms), Discrete\n // Results\n oxygenSaturation = 'HKQuantityTypeIdentifierOxygenSaturation', // Scalar (Percent, 0.0 - 1.0, Discrete\n peripheralPerfusionIndex = 'HKQuantityTypeIdentifierPeripheralPerfusionIndex', // Scalar(Percent, 0.0 - 1.0), Discrete\n bloodGlucose = 'HKQuantityTypeIdentifierBloodGlucose', // Mass/Volume, Discrete\n numberOfTimesFallen = 'HKQuantityTypeIdentifierNumberOfTimesFallen', // Scalar(Count), Cumulative\n electrodermalActivity = 'HKQuantityTypeIdentifierElectrodermalActivity', // Conductance, Discrete\n inhalerUsage = 'HKQuantityTypeIdentifierInhalerUsage', // Scalar(Count), Cumulative\n insulinDelivery = 'HKQuantityTypeIdentifierInsulinDelivery', // Pharmacology (IU) Cumulative\n bloodAlcoholContent = 'HKQuantityTypeIdentifierBloodAlcoholContent', // Scalar(Percent, 0.0 - 1.0), Discrete\n forcedVitalCapacity = 'HKQuantityTypeIdentifierForcedVitalCapacity', // Volume, Discrete\n forcedExpiratoryVolume1 = 'HKQuantityTypeIdentifierForcedExpiratoryVolume1', // Volume, Discrete\n peakExpiratoryFlowRate = 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate', // Volume/Time, Discrete\n environmentalAudioExposure = 'HKQuantityTypeIdentifierEnvironmentalAudioExposure', // Pressure, Cumulative\n\n headphoneAudioExposure = 'HKQuantityTypeIdentifierHeadphoneAudioExposure', // Pressure, Cumulative\n // Nutrition\n dietaryFatTotal = 'HKQuantityTypeIdentifierDietaryFatTotal', // Mass, Cumulative\n dietaryFatPolyunsaturated = 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated', // Mass, Cumulative\n dietaryFatMonounsaturated = 'HKQuantityTypeIdentifierDietaryFatMonounsaturated', // Mass, Cumulative\n dietaryFatSaturated = 'HKQuantityTypeIdentifierDietaryFatSaturated', // Mass, Cumulative\n dietaryCholesterol = 'HKQuantityTypeIdentifierDietaryCholesterol', // Mass, Cumulative\n dietarySodium = 'HKQuantityTypeIdentifierDietarySodium', // Mass, Cumulative\n dietaryCarbohydrates = 'HKQuantityTypeIdentifierDietaryCarbohydrates', // Mass, Cumulative\n dietaryFiber = 'HKQuantityTypeIdentifierDietaryFiber', // Mass, Cumulative\n dietarySugar = 'HKQuantityTypeIdentifierDietarySugar', // Mass, Cumulative\n dietaryEnergyConsumed = 'HKQuantityTypeIdentifierDietaryEnergyConsumed', // Energy, Cumulative\n dietaryProtein = 'HKQuantityTypeIdentifierDietaryProtein', // Mass, Cumulative\n\n dietaryVitaminA = 'HKQuantityTypeIdentifierDietaryVitaminA', // Mass, Cumulative\n dietaryVitaminB6 = 'HKQuantityTypeIdentifierDietaryVitaminB6', // Mass, Cumulative\n dietaryVitaminB12 = 'HKQuantityTypeIdentifierDietaryVitaminB12', // Mass, Cumulative\n dietaryVitaminC = 'HKQuantityTypeIdentifierDietaryVitaminC', // Mass, Cumulative\n dietaryVitaminD = 'HKQuantityTypeIdentifierDietaryVitaminD', // Mass, Cumulative\n dietaryVitaminE = 'HKQuantityTypeIdentifierDietaryVitaminE', // Mass, Cumulative\n dietaryVitaminK = 'HKQuantityTypeIdentifierDietaryVitaminK', // Mass, Cumulative\n dietaryCalcium = 'HKQuantityTypeIdentifierDietaryCalcium', // Mass, Cumulative\n dietaryIron = 'HKQuantityTypeIdentifierDietaryIron', // Mass, Cumulative\n dietaryThiamin = 'HKQuantityTypeIdentifierDietaryThiamin', // Mass, Cumulative\n dietaryRiboflavin = 'HKQuantityTypeIdentifierDietaryRiboflavin', // Mass, Cumulative\n dietaryNiacin = 'HKQuantityTypeIdentifierDietaryNiacin', // Mass, Cumulative\n dietaryFolate = 'HKQuantityTypeIdentifierDietaryFolate', // Mass, Cumulative\n dietaryBiotin = 'HKQuantityTypeIdentifierDietaryBiotin', // Mass, Cumulative\n dietaryPantothenicAcid = 'HKQuantityTypeIdentifierDietaryPantothenicAcid', // Mass, Cumulative\n dietaryPhosphorus = 'HKQuantityTypeIdentifierDietaryPhosphorus', // Mass, Cumulative\n dietaryIodine = 'HKQuantityTypeIdentifierDietaryIodine', // Mass, Cumulative\n dietaryMagnesium = 'HKQuantityTypeIdentifierDietaryMagnesium', // Mass, Cumulative\n dietaryZinc = 'HKQuantityTypeIdentifierDietaryZinc', // Mass, Cumulative\n dietarySelenium = 'HKQuantityTypeIdentifierDietarySelenium', // Mass, Cumulative\n dietaryCopper = 'HKQuantityTypeIdentifierDietaryCopper', // Mass, Cumulative\n dietaryManganese = 'HKQuantityTypeIdentifierDietaryManganese', // Mass, Cumulative\n dietaryChromium = 'HKQuantityTypeIdentifierDietaryChromium', // Mass, Cumulative\n dietaryMolybdenum = 'HKQuantityTypeIdentifierDietaryMolybdenum', // Mass, Cumulative\n dietaryChloride = 'HKQuantityTypeIdentifierDietaryChloride', // Mass, Cumulative\n dietaryPotassium = 'HKQuantityTypeIdentifierDietaryPotassium', // Mass, Cumulative\n dietaryCaffeine = 'HKQuantityTypeIdentifierDietaryCaffeine', // Mass, Cumulative\n dietaryWater = 'HKQuantityTypeIdentifierDietaryWater', // Volume, Cumulative\n\n // Mobility\n sixMinuteWalkTestDistance = 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance',\n walkingSpeed = 'HKQuantityTypeIdentifierWalkingSpeed',\n walkingStepLength = 'HKQuantityTypeIdentifierWalkingStepLength',\n walkingAsymmetryPercentage = 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage',\n walkingDoubleSupportPercentage = 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage',\n stairAscentSpeed = 'HKQuantityTypeIdentifierStairAscentSpeed',\n stairDescentSpeed = 'HKQuantityTypeIdentifierStairDescentSpeed',\n\n uvExposure = 'HKQuantityTypeIdentifierUvExposure', // Scalar (Count), Discrete\n\n appleMoveTime = 'HKQuantityTypeIdentifierAppleMoveTime', // Time, Cumulative\n appleWalkingSteadiness = 'HKQuantityTypeIdentifierAppleWalkingSteadiness', // Scalar(Percent, 0.0 - 1.0), Discrete\n\n numberOfAlcoholicBeverages = 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages', // Scalar(Count), Cumulative\n}\n\nexport type TypeToUnitMapping = { readonly\n [key in HKQuantityTypeIdentifier]: HKUnit;\n};\n\nexport enum HKCategoryValueLowCardioFitnessEvent {\n lowFitness = 1,\n}\n\nexport enum HKHeartRateMotionContext {\n active = 2,\n notSet = 0,\n sedentary = 1,\n}\n\nexport enum HKCorrelationTypeIdentifier {\n bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',\n food = 'HKCorrelationTypeIdentifierFood',\n}\n\nexport enum HKCategoryTypeIdentifier {\n sleepAnalysis = 'HKCategoryTypeIdentifierSleepAnalysis',\n appleStandHour = 'HKCategoryTypeIdentifierAppleStandHour',\n cervicalMucusQuality = 'HKCategoryTypeIdentifierCervicalMucusQuality',\n ovulationTestResult = 'HKCategoryTypeIdentifierOvulationTestResult',\n menstrualFlow = 'HKCategoryTypeIdentifierMenstrualFlow',\n intermenstrualBleeding = 'HKCategoryTypeIdentifierIntermenstrualBleeding',\n sexualActivity = 'HKCategoryTypeIdentifierSexualActivity',\n mindfulSession = 'HKCategoryTypeIdentifierMindfulSession',\n highHeartRateEvent = 'HKCategoryTypeIdentifierHighHeartRateEvent',\n lowHeartRateEvent = 'HKCategoryTypeIdentifierLowHeartRateEvent',\n irregularHeartRhythmEvent = 'HKCategoryTypeIdentifierIrregularHeartRhythmEvent',\n audioExposureEvent = 'HKCategoryTypeIdentifierAudioExposureEvent',\n toothbrushingEvent = 'HKCategoryTypeIdentifierToothbrushingEvent',\n lowCardioFitnessEvent = 'HKCategoryTypeIdentifierLowCardioFitnessEvent',\n contraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n pregnancyTestResult = 'HKCategoryTypeIdentifierPregnancyTestResult',\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue\n\n // Symptoms\n abdominalCramps = 'HKCategoryTypeIdentifierAbdominalCramps', // HKCategoryValueSeverity\n acne = 'HKCategoryTypeIdentifierAcne', // HKCategoryValueSeverity\n appetiteChanges = 'HKCategoryTypeIdentifierAppetiteChanges', // HKCategoryValueAppetiteChanges\n bladderIncontinence = 'HKCategoryTypeIdentifierBladderIncontinence', // HKCategoryValueSeverity\n bloating = 'HKCategoryTypeIdentifierBloating', // HKCategoryValueSeverity\n breastPain = 'HKCategoryTypeIdentifierBreastPain', // HKCategoryValueSeverity\n chestTightnessOrPain = 'HKCategoryTypeIdentifierChestTightnessOrPain', // HKCategoryValueSeverity\n chills = 'HKCategoryTypeIdentifierChills', // HKCategoryValueSeverity\n constipation = 'HKCategoryTypeIdentifierConstipation', // HKCategoryValueSeverity\n coughing = 'HKCategoryTypeIdentifierCoughing', // HKCategoryValueSeverity\n diarrhea = 'HKCategoryTypeIdentifierDiarrhea', // HKCategoryValueSeverity\n dizziness = 'HKCategoryTypeIdentifierDizziness', // HKCategoryValueSeverity\n drySkin = 'HKCategoryTypeIdentifierDrySkin', // HKCategoryValueSeverity\n fainting = 'HKCategoryTypeIdentifierFainting', // HKCategoryValueSeverity\n fatigue = 'HKCategoryTypeIdentifierFatigue', // HKCategoryValueSeverity\n fever = 'HKCategoryTypeIdentifierFever', // HKCategoryValueSeverity\n generalizedBodyAche = 'HKCategoryTypeIdentifierGeneralizedBodyAche', // HKCategoryValueSeverity\n hairLoss = 'HKCategoryTypeIdentifierHairLoss', // HKCategoryValueSeverity\n headache = 'HKCategoryTypeIdentifierHeadache', // HKCategoryValueSeverity\n heartburn = 'HKCategoryTypeIdentifierHeartburn', // HKCategoryValueSeverity\n hotFlashes = 'HKCategoryTypeIdentifierHotFlashes', // HKCategoryValueSeverity\n lossOfSmell = 'HKCategoryTypeIdentifierLossOfSmell', // HKCategoryValueSeverity\n lossOfTaste = 'HKCategoryTypeIdentifierLossOfTaste', // HKCategoryValueSeverity\n lowerBackPain = 'HKCategoryTypeIdentifierLowerBackPain', // HKCategoryValueSeverity\n memoryLapse = 'HKCategoryTypeIdentifierMemoryLapse', // HKCategoryValueSeverity\n moodChanges = 'HKCategoryTypeIdentifierMoodChanges', // HKCategoryValuePresence\n nausea = 'HKCategoryTypeIdentifierNausea', // HKCategoryValueSeverity\n nightSweats = 'HKCategoryTypeIdentifierNightSweats', // HKCategoryValueSeverity\n pelvicPain = 'HKCategoryTypeIdentifierPelvicPain', // HKCategoryValueSeverity\n rapidPoundingOrFlutteringHeartbeat = 'HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat', // HKCategoryValueSeverity\n runnyNose = 'HKCategoryTypeIdentifierRunnyNose', // HKCategoryValueSeverity\n shortnessOfBreath = 'HKCategoryTypeIdentifierShortnessOfBreath', // HKCategoryValueSeverity\n sinusCongestion = 'HKCategoryTypeIdentifierSinusCongestion', // HKCategoryValueSeverity\n skippedHeartbeat = 'HKCategoryTypeIdentifierSkippedHeartbeat', // HKCategoryValueSeverity\n sleepChanges = 'HKCategoryTypeIdentifierSleepChanges', // HKCategoryValuePresence\n soreThroat = 'HKCategoryTypeIdentifierSoreThroat', // HKCategoryValueSeverity\n vaginalDryness = 'HKCategoryTypeIdentifierVaginalDryness', // HKCategoryValueSeverity\n vomiting = 'HKCategoryTypeIdentifierVomiting', // HKCategoryValueSeverity\n wheezing = 'HKCategoryTypeIdentifierWheezing', // HKCategoryValueSeverity\n\n}\n\nexport type HKSampleTypeIdentifier =\nHKCategoryTypeIdentifier\n| HKCorrelationTypeIdentifier\n| HKQuantityTypeIdentifier\n| typeof HKAudiogramTypeIdentifier\n| typeof HKDataTypeIdentifierHeartbeatSeries\n| typeof HKWorkoutRouteTypeIdentifier\n| typeof HKWorkoutTypeIdentifier\n| `${HKCategoryTypeIdentifier}`\n| `${HKCorrelationTypeIdentifier}`\n| `${HKQuantityTypeIdentifier}`\n\nexport type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`\nexport type HealthkitWriteAuthorization = HKSampleTypeIdentifier\n\nexport enum HKCategoryValueAppleStandHour {\n stood = 0,\n idle = 1,\n}\n\nexport enum HKWorkoutActivityType {\n americanFootball = 1,\n archery = 2,\n australianFootball = 3,\n badminton = 4,\n baseball = 5,\n basketball = 6,\n bowling = 7,\n boxing = 8, // See also HKWorkoutActivityTypeKickboxing.,\n climbing = 9,\n cricket = 10,\n crossTraining = 11, // Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,\n curling = 12,\n cycling = 13,\n dance = 14,\n danceInspiredTraining = 15, // This enum remains available to access older data.,\n elliptical = 16,\n equestrianSports = 17, // Polo, Horse Racing, Horse Riding, etc.,\n fencing = 18,\n fishing = 19,\n functionalStrengthTraining = 20, // Primarily free weights and/or body weight and/or accessories,\n golf = 21,\n gymnastics = 22,\n handball = 23,\n hiking = 24,\n hockey = 25, // Ice Hockey, Field Hockey, etc.,\n hunting = 26,\n lacrosse = 27,\n martialArts = 28,\n mindAndBody = 29, // Qigong, meditation, etc.,\n mixedMetabolicCardioTraining = 30, // This enum remains available to access older data.,\n paddleSports = 31, // Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,\n play = 32, // Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,\n preparationAndRecovery = 33, // Foam rolling, stretching, etc.,\n racquetball = 34,\n rowing = 35,\n rugby = 36,\n running = 37,\n sailing = 38,\n skatingSports = 39, // Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,\n snowSports = 40, // Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,\n soccer = 41,\n softball = 42,\n squash = 43,\n stairClimbing = 44, // See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,\n surfingSports = 45, // Traditional Surfing, Kite Surfing, Wind Surfing, etc.,\n swimming = 46,\n tableTennis = 47,\n tennis = 48,\n trackAndField = 49, // Shot Put, Javelin, Pole Vaulting, etc.,\n traditionalStrengthTraining = 50, // Primarily machines and/or free weights,\n volleyball = 51,\n walking = 52,\n waterFitness = 53,\n waterPolo = 54,\n waterSports = 55, // Water Skiing, Wake Boarding, etc.,\n wrestling = 56,\n yoga = 57,\n barre = 58, // HKWorkoutActivityTypeDanceInspiredTraining,\n coreTraining = 59,\n crossCountrySkiing = 60,\n downhillSkiing = 61,\n flexibility = 62,\n highIntensityIntervalTraining = 63,\n jumpRope = 64,\n kickboxing = 65,\n pilates = 66, // HKWorkoutActivityTypeDanceInspiredTraining,\n snowboarding = 67,\n stairs = 68,\n stepTraining = 69,\n wheelchairWalkPace = 70,\n wheelchairRunPace = 71,\n taiChi = 72,\n mixedCardio = 73, // HKWorkoutActivityTypeMixedMetabolicCardioTraining,\n handCycling = 74,\n discSports = 75,\n fitnessGaming = 76,\n other = 3000,\n}\n\nexport type HKGenericMetadata = {\n readonly [key: string]: HKQuantity | boolean | number | string | undefined;\n readonly HKExternalUUID?: string;\n readonly HKTimeZone?: string;\n readonly HKWasUserEntered?: boolean;\n readonly HKDeviceSerialNumber?: string;\n readonly HKUDIDeviceIdentifier?: string;\n readonly HKUDIProductionIdentifier?: string;\n readonly HKDigitalSignature?: string;\n readonly HKDeviceName?: string;\n readonly HKDeviceManufacturerName?: string;\n readonly HKSyncIdentifier?: string;\n readonly HKSyncVersion?: number;\n readonly HKWasTakenInLab?: boolean;\n readonly HKReferenceRangeLowerLimit?: number;\n readonly HKReferenceRangeUpperLimit?: number;\n};\n\n// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition\nexport enum HKWeatherCondition {\n none = 0,\n clear = 1,\n fair = 2,\n partlyCloudy = 3,\n mostlyCloudy = 4,\n cloudy = 5,\n foggy = 6,\n haze = 7,\n windy = 8,\n blustery = 9,\n smoky = 10,\n dust = 11,\n snow = 12,\n hail = 13,\n sleet = 14,\n freezingDrizzle = 15,\n freezingRain = 16,\n mixedRainAndHail = 17,\n mixedRainAndSnow = 18,\n mixedRainAndSleet = 19,\n mixedSnowAndSleet = 20,\n drizzle = 21,\n scatteredShowers = 22,\n showers = 23,\n thunderstorms = 24,\n tropicalStorm = 25,\n hurricane = 26,\n tornado = 27,\n}\n\nenum HKIndoorWorkout {\n false = 0,\n true = 1,\n}\n\nexport interface HKWorkoutMetadata\n extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {\n readonly HKWeatherCondition?: HKWeatherCondition;\n readonly HKWeatherHumidity?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Percent>;\n // HKWeatherTemperature: HKQuantity<TTemperatureUnit>\n readonly HKAverageMETs?: HKQuantity<HKQuantityTypeIdentifier, HKUnit>,\n readonly HKElevationAscended?: HKQuantity<HKQuantityTypeIdentifier, LengthUnit>,\n readonly HKIndoorWorkout?: HKIndoorWorkout,\n}\n\nexport enum HKAuthorizationRequestStatus {\n unknown = 0,\n shouldRequest = 1,\n unnecessary = 2,\n}\n\nexport enum HKAuthorizationStatus {\n notDetermined = 0,\n sharingDenied = 1,\n sharingAuthorized = 2,\n}\n\nexport type HKQuantity<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> = {\n readonly unit: TUnit;\n readonly quantity: number;\n};\n\nexport enum HKBloodType {\n notSet = 0,\n aPositive = 1,\n aNegative = 2,\n bPositive = 3,\n bNegative = 4,\n abPositive = 5,\n abNegative = 6,\n oPositive = 7,\n oNegative = 8,\n}\n\nexport enum HKBiologicalSex {\n notSet = 0,\n female = 1,\n male = 2,\n other = 3,\n}\n\nexport enum HKFitzpatrickSkinType {\n notSet = 0,\n I = 1,\n II = 2,\n III = 3,\n IV = 4,\n V = 5,\n VI = 6,\n}\n\nexport enum HKStatisticsOptions {\n cumulativeSum = 'cumulativeSum',\n discreteAverage = 'discreteAverage',\n discreteMax = 'discreteMax',\n discreteMin = 'discreteMin',\n discreteMostRecent = 'discreteMostRecent',\n duration = 'duration',\n mostRecent = 'mostRecent',\n separateBySource = 'separateBySource',\n}\n\nexport type QueryStatisticsResponseRaw<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>> = {\n readonly averageQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly maximumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly minimumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly sumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantityDateInterval?: { readonly from: string; readonly to: string };\n readonly duration?: HKQuantity<HKQuantityTypeIdentifier, TimeUnit>;\n};\n\nexport enum HKCategoryValueCervicalMucusQuality {\n dry = 1,\n sticky = 2,\n creamy = 3,\n watery = 4,\n eggWhite = 5,\n}\n\nexport enum HKCategoryValueMenstrualFlow {\n unspecified = 1,\n none = 5,\n light = 2,\n medium = 3,\n heavy = 4,\n}\n\nexport enum HKCategoryValueOvulationTestResult {\n negative = 1,\n luteinizingHormoneSurge = 2,\n indeterminate = 3,\n estrogenSurge = 4,\n}\n\nexport enum HKCategoryValueSleepAnalysis {\n inBed = 0,\n asleep = 1,\n awake = 2,\n}\n\nexport enum HKCategoryValueAppetiteChanges {\n decreased = 2,\n increased = 3,\n noChange = 1,\n unspecified = 0,\n}\n\nexport enum HKCategoryValuePresence {\n notPresent = 1,\n present = 0,\n}\n\nexport enum HKCategoryValueSeverity {\n notPresent = 1,\n mild = 2,\n moderate = 3,\n severe = 4,\n unspecified = 0,\n}\n\nexport enum HKCategoryValueNotApplicable {\n notApplicable = 0,\n}\n\nexport type HKCategoryValue =\n HKCategoryValueAppetiteChanges | HKCategoryValueCervicalMucusQuality |\n HKCategoryValueLowCardioFitnessEvent | HKCategoryValueMenstrualFlow |\n HKCategoryValueOvulationTestResult | HKCategoryValuePresence |\n HKCategoryValueSeverity | HKCategoryValueSleepAnalysis | number;\n\nexport enum HKInsulinDeliveryReason {\n basal = 1,\n bolus = 2,\n}\n\nexport type MetadataMapperForQuantityIdentifier<\n TQuantityTypeIdentifier = HKQuantityTypeIdentifier\n> = TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.insulinDelivery\n ? HKGenericMetadata & {\n readonly HKInsulinDeliveryReason: HKInsulinDeliveryReason;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.bloodGlucose\n ? HKGenericMetadata & {\n readonly HKBloodGlucoseMealTime?: number;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.heartRate\n ? HKGenericMetadata & {\n readonly HKHeartRateMotionContext?: HKHeartRateMotionContext;\n }\n : HKGenericMetadata;\n\nexport type MetadataMapperForCorrelationIdentifier<\n TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier\n> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food\n ? HKGenericMetadata & {\n readonly HKFoodType?: string;\n }\n : HKGenericMetadata;\n\nexport type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit\n : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit\n : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit\n : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit\n : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent\n : T extends HKQuantityTypeIdentifier.basalBodyTemperature | HKQuantityTypeIdentifier.basalBodyTemperature ? TemperatureUnit\n : T extends HKQuantityTypeIdentifier.stairAscentSpeed | HKQuantityTypeIdentifier.stairDescentSpeed | HKQuantityTypeIdentifier.walkingSpeed | HKQuantityTypeIdentifier.walkingSpeed ? SpeedUnit<LengthUnit, TimeUnit>\n : T extends HKQuantityTypeIdentifier.flightsClimbed | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages | HKQuantityTypeIdentifier.numberOfTimesFallen | HKQuantityTypeIdentifier.pushCount | HKQuantityTypeIdentifier.stepCount | HKQuantityTypeIdentifier.swimmingStrokeCount ? HKUnits.Count\n : T extends HKQuantityTypeIdentifier.dietaryBiotin | HKQuantityTypeIdentifier.dietaryCaffeine | HKQuantityTypeIdentifier.dietaryCalcium | HKQuantityTypeIdentifier.dietaryCarbohydrates | HKQuantityTypeIdentifier.dietaryChloride | HKQuantityTypeIdentifier.dietaryCholesterol | HKQuantityTypeIdentifier.dietaryChromium | HKQuantityTypeIdentifier.dietaryCopper | HKQuantityTypeIdentifier.dietaryFatMonounsaturated | HKQuantityTypeIdentifier.dietaryFatPolyunsaturated | HKQuantityTypeIdentifier.dietaryFatSaturated | HKQuantityTypeIdentifier.dietaryFatTotal | HKQuantityTypeIdentifier.dietaryFiber | HKQuantityTypeIdentifier.dietaryFolate | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIron | HKQuantityTypeIdentifier.dietaryMagnesium | HKQuantityTypeIdentifier.dietaryManganese | HKQuantityTypeIdentifier.dietaryMolybdenum | HKQuantityTypeIdentifier.dietaryNiacin | HKQuantityTypeIdentifier.dietaryPantothenicAcid | HKQuantityTypeIdentifier.dietaryPhosphorus | HKQuantityTypeIdentifier.dietaryPotassium | HKQuantityTypeIdentifier.dietaryProtein | HKQuantityTypeIdentifier.dietaryRiboflavin | HKQuantityTypeIdentifier.dietarySelenium | HKQuantityTypeIdentifier.dietarySodium | HKQuantityTypeIdentifier.dietarySugar | HKQuantityTypeIdentifier.dietaryThiamin | HKQuantityTypeIdentifier.dietaryVitaminA | HKQuantityTypeIdentifier.dietaryVitaminB6 | HKQuantityTypeIdentifier.dietaryVitaminB12 | HKQuantityTypeIdentifier.dietaryVitaminC | HKQuantityTypeIdentifier.dietaryVitaminD | HKQuantityTypeIdentifier.dietaryVitaminE | HKQuantityTypeIdentifier.dietaryVitaminK | HKQuantityTypeIdentifier.dietaryZinc ? MassUnit\n : T extends HKQuantityTypeIdentifier.dietaryWater ? VolumeUnit\n : T extends HKQuantityTypeIdentifier.insulinDelivery ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}`\n : T extends HKQuantityTypeIdentifier.heartRate | HKQuantityTypeIdentifier.restingHeartRate | HKQuantityTypeIdentifier.walkingHeartRateAverage ? CountPerTime<TimeUnit>\n : HKUnit\n\nexport type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> =\n T extends HKCategoryTypeIdentifier.cervicalMucusQuality\n ? HKCategoryValueCervicalMucusQuality\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKCategoryValueMenstrualFlow\n : T extends HKCategoryTypeIdentifier.ovulationTestResult\n ? HKCategoryValueOvulationTestResult\n : T extends HKCategoryTypeIdentifier.sleepAnalysis\n ? HKCategoryValueSleepAnalysis\n : T extends (HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding\n | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity)\n ? HKCategoryValueNotApplicable\n : T extends (HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.acne\n | HKCategoryTypeIdentifier.bladderIncontinence\n | HKCategoryTypeIdentifier.bloating| HKCategoryTypeIdentifier.breastPain\n | HKCategoryTypeIdentifier.chestTightnessOrPain| HKCategoryTypeIdentifier.chills| HKCategoryTypeIdentifier.constipation\n | HKCategoryTypeIdentifier.coughing| HKCategoryTypeIdentifier.diarrhea| HKCategoryTypeIdentifier.dizziness| HKCategoryTypeIdentifier.drySkin| HKCategoryTypeIdentifier.fainting\n | HKCategoryTypeIdentifier.fatigue| HKCategoryTypeIdentifier.fever| HKCategoryTypeIdentifier.generalizedBodyAche| HKCategoryTypeIdentifier.hairLoss\n | HKCategoryTypeIdentifier.headache| HKCategoryTypeIdentifier.heartburn\n | HKCategoryTypeIdentifier.hotFlashes| HKCategoryTypeIdentifier.lossOfSmell| HKCategoryTypeIdentifier.lossOfTaste\n | HKCategoryTypeIdentifier.lowerBackPain| HKCategoryTypeIdentifier.memoryLapse| HKCategoryTypeIdentifier.moodChanges\n | HKCategoryTypeIdentifier.nausea| HKCategoryTypeIdentifier.nightSweats| HKCategoryTypeIdentifier.pelvicPain\n | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat| HKCategoryTypeIdentifier.runnyNose\n | HKCategoryTypeIdentifier.shortnessOfBreath| HKCategoryTypeIdentifier.sinusCongestion| HKCategoryTypeIdentifier.skippedHeartbeat\n | HKCategoryTypeIdentifier.soreThroat| HKCategoryTypeIdentifier.vaginalDryness\n | HKCategoryTypeIdentifier.vomiting| HKCategoryTypeIdentifier.wheezing)\n ? HKCategoryValueSeverity\n : T extends (HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges)\n ? HKCategoryValuePresence\n : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.appleStandHour\n ? HKCategoryValueAppleStandHour\n : number;\n\nenum HKCategoryValuePregnancyTestResult {\n positive = 2,\n negative = 1,\n indeterminate = 3\n}\n/* needs further mapping\n\ncontraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue */\n\nexport type MetadataMapperForCategoryIdentifier<\n T extends HKCategoryTypeIdentifier\n> = T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKGenericMetadata & {\n readonly HKSexualActivityProtectionUsed: boolean;\n }\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKGenericMetadata & {\n readonly HKMenstrualCycleStart: boolean;\n }\n : HKGenericMetadata;\n\n// Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse\nexport enum HKWheelchairUse {\n notSet = 0,\n no = 1,\n yes = 2,\n}\n\n// Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init\nexport enum HKMetricPrefix {\n None = '',\n Pico = 'p',\n Nano = 'n',\n Micro = 'mc',\n Milli = 'm',\n Centi = 'c',\n Deci = 'd',\n Deca = 'da',\n Hecto = 'h',\n Kilo = 'k',\n Mega = 'M',\n Giga = 'G',\n Tera = 'T',\n Femto = 'f',\n}\n\nexport enum HKUnitMetric {\n Gram = 'g',\n Joule = 'J',\n Kelvin = 'K',\n Liter = 'l',\n Meter = 'm',\n Pascal = 'Pa',\n Second = 's',\n Siemen = 'S',\n Hertz = 'Hz',\n Volt = 'V',\n}\n\nexport enum HKUnits {\n\n DecibelHearingLevel = 'dBHL',\n DecibelSoundPressureLevel = 'dBASPL',\n\n Percent = '%',\n Count = 'count',\n InternationalUnit = 'IU',\n\n}\n\nexport type MeterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Meter}`;\nexport type LiterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Liter}`;\nexport type GramUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Gram}`;\nexport type PascalUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Pascal}`;\nexport type SecondUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Second}`;\nexport type JouleUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Joule}`;\nexport type HertzUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Hertz}`;\nexport type VoltUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Volt}`;\nexport type SiemenUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Siemen}`;\n\n// not 100% sure about these\nexport type MoleUnit<MolarMass extends number> =`mol<${MolarMass}>`;\nexport type MoleUnitWith<MolarMass extends number, Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}mol<${MolarMass}>`;\n\nexport type FrequencyUnit = HertzUnit<HKMetricPrefix>\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\nexport enum UnitOfLength {\n Feet = 'ft',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\n Meter = 'm',\n Inches = 'in',\n Yards = 'yd',\n Miles = 'mi',\n}\nexport type LengthUnit = MeterUnit<HKMetricPrefix> | UnitOfLength\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\nexport enum UnitOfVolume {\n ImperialCup = 'cup_imp',\n ImperialFluidOunces = 'fl_oz_imp',\n ImperialPint = 'pt_imp',\n USCup = 'cup_us',\n USFluidOunces = 'fl_oz_us',\n USPint = 'pt_us',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\n Liter = 'l',\n}\nexport type VolumeUnit = LiterUnit<HKMetricPrefix> | UnitOfVolume;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport enum UnitOfMass {\n Ounces = 'oz',\n Stones = 'st',\n Pounds = 'lb',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\n Gram = 'g'\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport type MassUnit = GramUnit<HKMetricPrefix> | UnitOfMass\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport enum UnitOfPressure {\n Atmospheres = 'atm',\n CentimetersOfWater = 'cmAq',\n MillimetersOfMercury = 'mmHg',\n InchesOfMercury = 'inHg',\n DecibelAWeightedSoundPressureLevel = 'dBASPL',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\n Pascals = 'Pa',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport type PressureUnit = PascalUnit<HKMetricPrefix> | UnitOfPressure;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport enum UnitOfTime {\n Days = 'd',\n Minutes = 'min',\n Hours = 'hr',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\n Seconds = 's',\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport type TimeUnit = SecondUnit<HKMetricPrefix> | UnitOfTime\nexport enum TemperatureUnit {\n DegreesCelsius = 'degC',\n DegreesFahrenheit = 'degF',\n Kelvin = 'K',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\nexport enum UnitOfEnergy {\n Kilocalories = 'kcal',\n LargeCalories = 'Cal',\n SmallCalories = 'cal',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\n Joules = 'J',\n}\nexport type EnergyUnit = JouleUnit<HKMetricPrefix> | UnitOfEnergy\nexport enum BloodGlucoseUnit {\n GlucoseMmolPerL = 'mmol<180.15588000005408>/l',\n GlucoseMgPerDl = 'mg/dL',\n}\n\nexport type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> =`${TLength}/${TTime}`;\nexport type CountPerTime<TTime extends TimeUnit> =`count/${TTime}`;\n\nexport type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit\n| `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${FrequencyUnit}` | `${HKUnits}` | `${LengthUnit}` | `${MassUnit}` | `${PressureUnit}` | `${TemperatureUnit}` | `${TimeUnit}` | `${VolumeUnit}`;\n\nexport type HKDevice = {\n readonly name: string; // ex: \"Apple Watch\"\n readonly firmwareVersion: string | null;\n readonly hardwareVersion: string; // ex: \"Watch6,2\",\n readonly localIdentifier: string | null;\n readonly manufacturer: string; // ex: \"Apple Inc.\"\n readonly model: string; // ex: \"Watch\"\n readonly softwareVersion: string; // ex: \"9.0\"\n};\n\nexport type HKSource = {\n readonly name: string;\n readonly bundleIdentifier: string;\n};\n\nexport type HKSourceRevision = {\n readonly source: HKSource;\n readonly version: string;\n readonly operatingSystemVersion?: string;\n readonly productType?: string;\n};\n\nexport type HKQuantitySampleRaw<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TQuantityIdentifier;\n readonly startDate: string;\n readonly endDate: string;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKQuantitySampleRawForSaving<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = Omit<\nHKQuantitySampleRaw<TQuantityIdentifier, TUnit>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKCategorySampleRawForSaving<\n TCategory extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier,\n> = Omit<\nHKCategorySampleRaw<TCategory>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKWorkoutRaw<TEnergy extends EnergyUnit, TDistance extends LengthUnit> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly workoutActivityType: HKWorkoutActivityType;\n readonly duration: number;\n readonly totalDistance?: HKQuantity<HKQuantityTypeIdentifier, TDistance>;\n readonly totalEnergyBurned?: HKQuantity<HKQuantityTypeIdentifier, TEnergy>;\n readonly totalSwimmingStrokeCount?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly totalFlightsClimbed?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly startDate: string;\n readonly endDate: string;\n readonly metadata?: HKWorkoutMetadata;\n readonly sourceRevision?: HKSourceRevision;\n};\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier\nexport enum HKCharacteristicTypeIdentifier {\n fitzpatrickSkinType = 'HKCharacteristicTypeIdentifierFitzpatrickSkinType',\n biologicalSex = 'HKCharacteristicTypeIdentifierBiologicalSex',\n bloodType = 'HKCharacteristicTypeIdentifierBloodType',\n dateOfBirth = 'HKCharacteristicTypeIdentifierDateOfBirth',\n wheelchairUse = 'HKCharacteristicTypeIdentifierWheelchairUse',\n activityMoveMode = 'HKCharacteristicTypeIdentifierActivityMoveMode', // HKActivityMoveModeObject\n}\n\nexport type WritePermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type ReadPermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type HKCategorySampleRaw<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly categoryType: T;\n readonly startDate: string;\n readonly endDate: string;\n readonly value: HKCategoryValueForIdentifier<T>;\n readonly metadata: MetadataMapperForCategoryIdentifier<T>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKCorrelationRaw<TIdentifier extends HKCorrelationTypeIdentifier> =\n {\n readonly correlationType: HKCorrelationTypeIdentifier;\n readonly objects: readonly (HKCategorySampleRaw | HKQuantitySampleRaw)[];\n readonly metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n readonly startDate: string;\n readonly endDate: string;\n };\n\ntype QueryId = string;\n\nexport enum HKUpdateFrequency {\n immediate = 1,\n hourly = 2,\n daily = 3,\n weekly = 4,\n}\n\nexport type WorkoutLocation = {\n readonly longitude: number;\n readonly latitude: number;\n readonly altitude: number;\n readonly speed: number;\n readonly timestamp: number;\n readonly horizontalAccuracy: number;\n readonly speedAccuracy: number;\n readonly verticalAccuracy: number;\n};\n\nexport type WorkoutRoute = {\n readonly locations: readonly WorkoutLocation[];\n readonly HKMetadataKeySyncIdentifier?: string;\n readonly HKMetadataKeySyncVersion?: number;\n};\n\ntype ReactNativeHealthkitTypeNative = {\n isHealthDataAvailable(): Promise<boolean>;\n getBloodType(): Promise<HKBloodType>;\n getDateOfBirth(): Promise<string>;\n getBiologicalSex(): Promise<HKBiologicalSex>;\n getFitzpatrickSkinType(): Promise<HKFitzpatrickSkinType>;\n readonly getWheelchairUse: () => Promise<HKWheelchairUse>;\n\n readonly enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n readonly disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n ) => Promise<boolean>;\n readonly disableAllBackgroundDelivery: () => Promise<boolean>;\n\n readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier, TSamples extends readonly (HKCategorySampleRawForSaving | HKQuantitySampleRawForSaving)[]>(\n typeIdentifier: TIdentifier,\n samples: TSamples,\n start: string,\n end: string,\n metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>\n ) => Promise<boolean>;\n\n readonly saveWorkoutSample: (\n typeIdentifier: HKWorkoutActivityType,\n quantities: readonly HKQuantitySampleRawForSaving[],\n start: string,\n end: string,\n metadata: HKWorkoutMetadata\n ) => Promise<boolean>;\n\n readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n from: string,\n to: string\n ) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;\n\n subscribeToObserverQuery(\n identifier: HKSampleTypeIdentifier\n ): Promise<QueryId>;\n unsubscribeQuery(queryId: QueryId): Promise<boolean>;\n authorizationStatusFor(\n type: HealthkitReadAuthorization\n ): Promise<boolean>;\n getRequestStatusForAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<HKAuthorizationRequestStatus>;\n requestAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<boolean>;\n readonly saveQuantitySample: <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>> (\n identifier: TType,\n unit: TUnit,\n value: number,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(\n energyUnit: TEnergy,\n distanceUnit: TDistance,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;\n readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKCategorySampleRaw<T>[]>;\n readonly queryQuantitySamples: <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>,\n >(\n identifier: TIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;\n readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryStatisticsForQuantity: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(\n identifier: HKQuantityTypeIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n options: readonly HKStatisticsOptions[]\n ) => Promise<QueryStatisticsResponseRaw<TIdentifier, TUnit>>;\n readonly getPreferredUnits: (\n identifiers: readonly HKQuantityTypeIdentifier[]\n ) => Promise<TypeToUnitMapping>;\n readonly getWorkoutRoutes: (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;\n};\n\nconst Native = NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNative\n\ntype OnChangeCallback = ({\n typeIdentifier,\n}: {\n readonly typeIdentifier: HKSampleTypeIdentifier;\n}) => void;\n\ninterface HealthkitEventEmitter extends NativeEventEmitter {\n readonly addListener: (\n eventType: 'onChange',\n callback: OnChangeCallback\n ) => EmitterSubscription;\n}\n\nexport const EventEmitter = new NativeEventEmitter(\n NativeModules.ReactNativeHealthkit,\n) as HealthkitEventEmitter\n\nexport default Native\n"],"mappings":"AAAA,SACEA,kBADF,EAEEC,aAFF,QAGO,cAHP;AAOA,OAAO,MAAMC,uBAAuB,GAAG,yBAAhC;AACP,OAAO,MAAMC,yBAAyB,GAAG,2BAAlC;AACP,OAAO,MAAMC,4BAA4B,GAAG,8BAArC;AACP,OAAO,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EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;GAAAA,8B,KAAAA,8B;;AAyCZ,WAAYC,iBAAZ;;WAAYA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;GAAAA,iB,KAAAA,iB;;AAoIZ,MAAMC,MAAM,GAAG5C,aAAa,CAAC6C,oBAA7B;AAeA,OAAO,MAAMC,YAAY,GAAG,IAAI/C,kBAAJ,CAC1BC,aAAa,CAAC6C,oBADY,CAArB;AAIP,eAAeD,MAAf"}
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","HKWorkoutTypeIdentifier","HKAudiogramTypeIdentifier","HKWorkoutRouteTypeIdentifier","HKDataTypeIdentifierHeartbeatSeries","HKQuantityTypeIdentifier","HKCategoryValueLowCardioFitnessEvent","HKHeartRateMotionContext","HKCorrelationTypeIdentifier","HKCategoryTypeIdentifier","HKCategoryValueAppleStandHour","HKWorkoutActivityType","HKWeatherCondition","HKIndoorWorkout","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBloodType","HKBiologicalSex","HKFitzpatrickSkinType","HKStatisticsOptions","HKCategoryValueCervicalMucusQuality","HKCategoryValueMenstrualFlow","HKCategoryValueOvulationTestResult","HKCategoryValueSleepAnalysis","HKCategoryValueAppetiteChanges","HKCategoryValuePresence","HKCategoryValueSeverity","HKCategoryValueNotApplicable","HKInsulinDeliveryReason","HKCategoryValuePregnancyTestResult","HKWheelchairUse","HKMetricPrefix","HKUnitMetric","HKUnits","UnitOfLength","UnitOfVolume","UnitOfMass","UnitOfPressure","UnitOfTime","TemperatureUnit","UnitOfEnergy","BloodGlucoseUnit","HKCharacteristicTypeIdentifier","HKUpdateFrequency","Native","ReactNativeHealthkit","EventEmitter"],"sources":["native-types.ts"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n} from 'react-native'\n\nimport type { EmitterSubscription } from 'react-native'\n\nexport const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier' as const\nexport const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier' as const\nexport const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier' as const\nexport const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries' as const\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier\nexport enum HKQuantityTypeIdentifier {\n bodyMassIndex = 'HKQuantityTypeIdentifierBodyMassIndex',\n bodyFatPercentage = 'HKQuantityTypeIdentifierBodyFatPercentage', // Scalar(Percent, 0.0 - 1.0), Discrete\n height = 'HKQuantityTypeIdentifierHeight', // Length, Discrete\n bodyMass = 'HKQuantityTypeIdentifierBodyMass', // Mass, Discrete\n leanBodyMass = 'HKQuantityTypeIdentifierLeanBodyMass', // Mass, Discrete\n\n waistCircumference = 'HKQuantityTypeIdentifierWaistCircumference', // Length, Discrete\n // Fitness\n stepCount = 'HKQuantityTypeIdentifierStepCount', // Scalar(Count), Cumulative\n distanceWalkingRunning = 'HKQuantityTypeIdentifierDistanceWalkingRunning', // Length, Cumulative\n distanceCycling = 'HKQuantityTypeIdentifierDistanceCycling', // Length, Cumulative\n distanceWheelchair = 'HKQuantityTypeIdentifierDistanceWheelchair', // Length, Cumulative\n basalEnergyBurned = 'HKQuantityTypeIdentifierBasalEnergyBurned', // Energy, Cumulative\n activeEnergyBurned = 'HKQuantityTypeIdentifierActiveEnergyBurned', // Energy, Cumulative\n flightsClimbed = 'HKQuantityTypeIdentifierFlightsClimbed', // Scalar(Count), Cumulative\n nikeFuel = 'HKQuantityTypeIdentifierNikeFuel', // Scalar(Count), Cumulative\n appleExerciseTime = 'HKQuantityTypeIdentifierAppleExerciseTime', // Time Cumulative\n pushCount = 'HKQuantityTypeIdentifierPushCount', // Scalar(Count), Cumulative\n distanceSwimming = 'HKQuantityTypeIdentifierDistanceSwimming', // Length, Cumulative\n swimmingStrokeCount = 'HKQuantityTypeIdentifierSwimmingStrokeCount', // Scalar(Count), Cumulative\n vo2Max = 'HKQuantityTypeIdentifierVo2Max', // ml/(kg*min) Discrete\n distanceDownhillSnowSports = 'HKQuantityTypeIdentifierDistanceDownhillSnowSports', // Length, Cumulative\n\n appleStandTime = 'HKQuantityTypeIdentifierAppleStandTime', // Time, Cumulative\n // Vitals\n heartRate = 'HKQuantityTypeIdentifierHeartRate', // Scalar(Count)/Time, Discrete\n bodyTemperature = 'HKQuantityTypeIdentifierBodyTemperature', // Temperature, Discrete\n basalBodyTemperature = 'HKQuantityTypeIdentifierBasalBodyTemperature', // Basal Body Temperature, Discrete\n bloodPressureSystolic = 'HKQuantityTypeIdentifierBloodPressureSystolic', // Pressure, Discrete\n bloodPressureDiastolic = 'HKQuantityTypeIdentifierBloodPressureDiastolic', // Pressure, Discrete\n respiratoryRate = 'HKQuantityTypeIdentifierRespiratoryRate', // Scalar(Count)/Time, Discrete\n // Beats per minute estimate of a user's lowest heart rate while at rest\n restingHeartRate = 'HKQuantityTypeIdentifierRestingHeartRate', // Scalar(Count)/Time, Discrete\n // Average heartbeats per minute captured by an Apple Watch while a user is walking\n walkingHeartRateAverage = 'HKQuantityTypeIdentifierWalkingHeartRateAverage', // Scalar(Count)/Time, Discrete\n // The standard deviation of heart beat-to-beat intevals (Standard Deviation of Normal to Normal)\n\n heartRateVariabilitySDNN = 'HKQuantityTypeIdentifierHeartRateVariabilitySDNN', // Time (ms), Discrete\n // Results\n oxygenSaturation = 'HKQuantityTypeIdentifierOxygenSaturation', // Scalar (Percent, 0.0 - 1.0, Discrete\n peripheralPerfusionIndex = 'HKQuantityTypeIdentifierPeripheralPerfusionIndex', // Scalar(Percent, 0.0 - 1.0), Discrete\n bloodGlucose = 'HKQuantityTypeIdentifierBloodGlucose', // Mass/Volume, Discrete\n numberOfTimesFallen = 'HKQuantityTypeIdentifierNumberOfTimesFallen', // Scalar(Count), Cumulative\n electrodermalActivity = 'HKQuantityTypeIdentifierElectrodermalActivity', // Conductance, Discrete\n inhalerUsage = 'HKQuantityTypeIdentifierInhalerUsage', // Scalar(Count), Cumulative\n insulinDelivery = 'HKQuantityTypeIdentifierInsulinDelivery', // Pharmacology (IU) Cumulative\n bloodAlcoholContent = 'HKQuantityTypeIdentifierBloodAlcoholContent', // Scalar(Percent, 0.0 - 1.0), Discrete\n forcedVitalCapacity = 'HKQuantityTypeIdentifierForcedVitalCapacity', // Volume, Discrete\n forcedExpiratoryVolume1 = 'HKQuantityTypeIdentifierForcedExpiratoryVolume1', // Volume, Discrete\n peakExpiratoryFlowRate = 'HKQuantityTypeIdentifierPeakExpiratoryFlowRate', // Volume/Time, Discrete\n environmentalAudioExposure = 'HKQuantityTypeIdentifierEnvironmentalAudioExposure', // Pressure, Cumulative\n\n headphoneAudioExposure = 'HKQuantityTypeIdentifierHeadphoneAudioExposure', // Pressure, Cumulative\n // Nutrition\n dietaryFatTotal = 'HKQuantityTypeIdentifierDietaryFatTotal', // Mass, Cumulative\n dietaryFatPolyunsaturated = 'HKQuantityTypeIdentifierDietaryFatPolyunsaturated', // Mass, Cumulative\n dietaryFatMonounsaturated = 'HKQuantityTypeIdentifierDietaryFatMonounsaturated', // Mass, Cumulative\n dietaryFatSaturated = 'HKQuantityTypeIdentifierDietaryFatSaturated', // Mass, Cumulative\n dietaryCholesterol = 'HKQuantityTypeIdentifierDietaryCholesterol', // Mass, Cumulative\n dietarySodium = 'HKQuantityTypeIdentifierDietarySodium', // Mass, Cumulative\n dietaryCarbohydrates = 'HKQuantityTypeIdentifierDietaryCarbohydrates', // Mass, Cumulative\n dietaryFiber = 'HKQuantityTypeIdentifierDietaryFiber', // Mass, Cumulative\n dietarySugar = 'HKQuantityTypeIdentifierDietarySugar', // Mass, Cumulative\n dietaryEnergyConsumed = 'HKQuantityTypeIdentifierDietaryEnergyConsumed', // Energy, Cumulative\n dietaryProtein = 'HKQuantityTypeIdentifierDietaryProtein', // Mass, Cumulative\n\n dietaryVitaminA = 'HKQuantityTypeIdentifierDietaryVitaminA', // Mass, Cumulative\n dietaryVitaminB6 = 'HKQuantityTypeIdentifierDietaryVitaminB6', // Mass, Cumulative\n dietaryVitaminB12 = 'HKQuantityTypeIdentifierDietaryVitaminB12', // Mass, Cumulative\n dietaryVitaminC = 'HKQuantityTypeIdentifierDietaryVitaminC', // Mass, Cumulative\n dietaryVitaminD = 'HKQuantityTypeIdentifierDietaryVitaminD', // Mass, Cumulative\n dietaryVitaminE = 'HKQuantityTypeIdentifierDietaryVitaminE', // Mass, Cumulative\n dietaryVitaminK = 'HKQuantityTypeIdentifierDietaryVitaminK', // Mass, Cumulative\n dietaryCalcium = 'HKQuantityTypeIdentifierDietaryCalcium', // Mass, Cumulative\n dietaryIron = 'HKQuantityTypeIdentifierDietaryIron', // Mass, Cumulative\n dietaryThiamin = 'HKQuantityTypeIdentifierDietaryThiamin', // Mass, Cumulative\n dietaryRiboflavin = 'HKQuantityTypeIdentifierDietaryRiboflavin', // Mass, Cumulative\n dietaryNiacin = 'HKQuantityTypeIdentifierDietaryNiacin', // Mass, Cumulative\n dietaryFolate = 'HKQuantityTypeIdentifierDietaryFolate', // Mass, Cumulative\n dietaryBiotin = 'HKQuantityTypeIdentifierDietaryBiotin', // Mass, Cumulative\n dietaryPantothenicAcid = 'HKQuantityTypeIdentifierDietaryPantothenicAcid', // Mass, Cumulative\n dietaryPhosphorus = 'HKQuantityTypeIdentifierDietaryPhosphorus', // Mass, Cumulative\n dietaryIodine = 'HKQuantityTypeIdentifierDietaryIodine', // Mass, Cumulative\n dietaryMagnesium = 'HKQuantityTypeIdentifierDietaryMagnesium', // Mass, Cumulative\n dietaryZinc = 'HKQuantityTypeIdentifierDietaryZinc', // Mass, Cumulative\n dietarySelenium = 'HKQuantityTypeIdentifierDietarySelenium', // Mass, Cumulative\n dietaryCopper = 'HKQuantityTypeIdentifierDietaryCopper', // Mass, Cumulative\n dietaryManganese = 'HKQuantityTypeIdentifierDietaryManganese', // Mass, Cumulative\n dietaryChromium = 'HKQuantityTypeIdentifierDietaryChromium', // Mass, Cumulative\n dietaryMolybdenum = 'HKQuantityTypeIdentifierDietaryMolybdenum', // Mass, Cumulative\n dietaryChloride = 'HKQuantityTypeIdentifierDietaryChloride', // Mass, Cumulative\n dietaryPotassium = 'HKQuantityTypeIdentifierDietaryPotassium', // Mass, Cumulative\n dietaryCaffeine = 'HKQuantityTypeIdentifierDietaryCaffeine', // Mass, Cumulative\n dietaryWater = 'HKQuantityTypeIdentifierDietaryWater', // Volume, Cumulative\n\n // Mobility\n sixMinuteWalkTestDistance = 'HKQuantityTypeIdentifierSixMinuteWalkTestDistance',\n walkingSpeed = 'HKQuantityTypeIdentifierWalkingSpeed',\n walkingStepLength = 'HKQuantityTypeIdentifierWalkingStepLength',\n walkingAsymmetryPercentage = 'HKQuantityTypeIdentifierWalkingAsymmetryPercentage',\n walkingDoubleSupportPercentage = 'HKQuantityTypeIdentifierWalkingDoubleSupportPercentage',\n stairAscentSpeed = 'HKQuantityTypeIdentifierStairAscentSpeed',\n stairDescentSpeed = 'HKQuantityTypeIdentifierStairDescentSpeed',\n\n uvExposure = 'HKQuantityTypeIdentifierUvExposure', // Scalar (Count), Discrete\n\n appleMoveTime = 'HKQuantityTypeIdentifierAppleMoveTime', // Time, Cumulative\n appleWalkingSteadiness = 'HKQuantityTypeIdentifierAppleWalkingSteadiness', // Scalar(Percent, 0.0 - 1.0), Discrete\n\n numberOfAlcoholicBeverages = 'HKQuantityTypeIdentifierNumberOfAlcoholicBeverages', // Scalar(Count), Cumulative\n}\n\nexport type TypeToUnitMapping = { readonly\n [key in HKQuantityTypeIdentifier]: HKUnit;\n};\n\nexport enum HKCategoryValueLowCardioFitnessEvent {\n lowFitness = 1,\n}\n\nexport enum HKHeartRateMotionContext {\n active = 2,\n notSet = 0,\n sedentary = 1,\n}\n\nexport enum HKCorrelationTypeIdentifier {\n bloodPressure = 'HKCorrelationTypeIdentifierBloodPressure',\n food = 'HKCorrelationTypeIdentifierFood',\n}\n\nexport enum HKCategoryTypeIdentifier {\n sleepAnalysis = 'HKCategoryTypeIdentifierSleepAnalysis',\n appleStandHour = 'HKCategoryTypeIdentifierAppleStandHour',\n cervicalMucusQuality = 'HKCategoryTypeIdentifierCervicalMucusQuality',\n ovulationTestResult = 'HKCategoryTypeIdentifierOvulationTestResult',\n menstrualFlow = 'HKCategoryTypeIdentifierMenstrualFlow',\n intermenstrualBleeding = 'HKCategoryTypeIdentifierIntermenstrualBleeding',\n sexualActivity = 'HKCategoryTypeIdentifierSexualActivity',\n mindfulSession = 'HKCategoryTypeIdentifierMindfulSession',\n highHeartRateEvent = 'HKCategoryTypeIdentifierHighHeartRateEvent',\n lowHeartRateEvent = 'HKCategoryTypeIdentifierLowHeartRateEvent',\n irregularHeartRhythmEvent = 'HKCategoryTypeIdentifierIrregularHeartRhythmEvent',\n audioExposureEvent = 'HKCategoryTypeIdentifierAudioExposureEvent',\n toothbrushingEvent = 'HKCategoryTypeIdentifierToothbrushingEvent',\n lowCardioFitnessEvent = 'HKCategoryTypeIdentifierLowCardioFitnessEvent',\n contraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n pregnancyTestResult = 'HKCategoryTypeIdentifierPregnancyTestResult',\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue\n\n // Symptoms\n abdominalCramps = 'HKCategoryTypeIdentifierAbdominalCramps', // HKCategoryValueSeverity\n acne = 'HKCategoryTypeIdentifierAcne', // HKCategoryValueSeverity\n appetiteChanges = 'HKCategoryTypeIdentifierAppetiteChanges', // HKCategoryValueAppetiteChanges\n bladderIncontinence = 'HKCategoryTypeIdentifierBladderIncontinence', // HKCategoryValueSeverity\n bloating = 'HKCategoryTypeIdentifierBloating', // HKCategoryValueSeverity\n breastPain = 'HKCategoryTypeIdentifierBreastPain', // HKCategoryValueSeverity\n chestTightnessOrPain = 'HKCategoryTypeIdentifierChestTightnessOrPain', // HKCategoryValueSeverity\n chills = 'HKCategoryTypeIdentifierChills', // HKCategoryValueSeverity\n constipation = 'HKCategoryTypeIdentifierConstipation', // HKCategoryValueSeverity\n coughing = 'HKCategoryTypeIdentifierCoughing', // HKCategoryValueSeverity\n diarrhea = 'HKCategoryTypeIdentifierDiarrhea', // HKCategoryValueSeverity\n dizziness = 'HKCategoryTypeIdentifierDizziness', // HKCategoryValueSeverity\n drySkin = 'HKCategoryTypeIdentifierDrySkin', // HKCategoryValueSeverity\n fainting = 'HKCategoryTypeIdentifierFainting', // HKCategoryValueSeverity\n fatigue = 'HKCategoryTypeIdentifierFatigue', // HKCategoryValueSeverity\n fever = 'HKCategoryTypeIdentifierFever', // HKCategoryValueSeverity\n generalizedBodyAche = 'HKCategoryTypeIdentifierGeneralizedBodyAche', // HKCategoryValueSeverity\n hairLoss = 'HKCategoryTypeIdentifierHairLoss', // HKCategoryValueSeverity\n headache = 'HKCategoryTypeIdentifierHeadache', // HKCategoryValueSeverity\n heartburn = 'HKCategoryTypeIdentifierHeartburn', // HKCategoryValueSeverity\n hotFlashes = 'HKCategoryTypeIdentifierHotFlashes', // HKCategoryValueSeverity\n lossOfSmell = 'HKCategoryTypeIdentifierLossOfSmell', // HKCategoryValueSeverity\n lossOfTaste = 'HKCategoryTypeIdentifierLossOfTaste', // HKCategoryValueSeverity\n lowerBackPain = 'HKCategoryTypeIdentifierLowerBackPain', // HKCategoryValueSeverity\n memoryLapse = 'HKCategoryTypeIdentifierMemoryLapse', // HKCategoryValueSeverity\n moodChanges = 'HKCategoryTypeIdentifierMoodChanges', // HKCategoryValuePresence\n nausea = 'HKCategoryTypeIdentifierNausea', // HKCategoryValueSeverity\n nightSweats = 'HKCategoryTypeIdentifierNightSweats', // HKCategoryValueSeverity\n pelvicPain = 'HKCategoryTypeIdentifierPelvicPain', // HKCategoryValueSeverity\n rapidPoundingOrFlutteringHeartbeat = 'HKCategoryTypeIdentifierRapidPoundingOrFlutteringHeartbeat', // HKCategoryValueSeverity\n runnyNose = 'HKCategoryTypeIdentifierRunnyNose', // HKCategoryValueSeverity\n shortnessOfBreath = 'HKCategoryTypeIdentifierShortnessOfBreath', // HKCategoryValueSeverity\n sinusCongestion = 'HKCategoryTypeIdentifierSinusCongestion', // HKCategoryValueSeverity\n skippedHeartbeat = 'HKCategoryTypeIdentifierSkippedHeartbeat', // HKCategoryValueSeverity\n sleepChanges = 'HKCategoryTypeIdentifierSleepChanges', // HKCategoryValuePresence\n soreThroat = 'HKCategoryTypeIdentifierSoreThroat', // HKCategoryValueSeverity\n vaginalDryness = 'HKCategoryTypeIdentifierVaginalDryness', // HKCategoryValueSeverity\n vomiting = 'HKCategoryTypeIdentifierVomiting', // HKCategoryValueSeverity\n wheezing = 'HKCategoryTypeIdentifierWheezing', // HKCategoryValueSeverity\n\n}\n\nexport type HKSampleTypeIdentifier =\nHKCategoryTypeIdentifier\n| HKCorrelationTypeIdentifier\n| HKQuantityTypeIdentifier\n| typeof HKAudiogramTypeIdentifier\n| typeof HKDataTypeIdentifierHeartbeatSeries\n| typeof HKWorkoutRouteTypeIdentifier\n| typeof HKWorkoutTypeIdentifier\n| `${HKCategoryTypeIdentifier}`\n| `${HKCorrelationTypeIdentifier}`\n| `${HKQuantityTypeIdentifier}`\n\nexport type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`\nexport type HealthkitWriteAuthorization = HKSampleTypeIdentifier\n\nexport enum HKCategoryValueAppleStandHour {\n stood = 0,\n idle = 1,\n}\n\nexport enum HKWorkoutActivityType {\n americanFootball = 1,\n archery = 2,\n australianFootball = 3,\n badminton = 4,\n baseball = 5,\n basketball = 6,\n bowling = 7,\n boxing = 8, // See also HKWorkoutActivityTypeKickboxing.,\n climbing = 9,\n cricket = 10,\n crossTraining = 11, // Any mix of cardio and/or strength training. See also HKWorkoutActivityTypeCoreTraining and HKWorkoutActivityTypeFlexibility.,\n curling = 12,\n cycling = 13,\n dance = 14,\n danceInspiredTraining = 15, // This enum remains available to access older data.,\n elliptical = 16,\n equestrianSports = 17, // Polo, Horse Racing, Horse Riding, etc.,\n fencing = 18,\n fishing = 19,\n functionalStrengthTraining = 20, // Primarily free weights and/or body weight and/or accessories,\n golf = 21,\n gymnastics = 22,\n handball = 23,\n hiking = 24,\n hockey = 25, // Ice Hockey, Field Hockey, etc.,\n hunting = 26,\n lacrosse = 27,\n martialArts = 28,\n mindAndBody = 29, // Qigong, meditation, etc.,\n mixedMetabolicCardioTraining = 30, // This enum remains available to access older data.,\n paddleSports = 31, // Canoeing, Kayaking, Outrigger, Stand Up Paddle Board, etc.,\n play = 32, // Dodge Ball, Hopscotch, Tetherball, Jungle Gym, etc.,\n preparationAndRecovery = 33, // Foam rolling, stretching, etc.,\n racquetball = 34,\n rowing = 35,\n rugby = 36,\n running = 37,\n sailing = 38,\n skatingSports = 39, // Ice Skating, Speed Skating, Inline Skating, Skateboarding, etc.,\n snowSports = 40, // Sledding, Snowmobiling, Building a Snowman, etc. See also HKWorkoutActivityTypeCrossCountrySkiing, HKWorkoutActivityTypeSnowboarding, and HKWorkoutActivityTypeDownhillSkiing.,\n soccer = 41,\n softball = 42,\n squash = 43,\n stairClimbing = 44, // See also HKWorkoutActivityTypeStairs and HKWorkoutActivityTypeStepTraining.,\n surfingSports = 45, // Traditional Surfing, Kite Surfing, Wind Surfing, etc.,\n swimming = 46,\n tableTennis = 47,\n tennis = 48,\n trackAndField = 49, // Shot Put, Javelin, Pole Vaulting, etc.,\n traditionalStrengthTraining = 50, // Primarily machines and/or free weights,\n volleyball = 51,\n walking = 52,\n waterFitness = 53,\n waterPolo = 54,\n waterSports = 55, // Water Skiing, Wake Boarding, etc.,\n wrestling = 56,\n yoga = 57,\n barre = 58, // HKWorkoutActivityTypeDanceInspiredTraining,\n coreTraining = 59,\n crossCountrySkiing = 60,\n downhillSkiing = 61,\n flexibility = 62,\n highIntensityIntervalTraining = 63,\n jumpRope = 64,\n kickboxing = 65,\n pilates = 66, // HKWorkoutActivityTypeDanceInspiredTraining,\n snowboarding = 67,\n stairs = 68,\n stepTraining = 69,\n wheelchairWalkPace = 70,\n wheelchairRunPace = 71,\n taiChi = 72,\n mixedCardio = 73, // HKWorkoutActivityTypeMixedMetabolicCardioTraining,\n handCycling = 74,\n discSports = 75,\n fitnessGaming = 76,\n other = 3000,\n}\n\nexport type HKGenericMetadata = {\n readonly [key: string]: HKQuantity | boolean | number | string | undefined;\n readonly HKExternalUUID?: string;\n readonly HKTimeZone?: string;\n readonly HKWasUserEntered?: boolean;\n readonly HKDeviceSerialNumber?: string;\n readonly HKUDIDeviceIdentifier?: string;\n readonly HKUDIProductionIdentifier?: string;\n readonly HKDigitalSignature?: string;\n readonly HKDeviceName?: string;\n readonly HKDeviceManufacturerName?: string;\n readonly HKSyncIdentifier?: string;\n readonly HKSyncVersion?: number;\n readonly HKWasTakenInLab?: boolean;\n readonly HKReferenceRangeLowerLimit?: number;\n readonly HKReferenceRangeUpperLimit?: number;\n};\n\n// documented at https://developer.apple.com/documentation/healthkit/hkweathercondition\nexport enum HKWeatherCondition {\n none = 0,\n clear = 1,\n fair = 2,\n partlyCloudy = 3,\n mostlyCloudy = 4,\n cloudy = 5,\n foggy = 6,\n haze = 7,\n windy = 8,\n blustery = 9,\n smoky = 10,\n dust = 11,\n snow = 12,\n hail = 13,\n sleet = 14,\n freezingDrizzle = 15,\n freezingRain = 16,\n mixedRainAndHail = 17,\n mixedRainAndSnow = 18,\n mixedRainAndSleet = 19,\n mixedSnowAndSleet = 20,\n drizzle = 21,\n scatteredShowers = 22,\n showers = 23,\n thunderstorms = 24,\n tropicalStorm = 25,\n hurricane = 26,\n tornado = 27,\n}\n\nenum HKIndoorWorkout {\n false = 0,\n true = 1,\n}\n\nexport interface HKWorkoutMetadata\n extends HKGenericMetadata /* <TTemperatureUnit extends HKUnit> */ {\n readonly HKWeatherCondition?: HKWeatherCondition;\n readonly HKWeatherHumidity?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Percent>;\n // HKWeatherTemperature: HKQuantity<TTemperatureUnit>\n readonly HKAverageMETs?: HKQuantity<HKQuantityTypeIdentifier, HKUnit>,\n readonly HKElevationAscended?: HKQuantity<HKQuantityTypeIdentifier, LengthUnit>,\n readonly HKIndoorWorkout?: HKIndoorWorkout,\n}\n\nexport enum HKAuthorizationRequestStatus {\n unknown = 0,\n shouldRequest = 1,\n unnecessary = 2,\n}\n\nexport enum HKAuthorizationStatus {\n notDetermined = 0,\n sharingDenied = 1,\n sharingAuthorized = 2,\n}\n\nexport type HKQuantity<TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>> = {\n readonly unit: TUnit;\n readonly quantity: number;\n};\n\nexport enum HKBloodType {\n notSet = 0,\n aPositive = 1,\n aNegative = 2,\n bPositive = 3,\n bNegative = 4,\n abPositive = 5,\n abNegative = 6,\n oPositive = 7,\n oNegative = 8,\n}\n\nexport enum HKBiologicalSex {\n notSet = 0,\n female = 1,\n male = 2,\n other = 3,\n}\n\nexport enum HKFitzpatrickSkinType {\n notSet = 0,\n I = 1,\n II = 2,\n III = 3,\n IV = 4,\n V = 5,\n VI = 6,\n}\n\nexport enum HKStatisticsOptions {\n cumulativeSum = 'cumulativeSum',\n discreteAverage = 'discreteAverage',\n discreteMax = 'discreteMax',\n discreteMin = 'discreteMin',\n discreteMostRecent = 'discreteMostRecent',\n duration = 'duration',\n mostRecent = 'mostRecent',\n separateBySource = 'separateBySource',\n}\n\nexport type QueryStatisticsResponseRaw<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>> = {\n readonly averageQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly maximumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly minimumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly sumQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantity?: HKQuantity<TIdentifier, TUnit>;\n readonly mostRecentQuantityDateInterval?: { readonly from: string; readonly to: string };\n readonly duration?: HKQuantity<HKQuantityTypeIdentifier, TimeUnit>;\n};\n\nexport enum HKCategoryValueCervicalMucusQuality {\n dry = 1,\n sticky = 2,\n creamy = 3,\n watery = 4,\n eggWhite = 5,\n}\n\nexport enum HKCategoryValueMenstrualFlow {\n unspecified = 1,\n none = 5,\n light = 2,\n medium = 3,\n heavy = 4,\n}\n\nexport enum HKCategoryValueOvulationTestResult {\n negative = 1,\n luteinizingHormoneSurge = 2,\n indeterminate = 3,\n estrogenSurge = 4,\n}\n\nexport enum HKCategoryValueSleepAnalysis {\n inBed = 0,\n asleep = 1,\n awake = 2,\n}\n\nexport enum HKCategoryValueAppetiteChanges {\n decreased = 2,\n increased = 3,\n noChange = 1,\n unspecified = 0,\n}\n\nexport enum HKCategoryValuePresence {\n notPresent = 1,\n present = 0,\n}\n\nexport enum HKCategoryValueSeverity {\n notPresent = 1,\n mild = 2,\n moderate = 3,\n severe = 4,\n unspecified = 0,\n}\n\nexport enum HKCategoryValueNotApplicable {\n notApplicable = 0,\n}\n\nexport type HKCategoryValue =\n HKCategoryValueAppetiteChanges | HKCategoryValueCervicalMucusQuality |\n HKCategoryValueLowCardioFitnessEvent | HKCategoryValueMenstrualFlow |\n HKCategoryValueOvulationTestResult | HKCategoryValuePresence |\n HKCategoryValueSeverity | HKCategoryValueSleepAnalysis | number;\n\nexport enum HKInsulinDeliveryReason {\n basal = 1,\n bolus = 2,\n}\n\nexport type MetadataMapperForQuantityIdentifier<\n TQuantityTypeIdentifier = HKQuantityTypeIdentifier\n> = TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.insulinDelivery\n ? HKGenericMetadata & {\n readonly HKInsulinDeliveryReason: HKInsulinDeliveryReason;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.bloodGlucose\n ? HKGenericMetadata & {\n readonly HKBloodGlucoseMealTime?: number;\n }\n : TQuantityTypeIdentifier extends HKQuantityTypeIdentifier.heartRate\n ? HKGenericMetadata & {\n readonly HKHeartRateMotionContext?: HKHeartRateMotionContext;\n }\n : HKGenericMetadata;\n\nexport type MetadataMapperForCorrelationIdentifier<\n TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier\n> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food\n ? HKGenericMetadata & {\n readonly HKFoodType?: string;\n }\n : HKGenericMetadata;\n\nexport type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit\n : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit\n : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit\n : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit\n : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent\n : T extends HKQuantityTypeIdentifier.basalBodyTemperature | HKQuantityTypeIdentifier.basalBodyTemperature ? TemperatureUnit\n : T extends HKQuantityTypeIdentifier.stairAscentSpeed | HKQuantityTypeIdentifier.stairDescentSpeed | HKQuantityTypeIdentifier.walkingSpeed | HKQuantityTypeIdentifier.walkingSpeed ? SpeedUnit<LengthUnit, TimeUnit>\n : T extends HKQuantityTypeIdentifier.flightsClimbed | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages | HKQuantityTypeIdentifier.numberOfTimesFallen | HKQuantityTypeIdentifier.pushCount | HKQuantityTypeIdentifier.stepCount | HKQuantityTypeIdentifier.swimmingStrokeCount ? HKUnits.Count\n : T extends HKQuantityTypeIdentifier.dietaryBiotin | HKQuantityTypeIdentifier.dietaryCaffeine | HKQuantityTypeIdentifier.dietaryCalcium | HKQuantityTypeIdentifier.dietaryCarbohydrates | HKQuantityTypeIdentifier.dietaryChloride | HKQuantityTypeIdentifier.dietaryCholesterol | HKQuantityTypeIdentifier.dietaryChromium | HKQuantityTypeIdentifier.dietaryCopper | HKQuantityTypeIdentifier.dietaryFatMonounsaturated | HKQuantityTypeIdentifier.dietaryFatPolyunsaturated | HKQuantityTypeIdentifier.dietaryFatSaturated | HKQuantityTypeIdentifier.dietaryFatTotal | HKQuantityTypeIdentifier.dietaryFiber | HKQuantityTypeIdentifier.dietaryFolate | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIodine | HKQuantityTypeIdentifier.dietaryIron | HKQuantityTypeIdentifier.dietaryMagnesium | HKQuantityTypeIdentifier.dietaryManganese | HKQuantityTypeIdentifier.dietaryMolybdenum | HKQuantityTypeIdentifier.dietaryNiacin | HKQuantityTypeIdentifier.dietaryPantothenicAcid | HKQuantityTypeIdentifier.dietaryPhosphorus | HKQuantityTypeIdentifier.dietaryPotassium | HKQuantityTypeIdentifier.dietaryProtein | HKQuantityTypeIdentifier.dietaryRiboflavin | HKQuantityTypeIdentifier.dietarySelenium | HKQuantityTypeIdentifier.dietarySodium | HKQuantityTypeIdentifier.dietarySugar | HKQuantityTypeIdentifier.dietaryThiamin | HKQuantityTypeIdentifier.dietaryVitaminA | HKQuantityTypeIdentifier.dietaryVitaminB6 | HKQuantityTypeIdentifier.dietaryVitaminB12 | HKQuantityTypeIdentifier.dietaryVitaminC | HKQuantityTypeIdentifier.dietaryVitaminD | HKQuantityTypeIdentifier.dietaryVitaminE | HKQuantityTypeIdentifier.dietaryVitaminK | HKQuantityTypeIdentifier.dietaryZinc ? MassUnit\n : T extends HKQuantityTypeIdentifier.dietaryWater ? VolumeUnit\n : T extends HKQuantityTypeIdentifier.insulinDelivery ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}`\n : T extends HKQuantityTypeIdentifier.heartRate | HKQuantityTypeIdentifier.restingHeartRate | HKQuantityTypeIdentifier.walkingHeartRateAverage ? CountPerTime<TimeUnit>\n : HKUnit\n\nexport type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> =\n T extends HKCategoryTypeIdentifier.cervicalMucusQuality\n ? HKCategoryValueCervicalMucusQuality\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKCategoryValueMenstrualFlow\n : T extends HKCategoryTypeIdentifier.ovulationTestResult\n ? HKCategoryValueOvulationTestResult\n : T extends HKCategoryTypeIdentifier.sleepAnalysis\n ? HKCategoryValueSleepAnalysis\n : T extends (HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding\n | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity)\n ? HKCategoryValueNotApplicable\n : T extends (HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.abdominalCramps\n | HKCategoryTypeIdentifier.acne\n | HKCategoryTypeIdentifier.bladderIncontinence\n | HKCategoryTypeIdentifier.bloating| HKCategoryTypeIdentifier.breastPain\n | HKCategoryTypeIdentifier.chestTightnessOrPain| HKCategoryTypeIdentifier.chills| HKCategoryTypeIdentifier.constipation\n | HKCategoryTypeIdentifier.coughing| HKCategoryTypeIdentifier.diarrhea| HKCategoryTypeIdentifier.dizziness| HKCategoryTypeIdentifier.drySkin| HKCategoryTypeIdentifier.fainting\n | HKCategoryTypeIdentifier.fatigue| HKCategoryTypeIdentifier.fever| HKCategoryTypeIdentifier.generalizedBodyAche| HKCategoryTypeIdentifier.hairLoss\n | HKCategoryTypeIdentifier.headache| HKCategoryTypeIdentifier.heartburn\n | HKCategoryTypeIdentifier.hotFlashes| HKCategoryTypeIdentifier.lossOfSmell| HKCategoryTypeIdentifier.lossOfTaste\n | HKCategoryTypeIdentifier.lowerBackPain| HKCategoryTypeIdentifier.memoryLapse| HKCategoryTypeIdentifier.moodChanges\n | HKCategoryTypeIdentifier.nausea| HKCategoryTypeIdentifier.nightSweats| HKCategoryTypeIdentifier.pelvicPain\n | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat| HKCategoryTypeIdentifier.runnyNose\n | HKCategoryTypeIdentifier.shortnessOfBreath| HKCategoryTypeIdentifier.sinusCongestion| HKCategoryTypeIdentifier.skippedHeartbeat\n | HKCategoryTypeIdentifier.soreThroat| HKCategoryTypeIdentifier.vaginalDryness\n | HKCategoryTypeIdentifier.vomiting| HKCategoryTypeIdentifier.wheezing)\n ? HKCategoryValueSeverity\n : T extends (HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges)\n ? HKCategoryValuePresence\n : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult :\n T extends HKCategoryTypeIdentifier.appleStandHour\n ? HKCategoryValueAppleStandHour\n : number;\n\nenum HKCategoryValuePregnancyTestResult {\n positive = 2,\n negative = 1,\n indeterminate = 3\n}\n/* needs further mapping\n\ncontraceptive = 'HKCategoryTypeIdentifierContraceptive',\n lactation = 'HKCategoryTypeIdentifierLactation',\n pregnancy = 'HKCategoryTypeIdentifierPregnancy',\n\n progesteroneTestResult = 'HKCategoryTypeIdentifierProgesteroneTestResult',\n environmentalAudioExposureEvent = 'HKCategoryTypeIdentifierEnvironmentalAudioExposureEvent',\n headphoneAudioExposureEvent = 'HKCategoryTypeIdentifierHeadphoneAudioExposureEvent',\n appleWalkingSteadinessEvent = 'HKCategoryTypeIdentifierAppleWalkingSteadinessEvent',\n handwashingEvent = 'HKCategoryTypeIdentifierHandwashingEvent', // HKCategoryValue */\n\nexport type MetadataMapperForCategoryIdentifier<\n T extends HKCategoryTypeIdentifier\n> = T extends HKCategoryTypeIdentifier.sexualActivity\n ? HKGenericMetadata & {\n readonly HKSexualActivityProtectionUsed: boolean;\n }\n : T extends HKCategoryTypeIdentifier.menstrualFlow\n ? HKGenericMetadata & {\n readonly HKMenstrualCycleStart: boolean;\n }\n : HKGenericMetadata;\n\n// Maps directly to https://developer.apple.com/documentation/healthkit/hkwheelchairuse\nexport enum HKWheelchairUse {\n notSet = 0,\n no = 1,\n yes = 2,\n}\n\n// Unit types are a straight mapping from here https://developer.apple.com/documentation/healthkit/hkunit/1615733-init\nexport enum HKMetricPrefix {\n None = '',\n Pico = 'p',\n Nano = 'n',\n Micro = 'mc',\n Milli = 'm',\n Centi = 'c',\n Deci = 'd',\n Deca = 'da',\n Hecto = 'h',\n Kilo = 'k',\n Mega = 'M',\n Giga = 'G',\n Tera = 'T',\n Femto = 'f',\n}\n\nexport enum HKUnitMetric {\n Gram = 'g',\n Joule = 'J',\n Kelvin = 'K',\n Liter = 'l',\n Meter = 'm',\n Pascal = 'Pa',\n Second = 's',\n Siemen = 'S',\n Hertz = 'Hz',\n Volt = 'V',\n}\n\nexport enum HKUnits {\n\n DecibelHearingLevel = 'dBHL',\n DecibelSoundPressureLevel = 'dBASPL',\n\n Percent = '%',\n Count = 'count',\n InternationalUnit = 'IU',\n\n}\n\nexport type MeterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Meter}`;\nexport type LiterUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Liter}`;\nexport type GramUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Gram}`;\nexport type PascalUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Pascal}`;\nexport type SecondUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Second}`;\nexport type JouleUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Joule}`;\nexport type HertzUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Hertz}`;\nexport type VoltUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Volt}`;\nexport type SiemenUnit<Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}${HKUnitMetric.Siemen}`;\n\n// not 100% sure about these\nexport type MoleUnit<MolarMass extends number> =`mol<${MolarMass}>`;\nexport type MoleUnitWith<MolarMass extends number, Prefix extends HKMetricPrefix = HKMetricPrefix.None> =`${Prefix}mol<${MolarMass}>`;\n\nexport type FrequencyUnit = HertzUnit<HKMetricPrefix>\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\nexport enum UnitOfLength {\n Feet = 'ft',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'cm', 'km'\n */\n Meter = 'm',\n Inches = 'in',\n Yards = 'yd',\n Miles = 'mi',\n}\nexport type LengthUnit = MeterUnit<HKMetricPrefix> | UnitOfLength\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\nexport enum UnitOfVolume {\n ImperialCup = 'cup_imp',\n ImperialFluidOunces = 'fl_oz_imp',\n ImperialPint = 'pt_imp',\n USCup = 'cup_us',\n USFluidOunces = 'fl_oz_us',\n USPint = 'pt_us',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ml', 'cl'\n */\n Liter = 'l',\n}\nexport type VolumeUnit = LiterUnit<HKMetricPrefix> | UnitOfVolume;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport enum UnitOfMass {\n Ounces = 'oz',\n Stones = 'st',\n Pounds = 'lb',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\n Gram = 'g'\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'mg', 'kg'\n */\nexport type MassUnit = GramUnit<HKMetricPrefix> | UnitOfMass\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport enum UnitOfPressure {\n Atmospheres = 'atm',\n CentimetersOfWater = 'cmAq',\n MillimetersOfMercury = 'mmHg',\n InchesOfMercury = 'inHg',\n DecibelAWeightedSoundPressureLevel = 'dBASPL',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\n Pascals = 'Pa',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kPa', 'hPa'\n */\nexport type PressureUnit = PascalUnit<HKMetricPrefix> | UnitOfPressure;\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport enum UnitOfTime {\n Days = 'd',\n Minutes = 'min',\n Hours = 'hr',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\n Seconds = 's',\n}\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'ms'\n */\nexport type TimeUnit = SecondUnit<HKMetricPrefix> | UnitOfTime\nexport enum TemperatureUnit {\n DegreesCelsius = 'degC',\n DegreesFahrenheit = 'degF',\n Kelvin = 'K',\n}\n\n/**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\nexport enum UnitOfEnergy {\n Kilocalories = 'kcal',\n LargeCalories = 'Cal',\n SmallCalories = 'cal',\n /**\n * More SI prefixes also available as literals, just type the string\n * @example 'kJ'\n */\n Joules = 'J',\n}\nexport type EnergyUnit = JouleUnit<HKMetricPrefix> | UnitOfEnergy\nexport enum BloodGlucoseUnit {\n GlucoseMmolPerL = 'mmol<180.15588000005408>/l',\n GlucoseMgPerDl = 'mg/dL',\n}\n\nexport type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> =`${TLength}/${TTime}`;\nexport type CountPerTime<TTime extends TimeUnit> =`count/${TTime}`;\n\nexport type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit\n| `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${FrequencyUnit}` | `${HKUnits}` | `${LengthUnit}` | `${MassUnit}` | `${PressureUnit}` | `${TemperatureUnit}` | `${TimeUnit}` | `${VolumeUnit}`;\n\nexport type HKDevice = {\n readonly name: string; // ex: \"Apple Watch\"\n readonly firmwareVersion: string | null;\n readonly hardwareVersion: string; // ex: \"Watch6,2\",\n readonly localIdentifier: string | null;\n readonly manufacturer: string; // ex: \"Apple Inc.\"\n readonly model: string; // ex: \"Watch\"\n readonly softwareVersion: string; // ex: \"9.0\"\n};\n\nexport type HKSource = {\n readonly name: string;\n readonly bundleIdentifier: string;\n};\n\nexport type HKSourceRevision = {\n readonly source: HKSource;\n readonly version: string;\n readonly operatingSystemVersion?: string;\n readonly productType?: string;\n};\n\nexport type HKQuantitySampleRaw<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TQuantityIdentifier;\n readonly startDate: string;\n readonly endDate: string;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata: MetadataMapperForQuantityIdentifier<TQuantityIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKQuantitySampleRawForSaving<\n TQuantityIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TQuantityIdentifier> = UnitForIdentifier<TQuantityIdentifier>,\n> = Omit<\nHKQuantitySampleRaw<TQuantityIdentifier, TUnit>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKCategorySampleRawForSaving<\n TCategory extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier,\n> = Omit<\nHKCategorySampleRaw<TCategory>,\n'device' | 'endDate' | 'startDate' | 'uuid'\n>\n\nexport type HKWorkoutRaw<TEnergy extends EnergyUnit, TDistance extends LengthUnit> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly workoutActivityType: HKWorkoutActivityType;\n readonly duration: number;\n readonly totalDistance?: HKQuantity<HKQuantityTypeIdentifier, TDistance>;\n readonly totalEnergyBurned?: HKQuantity<HKQuantityTypeIdentifier, TEnergy>;\n readonly totalSwimmingStrokeCount?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly totalFlightsClimbed?: HKQuantity<HKQuantityTypeIdentifier, HKUnits.Count>;\n readonly startDate: string;\n readonly endDate: string;\n readonly metadata?: HKWorkoutMetadata;\n readonly sourceRevision?: HKSourceRevision;\n};\n\n// Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier\nexport enum HKCharacteristicTypeIdentifier {\n fitzpatrickSkinType = 'HKCharacteristicTypeIdentifierFitzpatrickSkinType',\n biologicalSex = 'HKCharacteristicTypeIdentifierBiologicalSex',\n bloodType = 'HKCharacteristicTypeIdentifierBloodType',\n dateOfBirth = 'HKCharacteristicTypeIdentifierDateOfBirth',\n wheelchairUse = 'HKCharacteristicTypeIdentifierWheelchairUse',\n activityMoveMode = 'HKCharacteristicTypeIdentifierActivityMoveMode', // HKActivityMoveModeObject\n}\n\nexport type WritePermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type ReadPermissions = {\n readonly [key in HKCategoryTypeIdentifier | HKCharacteristicTypeIdentifier | HKQuantityTypeIdentifier]: boolean;\n};\n\nexport type HKCategorySampleRaw<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> = {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly categoryType: T;\n readonly startDate: string;\n readonly endDate: string;\n readonly value: HKCategoryValueForIdentifier<T>;\n readonly metadata: MetadataMapperForCategoryIdentifier<T>;\n readonly sourceRevision?: HKSourceRevision;\n};\n\nexport type HKCorrelationRaw<TIdentifier extends HKCorrelationTypeIdentifier> =\n {\n readonly correlationType: HKCorrelationTypeIdentifier;\n readonly objects: readonly (HKCategorySampleRaw | HKQuantitySampleRaw)[];\n readonly metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n readonly startDate: string;\n readonly endDate: string;\n };\n\ntype QueryId = string;\n\nexport enum HKUpdateFrequency {\n immediate = 1,\n hourly = 2,\n daily = 3,\n weekly = 4,\n}\n\nexport type WorkoutLocation = {\n readonly longitude: number;\n readonly latitude: number;\n readonly altitude: number;\n readonly speed: number;\n readonly timestamp: number;\n readonly horizontalAccuracy: number;\n readonly speedAccuracy: number;\n readonly verticalAccuracy: number;\n};\n\nexport type WorkoutRoute = {\n readonly locations: readonly WorkoutLocation[];\n readonly HKMetadataKeySyncIdentifier?: string;\n readonly HKMetadataKeySyncVersion?: number;\n};\n\ntype ReactNativeHealthkitTypeNative = {\n isHealthDataAvailable(): Promise<boolean>;\n getBloodType(): Promise<HKBloodType>;\n getDateOfBirth(): Promise<string>;\n getBiologicalSex(): Promise<HKBiologicalSex>;\n getFitzpatrickSkinType(): Promise<HKFitzpatrickSkinType>;\n readonly getWheelchairUse: () => Promise<HKWheelchairUse>;\n\n readonly enableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n updateFrequency: HKUpdateFrequency\n ) => Promise<boolean>;\n readonly disableBackgroundDelivery: (\n typeIdentifier: HKSampleTypeIdentifier,\n ) => Promise<boolean>;\n readonly disableAllBackgroundDelivery: () => Promise<boolean>;\n\n readonly saveCorrelationSample: <TIdentifier extends HKCorrelationTypeIdentifier, TSamples extends readonly (HKCategorySampleRawForSaving | HKQuantitySampleRawForSaving)[]>(\n typeIdentifier: TIdentifier,\n samples: TSamples,\n start: string,\n end: string,\n metadata: MetadataMapperForCorrelationIdentifier<TIdentifier>\n ) => Promise<boolean>;\n\n readonly saveWorkoutSample: (\n typeIdentifier: HKWorkoutActivityType,\n quantities: readonly HKQuantitySampleRawForSaving[],\n start: string,\n end: string,\n metadata: HKWorkoutMetadata\n ) => Promise<boolean>;\n\n readonly queryCorrelationSamples: <TIdentifier extends HKCorrelationTypeIdentifier>(\n typeIdentifier: TIdentifier,\n from: string,\n to: string\n ) => Promise<readonly HKCorrelationRaw<TIdentifier>[]>;\n\n subscribeToObserverQuery(\n identifier: HKSampleTypeIdentifier\n ): Promise<QueryId>;\n unsubscribeQuery(queryId: QueryId): Promise<boolean>;\n authorizationStatusFor(\n type: HealthkitReadAuthorization\n ): Promise<boolean>;\n getRequestStatusForAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<HKAuthorizationRequestStatus>;\n requestAuthorization(\n write: WritePermissions,\n read: ReadPermissions\n ): Promise<boolean>;\n readonly saveQuantitySample: <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>> (\n identifier: TType,\n unit: TUnit,\n value: number,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly deleteQuantitySample: <TIdentifier extends HKQuantityTypeIdentifier>(\n typeIdentifier: TIdentifier,\n uuid: string\n ) => Promise<boolean>;\n readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(\n energyUnit: TEnergy,\n distanceUnit: TDistance,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;\n readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKCategorySampleRaw<T>[]>;\n readonly queryQuantitySamples: <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>,\n >(\n identifier: TIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n limit: number,\n ascending: boolean\n ) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;\n readonly saveCategorySample: <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n start: string,\n end: string,\n metadata: unknown\n ) => Promise<boolean>;\n readonly queryStatisticsForQuantity: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(\n identifier: HKQuantityTypeIdentifier,\n unit: TUnit,\n from: string,\n to: string,\n options: readonly HKStatisticsOptions[]\n ) => Promise<QueryStatisticsResponseRaw<TIdentifier, TUnit>>;\n readonly getPreferredUnits: (\n identifiers: readonly HKQuantityTypeIdentifier[]\n ) => Promise<TypeToUnitMapping>;\n readonly getWorkoutRoutes: (workoutUUID: string) => Promise<readonly WorkoutRoute[]>;\n};\n\nconst Native = NativeModules.ReactNativeHealthkit as ReactNativeHealthkitTypeNative\n\ntype OnChangeCallback = ({\n typeIdentifier,\n}: {\n readonly typeIdentifier: HKSampleTypeIdentifier;\n}) => void;\n\ninterface HealthkitEventEmitter extends NativeEventEmitter {\n readonly addListener: (\n eventType: 'onChange',\n callback: OnChangeCallback\n ) => EmitterSubscription;\n}\n\nexport const EventEmitter = new NativeEventEmitter(\n NativeModules.ReactNativeHealthkit,\n) as HealthkitEventEmitter\n\nexport default Native\n"],"mappings":"AAAA,SACEA,kBADF,EAEEC,aAFF,QAGO,cAHP;AAOA,OAAO,MAAMC,uBAAuB,GAAG,yBAAhC;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A,gB;GAAAA,gB,KAAAA,gB;;AA8EZ;AACA,WAAYC,8BAAZ;;WAAYA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;EAAAA,8B;GAAAA,8B,KAAAA,8B;;AAyCZ,WAAYC,iBAAZ;;WAAYA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;EAAAA,iB,CAAAA,iB;GAAAA,iB,KAAAA,iB;;AAwIZ,MAAMC,MAAM,GAAG5C,aAAa,CAAC6C,oBAA7B;AAeA,OAAO,MAAMC,YAAY,GAAG,IAAI/C,kBAAJ,CAC1BC,aAAa,CAAC6C,oBADY,CAArB;AAIP,eAAeD,MAAf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Native","deleteQuantitySample","identifier","uuid"],"sources":["deleteQuantitySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier } from '../native-types'\n\nexport type DeleteQuantitySampleFn = <\n TIdentifier extends HKQuantityTypeIdentifier\n>(\n identifier: TIdentifier,\n uuid: string\n) => Promise<boolean>\n\nconst deleteQuantitySample: DeleteQuantitySampleFn = async (identifier, uuid) => Native.deleteQuantitySample(identifier, uuid)\n\nexport default deleteQuantitySample\n"],"mappings":"AAAA,OAAOA,MAAP,MAAmB,iBAAnB;;AAWA,MAAMC,oBAA4C,GAAG,OAAOC,UAAP,EAAmBC,IAAnB,KAA4BH,MAAM,CAACC,oBAAP,CAA4BC,UAA5B,EAAwCC,IAAxC,CAAjF;;AAEA,eAAeF,oBAAf"}
|
|
@@ -34,6 +34,7 @@ declare const Healthkit: {
|
|
|
34
34
|
queryStatisticsForQuantity: typeof queryStatisticsForQuantity;
|
|
35
35
|
queryWorkouts: typeof queryWorkouts;
|
|
36
36
|
requestAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<boolean>;
|
|
37
|
+
deleteQuantitySample: import("./utils/deleteQuantitySample").DeleteQuantitySampleFn;
|
|
37
38
|
saveCategorySample: typeof saveCategorySample;
|
|
38
39
|
saveCorrelationSample: typeof saveCorrelationSample;
|
|
39
40
|
saveQuantitySample: typeof saveQuantitySample;
|
|
@@ -746,6 +746,7 @@ declare type ReactNativeHealthkitTypeNative = {
|
|
|
746
746
|
getRequestStatusForAuthorization(write: WritePermissions, read: ReadPermissions): Promise<HKAuthorizationRequestStatus>;
|
|
747
747
|
requestAuthorization(write: WritePermissions, read: ReadPermissions): Promise<boolean>;
|
|
748
748
|
readonly saveQuantitySample: <TType extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TType> = UnitForIdentifier<TType>>(identifier: TType, unit: TUnit, value: number, start: string, end: string, metadata: unknown) => Promise<boolean>;
|
|
749
|
+
readonly deleteQuantitySample: <TIdentifier extends HKQuantityTypeIdentifier>(typeIdentifier: TIdentifier, uuid: string) => Promise<boolean>;
|
|
749
750
|
readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(energyUnit: TEnergy, distanceUnit: TDistance, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKWorkoutRaw<TEnergy, TDistance>[]>;
|
|
750
751
|
readonly queryCategorySamples: <T extends HKCategoryTypeIdentifier>(identifier: T, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKCategorySampleRaw<T>[]>;
|
|
751
752
|
readonly queryQuantitySamples: <TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier>>(identifier: TIdentifier, unit: TUnit, from: string, to: string, limit: number, ascending: boolean) => Promise<readonly HKQuantitySampleRaw<TIdentifier, TUnit>[]>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HKQuantityTypeIdentifier } from '../native-types';
|
|
2
|
+
export declare type DeleteQuantitySampleFn = <TIdentifier extends HKQuantityTypeIdentifier>(identifier: TIdentifier, uuid: string) => Promise<boolean>;
|
|
3
|
+
declare const deleteQuantitySample: DeleteQuantitySampleFn;
|
|
4
|
+
export default deleteQuantitySample;
|
package/package.json
CHANGED
package/src/index.ios.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'
|
|
|
5
5
|
import useMostRecentWorkout from './hooks/useMostRecentWorkout'
|
|
6
6
|
import useSubscribeToChanges from './hooks/useSubscribeToChanges'
|
|
7
7
|
import Native from './native-types'
|
|
8
|
+
import deleteQuantitySample from './utils/deleteQuantitySample'
|
|
8
9
|
import getDateOfBirth from './utils/getDateOfBirth'
|
|
9
10
|
import getMostRecentCategorySample from './utils/getMostRecentCategorySample'
|
|
10
11
|
import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'
|
|
@@ -60,6 +61,9 @@ const Healthkit = {
|
|
|
60
61
|
|
|
61
62
|
requestAuthorization,
|
|
62
63
|
|
|
64
|
+
// delete methods
|
|
65
|
+
deleteQuantitySample,
|
|
66
|
+
|
|
63
67
|
// save methods
|
|
64
68
|
saveCategorySample,
|
|
65
69
|
saveCorrelationSample,
|
package/src/index.tsx
CHANGED
|
@@ -54,6 +54,7 @@ const Healthkit: typeof ReactNativeHealthkit = {
|
|
|
54
54
|
})),
|
|
55
55
|
queryWorkouts: UnavailableFn(Promise.resolve([])),
|
|
56
56
|
requestAuthorization: UnavailableFn(Promise.resolve(false)),
|
|
57
|
+
deleteQuantitySample: UnavailableFn(Promise.resolve(false)),
|
|
57
58
|
saveCategorySample: UnavailableFn(Promise.resolve(false)),
|
|
58
59
|
saveCorrelationSample: UnavailableFn(Promise.resolve(false)),
|
|
59
60
|
saveQuantitySample: UnavailableFn(Promise.resolve(false)),
|
package/src/native-types.ts
CHANGED
|
@@ -1002,6 +1002,10 @@ type ReactNativeHealthkitTypeNative = {
|
|
|
1002
1002
|
end: string,
|
|
1003
1003
|
metadata: unknown
|
|
1004
1004
|
) => Promise<boolean>;
|
|
1005
|
+
readonly deleteQuantitySample: <TIdentifier extends HKQuantityTypeIdentifier>(
|
|
1006
|
+
typeIdentifier: TIdentifier,
|
|
1007
|
+
uuid: string
|
|
1008
|
+
) => Promise<boolean>;
|
|
1005
1009
|
readonly queryWorkoutSamples: <TEnergy extends EnergyUnit, TDistance extends LengthUnit>(
|
|
1006
1010
|
energyUnit: TEnergy,
|
|
1007
1011
|
distanceUnit: TDistance,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Native from '../native-types'
|
|
2
|
+
|
|
3
|
+
import type { HKQuantityTypeIdentifier } from '../native-types'
|
|
4
|
+
|
|
5
|
+
export type DeleteQuantitySampleFn = <
|
|
6
|
+
TIdentifier extends HKQuantityTypeIdentifier
|
|
7
|
+
>(
|
|
8
|
+
identifier: TIdentifier,
|
|
9
|
+
uuid: string
|
|
10
|
+
) => Promise<boolean>
|
|
11
|
+
|
|
12
|
+
const deleteQuantitySample: DeleteQuantitySampleFn = async (identifier, uuid) => Native.deleteQuantitySample(identifier, uuid)
|
|
13
|
+
|
|
14
|
+
export default deleteQuantitySample
|