@kingstinct/react-native-healthkit 7.3.1 → 7.3.2
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 +496 -0
- package/lib/commonjs/index.ios.js.map +1 -0
- package/lib/commonjs/index.js +7 -479
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/index.web.js +8 -1
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/module/index.ios.js +199 -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.map +1 -1
- package/lib/module/index.web.js +2 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -180
- package/lib/typescript/src/index.ios.d.ts +180 -0
- package/lib/typescript/src/index.native.d.ts +1 -1
- package/lib/typescript/src/index.web.d.ts +2 -0
- package/package.json +1 -1
- package/src/index.ios.tsx +276 -0
- package/src/index.native.tsx +1 -1
- package/src/index.tsx +3 -274
- package/src/index.web.tsx +4 -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,180 @@
|
|
|
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 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,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<{
|