@kingstinct/react-native-healthkit 7.3.1 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/ios/Constants.swift +1 -1
- package/ios/ReactNativeHealthkit.m +1 -1
- package/ios/ReactNativeHealthkit.swift +2 -2
- package/ios/Serializers.swift +12 -0
- package/lib/commonjs/hooks/useHealthkitAuthorization.js +2 -3
- package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +1 -1
- package/lib/commonjs/hooks/useHealthkitAuthorization.test.js +42 -19
- package/lib/commonjs/hooks/useHealthkitAuthorization.test.js.map +1 -1
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js +2 -3
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -1
- package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js +17 -8
- package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js.map +1 -1
- package/lib/commonjs/hooks/useMostRecentCategorySample.js +2 -3
- package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -1
- package/lib/commonjs/hooks/useMostRecentQuantitySample.js +4 -3
- package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -1
- package/lib/commonjs/hooks/useMostRecentWorkout.js +2 -3
- package/lib/commonjs/hooks/useMostRecentWorkout.js.map +1 -1
- package/lib/commonjs/hooks/useSources.js +2 -3
- package/lib/commonjs/hooks/useSources.js.map +1 -1
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +2 -3
- package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +1 -1
- package/lib/commonjs/hooks/useSubscribeToChanges.js +2 -3
- package/lib/commonjs/hooks/useSubscribeToChanges.js.map +1 -1
- package/lib/commonjs/index.ios.js +471 -0
- package/lib/commonjs/index.ios.js.map +1 -0
- package/lib/commonjs/index.js +9 -482
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.native.js +46 -95
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/index.web.js +7 -1
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/native-types.js +65 -90
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/test-setup.js +51 -0
- package/lib/commonjs/test-setup.js.map +1 -0
- package/lib/commonjs/test-utils.js +1 -2
- package/lib/commonjs/test-utils.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/deleteQuantitySample.js +2 -3
- package/lib/commonjs/utils/deleteQuantitySample.js.map +1 -1
- package/lib/commonjs/utils/deleteSamples.js +2 -3
- package/lib/commonjs/utils/deleteSamples.js.map +1 -1
- package/lib/commonjs/utils/deserializeCategorySample.js +1 -2
- package/lib/commonjs/utils/deserializeCategorySample.js.map +1 -1
- package/lib/commonjs/utils/deserializeCategorySample.test.js +8 -4
- package/lib/commonjs/utils/deserializeCategorySample.test.js.map +1 -1
- package/lib/commonjs/utils/deserializeCorrelation.js +2 -3
- package/lib/commonjs/utils/deserializeCorrelation.js.map +1 -1
- package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js +1 -2
- package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js.map +1 -1
- package/lib/commonjs/utils/deserializeSample.js +1 -2
- package/lib/commonjs/utils/deserializeSample.js.map +1 -1
- package/lib/commonjs/utils/deserializeWorkout.js +1 -2
- package/lib/commonjs/utils/deserializeWorkout.js.map +1 -1
- package/lib/commonjs/utils/ensureMetadata.js +1 -2
- package/lib/commonjs/utils/ensureMetadata.js.map +1 -1
- package/lib/commonjs/utils/ensureTotals.js +1 -2
- package/lib/commonjs/utils/ensureTotals.js.map +1 -1
- package/lib/commonjs/utils/ensureUnit.js +2 -3
- package/lib/commonjs/utils/ensureUnit.js.map +1 -1
- package/lib/commonjs/utils/getDateOfBirth.js +2 -3
- package/lib/commonjs/utils/getDateOfBirth.js.map +1 -1
- package/lib/commonjs/utils/getMostRecentCategorySample.js +2 -3
- package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -1
- package/lib/commonjs/utils/getMostRecentQuantitySample.js +2 -3
- package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -1
- package/lib/commonjs/utils/getMostRecentWorkout.js +2 -3
- package/lib/commonjs/utils/getMostRecentWorkout.js.map +1 -1
- package/lib/commonjs/utils/getPreferredUnit.js +2 -3
- package/lib/commonjs/utils/getPreferredUnit.js.map +1 -1
- package/lib/commonjs/utils/getPreferredUnits.js +2 -3
- package/lib/commonjs/utils/getPreferredUnits.js.map +1 -1
- package/lib/commonjs/utils/getPreferredUnitsTyped.js +3 -4
- package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +1 -1
- package/lib/commonjs/utils/getRequestStatusForAuthorization.js +3 -5
- package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +1 -1
- package/lib/commonjs/utils/getWorkoutPlanById.js +2 -3
- package/lib/commonjs/utils/getWorkoutPlanById.js.map +1 -1
- package/lib/commonjs/utils/prepareOptions.js +3 -3
- package/lib/commonjs/utils/prepareOptions.js.map +1 -1
- package/lib/commonjs/utils/queryCategorySamples.js +2 -3
- package/lib/commonjs/utils/queryCategorySamples.js.map +1 -1
- package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js +2 -3
- package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js.map +1 -1
- package/lib/commonjs/utils/queryCorrelationSamples.js +2 -3
- package/lib/commonjs/utils/queryCorrelationSamples.js.map +1 -1
- package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js +2 -3
- package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js.map +1 -1
- package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js +2 -3
- package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +1 -1
- package/lib/commonjs/utils/queryQuantitySamples.js +2 -3
- package/lib/commonjs/utils/queryQuantitySamples.js.map +1 -1
- package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js +2 -3
- package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js.map +1 -1
- package/lib/commonjs/utils/querySources.js +2 -3
- package/lib/commonjs/utils/querySources.js.map +1 -1
- package/lib/commonjs/utils/queryStatisticsForQuantity.js +2 -3
- package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +1 -1
- package/lib/commonjs/utils/queryWorkouts.js +2 -3
- package/lib/commonjs/utils/queryWorkouts.js.map +1 -1
- package/lib/commonjs/utils/requestAuthorization.js +3 -5
- package/lib/commonjs/utils/requestAuthorization.js.map +1 -1
- package/lib/commonjs/utils/saveCategorySample.js +2 -3
- package/lib/commonjs/utils/saveCategorySample.js.map +1 -1
- package/lib/commonjs/utils/saveCorrelationSample.js +2 -3
- package/lib/commonjs/utils/saveCorrelationSample.js.map +1 -1
- package/lib/commonjs/utils/saveQuantitySample.js +2 -3
- package/lib/commonjs/utils/saveQuantitySample.js.map +1 -1
- package/lib/commonjs/utils/saveWorkoutRoute.js +2 -3
- package/lib/commonjs/utils/saveWorkoutRoute.js.map +1 -1
- package/lib/commonjs/utils/saveWorkoutSample.js +2 -3
- package/lib/commonjs/utils/saveWorkoutSample.js.map +1 -1
- package/lib/commonjs/utils/serializeDate.js +1 -2
- package/lib/commonjs/utils/serializeDate.js.map +1 -1
- package/lib/commonjs/utils/serializeDate.test.js +1 -1
- package/lib/commonjs/utils/serializeDate.test.js.map +1 -1
- package/lib/commonjs/utils/subscribeToChanges.js +6 -8
- package/lib/commonjs/utils/subscribeToChanges.js.map +1 -1
- package/lib/module/hooks/useHealthkitAuthorization.js.map +1 -1
- package/lib/module/hooks/useHealthkitAuthorization.test.js +26 -3
- package/lib/module/hooks/useHealthkitAuthorization.test.js.map +1 -1
- package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -1
- package/lib/module/hooks/useIsHealthDataAvailable.test.js +9 -2
- package/lib/module/hooks/useIsHealthDataAvailable.test.js.map +1 -1
- package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -1
- package/lib/module/hooks/useMostRecentQuantitySample.js +2 -0
- package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -1
- package/lib/module/hooks/useMostRecentWorkout.js.map +1 -1
- package/lib/module/hooks/useSources.js.map +1 -1
- package/lib/module/hooks/useStatisticsForQuantity.js.map +1 -1
- package/lib/module/hooks/useSubscribeToChanges.js.map +1 -1
- package/lib/module/index.ios.js +188 -0
- package/lib/module/index.ios.js.map +1 -0
- package/lib/module/index.js +3 -198
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.native.js +1 -3
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/index.web.js +2 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/native-types.js +21 -2
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/test-setup.js +48 -0
- package/lib/module/test-setup.js.map +1 -0
- package/lib/module/test-utils.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/deleteQuantitySample.js.map +1 -1
- package/lib/module/utils/deleteSamples.js.map +1 -1
- package/lib/module/utils/deserializeCategorySample.js.map +1 -1
- package/lib/module/utils/deserializeCategorySample.test.js +4 -2
- package/lib/module/utils/deserializeCategorySample.test.js.map +1 -1
- package/lib/module/utils/deserializeCorrelation.js.map +1 -1
- package/lib/module/utils/deserializeHeartbeatSeriesSample.js.map +1 -1
- package/lib/module/utils/deserializeSample.js.map +1 -1
- package/lib/module/utils/deserializeWorkout.js.map +1 -1
- package/lib/module/utils/ensureMetadata.js.map +1 -1
- package/lib/module/utils/ensureTotals.js.map +1 -1
- package/lib/module/utils/ensureUnit.js.map +1 -1
- package/lib/module/utils/getDateOfBirth.js.map +1 -1
- package/lib/module/utils/getMostRecentCategorySample.js.map +1 -1
- package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -1
- package/lib/module/utils/getMostRecentWorkout.js.map +1 -1
- package/lib/module/utils/getPreferredUnit.js.map +1 -1
- package/lib/module/utils/getPreferredUnits.js.map +1 -1
- package/lib/module/utils/getPreferredUnitsTyped.js.map +1 -1
- package/lib/module/utils/getRequestStatusForAuthorization.js +1 -2
- package/lib/module/utils/getRequestStatusForAuthorization.js.map +1 -1
- package/lib/module/utils/getWorkoutPlanById.js.map +1 -1
- package/lib/module/utils/prepareOptions.js +1 -0
- package/lib/module/utils/prepareOptions.js.map +1 -1
- package/lib/module/utils/queryCategorySamples.js.map +1 -1
- package/lib/module/utils/queryCategorySamplesWithAnchor.js.map +1 -1
- package/lib/module/utils/queryCorrelationSamples.js.map +1 -1
- package/lib/module/utils/queryHeartbeatSeriesSamples.js.map +1 -1
- package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +1 -1
- package/lib/module/utils/queryQuantitySamples.js.map +1 -1
- package/lib/module/utils/queryQuantitySamplesWithAnchor.js.map +1 -1
- package/lib/module/utils/querySources.js.map +1 -1
- package/lib/module/utils/queryStatisticsForQuantity.js.map +1 -1
- package/lib/module/utils/queryWorkouts.js.map +1 -1
- package/lib/module/utils/requestAuthorization.js +1 -2
- package/lib/module/utils/requestAuthorization.js.map +1 -1
- package/lib/module/utils/saveCategorySample.js.map +1 -1
- package/lib/module/utils/saveCorrelationSample.js.map +1 -1
- package/lib/module/utils/saveQuantitySample.js.map +1 -1
- package/lib/module/utils/saveWorkoutRoute.js.map +1 -1
- package/lib/module/utils/saveWorkoutSample.js.map +1 -1
- package/lib/module/utils/serializeDate.js.map +1 -1
- package/lib/module/utils/serializeDate.test.js.map +1 -1
- package/lib/module/utils/subscribeToChanges.js +3 -4
- package/lib/module/utils/subscribeToChanges.js.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -180
- package/lib/typescript/src/index.ios.d.ts +172 -0
- package/lib/typescript/src/index.native.d.ts +3 -3
- package/lib/typescript/src/index.web.d.ts +2 -0
- package/lib/typescript/src/native-types.d.ts +86 -8
- package/package.json +16 -11
- package/src/hooks/useHealthkitAuthorization.test.ts +18 -4
- package/src/hooks/useIsHealthDataAvailable.test.ts +5 -2
- package/src/hooks/useIsHealthDataAvailable.ts +1 -1
- package/src/hooks/useMostRecentQuantitySample.ts +3 -0
- package/src/index.ios.tsx +263 -0
- package/src/index.native.tsx +1 -4
- package/src/index.tsx +3 -274
- package/src/index.web.tsx +4 -0
- package/src/native-types.ts +97 -9
- package/src/test-setup.ts +51 -0
- package/src/utils/deserializeCategorySample.test.ts +5 -2
- package/src/utils/prepareOptions.ts +1 -0
- package/lib/commonjs/jest.setup.js +0 -45
- package/lib/commonjs/jest.setup.js.map +0 -1
- package/lib/module/jest.setup.js +0 -43
- package/lib/module/jest.setup.js.map +0 -1
- package/src/jest.setup.ts +0 -46
- /package/lib/typescript/src/{jest.setup.d.ts → test-setup.d.ts} +0 -0
|
@@ -1,180 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
|
|
5
|
-
import useMostRecentWorkout from './hooks/useMostRecentWorkout';
|
|
6
|
-
import useSources from './hooks/useSources';
|
|
7
|
-
import useStatisticsForQuantity from './hooks/useStatisticsForQuantity';
|
|
8
|
-
import useSubscribeToChanges from './hooks/useSubscribeToChanges';
|
|
9
|
-
import { HKQuantityTypeIdentifier } from './native-types';
|
|
10
|
-
import deleteQuantitySample from './utils/deleteQuantitySample';
|
|
11
|
-
import deleteSamples from './utils/deleteSamples';
|
|
12
|
-
import getDateOfBirth from './utils/getDateOfBirth';
|
|
13
|
-
import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
|
|
14
|
-
import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
|
|
15
|
-
import getMostRecentWorkout from './utils/getMostRecentWorkout';
|
|
16
|
-
import getPreferredUnit from './utils/getPreferredUnit';
|
|
17
|
-
import getPreferredUnits from './utils/getPreferredUnits';
|
|
18
|
-
import getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization';
|
|
19
|
-
import getWorkoutPlanById from './utils/getWorkoutPlanById';
|
|
20
|
-
import queryCategorySamples from './utils/queryCategorySamples';
|
|
21
|
-
import queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor';
|
|
22
|
-
import queryCorrelationSamples from './utils/queryCorrelationSamples';
|
|
23
|
-
import queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples';
|
|
24
|
-
import queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor';
|
|
25
|
-
import queryQuantitySamples from './utils/queryQuantitySamples';
|
|
26
|
-
import queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor';
|
|
27
|
-
import querySources from './utils/querySources';
|
|
28
|
-
import queryStatisticsForQuantity from './utils/queryStatisticsForQuantity';
|
|
29
|
-
import queryWorkouts from './utils/queryWorkouts';
|
|
30
|
-
import requestAuthorization from './utils/requestAuthorization';
|
|
31
|
-
import saveCategorySample from './utils/saveCategorySample';
|
|
32
|
-
import saveCorrelationSample from './utils/saveCorrelationSample';
|
|
33
|
-
import saveQuantitySample from './utils/saveQuantitySample';
|
|
34
|
-
import saveWorkoutRoute from './utils/saveWorkoutRoute';
|
|
35
|
-
import saveWorkoutSample from './utils/saveWorkoutSample';
|
|
36
|
-
import subscribeToChanges from './utils/subscribeToChanges';
|
|
37
|
-
declare const availableQuantityTypes: (majorVersionIOS?: number) => HKQuantityTypeIdentifier[];
|
|
38
|
-
declare const authorizationStatusFor: (type: import("./native-types").HealthkitReadAuthorization) => Promise<import("./native-types").HKAuthorizationStatus>;
|
|
39
|
-
declare const isHealthDataAvailable: () => Promise<boolean>;
|
|
40
|
-
declare const canAccessProtectedData: () => Promise<boolean>;
|
|
41
|
-
declare const disableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier) => Promise<boolean>;
|
|
42
|
-
declare const disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
43
|
-
declare const enableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier, updateFrequency: import("./native-types").HKUpdateFrequency) => Promise<boolean>;
|
|
44
|
-
declare const getBiologicalSex: () => Promise<import("./native-types").HKBiologicalSex>;
|
|
45
|
-
declare const getFitzpatrickSkinType: () => Promise<import("./native-types").HKFitzpatrickSkinType>;
|
|
46
|
-
declare const getWheelchairUse: () => Promise<import("./native-types").HKWheelchairUse>;
|
|
47
|
-
declare const getBloodType: () => Promise<import("./native-types").HKBloodType>;
|
|
48
|
-
declare const getWorkoutRoutes: (workoutUUID: string) => Promise<readonly import("./native-types").WorkoutRoute[]>;
|
|
49
|
-
/**
|
|
50
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
|
|
51
|
-
*/
|
|
52
|
-
declare const _default: {
|
|
53
|
-
/**
|
|
54
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
|
|
55
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
|
|
56
|
-
*/
|
|
57
|
-
authorizationStatusFor: (type: import("./native-types").HealthkitReadAuthorization) => Promise<import("./native-types").HKAuthorizationStatus>;
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
|
|
61
|
-
*/
|
|
62
|
-
availableQuantityTypes: (majorVersionIOS?: number) => HKQuantityTypeIdentifier[];
|
|
63
|
-
/**
|
|
64
|
-
* @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
|
|
65
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
|
|
66
|
-
* @returns {boolean} true if HealthKit is available; otherwise, false.
|
|
67
|
-
*/
|
|
68
|
-
isHealthDataAvailable: () => Promise<boolean>;
|
|
69
|
-
/**
|
|
70
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
|
|
71
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
|
|
72
|
-
* @returns {boolean} A Boolean value that indicates whether content protection is active.
|
|
73
|
-
*/
|
|
74
|
-
isProtectedDataAvailable: () => Promise<boolean>;
|
|
75
|
-
/**
|
|
76
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
|
|
77
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
|
|
78
|
-
* @deprecated Use {@link isProtectedDataAvailable} instead. Will be removed in next major version.
|
|
79
|
-
* @returns {boolean} A Boolean value that indicates whether content protection is active.
|
|
80
|
-
*/
|
|
81
|
-
canAccessProtectedData: () => Promise<boolean>;
|
|
82
|
-
/**
|
|
83
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
|
|
84
|
-
*/
|
|
85
|
-
disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
86
|
-
/**
|
|
87
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
|
|
88
|
-
*/
|
|
89
|
-
disableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier) => Promise<boolean>;
|
|
90
|
-
/**
|
|
91
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
|
|
92
|
-
*/
|
|
93
|
-
enableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier, updateFrequency: import("./native-types").HKUpdateFrequency) => Promise<boolean>;
|
|
94
|
-
/**
|
|
95
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
|
|
96
|
-
*/
|
|
97
|
-
getBiologicalSex: () => Promise<import("./native-types").HKBiologicalSex>;
|
|
98
|
-
/**
|
|
99
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
|
|
100
|
-
*/
|
|
101
|
-
getFitzpatrickSkinType: () => Promise<import("./native-types").HKFitzpatrickSkinType>;
|
|
102
|
-
/**
|
|
103
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
|
|
104
|
-
*/
|
|
105
|
-
getWheelchairUse: () => Promise<import("./native-types").HKWheelchairUse>;
|
|
106
|
-
/**
|
|
107
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
|
|
108
|
-
*/
|
|
109
|
-
getBloodType: () => Promise<import("./native-types").HKBloodType>;
|
|
110
|
-
/**
|
|
111
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
|
|
112
|
-
*/
|
|
113
|
-
getDateOfBirth: () => Promise<Date>;
|
|
114
|
-
getMostRecentQuantitySample: typeof getMostRecentQuantitySample;
|
|
115
|
-
getMostRecentCategorySample: typeof getMostRecentCategorySample;
|
|
116
|
-
getMostRecentWorkout: import("./utils/getMostRecentWorkout").GetMostRecentWorkoutFn;
|
|
117
|
-
/**
|
|
118
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
|
|
119
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
|
|
120
|
-
*/
|
|
121
|
-
getWorkoutRoutes: (workoutUUID: string) => Promise<readonly import("./native-types").WorkoutRoute[]>;
|
|
122
|
-
getWorkoutPlanById: typeof getWorkoutPlanById;
|
|
123
|
-
getPreferredUnit: import("./utils/getPreferredUnit").GetPreferredUnitFn;
|
|
124
|
-
getPreferredUnits: import("./utils/getPreferredUnits").GetPreferredUnitsFn;
|
|
125
|
-
getRequestStatusForAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<import("./native-types").HKAuthorizationRequestStatus>;
|
|
126
|
-
queryCategorySamples: import("./utils/queryCategorySamples").QueryCategorySamplesFn;
|
|
127
|
-
queryCategorySamplesWithAnchor: import("./utils/queryCategorySamplesWithAnchor").QueryCategorySamplesWithAnchorFn;
|
|
128
|
-
queryCorrelationSamples: import("./utils/queryCorrelationSamples").QueryCorrelationSamplesFn;
|
|
129
|
-
queryHeartbeatSeriesSamples: import("./utils/queryHeartbeatSeriesSamples").QueryHeartbeatSeriesSamplesFn;
|
|
130
|
-
queryHeartbeatSeriesSamplesWithAnchor: import("./utils/queryHeartbeatSeriesSamplesWithAnchor").QueryHeartbeatSeriesSamplesFn;
|
|
131
|
-
queryQuantitySamples: import("./utils/queryQuantitySamples").QueryQuantitySamplesFn;
|
|
132
|
-
queryQuantitySamplesWithAnchor: import("./utils/queryQuantitySamplesWithAnchor").QueryQuantitySamplesWithAnchorFn;
|
|
133
|
-
queryStatisticsForQuantity: typeof queryStatisticsForQuantity;
|
|
134
|
-
queryWorkouts: typeof queryWorkouts;
|
|
135
|
-
querySources: import("./utils/querySources").QuerySourcesFn;
|
|
136
|
-
requestAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<boolean>;
|
|
137
|
-
deleteQuantitySample: import("./utils/deleteQuantitySample").DeleteQuantitySampleFn;
|
|
138
|
-
deleteSamples: import("./utils/deleteSamples").DeleteSamplesFn;
|
|
139
|
-
/**
|
|
140
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
|
|
141
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
|
|
142
|
-
*/
|
|
143
|
-
saveCategorySample: typeof saveCategorySample;
|
|
144
|
-
saveCorrelationSample: typeof saveCorrelationSample;
|
|
145
|
-
saveQuantitySample: typeof saveQuantitySample;
|
|
146
|
-
saveWorkoutSample: typeof saveWorkoutSample;
|
|
147
|
-
saveWorkoutRoute: typeof saveWorkoutRoute;
|
|
148
|
-
subscribeToChanges: (identifier: import("./native-types").HKSampleTypeIdentifier, callback: () => void) => Promise<() => Promise<boolean>>;
|
|
149
|
-
/**
|
|
150
|
-
* @returns the most recent sample for the given category type.
|
|
151
|
-
*/
|
|
152
|
-
useMostRecentCategorySample: typeof useMostRecentCategorySample;
|
|
153
|
-
/**
|
|
154
|
-
* @returns the most recent sample for the given quantity type.
|
|
155
|
-
*/
|
|
156
|
-
useMostRecentQuantitySample: typeof useMostRecentQuantitySample;
|
|
157
|
-
/**
|
|
158
|
-
* @returns the most recent workout sample.
|
|
159
|
-
*/
|
|
160
|
-
useMostRecentWorkout: typeof useMostRecentWorkout;
|
|
161
|
-
useSubscribeToChanges: typeof useSubscribeToChanges;
|
|
162
|
-
/**
|
|
163
|
-
* @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
|
|
164
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
|
|
165
|
-
* @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
|
|
166
|
-
*/
|
|
167
|
-
useIsHealthDataAvailable: () => boolean | null;
|
|
168
|
-
/**
|
|
169
|
-
* @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
|
|
170
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
|
|
171
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
|
|
172
|
-
*/
|
|
173
|
-
useHealthkitAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[] | undefined) => readonly [import("./native-types").HKAuthorizationRequestStatus | null, () => Promise<import("./native-types").HKAuthorizationRequestStatus>];
|
|
174
|
-
useSources: typeof useSources;
|
|
175
|
-
useStatisticsForQuantity: typeof useStatisticsForQuantity;
|
|
176
|
-
};
|
|
177
|
-
export default _default;
|
|
178
|
-
declare const isProtectedDataAvailable: () => Promise<boolean>;
|
|
179
|
-
export { authorizationStatusFor, availableQuantityTypes, disableAllBackgroundDelivery, disableBackgroundDelivery, enableBackgroundDelivery, getBiologicalSex, getBloodType, getDateOfBirth, getFitzpatrickSkinType, getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, getPreferredUnits, getRequestStatusForAuthorization, getWheelchairUse, getWorkoutRoutes, isHealthDataAvailable, queryCategorySamples, queryCategorySamplesWithAnchor, queryCorrelationSamples, queryHeartbeatSeriesSamples, queryHeartbeatSeriesSamplesWithAnchor, queryQuantitySamples, queryQuantitySamplesWithAnchor, queryStatisticsForQuantity, queryWorkouts, querySources, requestAuthorization, deleteQuantitySample, deleteSamples, getWorkoutPlanById, saveCategorySample, saveCorrelationSample, saveQuantitySample, saveWorkoutSample, saveWorkoutRoute, subscribeToChanges, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSubscribeToChanges, useHealthkitAuthorization, useIsHealthDataAvailable, useSources, useStatisticsForQuantity, canAccessProtectedData, isProtectedDataAvailable, };
|
|
180
|
-
export * from './types';
|
|
1
|
+
import Healthkit from './index.ios';
|
|
2
|
+
export * from './index.ios';
|
|
3
|
+
export default Healthkit;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import useHealthkitAuthorization from './hooks/useHealthkitAuthorization';
|
|
2
|
+
import useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable';
|
|
3
|
+
import useMostRecentCategorySample from './hooks/useMostRecentCategorySample';
|
|
4
|
+
import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
|
|
5
|
+
import useMostRecentWorkout from './hooks/useMostRecentWorkout';
|
|
6
|
+
import useSources from './hooks/useSources';
|
|
7
|
+
import useStatisticsForQuantity from './hooks/useStatisticsForQuantity';
|
|
8
|
+
import useSubscribeToChanges from './hooks/useSubscribeToChanges';
|
|
9
|
+
import { HKQuantityTypeIdentifier } from './native-types';
|
|
10
|
+
import deleteQuantitySample from './utils/deleteQuantitySample';
|
|
11
|
+
import deleteSamples from './utils/deleteSamples';
|
|
12
|
+
import getDateOfBirth from './utils/getDateOfBirth';
|
|
13
|
+
import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
|
|
14
|
+
import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
|
|
15
|
+
import getMostRecentWorkout from './utils/getMostRecentWorkout';
|
|
16
|
+
import getPreferredUnit from './utils/getPreferredUnit';
|
|
17
|
+
import getPreferredUnits from './utils/getPreferredUnits';
|
|
18
|
+
import getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization';
|
|
19
|
+
import getWorkoutPlanById from './utils/getWorkoutPlanById';
|
|
20
|
+
import queryCategorySamples from './utils/queryCategorySamples';
|
|
21
|
+
import queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor';
|
|
22
|
+
import queryCorrelationSamples from './utils/queryCorrelationSamples';
|
|
23
|
+
import queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples';
|
|
24
|
+
import queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor';
|
|
25
|
+
import queryQuantitySamples from './utils/queryQuantitySamples';
|
|
26
|
+
import queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor';
|
|
27
|
+
import querySources from './utils/querySources';
|
|
28
|
+
import queryStatisticsForQuantity from './utils/queryStatisticsForQuantity';
|
|
29
|
+
import queryWorkouts from './utils/queryWorkouts';
|
|
30
|
+
import requestAuthorization from './utils/requestAuthorization';
|
|
31
|
+
import saveCategorySample from './utils/saveCategorySample';
|
|
32
|
+
import saveCorrelationSample from './utils/saveCorrelationSample';
|
|
33
|
+
import saveQuantitySample from './utils/saveQuantitySample';
|
|
34
|
+
import saveWorkoutRoute from './utils/saveWorkoutRoute';
|
|
35
|
+
import saveWorkoutSample from './utils/saveWorkoutSample';
|
|
36
|
+
import subscribeToChanges from './utils/subscribeToChanges';
|
|
37
|
+
declare const availableQuantityTypes: (majorVersionIOS?: number) => HKQuantityTypeIdentifier[];
|
|
38
|
+
declare const authorizationStatusFor: (type: import("./native-types").HealthkitReadAuthorization) => Promise<import("./native-types").HKAuthorizationStatus>;
|
|
39
|
+
declare const isHealthDataAvailable: () => Promise<boolean>;
|
|
40
|
+
declare const isProtectedDataAvailable: () => Promise<boolean>;
|
|
41
|
+
declare const disableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier) => Promise<boolean>;
|
|
42
|
+
declare const disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
43
|
+
declare const enableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier, updateFrequency: import("./native-types").HKUpdateFrequency) => Promise<boolean>;
|
|
44
|
+
declare const getBiologicalSex: () => Promise<import("./native-types").HKBiologicalSex>;
|
|
45
|
+
declare const getFitzpatrickSkinType: () => Promise<import("./native-types").HKFitzpatrickSkinType>;
|
|
46
|
+
declare const getWheelchairUse: () => Promise<import("./native-types").HKWheelchairUse>;
|
|
47
|
+
declare const getBloodType: () => Promise<import("./native-types").HKBloodType>;
|
|
48
|
+
declare const getWorkoutRoutes: (workoutUUID: string) => Promise<readonly import("./native-types").WorkoutRoute[]>;
|
|
49
|
+
/**
|
|
50
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
|
|
51
|
+
*/
|
|
52
|
+
declare const _default: {
|
|
53
|
+
/**
|
|
54
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
|
|
55
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
|
|
56
|
+
*/
|
|
57
|
+
authorizationStatusFor: (type: import("./native-types").HealthkitReadAuthorization) => Promise<import("./native-types").HKAuthorizationStatus>;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
|
|
61
|
+
*/
|
|
62
|
+
availableQuantityTypes: (majorVersionIOS?: number) => HKQuantityTypeIdentifier[];
|
|
63
|
+
/**
|
|
64
|
+
* @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
|
|
65
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
|
|
66
|
+
* @returns {boolean} true if HealthKit is available; otherwise, false.
|
|
67
|
+
*/
|
|
68
|
+
isHealthDataAvailable: () => Promise<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
|
|
71
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
|
|
72
|
+
* @returns {boolean} A Boolean value that indicates whether content protection is active.
|
|
73
|
+
*/
|
|
74
|
+
isProtectedDataAvailable: () => Promise<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
|
|
77
|
+
*/
|
|
78
|
+
disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
79
|
+
/**
|
|
80
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
|
|
81
|
+
*/
|
|
82
|
+
disableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier) => Promise<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
|
|
85
|
+
*/
|
|
86
|
+
enableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier, updateFrequency: import("./native-types").HKUpdateFrequency) => Promise<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
|
|
89
|
+
*/
|
|
90
|
+
getBiologicalSex: () => Promise<import("./native-types").HKBiologicalSex>;
|
|
91
|
+
/**
|
|
92
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
|
|
93
|
+
*/
|
|
94
|
+
getFitzpatrickSkinType: () => Promise<import("./native-types").HKFitzpatrickSkinType>;
|
|
95
|
+
/**
|
|
96
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
|
|
97
|
+
*/
|
|
98
|
+
getWheelchairUse: () => Promise<import("./native-types").HKWheelchairUse>;
|
|
99
|
+
/**
|
|
100
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
|
|
101
|
+
*/
|
|
102
|
+
getBloodType: () => Promise<import("./native-types").HKBloodType>;
|
|
103
|
+
/**
|
|
104
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
|
|
105
|
+
*/
|
|
106
|
+
getDateOfBirth: () => Promise<Date>;
|
|
107
|
+
getMostRecentQuantitySample: typeof getMostRecentQuantitySample;
|
|
108
|
+
getMostRecentCategorySample: typeof getMostRecentCategorySample;
|
|
109
|
+
getMostRecentWorkout: import("./utils/getMostRecentWorkout").GetMostRecentWorkoutFn;
|
|
110
|
+
/**
|
|
111
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
|
|
112
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
|
|
113
|
+
*/
|
|
114
|
+
getWorkoutRoutes: (workoutUUID: string) => Promise<readonly import("./native-types").WorkoutRoute[]>;
|
|
115
|
+
getWorkoutPlanById: typeof getWorkoutPlanById;
|
|
116
|
+
getPreferredUnit: import("./utils/getPreferredUnit").GetPreferredUnitFn;
|
|
117
|
+
getPreferredUnits: import("./utils/getPreferredUnits").GetPreferredUnitsFn;
|
|
118
|
+
getRequestStatusForAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<import("./native-types").HKAuthorizationRequestStatus>;
|
|
119
|
+
queryCategorySamples: import("./utils/queryCategorySamples").QueryCategorySamplesFn;
|
|
120
|
+
queryCategorySamplesWithAnchor: import("./utils/queryCategorySamplesWithAnchor").QueryCategorySamplesWithAnchorFn;
|
|
121
|
+
queryCorrelationSamples: import("./utils/queryCorrelationSamples").QueryCorrelationSamplesFn;
|
|
122
|
+
queryHeartbeatSeriesSamples: import("./utils/queryHeartbeatSeriesSamples").QueryHeartbeatSeriesSamplesFn;
|
|
123
|
+
queryHeartbeatSeriesSamplesWithAnchor: import("./utils/queryHeartbeatSeriesSamplesWithAnchor").QueryHeartbeatSeriesSamplesFn;
|
|
124
|
+
queryQuantitySamples: import("./utils/queryQuantitySamples").QueryQuantitySamplesFn;
|
|
125
|
+
queryQuantitySamplesWithAnchor: import("./utils/queryQuantitySamplesWithAnchor").QueryQuantitySamplesWithAnchorFn;
|
|
126
|
+
queryStatisticsForQuantity: typeof queryStatisticsForQuantity;
|
|
127
|
+
queryWorkouts: typeof queryWorkouts;
|
|
128
|
+
querySources: import("./utils/querySources").QuerySourcesFn;
|
|
129
|
+
requestAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<boolean>;
|
|
130
|
+
deleteQuantitySample: import("./utils/deleteQuantitySample").DeleteQuantitySampleFn;
|
|
131
|
+
deleteSamples: import("./utils/deleteSamples").DeleteSamplesFn;
|
|
132
|
+
/**
|
|
133
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
|
|
134
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
|
|
135
|
+
*/
|
|
136
|
+
saveCategorySample: typeof saveCategorySample;
|
|
137
|
+
saveCorrelationSample: typeof saveCorrelationSample;
|
|
138
|
+
saveQuantitySample: typeof saveQuantitySample;
|
|
139
|
+
saveWorkoutSample: typeof saveWorkoutSample;
|
|
140
|
+
saveWorkoutRoute: typeof saveWorkoutRoute;
|
|
141
|
+
subscribeToChanges: (identifier: import("./native-types").HKSampleTypeIdentifier, callback: () => void) => Promise<() => Promise<boolean>>;
|
|
142
|
+
/**
|
|
143
|
+
* @returns the most recent sample for the given category type.
|
|
144
|
+
*/
|
|
145
|
+
useMostRecentCategorySample: typeof useMostRecentCategorySample;
|
|
146
|
+
/**
|
|
147
|
+
* @returns the most recent sample for the given quantity type.
|
|
148
|
+
*/
|
|
149
|
+
useMostRecentQuantitySample: typeof useMostRecentQuantitySample;
|
|
150
|
+
/**
|
|
151
|
+
* @returns the most recent workout sample.
|
|
152
|
+
*/
|
|
153
|
+
useMostRecentWorkout: typeof useMostRecentWorkout;
|
|
154
|
+
useSubscribeToChanges: typeof useSubscribeToChanges;
|
|
155
|
+
/**
|
|
156
|
+
* @description By default, HealthKit data is available on iOS and watchOS. HealthKit data is also available on iPadOS 17 or later. However, devices running in an enterprise environment may restrict access to HealthKit data.
|
|
157
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
|
|
158
|
+
* @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
|
|
159
|
+
*/
|
|
160
|
+
useIsHealthDataAvailable: () => boolean | null;
|
|
161
|
+
/**
|
|
162
|
+
* @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
|
|
163
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
|
|
164
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
|
|
165
|
+
*/
|
|
166
|
+
useHealthkitAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[] | undefined) => readonly [import("./native-types").HKAuthorizationRequestStatus | null, () => Promise<import("./native-types").HKAuthorizationRequestStatus>];
|
|
167
|
+
useSources: typeof useSources;
|
|
168
|
+
useStatisticsForQuantity: typeof useStatisticsForQuantity;
|
|
169
|
+
};
|
|
170
|
+
export default _default;
|
|
171
|
+
export { authorizationStatusFor, availableQuantityTypes, disableAllBackgroundDelivery, disableBackgroundDelivery, enableBackgroundDelivery, getBiologicalSex, getBloodType, getDateOfBirth, getFitzpatrickSkinType, getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, getPreferredUnits, getRequestStatusForAuthorization, getWheelchairUse, getWorkoutRoutes, isHealthDataAvailable, queryCategorySamples, queryCategorySamplesWithAnchor, queryCorrelationSamples, queryHeartbeatSeriesSamples, queryHeartbeatSeriesSamplesWithAnchor, queryQuantitySamples, queryQuantitySamplesWithAnchor, queryStatisticsForQuantity, queryWorkouts, querySources, requestAuthorization, deleteQuantitySample, deleteSamples, getWorkoutPlanById, saveCategorySample, saveCorrelationSample, saveQuantitySample, saveWorkoutSample, saveWorkoutRoute, subscribeToChanges, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSubscribeToChanges, useHealthkitAuthorization, useIsHealthDataAvailable, useSources, useStatisticsForQuantity, isProtectedDataAvailable, };
|
|
172
|
+
export * from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HKAuthorizationRequestStatus, HKAuthorizationStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse } from './native-types';
|
|
2
|
-
import type ReactNativeHealthkit from '.';
|
|
2
|
+
import type ReactNativeHealthkit from './index.ios';
|
|
3
3
|
import type { QueryCategorySamplesFn } from './utils/queryCategorySamples';
|
|
4
4
|
import type { QueryQuantitySamplesFn } from './utils/queryQuantitySamples';
|
|
5
5
|
declare const authorizationStatusFor: () => Promise<HKAuthorizationStatus>, availableQuantityTypes: () => never[], disableAllBackgroundDelivery: () => Promise<boolean>, disableBackgroundDelivery: () => Promise<boolean>, enableBackgroundDelivery: () => Promise<boolean>, getBiologicalSex: () => Promise<HKBiologicalSex>, getBloodType: () => Promise<HKBloodType>, getDateOfBirth: () => Promise<Date>, getFitzpatrickSkinType: () => Promise<HKFitzpatrickSkinType>, getMostRecentCategorySample: () => Promise<null>, getMostRecentQuantitySample: () => Promise<null>, getMostRecentWorkout: () => Promise<null>, getPreferredUnit: () => Promise<HKUnits>, getPreferredUnits: () => Promise<never[]>, getRequestStatusForAuthorization: () => Promise<HKAuthorizationRequestStatus>, getWheelchairUse: () => Promise<HKWheelchairUse>, getWorkoutRoutes: () => Promise<never[]>, isHealthDataAvailable: () => Promise<boolean>, useSources: () => null, useStatisticsForQuantity: () => null, queryCategorySamples: QueryCategorySamplesFn, queryCategorySamplesWithAnchor: () => Promise<{
|
|
@@ -22,8 +22,8 @@ declare const authorizationStatusFor: () => Promise<HKAuthorizationStatus>, avai
|
|
|
22
22
|
mostRecentQuantity: undefined;
|
|
23
23
|
mostRecentQuantityDateInterval: undefined;
|
|
24
24
|
duration: undefined;
|
|
25
|
-
}>, queryWorkouts: () => Promise<never[]>, querySources: () => Promise<never[]>, requestAuthorization: () => Promise<boolean>, deleteQuantitySample: () => Promise<boolean>, deleteSamples: () => Promise<boolean>, getWorkoutPlanById: () => Promise<null>, saveCategorySample: () => Promise<boolean>, saveCorrelationSample: () => Promise<boolean>, saveQuantitySample: () => Promise<boolean>, saveWorkoutSample: () => Promise<null>, saveWorkoutRoute: () => Promise<boolean>, subscribeToChanges: () => Promise<() => Promise<boolean>>, useMostRecentCategorySample: () => null, useMostRecentQuantitySample: () => null, useMostRecentWorkout: () => null, useSubscribeToChanges: () => ((() => null) | null)[], useHealthkitAuthorization: () => readonly [null, () => Promise<HKAuthorizationRequestStatus>], useIsHealthDataAvailable: () => boolean,
|
|
25
|
+
}>, queryWorkouts: () => Promise<never[]>, querySources: () => Promise<never[]>, requestAuthorization: () => Promise<boolean>, deleteQuantitySample: () => Promise<boolean>, deleteSamples: () => Promise<boolean>, getWorkoutPlanById: () => Promise<null>, saveCategorySample: () => Promise<boolean>, saveCorrelationSample: () => Promise<boolean>, saveQuantitySample: () => Promise<boolean>, saveWorkoutSample: () => Promise<null>, saveWorkoutRoute: () => Promise<boolean>, subscribeToChanges: () => Promise<() => Promise<boolean>>, useMostRecentCategorySample: () => null, useMostRecentQuantitySample: () => null, useMostRecentWorkout: () => null, useSubscribeToChanges: () => ((() => null) | null)[], useHealthkitAuthorization: () => readonly [null, () => Promise<HKAuthorizationRequestStatus>], useIsHealthDataAvailable: () => boolean, isProtectedDataAvailable: () => Promise<boolean>;
|
|
26
26
|
declare const Healthkit: typeof ReactNativeHealthkit;
|
|
27
|
-
export { authorizationStatusFor, availableQuantityTypes, disableAllBackgroundDelivery, disableBackgroundDelivery, enableBackgroundDelivery, useSources, useStatisticsForQuantity, getBiologicalSex, getBloodType, getDateOfBirth, getFitzpatrickSkinType, getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, getPreferredUnits, getRequestStatusForAuthorization, getWheelchairUse, getWorkoutRoutes, isHealthDataAvailable, queryCategorySamples, queryCategorySamplesWithAnchor, queryCorrelationSamples, queryHeartbeatSeriesSamples, queryHeartbeatSeriesSamplesWithAnchor, queryQuantitySamples, queryQuantitySamplesWithAnchor, queryStatisticsForQuantity, queryWorkouts, querySources, requestAuthorization, deleteQuantitySample, deleteSamples, getWorkoutPlanById, saveCategorySample, saveCorrelationSample, saveQuantitySample, saveWorkoutSample, saveWorkoutRoute, subscribeToChanges, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSubscribeToChanges, useHealthkitAuthorization, useIsHealthDataAvailable,
|
|
27
|
+
export { authorizationStatusFor, availableQuantityTypes, disableAllBackgroundDelivery, disableBackgroundDelivery, enableBackgroundDelivery, useSources, useStatisticsForQuantity, getBiologicalSex, getBloodType, getDateOfBirth, getFitzpatrickSkinType, getMostRecentCategorySample, getMostRecentQuantitySample, getMostRecentWorkout, getPreferredUnit, getPreferredUnits, getRequestStatusForAuthorization, getWheelchairUse, getWorkoutRoutes, isHealthDataAvailable, queryCategorySamples, queryCategorySamplesWithAnchor, queryCorrelationSamples, queryHeartbeatSeriesSamples, queryHeartbeatSeriesSamplesWithAnchor, queryQuantitySamples, queryQuantitySamplesWithAnchor, queryStatisticsForQuantity, queryWorkouts, querySources, requestAuthorization, deleteQuantitySample, deleteSamples, getWorkoutPlanById, saveCategorySample, saveCorrelationSample, saveQuantitySample, saveWorkoutSample, saveWorkoutRoute, subscribeToChanges, useMostRecentCategorySample, useMostRecentQuantitySample, useMostRecentWorkout, useSubscribeToChanges, useHealthkitAuthorization, useIsHealthDataAvailable, isProtectedDataAvailable, };
|
|
28
28
|
export * from './types';
|
|
29
29
|
export default Healthkit;
|
|
@@ -623,7 +623,61 @@ export declare enum HKQuantityTypeIdentifier {
|
|
|
623
623
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifierrunningspeed Apple Docs HKQuantityTypeIdentifierRunningSpeed}
|
|
624
624
|
* @since iOS 16
|
|
625
625
|
*/
|
|
626
|
-
runningSpeed = "HKQuantityTypeIdentifierRunningSpeed"
|
|
626
|
+
runningSpeed = "HKQuantityTypeIdentifierRunningSpeed",
|
|
627
|
+
/**
|
|
628
|
+
* Cross Country Skiing Speed
|
|
629
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierCrossCountrySkiingSpeed Apple Docs HKQuantityTypeIdentifierCrossCountrySkiingSpeed}
|
|
630
|
+
* @since iOS 18
|
|
631
|
+
*/
|
|
632
|
+
crossCountrySkiingSpeed = "HKQuantityTypeIdentifierCrossCountrySkiingSpeed",
|
|
633
|
+
/**
|
|
634
|
+
* Cross Country Skiing Distance
|
|
635
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceCrossCountrySkiing Apple Docs HKQuantityTypeIdentifierCrossCountrySkiingDistance}
|
|
636
|
+
* @since iOS 18
|
|
637
|
+
*/
|
|
638
|
+
distanceCrossCountrySkiing = "HKQuantityTypeIdentifierDistanceCrossCountrySkiing",
|
|
639
|
+
/**
|
|
640
|
+
* Paddle Sports Distance
|
|
641
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistancePaddleSports Apple Docs HKQuantityTypeIdentifierDistancePaddleSports}
|
|
642
|
+
* @since iOS 18
|
|
643
|
+
*/
|
|
644
|
+
distancePaddleSports = "HKQuantityTypeIdentifierDistancePaddleSports",
|
|
645
|
+
/**
|
|
646
|
+
* Rowing Distance
|
|
647
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceRowing Apple Docs HKQuantityTypeIdentifierDistanceRowing}
|
|
648
|
+
* @since iOS 18
|
|
649
|
+
*/
|
|
650
|
+
distanceRowing = "HKQuantityTypeIdentifierDistanceRowing",
|
|
651
|
+
/**
|
|
652
|
+
* Skating Sports Distance
|
|
653
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierDistanceSkatingSports Apple Docs HKQuantityTypeIdentifierDistanceSkatingSports}
|
|
654
|
+
* @since iOS 18
|
|
655
|
+
*/
|
|
656
|
+
distanceSkatingSports = "HKQuantityTypeIdentifierDistanceSkatingSports",
|
|
657
|
+
/**
|
|
658
|
+
* Estimated Workout Effort Score
|
|
659
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierEstimatedWorkoutEffortScore Apple Docs HKQuantityTypeIdentifierEstimatedWorkoutEffortScore}
|
|
660
|
+
* @since iOS 18
|
|
661
|
+
*/
|
|
662
|
+
estimatedWorkoutEffortScore = "HKQuantityTypeIdentifierEstimatedWorkoutEffortScore",
|
|
663
|
+
/**
|
|
664
|
+
* Paddle Sports Speed
|
|
665
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierPaddleSportsSpeed Apple Docs HKQuantityTypeIdentifierPaddleSportsSpeed}
|
|
666
|
+
* @since iOS 18
|
|
667
|
+
*/
|
|
668
|
+
paddleSportsSpeed = "HKQuantityTypeIdentifierPaddleSportsSpeed",
|
|
669
|
+
/**
|
|
670
|
+
* Rowing Speed
|
|
671
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierRowingSpeed Apple Docs HKQuantityTypeIdentifierRowingSpeed}
|
|
672
|
+
* @since iOS 18
|
|
673
|
+
*/
|
|
674
|
+
rowingSpeed = "HKQuantityTypeIdentifierRowingSpeed",
|
|
675
|
+
/**
|
|
676
|
+
* Workout Effort Score
|
|
677
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/HKQuantityTypeIdentifierWorkoutEffortScore Apple Docs HKQuantityTypeIdentifierWorkoutEffortScore}
|
|
678
|
+
* @since iOS 18
|
|
679
|
+
*/
|
|
680
|
+
workoutEffortScore = "HKQuantityTypeIdentifierWorkoutEffortScore"
|
|
627
681
|
}
|
|
628
682
|
export type TypeToUnitMapping = {
|
|
629
683
|
readonly [key in HKQuantityTypeIdentifier]: HKUnit;
|
|
@@ -651,6 +705,10 @@ export declare enum HKCategoryTypeIdentifier {
|
|
|
651
705
|
appleStandHour = "HKCategoryTypeIdentifierAppleStandHour",
|
|
652
706
|
cervicalMucusQuality = "HKCategoryTypeIdentifierCervicalMucusQuality",
|
|
653
707
|
ovulationTestResult = "HKCategoryTypeIdentifierOvulationTestResult",
|
|
708
|
+
/**
|
|
709
|
+
* @deprecated In iOS 18 beta
|
|
710
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifiermenstrualflow Apple Docs }
|
|
711
|
+
*/
|
|
654
712
|
menstrualFlow = "HKCategoryTypeIdentifierMenstrualFlow",
|
|
655
713
|
intermenstrualBleeding = "HKCategoryTypeIdentifierIntermenstrualBleeding",
|
|
656
714
|
sexualActivity = "HKCategoryTypeIdentifierSexualActivity",
|
|
@@ -711,7 +769,19 @@ export declare enum HKCategoryTypeIdentifier {
|
|
|
711
769
|
soreThroat = "HKCategoryTypeIdentifierSoreThroat",
|
|
712
770
|
vaginalDryness = "HKCategoryTypeIdentifierVaginalDryness",
|
|
713
771
|
vomiting = "HKCategoryTypeIdentifierVomiting",
|
|
714
|
-
wheezing = "HKCategoryTypeIdentifierWheezing"
|
|
772
|
+
wheezing = "HKCategoryTypeIdentifierWheezing",
|
|
773
|
+
/**
|
|
774
|
+
* Bleeding After Pregnancy
|
|
775
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifierbleedingafterpregnancy Apple Docs }
|
|
776
|
+
* @since iOS 18
|
|
777
|
+
*/
|
|
778
|
+
bleedingAfterPregnancy = "HKCategoryTypeIdentifierBleedingAfterPregnancy",
|
|
779
|
+
/**
|
|
780
|
+
* Bleeding During Pregnancy
|
|
781
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifierbleedingduringpregnancy Apple Docs }
|
|
782
|
+
* @since iOS 18
|
|
783
|
+
*/
|
|
784
|
+
bleedingDuringPregnancy = "HKCategoryTypeIdentifierBleedingDuringPregnancy"
|
|
715
785
|
}
|
|
716
786
|
export type HKSampleTypeIdentifier = HKCategoryTypeIdentifier | HKCorrelationTypeIdentifier | HKQuantityTypeIdentifier | typeof HKActivitySummaryTypeIdentifier | typeof HKAudiogramTypeIdentifier | typeof HKDataTypeIdentifierHeartbeatSeries | typeof HKWorkoutRouteTypeIdentifier | typeof HKWorkoutTypeIdentifier | `${HKCategoryTypeIdentifier}` | `${HKCorrelationTypeIdentifier}` | `${HKQuantityTypeIdentifier}`;
|
|
717
787
|
export type HealthkitReadAuthorization = HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier | `${HKCharacteristicTypeIdentifier}` | `${HKSampleTypeIdentifier}`;
|
|
@@ -797,6 +867,13 @@ export declare enum HKWorkoutActivityType {
|
|
|
797
867
|
handCycling = 74,
|
|
798
868
|
discSports = 75,
|
|
799
869
|
fitnessGaming = 76,
|
|
870
|
+
cardioDance = 77,
|
|
871
|
+
socialDance = 78,
|
|
872
|
+
pickleball = 79,
|
|
873
|
+
cooldown = 80,
|
|
874
|
+
swimBikeRun = 82,
|
|
875
|
+
transition = 83,
|
|
876
|
+
underwaterDiving = 84,
|
|
800
877
|
other = 3000
|
|
801
878
|
}
|
|
802
879
|
export type HKGenericMetadata = {
|
|
@@ -949,6 +1026,7 @@ export declare enum HKCategoryValueCervicalMucusQuality {
|
|
|
949
1026
|
}
|
|
950
1027
|
/**
|
|
951
1028
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluemenstrualflow Apple Docs }
|
|
1029
|
+
* @deprecated In iOS 18 beta
|
|
952
1030
|
*/
|
|
953
1031
|
export declare enum HKCategoryValueMenstrualFlow {
|
|
954
1032
|
unspecified = 1,
|
|
@@ -978,7 +1056,7 @@ export declare enum HKCategoryValueSleepAnalysis {
|
|
|
978
1056
|
asleepREM = 5
|
|
979
1057
|
}
|
|
980
1058
|
/**
|
|
981
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges
|
|
1059
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges Apple Docs}
|
|
982
1060
|
*/
|
|
983
1061
|
export declare enum HKCategoryValueAppetiteChanges {
|
|
984
1062
|
decreased = 2,
|
|
@@ -987,7 +1065,7 @@ export declare enum HKCategoryValueAppetiteChanges {
|
|
|
987
1065
|
unspecified = 0
|
|
988
1066
|
}
|
|
989
1067
|
/**
|
|
990
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence
|
|
1068
|
+
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence Apple Docs}
|
|
991
1069
|
*/
|
|
992
1070
|
export declare enum HKCategoryValuePresence {
|
|
993
1071
|
notPresent = 1,
|
|
@@ -1030,8 +1108,8 @@ export type MetadataMapperForQuantityIdentifier<TQuantityTypeIdentifier = HKQuan
|
|
|
1030
1108
|
export type MetadataMapperForCorrelationIdentifier<TCorrelationTypeIdentifier = HKCorrelationTypeIdentifier> = TCorrelationTypeIdentifier extends HKCorrelationTypeIdentifier.food ? HKGenericMetadata & {
|
|
1031
1109
|
readonly HKFoodType?: string;
|
|
1032
1110
|
} : HKGenericMetadata;
|
|
1033
|
-
export type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent : T extends HKQuantityTypeIdentifier.basalBodyTemperature
|
|
1034
|
-
export type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> = T extends HKCategoryTypeIdentifier.cervicalMucusQuality ? HKCategoryValueCervicalMucusQuality : T extends HKCategoryTypeIdentifier.menstrualFlow ? HKCategoryValueMenstrualFlow : T extends HKCategoryTypeIdentifier.ovulationTestResult ? HKCategoryValueOvulationTestResult : T extends HKCategoryTypeIdentifier.sleepAnalysis ? HKCategoryValueSleepAnalysis : T extends HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity ? HKCategoryValueNotApplicable : T extends HKCategoryTypeIdentifier.abdominalCramps | HKCategoryTypeIdentifier.
|
|
1111
|
+
export type UnitForIdentifier<T extends HKQuantityTypeIdentifier> = T extends HKQuantityTypeIdentifier.bloodGlucose ? BloodGlucoseUnit : T extends HKQuantityTypeIdentifier.appleExerciseTime | HKQuantityTypeIdentifier.appleMoveTime | HKQuantityTypeIdentifier.appleStandTime ? TimeUnit : T extends HKQuantityTypeIdentifier.activeEnergyBurned | HKQuantityTypeIdentifier.basalEnergyBurned | HKQuantityTypeIdentifier.dietaryEnergyConsumed ? EnergyUnit : T extends HKQuantityTypeIdentifier.distanceCycling | HKQuantityTypeIdentifier.distanceDownhillSnowSports | HKQuantityTypeIdentifier.distanceSwimming | HKQuantityTypeIdentifier.distanceWalkingRunning | HKQuantityTypeIdentifier.distanceWheelchair | HKQuantityTypeIdentifier.sixMinuteWalkTestDistance | HKQuantityTypeIdentifier.waistCircumference ? LengthUnit : T extends HKQuantityTypeIdentifier.bodyFatPercentage | HKQuantityTypeIdentifier.oxygenSaturation | HKQuantityTypeIdentifier.walkingAsymmetryPercentage | HKQuantityTypeIdentifier.walkingDoubleSupportPercentage ? HKUnits.Percent : T extends HKQuantityTypeIdentifier.basalBodyTemperature ? TemperatureUnit : T extends HKQuantityTypeIdentifier.runningSpeed | HKQuantityTypeIdentifier.stairAscentSpeed | HKQuantityTypeIdentifier.stairDescentSpeed | HKQuantityTypeIdentifier.walkingSpeed ? SpeedUnit<LengthUnit, TimeUnit> : T extends HKQuantityTypeIdentifier.flightsClimbed | HKQuantityTypeIdentifier.numberOfAlcoholicBeverages | HKQuantityTypeIdentifier.numberOfTimesFallen | HKQuantityTypeIdentifier.pushCount | HKQuantityTypeIdentifier.stepCount | HKQuantityTypeIdentifier.swimmingStrokeCount ? HKUnits.Count : 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.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 : T extends HKQuantityTypeIdentifier.dietaryWater ? VolumeUnit : T extends HKQuantityTypeIdentifier.insulinDelivery ? HKUnits.InternationalUnit | `${HKUnits.InternationalUnit}` : T extends HKQuantityTypeIdentifier.heartRate | HKQuantityTypeIdentifier.restingHeartRate | HKQuantityTypeIdentifier.walkingHeartRateAverage ? CountPerTime<TimeUnit> : HKUnit;
|
|
1112
|
+
export type HKCategoryValueForIdentifier<T extends HKCategoryTypeIdentifier> = T extends HKCategoryTypeIdentifier.cervicalMucusQuality ? HKCategoryValueCervicalMucusQuality : T extends HKCategoryTypeIdentifier.menstrualFlow ? HKCategoryValueMenstrualFlow : T extends HKCategoryTypeIdentifier.ovulationTestResult ? HKCategoryValueOvulationTestResult : T extends HKCategoryTypeIdentifier.sleepAnalysis ? HKCategoryValueSleepAnalysis : T extends HKCategoryTypeIdentifier.highHeartRateEvent | HKCategoryTypeIdentifier.intermenstrualBleeding | HKCategoryTypeIdentifier.mindfulSession | HKCategoryTypeIdentifier.sexualActivity ? HKCategoryValueNotApplicable : T extends HKCategoryTypeIdentifier.abdominalCramps | HKCategoryTypeIdentifier.acne | HKCategoryTypeIdentifier.bladderIncontinence | HKCategoryTypeIdentifier.bloating | HKCategoryTypeIdentifier.breastPain | HKCategoryTypeIdentifier.chestTightnessOrPain | HKCategoryTypeIdentifier.chills | HKCategoryTypeIdentifier.constipation | HKCategoryTypeIdentifier.coughing | HKCategoryTypeIdentifier.diarrhea | HKCategoryTypeIdentifier.dizziness | HKCategoryTypeIdentifier.drySkin | HKCategoryTypeIdentifier.fainting | HKCategoryTypeIdentifier.fatigue | HKCategoryTypeIdentifier.fever | HKCategoryTypeIdentifier.generalizedBodyAche | HKCategoryTypeIdentifier.hairLoss | HKCategoryTypeIdentifier.headache | HKCategoryTypeIdentifier.heartburn | HKCategoryTypeIdentifier.hotFlashes | HKCategoryTypeIdentifier.lossOfSmell | HKCategoryTypeIdentifier.lossOfTaste | HKCategoryTypeIdentifier.lowerBackPain | HKCategoryTypeIdentifier.memoryLapse | HKCategoryTypeIdentifier.moodChanges | HKCategoryTypeIdentifier.nausea | HKCategoryTypeIdentifier.nightSweats | HKCategoryTypeIdentifier.pelvicPain | HKCategoryTypeIdentifier.rapidPoundingOrFlutteringHeartbeat | HKCategoryTypeIdentifier.runnyNose | HKCategoryTypeIdentifier.shortnessOfBreath | HKCategoryTypeIdentifier.sinusCongestion | HKCategoryTypeIdentifier.skippedHeartbeat | HKCategoryTypeIdentifier.soreThroat | HKCategoryTypeIdentifier.vaginalDryness | HKCategoryTypeIdentifier.vomiting | HKCategoryTypeIdentifier.wheezing ? HKCategoryValueSeverity : T extends HKCategoryTypeIdentifier.appetiteChanges | HKCategoryTypeIdentifier.sleepChanges ? HKCategoryValuePresence : T extends HKCategoryTypeIdentifier.lowCardioFitnessEvent ? HKCategoryValueLowCardioFitnessEvent : T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult : T extends HKCategoryTypeIdentifier.pregnancyTestResult ? HKCategoryValuePregnancyTestResult : T extends HKCategoryTypeIdentifier.appleStandHour ? HKCategoryValueAppleStandHour : number;
|
|
1035
1113
|
/**
|
|
1036
1114
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepregnancytestresult Apple Docs }
|
|
1037
1115
|
*/
|
|
@@ -1219,7 +1297,7 @@ export declare enum BloodGlucoseUnit {
|
|
|
1219
1297
|
}
|
|
1220
1298
|
export type SpeedUnit<TLength extends LengthUnit, TTime extends TimeUnit> = `${TLength}/${TTime}`;
|
|
1221
1299
|
export type CountPerTime<TTime extends TimeUnit> = `count/${TTime}`;
|
|
1222
|
-
export type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit | `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${
|
|
1300
|
+
export type HKUnit = BloodGlucoseUnit | CountPerTime<TimeUnit> | EnergyUnit | FrequencyUnit | HKUnits | LengthUnit | MassUnit | PressureUnit | SpeedUnit<LengthUnit, TimeUnit> | TemperatureUnit | TimeUnit | VolumeUnit | `${BloodGlucoseUnit}` | `${EnergyUnit}` | `${HKUnits}` | `${LengthUnit}` | `${MassUnit}` | `${PressureUnit}` | `${TemperatureUnit}` | `${TimeUnit}` | `${VolumeUnit}`;
|
|
1223
1301
|
/**
|
|
1224
1302
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkdevice Apple Docs }
|
|
1225
1303
|
*/
|
|
@@ -1421,7 +1499,7 @@ type ReactNativeHealthkitTypeNative = {
|
|
|
1421
1499
|
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs }
|
|
1422
1500
|
*/
|
|
1423
1501
|
isHealthDataAvailable(): Promise<boolean>;
|
|
1424
|
-
|
|
1502
|
+
isProtectedDataAvailable(): Promise<boolean>;
|
|
1425
1503
|
getBloodType(): Promise<HKBloodType>;
|
|
1426
1504
|
getDateOfBirth(): Promise<string>;
|
|
1427
1505
|
getBiologicalSex(): Promise<HKBiologicalSex>;
|