@kingstinct/react-native-healthkit 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.ios.js +31 -1
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +49 -36
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-types.js +120 -107
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/index.ios.js +32 -2
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +50 -36
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-types.js +115 -104
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/native-types.d.ts +333 -107
- package/lib/typescript/src/types.d.ts +13 -9
- package/package.json +2 -1
- package/src/index.ios.tsx +43 -7
- package/src/index.tsx +53 -36
- package/src/native-types.ts +134 -132
- package/src/types.ts +19 -10
|
@@ -208,6 +208,8 @@ function useSubscribeToChanges(identifier, onChange) {
|
|
|
208
208
|
}, [identifier, onChange]);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
useSubscribeToChanges(_nativeTypes.HKCategoryTypeIdentifier.appleStandHour, () => {});
|
|
212
|
+
|
|
211
213
|
function useMostRecentCategorySample(identifier) {
|
|
212
214
|
const [category, setCategory] = (0, _react.useState)(null);
|
|
213
215
|
const updater = (0, _react.useCallback)(() => {
|
|
@@ -411,7 +413,35 @@ const Healthkit = {
|
|
|
411
413
|
useMostRecentCategorySample,
|
|
412
414
|
useMostRecentQuantitySample,
|
|
413
415
|
useMostRecentWorkout,
|
|
414
|
-
useSubscribeToChanges
|
|
416
|
+
useSubscribeToChanges,
|
|
417
|
+
useIsHealthDataAvailable: () => {
|
|
418
|
+
const [isAvailable, setIsAvailable] = (0, _react.useState)(null);
|
|
419
|
+
(0, _react.useEffect)(() => {
|
|
420
|
+
const init = async () => {
|
|
421
|
+
const res = await _nativeTypes.default.isHealthDataAvailable();
|
|
422
|
+
setIsAvailable(res);
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
void init();
|
|
426
|
+
}, []);
|
|
427
|
+
return isAvailable;
|
|
428
|
+
},
|
|
429
|
+
useHealthkitAuthorization: (read, write) => {
|
|
430
|
+
const [status, setStatus] = (0, _react.useState)(null);
|
|
431
|
+
const refreshAuthStatus = (0, _react.useCallback)(async () => {
|
|
432
|
+
const auth = await getRequestStatusForAuthorization(read, write);
|
|
433
|
+
setStatus(auth);
|
|
434
|
+
return auth;
|
|
435
|
+
}, []);
|
|
436
|
+
const request = (0, _react.useCallback)(async () => {
|
|
437
|
+
await requestAuthorization(read, write);
|
|
438
|
+
return refreshAuthStatus();
|
|
439
|
+
}, []);
|
|
440
|
+
(0, _react.useEffect)(() => {
|
|
441
|
+
void refreshAuthStatus();
|
|
442
|
+
}, []);
|
|
443
|
+
return [status, request];
|
|
444
|
+
}
|
|
415
445
|
};
|
|
416
446
|
var _default = Healthkit;
|
|
417
447
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getPreferredUnit","type","unit","getPreferredUnits","ensureUnit","providedUnit","Native","deserializeSample","sample","startDate","Date","endDate","deserializeWorkout","deserializCategorySample","serializeDate","date","toISOString","prepareOptions","options","limit","Infinity","ascending","from","to","queryQuantitySamples","identifier","opts","quantitySamples","map","getPreferredUnitsTyped","energyUnit","distanceUnit","units","HKQuantityTypeIdentifier","distanceWalkingRunning","activeEnergyBurned","HKUnit","Kilocalories","Meters","subscribeToChanges","callback","subscription","EventEmitter","addListener","typeIdentifier","queryId","subscribeToObserverQuery","catch","error","remove","Promise","reject","unsubscribeQuery","getMostRecentQuantitySample","samples","useMostRecentWorkout","workout","setWorkout","useState","useEffect","cancelSubscription","init","w","getMostRecentWorkout","getMostRecentCategorySample","queryCategorySamples","useSubscribeToChanges","onChange","useMostRecentCategorySample","category","setCategory","updater","useCallback","then","useMostRecentQuantitySample","lastSample","setLastSample","actualUnit","value","saveQuantitySample","start","end","metadata","queryStatisticsForQuantity","toDate","mostRecentQuantityDateInterval","rawResponse","response","requestAuthorization","read","write","readPermissions","reduce","obj","cur","writePermissions","getDateOfBirth","dateOfBirth","getRequestStatusForAuthorization","results","queryWorkouts","workouts","queryWorkoutSamples","saveCategorySample","identifiers","i","buildUnitWithPrefix","prefix","deserializeCorrelation","s","objects","o","quantity","undefined","ensureMetadata","queryCorrelationSamples","correlations","saveCorrelationSample","saveWorkoutSample","quantities","_start","getWorkoutRoutes","workoutUUID","Healthkit","authorizationStatusFor","bind","isHealthDataAvailable","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType"],"sources":["index.ios.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\n\nimport Native, {\n EventEmitter,\n HKQuantityTypeIdentifier,\n HKUnit,\n} from './native-types'\n\nimport type {\n HKCategorySampleRaw,\n HKCategoryTypeIdentifier,\n HKCategoryValueForIdentifier,\n HKCharacteristicTypeIdentifier,\n HKCorrelationRaw,\n HKCorrelationTypeIdentifier,\n HKQuantitySampleRaw,\n HKSampleTypeIdentifier,\n HKUnitSI,\n HKUnitSIPrefix,\n HKWorkoutRaw,\n MetadataMapperForCategoryIdentifier,\n ReadPermissions,\n WritePermissions,\n} from './native-types'\nimport type {\n GenericQueryOptions,\n GetMostRecentCategorySampleFn,\n GetMostRecentQuantitySampleFn,\n GetMostRecentWorkoutFn,\n GetPreferredUnitFn,\n GetPreferredUnitsFn,\n GetWorkoutRoutesFn,\n HKCategorySample,\n HKCorrelation,\n HKQuantitySample,\n HKWorkout,\n QueryCategorySamplesFn,\n QueryCorrelationSamplesFn,\n QueryQuantitySamplesFn,\n QueryStatisticsForQuantityFn,\n QueryWorkoutsFn,\n ReactNativeHealthkit,\n SaveCorrelationSampleFn,\n SaveQuantitySampleFn,\n SaveWorkoutSampleFn,\n SubscribeToChangesFn,\n} from './types'\n\nconst getPreferredUnit: GetPreferredUnitFn = async (type) => {\n const [unit] = await getPreferredUnits([type])\n return unit\n}\n\nconst ensureUnit = async <TUnit extends HKUnit>(\n type: HKQuantityTypeIdentifier,\n providedUnit?: TUnit,\n) => {\n if (providedUnit) {\n return providedUnit\n }\n const unit = await Native.getPreferredUnits([type])\n return unit[type] as TUnit\n}\n\nfunction deserializeSample<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends HKUnit\n>(\n sample: HKQuantitySampleRaw<TIdentifier, TUnit>,\n): HKQuantitySample<TIdentifier, TUnit> {\n return {\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n }\n}\n\nfunction deserializeWorkout<TEnergy extends HKUnit, TDistance extends HKUnit>(\n sample: HKWorkoutRaw<TEnergy, TDistance>,\n): HKWorkout<TEnergy, TDistance> {\n return {\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n }\n}\n\nconst deserializCategorySample = <T extends HKCategoryTypeIdentifier>(\n sample: HKCategorySampleRaw<T>,\n): HKCategorySample<T> => ({\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n})\n\nconst serializeDate = (date?: Date | null): string => (date ? date.toISOString() : new Date(0).toISOString())\n\nconst prepareOptions = (options: GenericQueryOptions) => {\n const limit = !options.limit || options.limit === Infinity ? 0 : options.limit\n const ascending = options.ascending ?? limit === 0\n const from = serializeDate(options.from)\n const to = serializeDate(options.to)\n return {\n limit, ascending, from, to,\n }\n}\n\nconst queryQuantitySamples: QueryQuantitySamplesFn = async (\n identifier,\n options,\n) => {\n const unit = await ensureUnit(identifier, options.unit)\n const opts = prepareOptions(options)\n\n const quantitySamples = await Native.queryQuantitySamples(\n identifier,\n unit,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return quantitySamples.map(deserializeSample)\n}\n\nasync function getPreferredUnitsTyped<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n>(options?: { readonly energyUnit?: TEnergy; readonly distanceUnit?: TDistance }) {\n let energyUnit = options?.energyUnit\n let distanceUnit = options?.distanceUnit\n if (!energyUnit || !distanceUnit) {\n const units = await Native.getPreferredUnits([\n HKQuantityTypeIdentifier.distanceWalkingRunning,\n HKQuantityTypeIdentifier.activeEnergyBurned,\n ])\n if (!energyUnit) {\n energyUnit = units[HKQuantityTypeIdentifier.distanceWalkingRunning] as\n | TEnergy\n | undefined\n }\n if (!distanceUnit) {\n distanceUnit = units[HKQuantityTypeIdentifier.activeEnergyBurned] as\n | TDistance\n | undefined\n }\n }\n if (!energyUnit) {\n energyUnit = HKUnit.Kilocalories as TEnergy\n }\n if (!distanceUnit) {\n distanceUnit = HKUnit.Meters as TDistance\n }\n return { energyUnit, distanceUnit }\n}\n\nconst subscribeToChanges: SubscribeToChangesFn = async (\n identifier,\n callback,\n) => {\n const subscription = EventEmitter.addListener(\n 'onChange',\n ({ typeIdentifier }) => {\n if (typeIdentifier === identifier) {\n callback()\n }\n },\n )\n\n const queryId = await Native.subscribeToObserverQuery(identifier).catch(\n async (error) => {\n subscription.remove()\n return Promise.reject(error)\n },\n )\n\n return async () => {\n subscription.remove()\n return Native.unsubscribeQuery(queryId)\n }\n}\n\nconst getMostRecentQuantitySample: GetMostRecentQuantitySampleFn = async (\n identifier,\n unit,\n) => {\n const samples = await queryQuantitySamples(identifier, {\n limit: 1,\n unit,\n })\n return samples[0]\n}\n\nfunction useMostRecentWorkout<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n>(options?: { readonly energyUnit?: TEnergy; readonly distanceUnit?: TDistance }) {\n const [workout, setWorkout] = useState<HKWorkout<TEnergy, TDistance> | null>(\n null,\n )\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n const { energyUnit, distanceUnit } = await getPreferredUnitsTyped(\n options,\n )\n\n cancelSubscription = await subscribeToChanges(\n 'HKWorkoutTypeIdentifier',\n async () => {\n const w = await getMostRecentWorkout({ energyUnit, distanceUnit })\n setWorkout(w)\n },\n )\n }\n void init()\n return () => {\n void cancelSubscription?.()\n }\n }, [options])\n return workout\n}\n\nconst getMostRecentCategorySample: GetMostRecentCategorySampleFn = async (\n identifier,\n) => {\n const samples = await queryCategorySamples(identifier, {\n limit: 1,\n ascending: false,\n })\n\n return samples[0]\n}\n\nfunction useSubscribeToChanges<TIdentifier extends HKSampleTypeIdentifier>(\n identifier: TIdentifier,\n onChange: () => void,\n): void {\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n cancelSubscription = await subscribeToChanges(identifier, onChange)\n }\n void init()\n\n return () => {\n void cancelSubscription?.()\n }\n }, [identifier, onChange])\n}\n\nfunction useMostRecentCategorySample<\n TCategory extends HKCategoryTypeIdentifier\n>(identifier: TCategory) {\n const [category, setCategory] = useState<HKCategorySample<TCategory> | null>(\n null,\n )\n const updater = useCallback(() => {\n void getMostRecentCategorySample(identifier).then(setCategory)\n }, [identifier])\n\n useSubscribeToChanges(identifier, updater)\n\n return category\n}\n\nfunction useMostRecentQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends HKUnit = HKUnit\n>(identifier: TIdentifier, unit?: TUnit) {\n const [lastSample, setLastSample] = useState<HKQuantitySample<\n TIdentifier,\n TUnit\n > | null>(null)\n\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n const actualUnit = await ensureUnit(identifier, unit)\n\n cancelSubscription = await subscribeToChanges(identifier, async () => {\n const value = await getMostRecentQuantitySample(identifier, actualUnit)\n setLastSample(value)\n })\n }\n void init()\n\n return () => {\n void cancelSubscription?.()\n }\n }, [identifier, unit])\n\n return lastSample\n}\n\nconst saveQuantitySample: SaveQuantitySampleFn = async (\n identifier,\n unit,\n value,\n options,\n) => {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveQuantitySample(\n identifier,\n unit,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata,\n )\n}\n\nconst queryStatisticsForQuantity: QueryStatisticsForQuantityFn = async (\n identifier,\n options,\n from,\n to,\n unit,\n) => {\n const actualUnit = await ensureUnit(identifier, unit)\n const toDate = to || new Date()\n const { mostRecentQuantityDateInterval, ...rawResponse } = await Native.queryStatisticsForQuantity(\n identifier,\n actualUnit,\n from.toISOString(),\n toDate.toISOString(),\n options,\n )\n\n const response = {\n ...rawResponse,\n ...(mostRecentQuantityDateInterval\n ? {\n mostRecentQuantityDateInterval: {\n from: new Date(mostRecentQuantityDateInterval.from),\n to: new Date(mostRecentQuantityDateInterval.to),\n },\n }\n : {}),\n }\n\n return response\n}\n\nconst requestAuthorization = async (\n read: readonly (HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier)[],\n write: readonly HKSampleTypeIdentifier[] = [],\n): Promise<boolean> => {\n const readPermissions = read.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as ReadPermissions)\n\n const writePermissions = write.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as WritePermissions)\n\n return Native.requestAuthorization(writePermissions, readPermissions)\n}\n\nconst getDateOfBirth = async () => {\n const dateOfBirth = await Native.getDateOfBirth()\n return new Date(dateOfBirth)\n}\n\nconst getRequestStatusForAuthorization = async (\n read: readonly (HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier)[],\n write: readonly HKSampleTypeIdentifier[] = [],\n) => {\n const readPermissions = read.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as ReadPermissions)\n\n const writePermissions = write.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as WritePermissions)\n\n return Native.getRequestStatusForAuthorization(\n writePermissions,\n readPermissions,\n )\n}\n\nconst queryCategorySamples: QueryCategorySamplesFn = async (\n identifier,\n options,\n) => {\n const opts = prepareOptions(options)\n const results = await Native.queryCategorySamples(\n identifier,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return results.map(deserializCategorySample)\n}\n\nconst queryWorkouts: QueryWorkoutsFn = async (options) => {\n const { energyUnit, distanceUnit } = await getPreferredUnitsTyped(options)\n const opts = prepareOptions(options)\n\n const workouts = await Native.queryWorkoutSamples(\n energyUnit,\n distanceUnit,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return workouts.map(deserializeWorkout)\n}\n\nconst getMostRecentWorkout: GetMostRecentWorkoutFn = async (options) => {\n const workouts = await queryWorkouts({\n limit: 1,\n ascending: false,\n energyUnit: options?.energyUnit,\n distanceUnit: options?.distanceUnit,\n })\n\n return workouts[0]\n}\n\nasync function saveCategorySample<T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCategoryIdentifier<T>;\n },\n) {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveCategorySample(\n identifier,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata || {},\n )\n}\n\nconst getPreferredUnits: GetPreferredUnitsFn = async (identifiers) => {\n const units = await Native.getPreferredUnits(identifiers)\n return identifiers.map((i) => units[i])\n}\n\nconst buildUnitWithPrefix = (prefix: HKUnitSIPrefix, unit: HKUnitSI) => `${prefix}${unit}` as HKUnit\n\nfunction deserializeCorrelation<\n TIdentifier extends HKCorrelationTypeIdentifier\n>(s: HKCorrelationRaw<TIdentifier>): HKCorrelation<TIdentifier> {\n return {\n ...s,\n objects: s.objects.map((o) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (o.quantity !== undefined) {\n return deserializeSample(o as HKQuantitySampleRaw)\n }\n\n return deserializCategorySample(o as HKCategorySampleRaw)\n }),\n endDate: new Date(s.endDate),\n startDate: new Date(s.startDate),\n }\n}\n\nfunction ensureMetadata<TMetadata>(metadata?: TMetadata) {\n return metadata || ({} as TMetadata)\n}\n\nconst queryCorrelationSamples: QueryCorrelationSamplesFn = async (\n typeIdentifier,\n options,\n) => {\n const opts = prepareOptions(options)\n const correlations = await Native.queryCorrelationSamples(\n typeIdentifier,\n opts.from,\n opts.to,\n )\n\n return correlations.map(deserializeCorrelation)\n}\n\nconst saveCorrelationSample: SaveCorrelationSampleFn = async (\n typeIdentifier,\n samples,\n options,\n) => {\n const start = (options?.start || new Date()).toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveCorrelationSample(\n typeIdentifier,\n samples,\n start,\n end,\n ensureMetadata(options?.metadata),\n )\n}\n\nconst saveWorkoutSample: SaveWorkoutSampleFn = async (\n typeIdentifier,\n quantities,\n _start,\n options,\n) => {\n const start = _start.toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveWorkoutSample(\n typeIdentifier,\n quantities,\n start,\n end,\n ensureMetadata(options?.metadata),\n )\n}\n\nconst getWorkoutRoutes: GetWorkoutRoutesFn = async (workoutUUID: string) => Native.getWorkoutRoutes(workoutUUID)\n\nconst Healthkit: ReactNativeHealthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n\n buildUnitWithPrefix,\n\n disableAllBackgroundDelivery: Native.disableAllBackgroundDelivery,\n disableBackgroundDelivery: Native.disableBackgroundDelivery,\n enableBackgroundDelivery: Native.enableBackgroundDelivery,\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse,\n getBloodType: Native.getBloodType.bind(Native),\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n getWorkoutRoutes,\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\nexport * from './native-types'\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;AAokBA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;;;AAvhBA,MAAMA,gBAAoC,GAAG,MAAOC,IAAP,IAAgB;EAC3D,MAAM,CAACC,IAAD,IAAS,MAAMC,iBAAiB,CAAC,CAACF,IAAD,CAAD,CAAtC;EACA,OAAOC,IAAP;AACD,CAHD;;AAKA,MAAME,UAAU,GAAG,OACjBH,IADiB,EAEjBI,YAFiB,KAGd;EACH,IAAIA,YAAJ,EAAkB;IAChB,OAAOA,YAAP;EACD;;EACD,MAAMH,IAAI,GAAG,MAAMI,oBAAA,CAAOH,iBAAP,CAAyB,CAACF,IAAD,CAAzB,CAAnB;EACA,OAAOC,IAAI,CAACD,IAAD,CAAX;AACD,CATD;;AAWA,SAASM,iBAAT,CAIEC,MAJF,EAKwC;EACtC,OAAO,EACL,GAAGA,MADE;IAELC,SAAS,EAAE,IAAIC,IAAJ,CAASF,MAAM,CAACC,SAAhB,CAFN;IAGLE,OAAO,EAAE,IAAID,IAAJ,CAASF,MAAM,CAACG,OAAhB;EAHJ,CAAP;AAKD;;AAED,SAASC,kBAAT,CACEJ,MADF,EAEiC;EAC/B,OAAO,EACL,GAAGA,MADE;IAELC,SAAS,EAAE,IAAIC,IAAJ,CAASF,MAAM,CAACC,SAAhB,CAFN;IAGLE,OAAO,EAAE,IAAID,IAAJ,CAASF,MAAM,CAACG,OAAhB;EAHJ,CAAP;AAKD;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vH,oBAAlC,CAHe;EAKtCoG,mBALsC;EAOtCqB,4BAA4B,EAAEzH,oBAAA,CAAOyH,4BAPC;EAQtCC,yBAAyB,EAAE1H,oBAAA,CAAO0H,yBARI;EAStCC,wBAAwB,EAAE3H,oBAAA,CAAO2H,wBATK;EAWtC;EACAC,gBAAgB,EAAE5H,oBAAA,CAAO4H,gBAAP,CAAwBL,IAAxB,CAA6BvH,oBAA7B,CAZoB;EAatC6H,sBAAsB,EAAE7H,oBAAA,CAAO6H,sBAAP,CAA8BN,IAA9B,CAAmCvH,oBAAnC,CAbc;EActC8H,gBAAgB,EAAE9H,oBAAA,CAAO8H,gBAda;EAetCC,YAAY,EAAE/H,oBAAA,CAAO+H,YAAP,CAAoBR,IAApB,CAAyBvH,oBAAzB,CAfwB;EAgBtC0F,cAhBsC;EAkBtC3C,2BAlBsC;EAmBtCW,2BAnBsC;EAoBtCD,oBApBsC;EAsBtC/D,gBAtBsC;EAuBtCG,iBAvBsC;EAwBtC+F,gCAxBsC;EA0BtCuB,gBA1BsC;EA4BtC;EACAxD,oBA7BsC;EA8BtCkD,uBA9BsC;EA+BtC3F,oBA/BsC;EAgCtC2D,0BAhCsC;EAiCtCiB,aAjCsC;EAmCtCZ,oBAnCsC;EAqCtC;EACAe,kBAtCsC;EAuCtCc,qBAvCsC;EAwCtCtC,kBAxCsC;EAyCtCuC,iBAzCsC;EA2CtC;EACA/E,kBA5CsC;EA8CtC;EACA6B,2BA/CsC;EAiDtCM,2BAjDsC;EAkDtCnB,oBAlDsC;EAoDtCW;AApDsC,CAAxC;eA0DeyD,S"}
|
|
1
|
+
{"version":3,"names":["getPreferredUnit","type","unit","getPreferredUnits","ensureUnit","providedUnit","Native","deserializeSample","sample","startDate","Date","endDate","deserializeWorkout","deserializCategorySample","serializeDate","date","toISOString","prepareOptions","options","limit","Infinity","ascending","from","to","queryQuantitySamples","identifier","opts","quantitySamples","map","getPreferredUnitsTyped","energyUnit","distanceUnit","units","HKQuantityTypeIdentifier","distanceWalkingRunning","activeEnergyBurned","HKUnit","Kilocalories","Meters","subscribeToChanges","callback","subscription","EventEmitter","addListener","typeIdentifier","queryId","subscribeToObserverQuery","catch","error","remove","Promise","reject","unsubscribeQuery","getMostRecentQuantitySample","samples","useMostRecentWorkout","workout","setWorkout","useState","useEffect","cancelSubscription","init","w","getMostRecentWorkout","getMostRecentCategorySample","queryCategorySamples","useSubscribeToChanges","onChange","HKCategoryTypeIdentifier","appleStandHour","useMostRecentCategorySample","category","setCategory","updater","useCallback","then","useMostRecentQuantitySample","lastSample","setLastSample","actualUnit","value","saveQuantitySample","start","end","metadata","queryStatisticsForQuantity","toDate","mostRecentQuantityDateInterval","rawResponse","response","requestAuthorization","read","write","readPermissions","reduce","obj","cur","writePermissions","getDateOfBirth","dateOfBirth","getRequestStatusForAuthorization","results","queryWorkouts","workouts","queryWorkoutSamples","saveCategorySample","identifiers","i","buildUnitWithPrefix","prefix","deserializeCorrelation","s","objects","o","quantity","undefined","ensureMetadata","queryCorrelationSamples","correlations","saveCorrelationSample","saveWorkoutSample","quantities","_start","getWorkoutRoutes","workoutUUID","Healthkit","authorizationStatusFor","bind","isHealthDataAvailable","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","useIsHealthDataAvailable","isAvailable","setIsAvailable","res","useHealthkitAuthorization","status","setStatus","refreshAuthStatus","auth","request"],"sources":["index.ios.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\n\nimport Native, {\n EventEmitter,\n HKQuantityTypeIdentifier,\n HKUnit,\n HKCategoryTypeIdentifier,\n} from './native-types'\n\nimport type {\n HKSampleTypeIdentifier,\n HKCategorySampleRaw,\n HKCategoryValueForIdentifier,\n HKCharacteristicTypeIdentifier,\n HKCorrelationRaw,\n HKCorrelationTypeIdentifier,\n HKQuantitySampleRaw,\n HKUnitSI,\n HKUnitSIPrefix,\n HKWorkoutRaw,\n MetadataMapperForCategoryIdentifier,\n ReadPermissions,\n WritePermissions,\n HealthkitAuthorization,\n HKAuthorizationRequestStatus,\n} from './native-types'\nimport type {\n GenericQueryOptions,\n GetMostRecentCategorySampleFn,\n GetMostRecentQuantitySampleFn,\n GetMostRecentWorkoutFn,\n GetPreferredUnitFn,\n GetPreferredUnitsFn,\n GetWorkoutRoutesFn,\n HKCategorySample,\n HKCorrelation,\n HKQuantitySample,\n HKWorkout,\n QueryCategorySamplesFn,\n QueryCorrelationSamplesFn,\n QueryQuantitySamplesFn,\n QueryStatisticsForQuantityFn,\n QueryWorkoutsFn,\n ReactNativeHealthkit,\n SaveCorrelationSampleFn,\n SaveQuantitySampleFn,\n SaveWorkoutSampleFn,\n SubscribeToChangesFn,\n} from './types'\nimport type { ValueOf } from 'type-fest'\n\nconst getPreferredUnit: GetPreferredUnitFn = async (type) => {\n const [unit] = await getPreferredUnits([type])\n return unit\n}\n\nconst ensureUnit = async <TUnit extends HKUnit>(\n type: HKQuantityTypeIdentifier,\n providedUnit?: TUnit,\n) => {\n if (providedUnit) {\n return providedUnit\n }\n const unit = await Native.getPreferredUnits([type])\n return unit[type] as TUnit\n}\n\nfunction deserializeSample<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends HKUnit\n>(\n sample: HKQuantitySampleRaw<TIdentifier, TUnit>,\n): HKQuantitySample<TIdentifier, TUnit> {\n return {\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n }\n}\n\nfunction deserializeWorkout<TEnergy extends HKUnit, TDistance extends HKUnit>(\n sample: HKWorkoutRaw<TEnergy, TDistance>,\n): HKWorkout<TEnergy, TDistance> {\n return {\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n }\n}\n\nconst deserializCategorySample = <T extends HKCategoryTypeIdentifier>(\n sample: HKCategorySampleRaw<T>,\n): HKCategorySample<T> => ({\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n})\n\nconst serializeDate = (date?: Date | null): string => (date ? date.toISOString() : new Date(0).toISOString())\n\nconst prepareOptions = (options: GenericQueryOptions) => {\n const limit = !options.limit || options.limit === Infinity ? 0 : options.limit\n const ascending = options.ascending ?? limit === 0\n const from = serializeDate(options.from)\n const to = serializeDate(options.to)\n return {\n limit, ascending, from, to,\n }\n}\n\nconst queryQuantitySamples: QueryQuantitySamplesFn = async (\n identifier,\n options,\n) => {\n const unit = await ensureUnit(identifier, options.unit)\n const opts = prepareOptions(options)\n\n const quantitySamples = await Native.queryQuantitySamples(\n identifier,\n unit,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return quantitySamples.map(deserializeSample)\n}\n\nasync function getPreferredUnitsTyped<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n>(options?: { readonly energyUnit?: TEnergy; readonly distanceUnit?: TDistance }) {\n let energyUnit = options?.energyUnit\n let distanceUnit = options?.distanceUnit\n if (!energyUnit || !distanceUnit) {\n const units = await Native.getPreferredUnits([\n HKQuantityTypeIdentifier.distanceWalkingRunning,\n HKQuantityTypeIdentifier.activeEnergyBurned,\n ])\n if (!energyUnit) {\n energyUnit = units[HKQuantityTypeIdentifier.distanceWalkingRunning] as\n | TEnergy\n | undefined\n }\n if (!distanceUnit) {\n distanceUnit = units[HKQuantityTypeIdentifier.activeEnergyBurned] as\n | TDistance\n | undefined\n }\n }\n if (!energyUnit) {\n energyUnit = HKUnit.Kilocalories as TEnergy\n }\n if (!distanceUnit) {\n distanceUnit = HKUnit.Meters as TDistance\n }\n return { energyUnit, distanceUnit }\n}\n\nconst subscribeToChanges: SubscribeToChangesFn = async (\n identifier,\n callback,\n) => {\n const subscription = EventEmitter.addListener(\n 'onChange',\n ({ typeIdentifier }) => {\n if (typeIdentifier === identifier) {\n callback()\n }\n },\n )\n\n const queryId = await Native.subscribeToObserverQuery(identifier).catch(\n async (error) => {\n subscription.remove()\n return Promise.reject(error)\n },\n )\n\n return async () => {\n subscription.remove()\n return Native.unsubscribeQuery(queryId)\n }\n}\n\nconst getMostRecentQuantitySample: GetMostRecentQuantitySampleFn = async (\n identifier,\n unit,\n) => {\n const samples = await queryQuantitySamples(identifier, {\n limit: 1,\n unit,\n })\n return samples[0]\n}\n\nfunction useMostRecentWorkout<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n>(options?: { readonly energyUnit?: TEnergy; readonly distanceUnit?: TDistance }) {\n const [workout, setWorkout] = useState<HKWorkout<TEnergy, TDistance> | null>(\n null,\n )\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n const { energyUnit, distanceUnit } = await getPreferredUnitsTyped(\n options,\n )\n\n cancelSubscription = await subscribeToChanges(\n 'HKWorkoutTypeIdentifier',\n async () => {\n const w = await getMostRecentWorkout({ energyUnit, distanceUnit })\n setWorkout(w)\n },\n )\n }\n void init()\n return () => {\n void cancelSubscription?.()\n }\n }, [options])\n return workout\n}\n\nconst getMostRecentCategorySample: GetMostRecentCategorySampleFn = async (\n identifier,\n) => {\n const samples = await queryCategorySamples(identifier, {\n limit: 1,\n ascending: false,\n })\n\n return samples[0]\n}\n\nfunction useSubscribeToChanges<TIdentifier extends ValueOf<typeof HKSampleTypeIdentifier>>(\n identifier: TIdentifier,\n onChange: () => void,\n): void {\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n cancelSubscription = await subscribeToChanges(identifier, onChange)\n }\n void init()\n\n return () => {\n void cancelSubscription?.()\n }\n }, [identifier, onChange])\n}\n\nuseSubscribeToChanges(HKCategoryTypeIdentifier.appleStandHour, () => {})\n\nfunction useMostRecentCategorySample<\n TCategory extends HKCategoryTypeIdentifier\n>(identifier: TCategory) {\n const [category, setCategory] = useState<HKCategorySample<TCategory> | null>(\n null,\n )\n const updater = useCallback(() => {\n void getMostRecentCategorySample(identifier).then(setCategory)\n }, [identifier])\n\n useSubscribeToChanges(identifier, updater)\n\n return category\n}\n\nfunction useMostRecentQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends HKUnit = HKUnit\n>(identifier: TIdentifier, unit?: TUnit) {\n const [lastSample, setLastSample] = useState<HKQuantitySample<\n TIdentifier,\n TUnit\n > | null>(null)\n\n useEffect(() => {\n let cancelSubscription: (() => Promise<boolean>) | undefined\n\n const init = async () => {\n const actualUnit = await ensureUnit(identifier, unit)\n\n cancelSubscription = await subscribeToChanges(identifier, async () => {\n const value = await getMostRecentQuantitySample(identifier, actualUnit)\n setLastSample(value)\n })\n }\n void init()\n\n return () => {\n void cancelSubscription?.()\n }\n }, [identifier, unit])\n\n return lastSample\n}\n\nconst saveQuantitySample: SaveQuantitySampleFn = async (\n identifier,\n unit,\n value,\n options,\n) => {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveQuantitySample(\n identifier,\n unit,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata,\n )\n}\n\nconst queryStatisticsForQuantity: QueryStatisticsForQuantityFn = async (\n identifier,\n options,\n from,\n to,\n unit,\n) => {\n const actualUnit = await ensureUnit(identifier, unit)\n const toDate = to || new Date()\n const { mostRecentQuantityDateInterval, ...rawResponse } = await Native.queryStatisticsForQuantity(\n identifier,\n actualUnit,\n from.toISOString(),\n toDate.toISOString(),\n options,\n )\n\n const response = {\n ...rawResponse,\n ...(mostRecentQuantityDateInterval\n ? {\n mostRecentQuantityDateInterval: {\n from: new Date(mostRecentQuantityDateInterval.from),\n to: new Date(mostRecentQuantityDateInterval.to),\n },\n }\n : {}),\n }\n\n return response\n}\n\nconst requestAuthorization = async (\n read: readonly ValueOf<typeof HealthkitAuthorization>[],\n write: readonly ValueOf<typeof HKSampleTypeIdentifier>[] = [],\n): Promise<boolean> => {\n const readPermissions = read.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as ReadPermissions)\n\n const writePermissions = write.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as WritePermissions)\n\n return Native.requestAuthorization(writePermissions, readPermissions)\n}\n\nconst getDateOfBirth = async () => {\n const dateOfBirth = await Native.getDateOfBirth()\n return new Date(dateOfBirth)\n}\n\nconst getRequestStatusForAuthorization = async (\n read: readonly (HKCharacteristicTypeIdentifier | ValueOf<typeof HKSampleTypeIdentifier>)[],\n write: readonly (ValueOf<typeof HKSampleTypeIdentifier>)[] = [],\n) => {\n const readPermissions = read.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as ReadPermissions)\n\n const writePermissions = write.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as WritePermissions)\n\n return Native.getRequestStatusForAuthorization(\n writePermissions,\n readPermissions,\n )\n}\n\nconst queryCategorySamples: QueryCategorySamplesFn = async (\n identifier,\n options,\n) => {\n const opts = prepareOptions(options)\n const results = await Native.queryCategorySamples(\n identifier,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return results.map(deserializCategorySample)\n}\n\nconst queryWorkouts: QueryWorkoutsFn = async (options) => {\n const { energyUnit, distanceUnit } = await getPreferredUnitsTyped(options)\n const opts = prepareOptions(options)\n\n const workouts = await Native.queryWorkoutSamples(\n energyUnit,\n distanceUnit,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return workouts.map(deserializeWorkout)\n}\n\nconst getMostRecentWorkout: GetMostRecentWorkoutFn = async (options) => {\n const workouts = await queryWorkouts({\n limit: 1,\n ascending: false,\n energyUnit: options?.energyUnit,\n distanceUnit: options?.distanceUnit,\n })\n\n return workouts[0]\n}\n\nasync function saveCategorySample<T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCategoryIdentifier<T>;\n },\n) {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveCategorySample(\n identifier,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata || {},\n )\n}\n\nconst getPreferredUnits: GetPreferredUnitsFn = async (identifiers) => {\n const units = await Native.getPreferredUnits(identifiers)\n return identifiers.map((i) => units[i])\n}\n\nconst buildUnitWithPrefix = (prefix: HKUnitSIPrefix, unit: HKUnitSI) => `${prefix}${unit}` as HKUnit\n\nfunction deserializeCorrelation<\n TIdentifier extends HKCorrelationTypeIdentifier\n>(s: HKCorrelationRaw<TIdentifier>): HKCorrelation<TIdentifier> {\n return {\n ...s,\n objects: s.objects.map((o) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (o.quantity !== undefined) {\n return deserializeSample(o as HKQuantitySampleRaw)\n }\n\n return deserializCategorySample(o as HKCategorySampleRaw)\n }),\n endDate: new Date(s.endDate),\n startDate: new Date(s.startDate),\n }\n}\n\nfunction ensureMetadata<TMetadata>(metadata?: TMetadata) {\n return metadata || ({} as TMetadata)\n}\n\nconst queryCorrelationSamples: QueryCorrelationSamplesFn = async (\n typeIdentifier,\n options,\n) => {\n const opts = prepareOptions(options)\n const correlations = await Native.queryCorrelationSamples(\n typeIdentifier,\n opts.from,\n opts.to,\n )\n\n return correlations.map(deserializeCorrelation)\n}\n\nconst saveCorrelationSample: SaveCorrelationSampleFn = async (\n typeIdentifier,\n samples,\n options,\n) => {\n const start = (options?.start || new Date()).toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveCorrelationSample(\n typeIdentifier,\n samples,\n start,\n end,\n ensureMetadata(options?.metadata),\n )\n}\n\nconst saveWorkoutSample: SaveWorkoutSampleFn = async (\n typeIdentifier,\n quantities,\n _start,\n options,\n) => {\n const start = _start.toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveWorkoutSample(\n typeIdentifier,\n quantities,\n start,\n end,\n ensureMetadata(options?.metadata),\n )\n}\n\nconst getWorkoutRoutes: GetWorkoutRoutesFn = async (workoutUUID: string) => Native.getWorkoutRoutes(workoutUUID)\n\nconst Healthkit: ReactNativeHealthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n\n buildUnitWithPrefix,\n\n disableAllBackgroundDelivery: Native.disableAllBackgroundDelivery,\n disableBackgroundDelivery: Native.disableBackgroundDelivery,\n enableBackgroundDelivery: Native.enableBackgroundDelivery,\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse,\n getBloodType: Native.getBloodType.bind(Native),\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n getWorkoutRoutes,\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 const [isAvailable, setIsAvailable] = useState<boolean | null>(null)\n useEffect(() => {\n const init = async () => {\n const res = await Native.isHealthDataAvailable()\n setIsAvailable(res)\n }\n void init()\n }, [])\n return isAvailable\n },\n useHealthkitAuthorization: (read, write) => {\n const [status, setStatus] = useState<HKAuthorizationRequestStatus | null>(null)\n const refreshAuthStatus = useCallback(async () => {\n const auth = await getRequestStatusForAuthorization(read, write)\n setStatus(auth)\n return auth\n }, [])\n\n const request = useCallback(async () => {\n await requestAuthorization(read, write)\n return refreshAuthStatus()\n }, [])\n\n useEffect(() => {\n void refreshAuthStatus()\n }, [])\n\n return [status, request]\n },\n}\n\nexport * from './native-types'\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;AAwmBA;E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SAAT,IAAsB,IAAApF,eAAA,EAA8C,IAA9C,CAA5B;IACA,MAAMqF,iBAAiB,GAAG,IAAArE,kBAAA,EAAY,YAAY;MAChD,MAAMsE,IAAI,GAAG,MAAM5C,gCAAgC,CAACT,IAAD,EAAOC,KAAP,CAAnD;MACAkD,SAAS,CAACE,IAAD,CAAT;MACA,OAAOA,IAAP;IACD,CAJyB,EAIvB,EAJuB,CAA1B;IAMA,MAAMC,OAAO,GAAG,IAAAvE,kBAAA,EAAY,YAAY;MACtC,MAAMgB,oBAAoB,CAACC,IAAD,EAAOC,KAAP,CAA1B;MACA,OAAOmD,iBAAiB,EAAxB;IACD,CAHe,EAGb,EAHa,CAAhB;IAKA,IAAApF,gBAAA,EAAU,MAAM;MACd,KAAKoF,iBAAiB,EAAtB;IACD,CAFD,EAEG,EAFH;IAIA,OAAO,CAACF,MAAD,EAASI,OAAT,CAAP;EACD;AAnFqC,CAAxC;eAyFepB,S"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -35,46 +35,59 @@ Object.keys(_types).forEach(function (key) {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
-
const notAvailableError = `Platform "${_reactNative.Platform.OS}" not supported
|
|
38
|
+
const notAvailableError = `[@kingstinct/react-native-healthkit] Platform "${_reactNative.Platform.OS}" not supported`;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
function UnavailableFn(retVal) {
|
|
41
|
+
return () => {
|
|
42
|
+
console.warn(notAvailableError);
|
|
43
|
+
return retVal;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
43
46
|
|
|
44
47
|
const Healthkit = {
|
|
45
|
-
authorizationStatusFor: UnavailableFn,
|
|
46
|
-
buildUnitWithPrefix: UnavailableFn,
|
|
47
|
-
disableAllBackgroundDelivery: UnavailableFn,
|
|
48
|
-
disableBackgroundDelivery: UnavailableFn,
|
|
49
|
-
enableBackgroundDelivery: UnavailableFn,
|
|
50
|
-
getBiologicalSex: UnavailableFn,
|
|
51
|
-
getBloodType: UnavailableFn,
|
|
52
|
-
getDateOfBirth: UnavailableFn,
|
|
53
|
-
getFitzpatrickSkinType: UnavailableFn,
|
|
54
|
-
getMostRecentCategorySample: UnavailableFn,
|
|
55
|
-
getMostRecentQuantitySample: UnavailableFn,
|
|
56
|
-
getMostRecentWorkout: UnavailableFn,
|
|
57
|
-
getPreferredUnit: UnavailableFn,
|
|
58
|
-
getPreferredUnits: UnavailableFn,
|
|
59
|
-
getRequestStatusForAuthorization: UnavailableFn,
|
|
60
|
-
getWheelchairUse: UnavailableFn,
|
|
61
|
-
getWorkoutRoutes: UnavailableFn,
|
|
48
|
+
authorizationStatusFor: UnavailableFn(Promise.resolve(false)),
|
|
49
|
+
buildUnitWithPrefix: UnavailableFn(_nativeTypes.HKUnit.Atmospheres),
|
|
50
|
+
disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),
|
|
51
|
+
disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),
|
|
52
|
+
enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),
|
|
53
|
+
getBiologicalSex: UnavailableFn(Promise.resolve(_nativeTypes.HKBiologicalSex.notSet)),
|
|
54
|
+
getBloodType: UnavailableFn(Promise.resolve(_nativeTypes.HKBloodType.notSet)),
|
|
55
|
+
getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),
|
|
56
|
+
getFitzpatrickSkinType: UnavailableFn(Promise.resolve(_nativeTypes.HKFitzpatrickSkinType.notSet)),
|
|
57
|
+
getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),
|
|
58
|
+
getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),
|
|
59
|
+
getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),
|
|
60
|
+
getPreferredUnit: UnavailableFn(Promise.resolve(_nativeTypes.HKUnit.Atmospheres)),
|
|
61
|
+
getPreferredUnits: UnavailableFn(Promise.resolve([])),
|
|
62
|
+
getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(_nativeTypes.HKAuthorizationRequestStatus.unknown)),
|
|
63
|
+
getWheelchairUse: UnavailableFn(Promise.resolve(_nativeTypes.HKWheelchairUse.notSet)),
|
|
64
|
+
getWorkoutRoutes: UnavailableFn(Promise.resolve([])),
|
|
62
65
|
isHealthDataAvailable: async () => Promise.resolve(false),
|
|
63
|
-
queryCategorySamples: UnavailableFn,
|
|
64
|
-
queryCorrelationSamples: UnavailableFn,
|
|
65
|
-
queryQuantitySamples: UnavailableFn,
|
|
66
|
-
queryStatisticsForQuantity: UnavailableFn
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
queryCategorySamples: UnavailableFn(Promise.resolve([])),
|
|
67
|
+
queryCorrelationSamples: UnavailableFn(Promise.resolve([])),
|
|
68
|
+
queryQuantitySamples: UnavailableFn(Promise.resolve([])),
|
|
69
|
+
queryStatisticsForQuantity: UnavailableFn(Promise.resolve({
|
|
70
|
+
averageQuantity: undefined,
|
|
71
|
+
maximumQuantity: undefined,
|
|
72
|
+
minimumQuantity: undefined,
|
|
73
|
+
sumQuantity: undefined,
|
|
74
|
+
mostRecentQuantity: undefined,
|
|
75
|
+
mostRecentQuantityDateInterval: undefined,
|
|
76
|
+
duration: undefined
|
|
77
|
+
})),
|
|
78
|
+
queryWorkouts: UnavailableFn(Promise.resolve([])),
|
|
79
|
+
requestAuthorization: UnavailableFn(Promise.resolve(false)),
|
|
80
|
+
saveCategorySample: UnavailableFn(Promise.resolve(false)),
|
|
81
|
+
saveCorrelationSample: UnavailableFn(Promise.resolve(false)),
|
|
82
|
+
saveQuantitySample: UnavailableFn(Promise.resolve(false)),
|
|
83
|
+
saveWorkoutSample: UnavailableFn(Promise.resolve(false)),
|
|
84
|
+
subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),
|
|
85
|
+
useMostRecentCategorySample: UnavailableFn(null),
|
|
86
|
+
useMostRecentQuantitySample: UnavailableFn(null),
|
|
87
|
+
useMostRecentWorkout: UnavailableFn(null),
|
|
88
|
+
useSubscribeToChanges: UnavailableFn([null, () => null]),
|
|
89
|
+
useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(null)]),
|
|
90
|
+
useIsHealthDataAvailable: UnavailableFn(false)
|
|
78
91
|
};
|
|
79
92
|
var _default = Healthkit;
|
|
80
93
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["notAvailableError","Platform","OS","UnavailableFn","
|
|
1
|
+
{"version":3,"names":["notAvailableError","Platform","OS","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","buildUnitWithPrefix","HKUnit","Atmospheres","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","HKBiologicalSex","notSet","getBloodType","HKBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","HKFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","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, HKUnit, HKWheelchairUse,\n} from './native-types'\n\nimport type { ReactNativeHealthkit } from './types'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n console.warn(notAvailableError)\n return retVal\n }\n}\n\nconst Healthkit: ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(false)),\n buildUnitWithPrefix: UnavailableFn(HKUnit.Atmospheres),\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(HKUnit.Atmospheres)),\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(null)] as const),\n useIsHealthDataAvailable: UnavailableFn(false),\n}\n\nexport * from './native-types'\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":";;;;;;;;AAAA;;AAEA;;AA+DA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AA1DA,MAAMA,iBAAiB,GAAI,kDACzBC,qBAAA,CAASC,EACV,iBAFD;;AAIA,SAASC,aAAT,CAAoCC,MAApC,EAA+C;EAC7C,OAAO,MAAM;IACXC,OAAO,CAACC,IAAR,CAAaN,iBAAb;IACA,OAAOI,MAAP;EACD,CAHD;AAID;;AAED,MAAMG,SAA+B,GAAG;EACtCC,sBAAsB,EAAEL,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CADC;EAEtCC,mBAAmB,EAAER,aAAa,CAACS,mBAAA,CAAOC,WAAR,CAFI;EAGtCC,4BAA4B,EAAEX,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CAHL;EAItCK,yBAAyB,EAAEZ,aAAa,CAACM,OAAO,CAACC,OAAR,CAAgB,KAAhB,CAAD,CAJF;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,CAAC,IAAD,CAtCJ;EAuCtCuD,2BAA2B,EAAEvD,aAAa,CAAC,IAAD,CAvCJ;EAwCtCwD,oBAAoB,EAAExD,aAAa,CAAC,IAAD,CAxCG;EAyCtCyD,qBAAqB,EAAEzD,aAAa,CAAC,CAAC,IAAD,EAAO,MAAM,IAAb,CAAD,CAzCE;EA0CtC0D,yBAAyB,EAAE1D,aAAa,CAAC,CAAC,IAAD,EAAO,YAAYM,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAnB,CAAD,CA1CF;EA2CtCoD,wBAAwB,EAAE3D,aAAa,CAAC,KAAD;AA3CD,CAAxC;eAiDeI,S"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.HKWorkoutTypeIdentifier = exports.HKWorkoutRouteTypeIdentifier = exports.HKWorkoutActivityType = exports.HKWheelchairUse = exports.HKWeatherCondition = exports.HKUpdateFrequency = exports.HKUnitSIPrefix = exports.HKUnitSI = exports.HKUnit = exports.HKStatisticsOptions = exports.HKQuantityTypeIdentifier = exports.HKInsulinDeliveryReason = exports.HKHeartRateMotionContext = exports.HKFitzpatrickSkinType = exports.HKDataTypeIdentifierHeartbeatSeries = exports.HKCorrelationTypeIdentifier = exports.HKCharacteristicTypeIdentifier = exports.HKCategoryValueSleepAnalysis = exports.HKCategoryValueSeverity = exports.HKCategoryValuePresence = exports.HKCategoryValueOvulationTestResult = exports.HKCategoryValueNotApplicable = exports.HKCategoryValueMenstrualFlow = exports.HKCategoryValueCervicalMucusQuality = exports.HKCategoryValueAppleStandHour = exports.HKCategoryValueAppetiteChanges = exports.HKCategoryTypeIdentifier = exports.HKBloodType = exports.HKBiologicalSex = exports.HKAuthorizationStatus = exports.HKAuthorizationRequestStatus = exports.HKAudiogramTypeIdentifier = exports.EventEmitter = void 0;
|
|
6
|
+
exports.default = exports.HealthkitAuthorization = exports.HKWorkoutTypeIdentifier = exports.HKWorkoutRouteTypeIdentifier = exports.HKWorkoutActivityType = exports.HKWheelchairUse = exports.HKWeatherCondition = exports.HKUpdateFrequency = exports.HKUnitSIPrefix = exports.HKUnitSI = exports.HKUnit = exports.HKStatisticsOptions = exports.HKSampleTypeIdentifier = exports.HKQuantityTypeIdentifier = exports.HKInsulinDeliveryReason = exports.HKHeartRateMotionContext = exports.HKFitzpatrickSkinType = exports.HKDataTypeIdentifierHeartbeatSeries = exports.HKCorrelationTypeIdentifier = exports.HKCharacteristicTypeIdentifier = exports.HKCategoryValueSleepAnalysis = exports.HKCategoryValueSeverity = exports.HKCategoryValuePresence = exports.HKCategoryValueOvulationTestResult = exports.HKCategoryValueNotApplicable = exports.HKCategoryValueMenstrualFlow = exports.HKCategoryValueCervicalMucusQuality = exports.HKCategoryValueAppleStandHour = exports.HKCategoryValueAppetiteChanges = exports.HKCategoryTypeIdentifier = exports.HKBloodType = exports.HKBiologicalSex = exports.HKAuthorizationStatus = exports.HKAuthorizationRequestStatus = exports.HKAudiogramTypeIdentifier = exports.EventEmitter = void 0;
|
|
7
7
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
|
|
@@ -13,8 +13,105 @@ const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier';
|
|
|
13
13
|
exports.HKAudiogramTypeIdentifier = HKAudiogramTypeIdentifier;
|
|
14
14
|
const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier';
|
|
15
15
|
exports.HKWorkoutRouteTypeIdentifier = HKWorkoutRouteTypeIdentifier;
|
|
16
|
-
const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries';
|
|
16
|
+
const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries'; // Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier
|
|
17
|
+
|
|
17
18
|
exports.HKDataTypeIdentifierHeartbeatSeries = HKDataTypeIdentifierHeartbeatSeries;
|
|
19
|
+
let HKQuantityTypeIdentifier;
|
|
20
|
+
exports.HKQuantityTypeIdentifier = HKQuantityTypeIdentifier;
|
|
21
|
+
|
|
22
|
+
(function (HKQuantityTypeIdentifier) {
|
|
23
|
+
HKQuantityTypeIdentifier["bodyMassIndex"] = "HKQuantityTypeIdentifierBodyMassIndex";
|
|
24
|
+
HKQuantityTypeIdentifier["bodyFatPercentage"] = "HKQuantityTypeIdentifierBodyFatPercentage";
|
|
25
|
+
HKQuantityTypeIdentifier["height"] = "HKQuantityTypeIdentifierHeight";
|
|
26
|
+
HKQuantityTypeIdentifier["bodyMass"] = "HKQuantityTypeIdentifierBodyMass";
|
|
27
|
+
HKQuantityTypeIdentifier["leanBodyMass"] = "HKQuantityTypeIdentifierLeanBodyMass";
|
|
28
|
+
HKQuantityTypeIdentifier["waistCircumference"] = "HKQuantityTypeIdentifierWaistCircumference";
|
|
29
|
+
HKQuantityTypeIdentifier["stepCount"] = "HKQuantityTypeIdentifierStepCount";
|
|
30
|
+
HKQuantityTypeIdentifier["distanceWalkingRunning"] = "HKQuantityTypeIdentifierDistanceWalkingRunning";
|
|
31
|
+
HKQuantityTypeIdentifier["distanceCycling"] = "HKQuantityTypeIdentifierDistanceCycling";
|
|
32
|
+
HKQuantityTypeIdentifier["distanceWheelchair"] = "HKQuantityTypeIdentifierDistanceWheelchair";
|
|
33
|
+
HKQuantityTypeIdentifier["basalEnergyBurned"] = "HKQuantityTypeIdentifierBasalEnergyBurned";
|
|
34
|
+
HKQuantityTypeIdentifier["activeEnergyBurned"] = "HKQuantityTypeIdentifierActiveEnergyBurned";
|
|
35
|
+
HKQuantityTypeIdentifier["flightsClimbed"] = "HKQuantityTypeIdentifierFlightsClimbed";
|
|
36
|
+
HKQuantityTypeIdentifier["nikeFuel"] = "HKQuantityTypeIdentifierNikeFuel";
|
|
37
|
+
HKQuantityTypeIdentifier["appleExerciseTime"] = "HKQuantityTypeIdentifierAppleExerciseTime";
|
|
38
|
+
HKQuantityTypeIdentifier["pushCount"] = "HKQuantityTypeIdentifierPushCount";
|
|
39
|
+
HKQuantityTypeIdentifier["distanceSwimming"] = "HKQuantityTypeIdentifierDistanceSwimming";
|
|
40
|
+
HKQuantityTypeIdentifier["swimmingStrokeCount"] = "HKQuantityTypeIdentifierSwimmingStrokeCount";
|
|
41
|
+
HKQuantityTypeIdentifier["vo2Max"] = "HKQuantityTypeIdentifierVo2Max";
|
|
42
|
+
HKQuantityTypeIdentifier["distanceDownhillSnowSports"] = "HKQuantityTypeIdentifierDistanceDownhillSnowSports";
|
|
43
|
+
HKQuantityTypeIdentifier["appleStandTime"] = "HKQuantityTypeIdentifierAppleStandTime";
|
|
44
|
+
HKQuantityTypeIdentifier["heartRate"] = "HKQuantityTypeIdentifierHeartRate";
|
|
45
|
+
HKQuantityTypeIdentifier["bodyTemperature"] = "HKQuantityTypeIdentifierBodyTemperature";
|
|
46
|
+
HKQuantityTypeIdentifier["basalBodyTemperature"] = "HKQuantityTypeIdentifierBasalBodyTemperature";
|
|
47
|
+
HKQuantityTypeIdentifier["bloodPressureSystolic"] = "HKQuantityTypeIdentifierBloodPressureSystolic";
|
|
48
|
+
HKQuantityTypeIdentifier["bloodPressureDiastolic"] = "HKQuantityTypeIdentifierBloodPressureDiastolic";
|
|
49
|
+
HKQuantityTypeIdentifier["respiratoryRate"] = "HKQuantityTypeIdentifierRespiratoryRate";
|
|
50
|
+
HKQuantityTypeIdentifier["restingHeartRate"] = "HKQuantityTypeIdentifierRestingHeartRate";
|
|
51
|
+
HKQuantityTypeIdentifier["walkingHeartRateAverage"] = "HKQuantityTypeIdentifierWalkingHeartRateAverage";
|
|
52
|
+
HKQuantityTypeIdentifier["heartRateVariabilitySDNN"] = "HKQuantityTypeIdentifierHeartRateVariabilitySDNN";
|
|
53
|
+
HKQuantityTypeIdentifier["oxygenSaturation"] = "HKQuantityTypeIdentifierOxygenSaturation";
|
|
54
|
+
HKQuantityTypeIdentifier["peripheralPerfusionIndex"] = "HKQuantityTypeIdentifierPeripheralPerfusionIndex";
|
|
55
|
+
HKQuantityTypeIdentifier["bloodGlucose"] = "HKQuantityTypeIdentifierBloodGlucose";
|
|
56
|
+
HKQuantityTypeIdentifier["numberOfTimesFallen"] = "HKQuantityTypeIdentifierNumberOfTimesFallen";
|
|
57
|
+
HKQuantityTypeIdentifier["electrodermalActivity"] = "HKQuantityTypeIdentifierElectrodermalActivity";
|
|
58
|
+
HKQuantityTypeIdentifier["inhalerUsage"] = "HKQuantityTypeIdentifierInhalerUsage";
|
|
59
|
+
HKQuantityTypeIdentifier["insulinDelivery"] = "HKQuantityTypeIdentifierInsulinDelivery";
|
|
60
|
+
HKQuantityTypeIdentifier["bloodAlcoholContent"] = "HKQuantityTypeIdentifierBloodAlcoholContent";
|
|
61
|
+
HKQuantityTypeIdentifier["forcedVitalCapacity"] = "HKQuantityTypeIdentifierForcedVitalCapacity";
|
|
62
|
+
HKQuantityTypeIdentifier["forcedExpiratoryVolume1"] = "HKQuantityTypeIdentifierForcedExpiratoryVolume1";
|
|
63
|
+
HKQuantityTypeIdentifier["peakExpiratoryFlowRate"] = "HKQuantityTypeIdentifierPeakExpiratoryFlowRate";
|
|
64
|
+
HKQuantityTypeIdentifier["environmentalAudioExposure"] = "HKQuantityTypeIdentifierEnvironmentalAudioExposure";
|
|
65
|
+
HKQuantityTypeIdentifier["headphoneAudioExposure"] = "HKQuantityTypeIdentifierHeadphoneAudioExposure";
|
|
66
|
+
HKQuantityTypeIdentifier["dietaryFatTotal"] = "HKQuantityTypeIdentifierDietaryFatTotal";
|
|
67
|
+
HKQuantityTypeIdentifier["dietaryFatPolyunsaturated"] = "HKQuantityTypeIdentifierDietaryFatPolyunsaturated";
|
|
68
|
+
HKQuantityTypeIdentifier["dietaryFatMonounsaturated"] = "HKQuantityTypeIdentifierDietaryFatMonounsaturated";
|
|
69
|
+
HKQuantityTypeIdentifier["dietaryFatSaturated"] = "HKQuantityTypeIdentifierDietaryFatSaturated";
|
|
70
|
+
HKQuantityTypeIdentifier["dietaryCholesterol"] = "HKQuantityTypeIdentifierDietaryCholesterol";
|
|
71
|
+
HKQuantityTypeIdentifier["dietarySodium"] = "HKQuantityTypeIdentifierDietarySodium";
|
|
72
|
+
HKQuantityTypeIdentifier["dietaryCarbohydrates"] = "HKQuantityTypeIdentifierDietaryCarbohydrates";
|
|
73
|
+
HKQuantityTypeIdentifier["dietaryFiber"] = "HKQuantityTypeIdentifierDietaryFiber";
|
|
74
|
+
HKQuantityTypeIdentifier["dietarySugar"] = "HKQuantityTypeIdentifierDietarySugar";
|
|
75
|
+
HKQuantityTypeIdentifier["dietaryEnergyConsumed"] = "HKQuantityTypeIdentifierDietaryEnergyConsumed";
|
|
76
|
+
HKQuantityTypeIdentifier["dietaryProtein"] = "HKQuantityTypeIdentifierDietaryProtein";
|
|
77
|
+
HKQuantityTypeIdentifier["dietaryVitaminA"] = "HKQuantityTypeIdentifierDietaryVitaminA";
|
|
78
|
+
HKQuantityTypeIdentifier["dietaryVitaminB6"] = "HKQuantityTypeIdentifierDietaryVitaminB6";
|
|
79
|
+
HKQuantityTypeIdentifier["dietaryVitaminB12"] = "HKQuantityTypeIdentifierDietaryVitaminB12";
|
|
80
|
+
HKQuantityTypeIdentifier["dietaryVitaminC"] = "HKQuantityTypeIdentifierDietaryVitaminC";
|
|
81
|
+
HKQuantityTypeIdentifier["dietaryVitaminD"] = "HKQuantityTypeIdentifierDietaryVitaminD";
|
|
82
|
+
HKQuantityTypeIdentifier["dietaryVitaminE"] = "HKQuantityTypeIdentifierDietaryVitaminE";
|
|
83
|
+
HKQuantityTypeIdentifier["dietaryVitaminK"] = "HKQuantityTypeIdentifierDietaryVitaminK";
|
|
84
|
+
HKQuantityTypeIdentifier["dietaryCalcium"] = "HKQuantityTypeIdentifierDietaryCalcium";
|
|
85
|
+
HKQuantityTypeIdentifier["dietaryIron"] = "HKQuantityTypeIdentifierDietaryIron";
|
|
86
|
+
HKQuantityTypeIdentifier["dietaryThiamin"] = "HKQuantityTypeIdentifierDietaryThiamin";
|
|
87
|
+
HKQuantityTypeIdentifier["dietaryRiboflavin"] = "HKQuantityTypeIdentifierDietaryRiboflavin";
|
|
88
|
+
HKQuantityTypeIdentifier["dietaryNiacin"] = "HKQuantityTypeIdentifierDietaryNiacin";
|
|
89
|
+
HKQuantityTypeIdentifier["dietaryFolate"] = "HKQuantityTypeIdentifierDietaryFolate";
|
|
90
|
+
HKQuantityTypeIdentifier["dietaryBiotin"] = "HKQuantityTypeIdentifierDietaryBiotin";
|
|
91
|
+
HKQuantityTypeIdentifier["dietaryPantothenicAcid"] = "HKQuantityTypeIdentifierDietaryPantothenicAcid";
|
|
92
|
+
HKQuantityTypeIdentifier["dietaryPhosphorus"] = "HKQuantityTypeIdentifierDietaryPhosphorus";
|
|
93
|
+
HKQuantityTypeIdentifier["dietaryIodine"] = "HKQuantityTypeIdentifierDietaryIodine";
|
|
94
|
+
HKQuantityTypeIdentifier["dietaryMagnesium"] = "HKQuantityTypeIdentifierDietaryMagnesium";
|
|
95
|
+
HKQuantityTypeIdentifier["dietaryZinc"] = "HKQuantityTypeIdentifierDietaryZinc";
|
|
96
|
+
HKQuantityTypeIdentifier["dietarySelenium"] = "HKQuantityTypeIdentifierDietarySelenium";
|
|
97
|
+
HKQuantityTypeIdentifier["dietaryCopper"] = "HKQuantityTypeIdentifierDietaryCopper";
|
|
98
|
+
HKQuantityTypeIdentifier["dietaryManganese"] = "HKQuantityTypeIdentifierDietaryManganese";
|
|
99
|
+
HKQuantityTypeIdentifier["dietaryChromium"] = "HKQuantityTypeIdentifierDietaryChromium";
|
|
100
|
+
HKQuantityTypeIdentifier["dietaryMolybdenum"] = "HKQuantityTypeIdentifierDietaryMolybdenum";
|
|
101
|
+
HKQuantityTypeIdentifier["dietaryChloride"] = "HKQuantityTypeIdentifierDietaryChloride";
|
|
102
|
+
HKQuantityTypeIdentifier["dietaryPotassium"] = "HKQuantityTypeIdentifierDietaryPotassium";
|
|
103
|
+
HKQuantityTypeIdentifier["dietaryCaffeine"] = "HKQuantityTypeIdentifierDietaryCaffeine";
|
|
104
|
+
HKQuantityTypeIdentifier["dietaryWater"] = "HKQuantityTypeIdentifierDietaryWater";
|
|
105
|
+
HKQuantityTypeIdentifier["sixMinuteWalkTestDistance"] = "HKQuantityTypeIdentifierSixMinuteWalkTestDistance";
|
|
106
|
+
HKQuantityTypeIdentifier["walkingSpeed"] = "HKQuantityTypeIdentifierWalkingSpeed";
|
|
107
|
+
HKQuantityTypeIdentifier["walkingStepLength"] = "HKQuantityTypeIdentifierWalkingStepLength";
|
|
108
|
+
HKQuantityTypeIdentifier["walkingAsymmetryPercentage"] = "HKQuantityTypeIdentifierWalkingAsymmetryPercentage";
|
|
109
|
+
HKQuantityTypeIdentifier["walkingDoubleSupportPercentage"] = "HKQuantityTypeIdentifierWalkingDoubleSupportPercentage";
|
|
110
|
+
HKQuantityTypeIdentifier["stairAscentSpeed"] = "HKQuantityTypeIdentifierStairAscentSpeed";
|
|
111
|
+
HKQuantityTypeIdentifier["stairDescentSpeed"] = "HKQuantityTypeIdentifierStairDescentSpeed";
|
|
112
|
+
HKQuantityTypeIdentifier["uvExposure"] = "HKQuantityTypeIdentifierUvExposure";
|
|
113
|
+
})(HKQuantityTypeIdentifier || (exports.HKQuantityTypeIdentifier = HKQuantityTypeIdentifier = {}));
|
|
114
|
+
|
|
18
115
|
let HKHeartRateMotionContext;
|
|
19
116
|
exports.HKHeartRateMotionContext = HKHeartRateMotionContext;
|
|
20
117
|
|
|
@@ -24,6 +121,14 @@ exports.HKHeartRateMotionContext = HKHeartRateMotionContext;
|
|
|
24
121
|
HKHeartRateMotionContext[HKHeartRateMotionContext["sedentary"] = 1] = "sedentary";
|
|
25
122
|
})(HKHeartRateMotionContext || (exports.HKHeartRateMotionContext = HKHeartRateMotionContext = {}));
|
|
26
123
|
|
|
124
|
+
let HKCorrelationTypeIdentifier;
|
|
125
|
+
exports.HKCorrelationTypeIdentifier = HKCorrelationTypeIdentifier;
|
|
126
|
+
|
|
127
|
+
(function (HKCorrelationTypeIdentifier) {
|
|
128
|
+
HKCorrelationTypeIdentifier["bloodPressure"] = "HKCorrelationTypeIdentifierBloodPressure";
|
|
129
|
+
HKCorrelationTypeIdentifier["food"] = "HKCorrelationTypeIdentifierFood";
|
|
130
|
+
})(HKCorrelationTypeIdentifier || (exports.HKCorrelationTypeIdentifier = HKCorrelationTypeIdentifier = {}));
|
|
131
|
+
|
|
27
132
|
let HKCategoryTypeIdentifier;
|
|
28
133
|
exports.HKCategoryTypeIdentifier = HKCategoryTypeIdentifier;
|
|
29
134
|
|
|
@@ -43,6 +148,15 @@ exports.HKCategoryTypeIdentifier = HKCategoryTypeIdentifier;
|
|
|
43
148
|
HKCategoryTypeIdentifier["toothbrushingEvent"] = "HKCategoryTypeIdentifierToothbrushingEvent";
|
|
44
149
|
})(HKCategoryTypeIdentifier || (exports.HKCategoryTypeIdentifier = HKCategoryTypeIdentifier = {}));
|
|
45
150
|
|
|
151
|
+
const HKSampleTypeIdentifier = { ...HKCategoryTypeIdentifier,
|
|
152
|
+
...HKCorrelationTypeIdentifier,
|
|
153
|
+
...HKQuantityTypeIdentifier,
|
|
154
|
+
audiogram: HKAudiogramTypeIdentifier,
|
|
155
|
+
heartbeatSeries: HKDataTypeIdentifierHeartbeatSeries,
|
|
156
|
+
workoutRoute: HKWorkoutRouteTypeIdentifier,
|
|
157
|
+
workoute: HKWorkoutTypeIdentifier
|
|
158
|
+
};
|
|
159
|
+
exports.HKSampleTypeIdentifier = HKSampleTypeIdentifier;
|
|
46
160
|
let HKCategoryValueAppleStandHour;
|
|
47
161
|
exports.HKCategoryValueAppleStandHour = HKCategoryValueAppleStandHour;
|
|
48
162
|
|
|
@@ -169,103 +283,6 @@ exports.HKWeatherCondition = HKWeatherCondition;
|
|
|
169
283
|
HKWeatherCondition[HKWeatherCondition["tornado"] = 27] = "tornado";
|
|
170
284
|
})(HKWeatherCondition || (exports.HKWeatherCondition = HKWeatherCondition = {}));
|
|
171
285
|
|
|
172
|
-
// Straight mapping to https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier
|
|
173
|
-
let HKQuantityTypeIdentifier;
|
|
174
|
-
exports.HKQuantityTypeIdentifier = HKQuantityTypeIdentifier;
|
|
175
|
-
|
|
176
|
-
(function (HKQuantityTypeIdentifier) {
|
|
177
|
-
HKQuantityTypeIdentifier["bodyMassIndex"] = "HKQuantityTypeIdentifierBodyMassIndex";
|
|
178
|
-
HKQuantityTypeIdentifier["bodyFatPercentage"] = "HKQuantityTypeIdentifierBodyFatPercentage";
|
|
179
|
-
HKQuantityTypeIdentifier["height"] = "HKQuantityTypeIdentifierHeight";
|
|
180
|
-
HKQuantityTypeIdentifier["bodyMass"] = "HKQuantityTypeIdentifierBodyMass";
|
|
181
|
-
HKQuantityTypeIdentifier["leanBodyMass"] = "HKQuantityTypeIdentifierLeanBodyMass";
|
|
182
|
-
HKQuantityTypeIdentifier["waistCircumference"] = "HKQuantityTypeIdentifierWaistCircumference";
|
|
183
|
-
HKQuantityTypeIdentifier["stepCount"] = "HKQuantityTypeIdentifierStepCount";
|
|
184
|
-
HKQuantityTypeIdentifier["distanceWalkingRunning"] = "HKQuantityTypeIdentifierDistanceWalkingRunning";
|
|
185
|
-
HKQuantityTypeIdentifier["distanceCycling"] = "HKQuantityTypeIdentifierDistanceCycling";
|
|
186
|
-
HKQuantityTypeIdentifier["distanceWheelchair"] = "HKQuantityTypeIdentifierDistanceWheelchair";
|
|
187
|
-
HKQuantityTypeIdentifier["basalEnergyBurned"] = "HKQuantityTypeIdentifierBasalEnergyBurned";
|
|
188
|
-
HKQuantityTypeIdentifier["activeEnergyBurned"] = "HKQuantityTypeIdentifierActiveEnergyBurned";
|
|
189
|
-
HKQuantityTypeIdentifier["flightsClimbed"] = "HKQuantityTypeIdentifierFlightsClimbed";
|
|
190
|
-
HKQuantityTypeIdentifier["nikeFuel"] = "HKQuantityTypeIdentifierNikeFuel";
|
|
191
|
-
HKQuantityTypeIdentifier["appleExerciseTime"] = "HKQuantityTypeIdentifierAppleExerciseTime";
|
|
192
|
-
HKQuantityTypeIdentifier["pushCount"] = "HKQuantityTypeIdentifierPushCount";
|
|
193
|
-
HKQuantityTypeIdentifier["distanceSwimming"] = "HKQuantityTypeIdentifierDistanceSwimming";
|
|
194
|
-
HKQuantityTypeIdentifier["swimmingStrokeCount"] = "HKQuantityTypeIdentifierSwimmingStrokeCount";
|
|
195
|
-
HKQuantityTypeIdentifier["vo2Max"] = "HKQuantityTypeIdentifierVo2Max";
|
|
196
|
-
HKQuantityTypeIdentifier["distanceDownhillSnowSports"] = "HKQuantityTypeIdentifierDistanceDownhillSnowSports";
|
|
197
|
-
HKQuantityTypeIdentifier["appleStandTime"] = "HKQuantityTypeIdentifierAppleStandTime";
|
|
198
|
-
HKQuantityTypeIdentifier["heartRate"] = "HKQuantityTypeIdentifierHeartRate";
|
|
199
|
-
HKQuantityTypeIdentifier["bodyTemperature"] = "HKQuantityTypeIdentifierBodyTemperature";
|
|
200
|
-
HKQuantityTypeIdentifier["basalBodyTemperature"] = "HKQuantityTypeIdentifierBasalBodyTemperature";
|
|
201
|
-
HKQuantityTypeIdentifier["bloodPressureSystolic"] = "HKQuantityTypeIdentifierBloodPressureSystolic";
|
|
202
|
-
HKQuantityTypeIdentifier["bloodPressureDiastolic"] = "HKQuantityTypeIdentifierBloodPressureDiastolic";
|
|
203
|
-
HKQuantityTypeIdentifier["respiratoryRate"] = "HKQuantityTypeIdentifierRespiratoryRate";
|
|
204
|
-
HKQuantityTypeIdentifier["restingHeartRate"] = "HKQuantityTypeIdentifierRestingHeartRate";
|
|
205
|
-
HKQuantityTypeIdentifier["walkingHeartRateAverage"] = "HKQuantityTypeIdentifierWalkingHeartRateAverage";
|
|
206
|
-
HKQuantityTypeIdentifier["heartRateVariabilitySDNN"] = "HKQuantityTypeIdentifierHeartRateVariabilitySDNN";
|
|
207
|
-
HKQuantityTypeIdentifier["oxygenSaturation"] = "HKQuantityTypeIdentifierOxygenSaturation";
|
|
208
|
-
HKQuantityTypeIdentifier["peripheralPerfusionIndex"] = "HKQuantityTypeIdentifierPeripheralPerfusionIndex";
|
|
209
|
-
HKQuantityTypeIdentifier["bloodGlucose"] = "HKQuantityTypeIdentifierBloodGlucose";
|
|
210
|
-
HKQuantityTypeIdentifier["numberOfTimesFallen"] = "HKQuantityTypeIdentifierNumberOfTimesFallen";
|
|
211
|
-
HKQuantityTypeIdentifier["electrodermalActivity"] = "HKQuantityTypeIdentifierElectrodermalActivity";
|
|
212
|
-
HKQuantityTypeIdentifier["inhalerUsage"] = "HKQuantityTypeIdentifierInhalerUsage";
|
|
213
|
-
HKQuantityTypeIdentifier["insulinDelivery"] = "HKQuantityTypeIdentifierInsulinDelivery";
|
|
214
|
-
HKQuantityTypeIdentifier["bloodAlcoholContent"] = "HKQuantityTypeIdentifierBloodAlcoholContent";
|
|
215
|
-
HKQuantityTypeIdentifier["forcedVitalCapacity"] = "HKQuantityTypeIdentifierForcedVitalCapacity";
|
|
216
|
-
HKQuantityTypeIdentifier["forcedExpiratoryVolume1"] = "HKQuantityTypeIdentifierForcedExpiratoryVolume1";
|
|
217
|
-
HKQuantityTypeIdentifier["peakExpiratoryFlowRate"] = "HKQuantityTypeIdentifierPeakExpiratoryFlowRate";
|
|
218
|
-
HKQuantityTypeIdentifier["environmentalAudioExposure"] = "HKQuantityTypeIdentifierEnvironmentalAudioExposure";
|
|
219
|
-
HKQuantityTypeIdentifier["headphoneAudioExposure"] = "HKQuantityTypeIdentifierHeadphoneAudioExposure";
|
|
220
|
-
HKQuantityTypeIdentifier["dietaryFatTotal"] = "HKQuantityTypeIdentifierDietaryFatTotal";
|
|
221
|
-
HKQuantityTypeIdentifier["dietaryFatPolyunsaturated"] = "HKQuantityTypeIdentifierDietaryFatPolyunsaturated";
|
|
222
|
-
HKQuantityTypeIdentifier["dietaryFatMonounsaturated"] = "HKQuantityTypeIdentifierDietaryFatMonounsaturated";
|
|
223
|
-
HKQuantityTypeIdentifier["dietaryFatSaturated"] = "HKQuantityTypeIdentifierDietaryFatSaturated";
|
|
224
|
-
HKQuantityTypeIdentifier["dietaryCholesterol"] = "HKQuantityTypeIdentifierDietaryCholesterol";
|
|
225
|
-
HKQuantityTypeIdentifier["dietarySodium"] = "HKQuantityTypeIdentifierDietarySodium";
|
|
226
|
-
HKQuantityTypeIdentifier["dietaryCarbohydrates"] = "HKQuantityTypeIdentifierDietaryCarbohydrates";
|
|
227
|
-
HKQuantityTypeIdentifier["dietaryFiber"] = "HKQuantityTypeIdentifierDietaryFiber";
|
|
228
|
-
HKQuantityTypeIdentifier["dietarySugar"] = "HKQuantityTypeIdentifierDietarySugar";
|
|
229
|
-
HKQuantityTypeIdentifier["dietaryEnergyConsumed"] = "HKQuantityTypeIdentifierDietaryEnergyConsumed";
|
|
230
|
-
HKQuantityTypeIdentifier["dietaryProtein"] = "HKQuantityTypeIdentifierDietaryProtein";
|
|
231
|
-
HKQuantityTypeIdentifier["dietaryVitaminA"] = "HKQuantityTypeIdentifierDietaryVitaminA";
|
|
232
|
-
HKQuantityTypeIdentifier["dietaryVitaminB6"] = "HKQuantityTypeIdentifierDietaryVitaminB6";
|
|
233
|
-
HKQuantityTypeIdentifier["dietaryVitaminB12"] = "HKQuantityTypeIdentifierDietaryVitaminB12";
|
|
234
|
-
HKQuantityTypeIdentifier["dietaryVitaminC"] = "HKQuantityTypeIdentifierDietaryVitaminC";
|
|
235
|
-
HKQuantityTypeIdentifier["dietaryVitaminD"] = "HKQuantityTypeIdentifierDietaryVitaminD";
|
|
236
|
-
HKQuantityTypeIdentifier["dietaryVitaminE"] = "HKQuantityTypeIdentifierDietaryVitaminE";
|
|
237
|
-
HKQuantityTypeIdentifier["dietaryVitaminK"] = "HKQuantityTypeIdentifierDietaryVitaminK";
|
|
238
|
-
HKQuantityTypeIdentifier["dietaryCalcium"] = "HKQuantityTypeIdentifierDietaryCalcium";
|
|
239
|
-
HKQuantityTypeIdentifier["dietaryIron"] = "HKQuantityTypeIdentifierDietaryIron";
|
|
240
|
-
HKQuantityTypeIdentifier["dietaryThiamin"] = "HKQuantityTypeIdentifierDietaryThiamin";
|
|
241
|
-
HKQuantityTypeIdentifier["dietaryRiboflavin"] = "HKQuantityTypeIdentifierDietaryRiboflavin";
|
|
242
|
-
HKQuantityTypeIdentifier["dietaryNiacin"] = "HKQuantityTypeIdentifierDietaryNiacin";
|
|
243
|
-
HKQuantityTypeIdentifier["dietaryFolate"] = "HKQuantityTypeIdentifierDietaryFolate";
|
|
244
|
-
HKQuantityTypeIdentifier["dietaryBiotin"] = "HKQuantityTypeIdentifierDietaryBiotin";
|
|
245
|
-
HKQuantityTypeIdentifier["dietaryPantothenicAcid"] = "HKQuantityTypeIdentifierDietaryPantothenicAcid";
|
|
246
|
-
HKQuantityTypeIdentifier["dietaryPhosphorus"] = "HKQuantityTypeIdentifierDietaryPhosphorus";
|
|
247
|
-
HKQuantityTypeIdentifier["dietaryIodine"] = "HKQuantityTypeIdentifierDietaryIodine";
|
|
248
|
-
HKQuantityTypeIdentifier["dietaryMagnesium"] = "HKQuantityTypeIdentifierDietaryMagnesium";
|
|
249
|
-
HKQuantityTypeIdentifier["dietaryZinc"] = "HKQuantityTypeIdentifierDietaryZinc";
|
|
250
|
-
HKQuantityTypeIdentifier["dietarySelenium"] = "HKQuantityTypeIdentifierDietarySelenium";
|
|
251
|
-
HKQuantityTypeIdentifier["dietaryCopper"] = "HKQuantityTypeIdentifierDietaryCopper";
|
|
252
|
-
HKQuantityTypeIdentifier["dietaryManganese"] = "HKQuantityTypeIdentifierDietaryManganese";
|
|
253
|
-
HKQuantityTypeIdentifier["dietaryChromium"] = "HKQuantityTypeIdentifierDietaryChromium";
|
|
254
|
-
HKQuantityTypeIdentifier["dietaryMolybdenum"] = "HKQuantityTypeIdentifierDietaryMolybdenum";
|
|
255
|
-
HKQuantityTypeIdentifier["dietaryChloride"] = "HKQuantityTypeIdentifierDietaryChloride";
|
|
256
|
-
HKQuantityTypeIdentifier["dietaryPotassium"] = "HKQuantityTypeIdentifierDietaryPotassium";
|
|
257
|
-
HKQuantityTypeIdentifier["dietaryCaffeine"] = "HKQuantityTypeIdentifierDietaryCaffeine";
|
|
258
|
-
HKQuantityTypeIdentifier["dietaryWater"] = "HKQuantityTypeIdentifierDietaryWater";
|
|
259
|
-
HKQuantityTypeIdentifier["sixMinuteWalkTestDistance"] = "HKQuantityTypeIdentifierSixMinuteWalkTestDistance";
|
|
260
|
-
HKQuantityTypeIdentifier["walkingSpeed"] = "HKQuantityTypeIdentifierWalkingSpeed";
|
|
261
|
-
HKQuantityTypeIdentifier["walkingStepLength"] = "HKQuantityTypeIdentifierWalkingStepLength";
|
|
262
|
-
HKQuantityTypeIdentifier["walkingAsymmetryPercentage"] = "HKQuantityTypeIdentifierWalkingAsymmetryPercentage";
|
|
263
|
-
HKQuantityTypeIdentifier["walkingDoubleSupportPercentage"] = "HKQuantityTypeIdentifierWalkingDoubleSupportPercentage";
|
|
264
|
-
HKQuantityTypeIdentifier["stairAscentSpeed"] = "HKQuantityTypeIdentifierStairAscentSpeed";
|
|
265
|
-
HKQuantityTypeIdentifier["stairDescentSpeed"] = "HKQuantityTypeIdentifierStairDescentSpeed";
|
|
266
|
-
HKQuantityTypeIdentifier["uvExposure"] = "HKQuantityTypeIdentifierUvExposure";
|
|
267
|
-
})(HKQuantityTypeIdentifier || (exports.HKQuantityTypeIdentifier = HKQuantityTypeIdentifier = {}));
|
|
268
|
-
|
|
269
286
|
let HKAuthorizationRequestStatus;
|
|
270
287
|
exports.HKAuthorizationRequestStatus = HKAuthorizationRequestStatus;
|
|
271
288
|
|
|
@@ -522,14 +539,6 @@ exports.HKCharacteristicTypeIdentifier = HKCharacteristicTypeIdentifier;
|
|
|
522
539
|
HKCharacteristicTypeIdentifier["wheelchairUse"] = "HKCharacteristicTypeIdentifierWheelchairUse";
|
|
523
540
|
})(HKCharacteristicTypeIdentifier || (exports.HKCharacteristicTypeIdentifier = HKCharacteristicTypeIdentifier = {}));
|
|
524
541
|
|
|
525
|
-
let HKCorrelationTypeIdentifier;
|
|
526
|
-
exports.HKCorrelationTypeIdentifier = HKCorrelationTypeIdentifier;
|
|
527
|
-
|
|
528
|
-
(function (HKCorrelationTypeIdentifier) {
|
|
529
|
-
HKCorrelationTypeIdentifier["bloodPressure"] = "HKCorrelationTypeIdentifierBloodPressure";
|
|
530
|
-
HKCorrelationTypeIdentifier["food"] = "HKCorrelationTypeIdentifierFood";
|
|
531
|
-
})(HKCorrelationTypeIdentifier || (exports.HKCorrelationTypeIdentifier = HKCorrelationTypeIdentifier = {}));
|
|
532
|
-
|
|
533
542
|
let HKUpdateFrequency;
|
|
534
543
|
exports.HKUpdateFrequency = HKUpdateFrequency;
|
|
535
544
|
|
|
@@ -540,6 +549,10 @@ exports.HKUpdateFrequency = HKUpdateFrequency;
|
|
|
540
549
|
HKUpdateFrequency[HKUpdateFrequency["weekly"] = 4] = "weekly";
|
|
541
550
|
})(HKUpdateFrequency || (exports.HKUpdateFrequency = HKUpdateFrequency = {}));
|
|
542
551
|
|
|
552
|
+
const HealthkitAuthorization = { ...HKCharacteristicTypeIdentifier,
|
|
553
|
+
...HKSampleTypeIdentifier
|
|
554
|
+
};
|
|
555
|
+
exports.HealthkitAuthorization = HealthkitAuthorization;
|
|
543
556
|
const Native = _reactNative.NativeModules.ReactNativeHealthkit;
|
|
544
557
|
const EventEmitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.ReactNativeHealthkit);
|
|
545
558
|
exports.EventEmitter = EventEmitter;
|