@kingstinct/react-native-healthkit 7.2.0 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/ios/Constants.swift +1 -1
  2. package/ios/ReactNativeHealthkit.m +2 -1
  3. package/ios/ReactNativeHealthkit.swift +108 -54
  4. package/lib/commonjs/hooks/useHealthkitAuthorization.js +5 -0
  5. package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +1 -1
  6. package/lib/commonjs/hooks/useMostRecentCategorySample.js +3 -0
  7. package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -1
  8. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +3 -0
  9. package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -1
  10. package/lib/commonjs/hooks/useMostRecentWorkout.js +3 -0
  11. package/lib/commonjs/hooks/useMostRecentWorkout.js.map +1 -1
  12. package/lib/commonjs/index.js +475 -82
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/index.native.js +251 -0
  15. package/lib/commonjs/index.native.js.map +1 -0
  16. package/lib/commonjs/index.web.js +17 -0
  17. package/lib/commonjs/index.web.js.map +1 -0
  18. package/lib/commonjs/jest.setup.js +2 -1
  19. package/lib/commonjs/jest.setup.js.map +1 -1
  20. package/lib/commonjs/native-types.js +5 -5
  21. package/lib/commonjs/native-types.js.map +1 -1
  22. package/lib/commonjs/utils/ensureTotals.js +12 -0
  23. package/lib/commonjs/utils/ensureTotals.js.map +1 -0
  24. package/lib/commonjs/utils/getWorkoutPlanById.js +14 -0
  25. package/lib/commonjs/utils/getWorkoutPlanById.js.map +1 -0
  26. package/lib/commonjs/utils/saveCategorySample.js +4 -0
  27. package/lib/commonjs/utils/saveCategorySample.js.map +1 -1
  28. package/lib/commonjs/utils/saveWorkoutSample.js +2 -1
  29. package/lib/commonjs/utils/saveWorkoutSample.js.map +1 -1
  30. package/lib/module/hooks/useHealthkitAuthorization.js +5 -0
  31. package/lib/module/hooks/useHealthkitAuthorization.js.map +1 -1
  32. package/lib/module/hooks/useMostRecentCategorySample.js +3 -0
  33. package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -1
  34. package/lib/module/hooks/useMostRecentQuantitySample.js +3 -0
  35. package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -1
  36. package/lib/module/hooks/useMostRecentWorkout.js +3 -0
  37. package/lib/module/hooks/useMostRecentWorkout.js.map +1 -1
  38. package/lib/module/index.js +195 -80
  39. package/lib/module/index.js.map +1 -1
  40. package/lib/module/index.native.js +136 -0
  41. package/lib/module/index.native.js.map +1 -0
  42. package/lib/module/index.web.js +2 -0
  43. package/lib/module/index.web.js.map +1 -0
  44. package/lib/module/jest.setup.js +2 -1
  45. package/lib/module/jest.setup.js.map +1 -1
  46. package/lib/module/native-types.js +3 -3
  47. package/lib/module/native-types.js.map +1 -1
  48. package/lib/module/utils/ensureTotals.js +5 -0
  49. package/lib/module/utils/ensureTotals.js.map +1 -0
  50. package/lib/module/utils/getWorkoutPlanById.js +6 -0
  51. package/lib/module/utils/getWorkoutPlanById.js.map +1 -0
  52. package/lib/module/utils/saveCategorySample.js +4 -0
  53. package/lib/module/utils/saveCategorySample.js.map +1 -1
  54. package/lib/module/utils/saveWorkoutSample.js +2 -1
  55. package/lib/module/utils/saveWorkoutSample.js.map +1 -1
  56. package/lib/typescript/src/hooks/useHealthkitAuthorization.d.ts +5 -0
  57. package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +3 -0
  58. package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +3 -0
  59. package/lib/typescript/src/hooks/useMostRecentWorkout.d.ts +3 -0
  60. package/lib/typescript/src/index.d.ts +155 -27
  61. package/lib/typescript/src/index.native.d.ts +29 -0
  62. package/lib/typescript/src/index.web.d.ts +1 -0
  63. package/lib/typescript/src/native-types.d.ts +82 -75
  64. package/lib/typescript/src/utils/ensureTotals.d.ts +2 -0
  65. package/lib/typescript/src/utils/getWorkoutPlanById.d.ts +5 -0
  66. package/lib/typescript/src/utils/saveCategorySample.d.ts +4 -0
  67. package/lib/typescript/src/utils/saveWorkoutSample.d.ts +4 -0
  68. package/package.json +1 -1
  69. package/src/hooks/useHealthkitAuthorization.ts +5 -0
  70. package/src/hooks/useMostRecentCategorySample.ts +3 -0
  71. package/src/hooks/useMostRecentQuantitySample.ts +3 -0
  72. package/src/hooks/useMostRecentWorkout.ts +3 -0
  73. package/src/index.native.tsx +201 -0
  74. package/src/index.tsx +269 -91
  75. package/src/index.web.tsx +1 -0
  76. package/src/jest.setup.ts +2 -1
  77. package/src/native-types.ts +143 -116
  78. package/src/utils/ensureTotals.ts +5 -0
  79. package/src/utils/getWorkoutPlanById.ts +7 -0
  80. package/src/utils/saveCategorySample.ts +4 -0
  81. package/src/utils/saveWorkoutSample.ts +6 -0
  82. package/lib/commonjs/index.ios.js +0 -213
  83. package/lib/commonjs/index.ios.js.map +0 -1
  84. package/lib/module/index.ios.js +0 -191
  85. package/lib/module/index.ios.js.map +0 -1
  86. package/lib/typescript/src/index.ios.d.ts +0 -141
  87. package/src/index.ios.tsx +0 -217
@@ -1,141 +0,0 @@
1
- import useMostRecentCategorySample from './hooks/useMostRecentCategorySample';
2
- import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
3
- import useMostRecentWorkout from './hooks/useMostRecentWorkout';
4
- import useSubscribeToChanges from './hooks/useSubscribeToChanges';
5
- import { HKQuantityTypeIdentifier } from './native-types';
6
- import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
7
- import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
8
- import queryStatisticsForQuantity from './utils/queryStatisticsForQuantity';
9
- import queryWorkouts from './utils/queryWorkouts';
10
- import saveCategorySample from './utils/saveCategorySample';
11
- import saveCorrelationSample from './utils/saveCorrelationSample';
12
- import saveQuantitySample from './utils/saveQuantitySample';
13
- import saveWorkoutRoute from './utils/saveWorkoutRoute';
14
- import saveWorkoutSample from './utils/saveWorkoutSample';
15
- /**
16
- * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
17
- */
18
- declare const _default: {
19
- /**
20
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
21
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
22
- */
23
- authorizationStatusFor: (type: import("./native-types").HealthkitReadAuthorization) => Promise<import("./native-types").HKAuthorizationStatus>;
24
- /**
25
- *
26
- * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
27
- */
28
- availableQuantityTypes: (majorVersionIOS?: number) => HKQuantityTypeIdentifier[];
29
- /**
30
- * @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.
31
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
32
- * @returns {boolean} true if HealthKit is available; otherwise, false.
33
- */
34
- isHealthDataAvailable: () => Promise<boolean>;
35
- /**
36
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
37
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
38
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
39
- */
40
- isProtectedDataAvailable: () => Promise<boolean>;
41
- /**
42
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
43
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
44
- * @deprecated Use {@link isProtectedDataAvailable} instead. Will be removed in next major version.
45
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
46
- */
47
- canAccessProtectedData: () => Promise<boolean>;
48
- /**
49
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
50
- */
51
- disableAllBackgroundDelivery: () => Promise<boolean>;
52
- /**
53
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
54
- */
55
- disableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier) => Promise<boolean>;
56
- /**
57
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
58
- */
59
- enableBackgroundDelivery: (typeIdentifier: import("./native-types").HKSampleTypeIdentifier, updateFrequency: import("./native-types").HKUpdateFrequency) => Promise<boolean>;
60
- /**
61
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
62
- */
63
- getBiologicalSex: () => Promise<import("./native-types").HKBiologicalSex>;
64
- /**
65
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
66
- */
67
- getFitzpatrickSkinType: () => Promise<import("./native-types").HKFitzpatrickSkinType>;
68
- /**
69
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
70
- */
71
- getWheelchairUse: () => Promise<import("./native-types").HKWheelchairUse>;
72
- /**
73
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
74
- */
75
- getBloodType: () => Promise<import("./native-types").HKBloodType>;
76
- /**
77
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
78
- */
79
- getDateOfBirth: () => Promise<Date>;
80
- getMostRecentQuantitySample: typeof getMostRecentQuantitySample;
81
- getMostRecentCategorySample: typeof getMostRecentCategorySample;
82
- getMostRecentWorkout: import("./utils/getMostRecentWorkout").GetMostRecentWorkoutFn;
83
- /**
84
- * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
85
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
86
- */
87
- getWorkoutRoutes: (workoutUUID: string) => Promise<readonly import("./native-types").WorkoutRoute[]>;
88
- getPreferredUnit: import("./utils/getPreferredUnit").GetPreferredUnitFn;
89
- getPreferredUnits: import("./utils/getPreferredUnits").GetPreferredUnitsFn;
90
- getRequestStatusForAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<import("./native-types").HKAuthorizationRequestStatus>;
91
- queryCategorySamples: import("./utils/queryCategorySamples").QueryCategorySamplesFn;
92
- queryCategorySamplesWithAnchor: import("./utils/queryCategorySamplesWithAnchor").QueryCategorySamplesWithAnchorFn;
93
- queryCorrelationSamples: import("./utils/queryCorrelationSamples").QueryCorrelationSamplesFn;
94
- queryHeartbeatSeriesSamples: import("./utils/queryHeartbeatSeriesSamples").QueryHeartbeatSeriesSamplesFn;
95
- queryHeartbeatSeriesSamplesWithAnchor: import("./utils/queryHeartbeatSeriesSamplesWithAnchor").QueryHeartbeatSeriesSamplesFn;
96
- queryQuantitySamples: import("./utils/queryQuantitySamples").QueryQuantitySamplesFn;
97
- queryQuantitySamplesWithAnchor: import("./utils/queryQuantitySamplesWithAnchor").QueryQuantitySamplesWithAnchorFn;
98
- queryStatisticsForQuantity: typeof queryStatisticsForQuantity;
99
- queryWorkouts: typeof queryWorkouts;
100
- querySources: import("./utils/querySources").QuerySourcesFn;
101
- requestAuthorization: (read: readonly import("./native-types").HealthkitReadAuthorization[], write?: readonly import("./native-types").HKSampleTypeIdentifier[]) => Promise<boolean>;
102
- deleteQuantitySample: import("./utils/deleteQuantitySample").DeleteQuantitySampleFn;
103
- deleteSamples: import("./utils/deleteSamples").DeleteSamplesFn;
104
- /**
105
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
106
- * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
107
- */
108
- saveCategorySample: typeof saveCategorySample;
109
- saveCorrelationSample: typeof saveCorrelationSample;
110
- saveQuantitySample: typeof saveQuantitySample;
111
- saveWorkoutSample: typeof saveWorkoutSample;
112
- saveWorkoutRoute: typeof saveWorkoutRoute;
113
- subscribeToChanges: (identifier: import("./native-types").HKSampleTypeIdentifier, callback: () => void) => Promise<() => Promise<boolean>>;
114
- /**
115
- * @returns the most recent sample for the given category type.
116
- */
117
- useMostRecentCategorySample: typeof useMostRecentCategorySample;
118
- /**
119
- * @returns the most recent sample for the given quantity type.
120
- */
121
- useMostRecentQuantitySample: typeof useMostRecentQuantitySample;
122
- /**
123
- * @returns the most recent workout sample.
124
- */
125
- useMostRecentWorkout: typeof useMostRecentWorkout;
126
- useSubscribeToChanges: typeof useSubscribeToChanges;
127
- /**
128
- * @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.
129
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
130
- * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
131
- */
132
- useIsHealthDataAvailable: () => boolean | null;
133
- /**
134
- * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
135
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
136
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
137
- */
138
- 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>];
139
- };
140
- export default _default;
141
- export * from './types';
package/src/index.ios.tsx DELETED
@@ -1,217 +0,0 @@
1
- import { Platform } from 'react-native'
2
-
3
- import useHealthkitAuthorization from './hooks/useHealthkitAuthorization'
4
- import useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'
5
- import useMostRecentCategorySample from './hooks/useMostRecentCategorySample'
6
- import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'
7
- import useMostRecentWorkout from './hooks/useMostRecentWorkout'
8
- import useSubscribeToChanges from './hooks/useSubscribeToChanges'
9
- import Native, { 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 queryCategorySamples from './utils/queryCategorySamples'
20
- import queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor'
21
- import queryCorrelationSamples from './utils/queryCorrelationSamples'
22
- import queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'
23
- import queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor'
24
- import queryQuantitySamples from './utils/queryQuantitySamples'
25
- import queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor'
26
- import querySources from './utils/querySources'
27
- import queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'
28
- import queryWorkouts from './utils/queryWorkouts'
29
- import requestAuthorization from './utils/requestAuthorization'
30
- import saveCategorySample from './utils/saveCategorySample'
31
- import saveCorrelationSample from './utils/saveCorrelationSample'
32
- import saveQuantitySample from './utils/saveQuantitySample'
33
- import saveWorkoutRoute from './utils/saveWorkoutRoute'
34
- import saveWorkoutSample from './utils/saveWorkoutSample'
35
- import subscribeToChanges from './utils/subscribeToChanges'
36
-
37
- const currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0
38
-
39
- const allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)]
40
-
41
- const availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {
42
- if (majorVersionIOS >= 17) {
43
- return allQuantityTypesList
44
- }
45
-
46
- // remove types that are not available before iOS 17
47
- return allQuantityTypesList.filter((type) => ![
48
- HKQuantityTypeIdentifier.cyclingCadence,
49
- HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower,
50
- HKQuantityTypeIdentifier.cyclingPower,
51
- HKQuantityTypeIdentifier.cyclingSpeed,
52
- HKQuantityTypeIdentifier.physicalEffort,
53
- HKQuantityTypeIdentifier.timeInDaylight,
54
- ].includes(type))
55
- }
56
-
57
- const authorizationStatusFor = Native.authorizationStatusFor.bind(Native)
58
- const isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native)
59
- // Todo [>8]: Rename to align with Apple function name (isProtectedDataAvailable)
60
- const canAccessProtectedData = Native.canAccessProtectedData.bind(Native)
61
- const disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native)
62
- const disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native)
63
- const enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native)
64
- const getBiologicalSex = Native.getBiologicalSex.bind(Native)
65
- const getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native)
66
- const getWheelchairUse = Native.getWheelchairUse.bind(Native)
67
- const getBloodType = Native.getBloodType.bind(Native)
68
- const getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native)
69
-
70
- /**
71
- * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
72
- */
73
- export default {
74
- /**
75
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
76
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
77
- */
78
- authorizationStatusFor,
79
-
80
- /**
81
- *
82
- * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
83
- */
84
- availableQuantityTypes,
85
-
86
- /**
87
- * @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.
88
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
89
- * @returns {boolean} true if HealthKit is available; otherwise, false.
90
- */
91
- isHealthDataAvailable,
92
-
93
- /**
94
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
95
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
96
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
97
- */
98
- isProtectedDataAvailable: canAccessProtectedData,
99
-
100
- // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)
101
- /**
102
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
103
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
104
- * @deprecated Use {@link isProtectedDataAvailable} instead. Will be removed in next major version.
105
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
106
- */
107
- canAccessProtectedData,
108
-
109
- /**
110
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
111
- */
112
- disableAllBackgroundDelivery,
113
- /**
114
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
115
- */
116
- disableBackgroundDelivery,
117
- /**
118
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
119
- */
120
- enableBackgroundDelivery,
121
-
122
- // simple convenience getters
123
- /**
124
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
125
- */
126
- getBiologicalSex,
127
- /**
128
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
129
- */
130
- getFitzpatrickSkinType,
131
- /**
132
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
133
- */
134
- getWheelchairUse,
135
- /**
136
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
137
- */
138
- getBloodType,
139
- /**
140
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
141
- */
142
- getDateOfBirth,
143
-
144
- getMostRecentQuantitySample,
145
- getMostRecentCategorySample,
146
- getMostRecentWorkout,
147
-
148
- /**
149
- * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
150
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
151
- */
152
- getWorkoutRoutes,
153
-
154
- getPreferredUnit,
155
- getPreferredUnits,
156
- getRequestStatusForAuthorization,
157
-
158
- // query methods
159
- queryCategorySamples,
160
- queryCategorySamplesWithAnchor,
161
- queryCorrelationSamples,
162
- queryHeartbeatSeriesSamples,
163
- queryHeartbeatSeriesSamplesWithAnchor,
164
- queryQuantitySamples,
165
- queryQuantitySamplesWithAnchor,
166
- queryStatisticsForQuantity,
167
- queryWorkouts,
168
- querySources,
169
-
170
- requestAuthorization,
171
-
172
- // delete methods
173
- deleteQuantitySample,
174
- deleteSamples,
175
-
176
- // save methods
177
- /**
178
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
179
- * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
180
- */
181
- saveCategorySample,
182
- saveCorrelationSample,
183
- saveQuantitySample,
184
- saveWorkoutSample,
185
- saveWorkoutRoute,
186
-
187
- // subscriptions
188
- subscribeToChanges,
189
-
190
- /**
191
- * @returns the most recent sample for the given category type.
192
- */
193
- useMostRecentCategorySample,
194
- /**
195
- * @returns the most recent sample for the given quantity type.
196
- */
197
- useMostRecentQuantitySample,
198
- /**
199
- * @returns the most recent workout sample.
200
- */
201
- useMostRecentWorkout,
202
- useSubscribeToChanges,
203
- /**
204
- * @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.
205
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
206
- * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
207
- */
208
- useIsHealthDataAvailable,
209
- /**
210
- * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
211
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
212
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
213
- */
214
- useHealthkitAuthorization,
215
- }
216
-
217
- export * from './types'