@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,213 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {};
7
- exports.default = void 0;
8
- var _reactNative = require("react-native");
9
- var _useHealthkitAuthorization = _interopRequireDefault(require("./hooks/useHealthkitAuthorization"));
10
- var _useIsHealthDataAvailable = _interopRequireDefault(require("./hooks/useIsHealthDataAvailable"));
11
- var _useMostRecentCategorySample = _interopRequireDefault(require("./hooks/useMostRecentCategorySample"));
12
- var _useMostRecentQuantitySample = _interopRequireDefault(require("./hooks/useMostRecentQuantitySample"));
13
- var _useMostRecentWorkout = _interopRequireDefault(require("./hooks/useMostRecentWorkout"));
14
- var _useSubscribeToChanges = _interopRequireDefault(require("./hooks/useSubscribeToChanges"));
15
- var _nativeTypes = _interopRequireWildcard(require("./native-types"));
16
- var _deleteQuantitySample = _interopRequireDefault(require("./utils/deleteQuantitySample"));
17
- var _deleteSamples = _interopRequireDefault(require("./utils/deleteSamples"));
18
- var _getDateOfBirth = _interopRequireDefault(require("./utils/getDateOfBirth"));
19
- var _getMostRecentCategorySample = _interopRequireDefault(require("./utils/getMostRecentCategorySample"));
20
- var _getMostRecentQuantitySample = _interopRequireDefault(require("./utils/getMostRecentQuantitySample"));
21
- var _getMostRecentWorkout = _interopRequireDefault(require("./utils/getMostRecentWorkout"));
22
- var _getPreferredUnit = _interopRequireDefault(require("./utils/getPreferredUnit"));
23
- var _getPreferredUnits = _interopRequireDefault(require("./utils/getPreferredUnits"));
24
- var _getRequestStatusForAuthorization = _interopRequireDefault(require("./utils/getRequestStatusForAuthorization"));
25
- var _queryCategorySamples = _interopRequireDefault(require("./utils/queryCategorySamples"));
26
- var _queryCategorySamplesWithAnchor = _interopRequireDefault(require("./utils/queryCategorySamplesWithAnchor"));
27
- var _queryCorrelationSamples = _interopRequireDefault(require("./utils/queryCorrelationSamples"));
28
- var _queryHeartbeatSeriesSamples = _interopRequireDefault(require("./utils/queryHeartbeatSeriesSamples"));
29
- var _queryHeartbeatSeriesSamplesWithAnchor = _interopRequireDefault(require("./utils/queryHeartbeatSeriesSamplesWithAnchor"));
30
- var _queryQuantitySamples = _interopRequireDefault(require("./utils/queryQuantitySamples"));
31
- var _queryQuantitySamplesWithAnchor = _interopRequireDefault(require("./utils/queryQuantitySamplesWithAnchor"));
32
- var _querySources = _interopRequireDefault(require("./utils/querySources"));
33
- var _queryStatisticsForQuantity = _interopRequireDefault(require("./utils/queryStatisticsForQuantity"));
34
- var _queryWorkouts = _interopRequireDefault(require("./utils/queryWorkouts"));
35
- var _requestAuthorization = _interopRequireDefault(require("./utils/requestAuthorization"));
36
- var _saveCategorySample = _interopRequireDefault(require("./utils/saveCategorySample"));
37
- var _saveCorrelationSample = _interopRequireDefault(require("./utils/saveCorrelationSample"));
38
- var _saveQuantitySample = _interopRequireDefault(require("./utils/saveQuantitySample"));
39
- var _saveWorkoutRoute = _interopRequireDefault(require("./utils/saveWorkoutRoute"));
40
- var _saveWorkoutSample = _interopRequireDefault(require("./utils/saveWorkoutSample"));
41
- var _subscribeToChanges = _interopRequireDefault(require("./utils/subscribeToChanges"));
42
- var _types = require("./types");
43
- Object.keys(_types).forEach(function (key) {
44
- if (key === "default" || key === "__esModule") return;
45
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
46
- if (key in exports && exports[key] === _types[key]) return;
47
- Object.defineProperty(exports, key, {
48
- enumerable: true,
49
- get: function () {
50
- return _types[key];
51
- }
52
- });
53
- });
54
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
55
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
56
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
57
- const currentMajorVersionIOS = _reactNative.Platform.OS === 'ios' ? parseInt(_reactNative.Platform.Version, 10) : 0;
58
- const allQuantityTypesList = [...Object.values(_nativeTypes.HKQuantityTypeIdentifier)];
59
- const availableQuantityTypes = function () {
60
- let majorVersionIOS = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : currentMajorVersionIOS;
61
- if (majorVersionIOS >= 17) {
62
- return allQuantityTypesList;
63
- }
64
-
65
- // remove types that are not available before iOS 17
66
- return allQuantityTypesList.filter(type => ![_nativeTypes.HKQuantityTypeIdentifier.cyclingCadence, _nativeTypes.HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower, _nativeTypes.HKQuantityTypeIdentifier.cyclingPower, _nativeTypes.HKQuantityTypeIdentifier.cyclingSpeed, _nativeTypes.HKQuantityTypeIdentifier.physicalEffort, _nativeTypes.HKQuantityTypeIdentifier.timeInDaylight].includes(type));
67
- };
68
- const authorizationStatusFor = _nativeTypes.default.authorizationStatusFor.bind(_nativeTypes.default);
69
- const isHealthDataAvailable = _nativeTypes.default.isHealthDataAvailable.bind(_nativeTypes.default);
70
- // Todo [>8]: Rename to align with Apple function name (isProtectedDataAvailable)
71
- const canAccessProtectedData = _nativeTypes.default.canAccessProtectedData.bind(_nativeTypes.default);
72
- const disableBackgroundDelivery = _nativeTypes.default.disableBackgroundDelivery.bind(_nativeTypes.default);
73
- const disableAllBackgroundDelivery = _nativeTypes.default.disableAllBackgroundDelivery.bind(_nativeTypes.default);
74
- const enableBackgroundDelivery = _nativeTypes.default.enableBackgroundDelivery.bind(_nativeTypes.default);
75
- const getBiologicalSex = _nativeTypes.default.getBiologicalSex.bind(_nativeTypes.default);
76
- const getFitzpatrickSkinType = _nativeTypes.default.getFitzpatrickSkinType.bind(_nativeTypes.default);
77
- const getWheelchairUse = _nativeTypes.default.getWheelchairUse.bind(_nativeTypes.default);
78
- const getBloodType = _nativeTypes.default.getBloodType.bind(_nativeTypes.default);
79
- const getWorkoutRoutes = _nativeTypes.default.getWorkoutRoutes.bind(_nativeTypes.default);
80
-
81
- /**
82
- * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
83
- */
84
- var _default = {
85
- /**
86
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
87
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
88
- */
89
- authorizationStatusFor,
90
- /**
91
- *
92
- * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
93
- */
94
- availableQuantityTypes,
95
- /**
96
- * @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.
97
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
98
- * @returns {boolean} true if HealthKit is available; otherwise, false.
99
- */
100
- isHealthDataAvailable,
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
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
105
- */
106
- isProtectedDataAvailable: canAccessProtectedData,
107
- // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)
108
- /**
109
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
110
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
111
- * @deprecated Use {@link isProtectedDataAvailable} instead. Will be removed in next major version.
112
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
113
- */
114
- canAccessProtectedData,
115
- /**
116
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
117
- */
118
- disableAllBackgroundDelivery,
119
- /**
120
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
121
- */
122
- disableBackgroundDelivery,
123
- /**
124
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
125
- */
126
- enableBackgroundDelivery,
127
- // simple convenience getters
128
- /**
129
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
130
- */
131
- getBiologicalSex,
132
- /**
133
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
134
- */
135
- getFitzpatrickSkinType,
136
- /**
137
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
138
- */
139
- getWheelchairUse,
140
- /**
141
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
142
- */
143
- getBloodType,
144
- /**
145
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
146
- */
147
- getDateOfBirth: _getDateOfBirth.default,
148
- getMostRecentQuantitySample: _getMostRecentQuantitySample.default,
149
- getMostRecentCategorySample: _getMostRecentCategorySample.default,
150
- getMostRecentWorkout: _getMostRecentWorkout.default,
151
- /**
152
- * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
153
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
154
- */
155
- getWorkoutRoutes,
156
- getPreferredUnit: _getPreferredUnit.default,
157
- getPreferredUnits: _getPreferredUnits.default,
158
- getRequestStatusForAuthorization: _getRequestStatusForAuthorization.default,
159
- // query methods
160
- queryCategorySamples: _queryCategorySamples.default,
161
- queryCategorySamplesWithAnchor: _queryCategorySamplesWithAnchor.default,
162
- queryCorrelationSamples: _queryCorrelationSamples.default,
163
- queryHeartbeatSeriesSamples: _queryHeartbeatSeriesSamples.default,
164
- queryHeartbeatSeriesSamplesWithAnchor: _queryHeartbeatSeriesSamplesWithAnchor.default,
165
- queryQuantitySamples: _queryQuantitySamples.default,
166
- queryQuantitySamplesWithAnchor: _queryQuantitySamplesWithAnchor.default,
167
- queryStatisticsForQuantity: _queryStatisticsForQuantity.default,
168
- queryWorkouts: _queryWorkouts.default,
169
- querySources: _querySources.default,
170
- requestAuthorization: _requestAuthorization.default,
171
- // delete methods
172
- deleteQuantitySample: _deleteQuantitySample.default,
173
- deleteSamples: _deleteSamples.default,
174
- // save methods
175
- /**
176
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
177
- * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
178
- */
179
- saveCategorySample: _saveCategorySample.default,
180
- saveCorrelationSample: _saveCorrelationSample.default,
181
- saveQuantitySample: _saveQuantitySample.default,
182
- saveWorkoutSample: _saveWorkoutSample.default,
183
- saveWorkoutRoute: _saveWorkoutRoute.default,
184
- // subscriptions
185
- subscribeToChanges: _subscribeToChanges.default,
186
- /**
187
- * @returns the most recent sample for the given category type.
188
- */
189
- useMostRecentCategorySample: _useMostRecentCategorySample.default,
190
- /**
191
- * @returns the most recent sample for the given quantity type.
192
- */
193
- useMostRecentQuantitySample: _useMostRecentQuantitySample.default,
194
- /**
195
- * @returns the most recent workout sample.
196
- */
197
- useMostRecentWorkout: _useMostRecentWorkout.default,
198
- useSubscribeToChanges: _useSubscribeToChanges.default,
199
- /**
200
- * @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.
201
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
202
- * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
203
- */
204
- useIsHealthDataAvailable: _useIsHealthDataAvailable.default,
205
- /**
206
- * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
207
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
208
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
209
- */
210
- useHealthkitAuthorization: _useHealthkitAuthorization.default
211
- };
212
- exports.default = _default;
213
- //# sourceMappingURL=index.ios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_useHealthkitAuthorization","_interopRequireDefault","_useIsHealthDataAvailable","_useMostRecentCategorySample","_useMostRecentQuantitySample","_useMostRecentWorkout","_useSubscribeToChanges","_nativeTypes","_interopRequireWildcard","_deleteQuantitySample","_deleteSamples","_getDateOfBirth","_getMostRecentCategorySample","_getMostRecentQuantitySample","_getMostRecentWorkout","_getPreferredUnit","_getPreferredUnits","_getRequestStatusForAuthorization","_queryCategorySamples","_queryCategorySamplesWithAnchor","_queryCorrelationSamples","_queryHeartbeatSeriesSamples","_queryHeartbeatSeriesSamplesWithAnchor","_queryQuantitySamples","_queryQuantitySamplesWithAnchor","_querySources","_queryStatisticsForQuantity","_queryWorkouts","_requestAuthorization","_saveCategorySample","_saveCorrelationSample","_saveQuantitySample","_saveWorkoutRoute","_saveWorkoutSample","_subscribeToChanges","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","currentMajorVersionIOS","Platform","OS","parseInt","Version","allQuantityTypesList","values","HKQuantityTypeIdentifier","availableQuantityTypes","majorVersionIOS","arguments","length","undefined","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","Native","bind","isHealthDataAvailable","canAccessProtectedData","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","_default","isProtectedDataAvailable","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization"],"sources":["index.ios.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native, { HKQuantityTypeIdentifier } from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport deleteSamples from './utils/deleteSamples'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'\nimport queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor'\nimport querySources from './utils/querySources'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutRoute from './utils/saveWorkoutRoute'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0\n\nconst allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)]\n\nconst availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {\n if (majorVersionIOS >= 17) {\n return allQuantityTypesList\n }\n\n // remove types that are not available before iOS 17\n return allQuantityTypesList.filter((type) => ![\n HKQuantityTypeIdentifier.cyclingCadence,\n HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower,\n HKQuantityTypeIdentifier.cyclingPower,\n HKQuantityTypeIdentifier.cyclingSpeed,\n HKQuantityTypeIdentifier.physicalEffort,\n HKQuantityTypeIdentifier.timeInDaylight,\n ].includes(type))\n}\n\nconst authorizationStatusFor = Native.authorizationStatusFor.bind(Native)\nconst isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native)\n// Todo [>8]: Rename to align with Apple function name (isProtectedDataAvailable)\nconst canAccessProtectedData = Native.canAccessProtectedData.bind(Native)\nconst disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native)\nconst disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native)\nconst enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native)\nconst getBiologicalSex = Native.getBiologicalSex.bind(Native)\nconst getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native)\nconst getWheelchairUse = Native.getWheelchairUse.bind(Native)\nconst getBloodType = Native.getBloodType.bind(Native)\nconst getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native)\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}\n */\nexport default {\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }\n */\n authorizationStatusFor,\n\n /**\n *\n * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)\n */\n availableQuantityTypes,\n\n /**\n * @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.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}\n * @returns {boolean} true if HealthKit is available; otherwise, false.\n */\n isHealthDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n isProtectedDataAvailable: canAccessProtectedData,\n\n // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @deprecated Use {@link isProtectedDataAvailable} instead. Will be removed in next major version.\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n canAccessProtectedData,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}\n */\n disableAllBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}\n */\n disableBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}\n */\n enableBackgroundDelivery,\n\n // simple convenience getters\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}\n */\n getBiologicalSex,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}\n */\n getFitzpatrickSkinType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}\n */\n getWheelchairUse,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}\n */\n getBloodType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}\n */\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}\n */\n getWorkoutRoutes,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryWorkouts,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n\n // save methods\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n\n // subscriptions\n subscribeToChanges,\n\n /**\n * @returns the most recent sample for the given category type.\n */\n useMostRecentCategorySample,\n /**\n * @returns the most recent sample for the given quantity type.\n */\n useMostRecentQuantitySample,\n /**\n * @returns the most recent workout sample.\n */\n useMostRecentWorkout,\n useSubscribeToChanges,\n /**\n * @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.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}\n * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.\n */\n useIsHealthDataAvailable,\n /**\n * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}\n */\n use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ACA;AACF;AACA;AACA;EACEC,kBAAkB,EAAlBA,2BAAkB;EAClBC,qBAAqB,EAArBA,8BAAqB;EACrBC,kBAAkB,EAAlBA,2BAAkB;EAClBC,iBAAiB,EAAjBA,0BAAiB;EACjBC,gBAAgB,EAAhBA,yBAAgB;EAEhB;EACAC,kBAAkB,EAAlBA,2BAAkB;EAElB;AACF;AACA;EACEC,2BAA2B,EAA3BA,oCAA2B;EAC3B;AACF;AACA;EACEC,2BAA2B,EAA3BA,oCAA2B;EAC3B;AACF;AACA;EACEC,oBAAoB,EAApBA,6BAAoB;EACpBC,qBAAqB,EAArBA,8BAAqB;EACrB;AACF;AACA;AACA;AACA;EACEC,wBAAwB,EAAxBA,iCAAwB;EACxB;AACF;AACA;AACA;AACA;EACEC,yBAAyB,EAAzBA;AACF,CAAC;AAAAvF,OAAA,CAAAW,OAAA,GAAA2C,QAAA"}
@@ -1,191 +0,0 @@
1
- import { Platform } from 'react-native';
2
- import useHealthkitAuthorization from './hooks/useHealthkitAuthorization';
3
- import useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable';
4
- import useMostRecentCategorySample from './hooks/useMostRecentCategorySample';
5
- import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
6
- import useMostRecentWorkout from './hooks/useMostRecentWorkout';
7
- import useSubscribeToChanges from './hooks/useSubscribeToChanges';
8
- import Native, { HKQuantityTypeIdentifier } from './native-types';
9
- import deleteQuantitySample from './utils/deleteQuantitySample';
10
- import deleteSamples from './utils/deleteSamples';
11
- import getDateOfBirth from './utils/getDateOfBirth';
12
- import getMostRecentCategorySample from './utils/getMostRecentCategorySample';
13
- import getMostRecentQuantitySample from './utils/getMostRecentQuantitySample';
14
- import getMostRecentWorkout from './utils/getMostRecentWorkout';
15
- import getPreferredUnit from './utils/getPreferredUnit';
16
- import getPreferredUnits from './utils/getPreferredUnits';
17
- import getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization';
18
- import queryCategorySamples from './utils/queryCategorySamples';
19
- import queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor';
20
- import queryCorrelationSamples from './utils/queryCorrelationSamples';
21
- import queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples';
22
- import queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor';
23
- import queryQuantitySamples from './utils/queryQuantitySamples';
24
- import queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor';
25
- import querySources from './utils/querySources';
26
- import queryStatisticsForQuantity from './utils/queryStatisticsForQuantity';
27
- import queryWorkouts from './utils/queryWorkouts';
28
- import requestAuthorization from './utils/requestAuthorization';
29
- import saveCategorySample from './utils/saveCategorySample';
30
- import saveCorrelationSample from './utils/saveCorrelationSample';
31
- import saveQuantitySample from './utils/saveQuantitySample';
32
- import saveWorkoutRoute from './utils/saveWorkoutRoute';
33
- import saveWorkoutSample from './utils/saveWorkoutSample';
34
- import subscribeToChanges from './utils/subscribeToChanges';
35
- const currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0;
36
- const allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)];
37
- const availableQuantityTypes = function () {
38
- let majorVersionIOS = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : currentMajorVersionIOS;
39
- if (majorVersionIOS >= 17) {
40
- return allQuantityTypesList;
41
- }
42
-
43
- // remove types that are not available before iOS 17
44
- return allQuantityTypesList.filter(type => ![HKQuantityTypeIdentifier.cyclingCadence, HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower, HKQuantityTypeIdentifier.cyclingPower, HKQuantityTypeIdentifier.cyclingSpeed, HKQuantityTypeIdentifier.physicalEffort, HKQuantityTypeIdentifier.timeInDaylight].includes(type));
45
- };
46
- const authorizationStatusFor = Native.authorizationStatusFor.bind(Native);
47
- const isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native);
48
- // Todo [>8]: Rename to align with Apple function name (isProtectedDataAvailable)
49
- const canAccessProtectedData = Native.canAccessProtectedData.bind(Native);
50
- const disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native);
51
- const disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native);
52
- const enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native);
53
- const getBiologicalSex = Native.getBiologicalSex.bind(Native);
54
- const getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native);
55
- const getWheelchairUse = Native.getWheelchairUse.bind(Native);
56
- const getBloodType = Native.getBloodType.bind(Native);
57
- const getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native);
58
-
59
- /**
60
- * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
61
- */
62
- export default {
63
- /**
64
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
65
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
66
- */
67
- authorizationStatusFor,
68
- /**
69
- *
70
- * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
71
- */
72
- availableQuantityTypes,
73
- /**
74
- * @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.
75
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
76
- * @returns {boolean} true if HealthKit is available; otherwise, false.
77
- */
78
- isHealthDataAvailable,
79
- /**
80
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
81
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
82
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
83
- */
84
- isProtectedDataAvailable: canAccessProtectedData,
85
- // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)
86
- /**
87
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
88
- * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
89
- * @deprecated Use {@link isProtectedDataAvailable} instead. Will be removed in next major version.
90
- * @returns {boolean} A Boolean value that indicates whether content protection is active.
91
- */
92
- canAccessProtectedData,
93
- /**
94
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
95
- */
96
- disableAllBackgroundDelivery,
97
- /**
98
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
99
- */
100
- disableBackgroundDelivery,
101
- /**
102
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
103
- */
104
- enableBackgroundDelivery,
105
- // simple convenience getters
106
- /**
107
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
108
- */
109
- getBiologicalSex,
110
- /**
111
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
112
- */
113
- getFitzpatrickSkinType,
114
- /**
115
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
116
- */
117
- getWheelchairUse,
118
- /**
119
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
120
- */
121
- getBloodType,
122
- /**
123
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
124
- */
125
- getDateOfBirth,
126
- getMostRecentQuantitySample,
127
- getMostRecentCategorySample,
128
- getMostRecentWorkout,
129
- /**
130
- * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
131
- * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
132
- */
133
- getWorkoutRoutes,
134
- getPreferredUnit,
135
- getPreferredUnits,
136
- getRequestStatusForAuthorization,
137
- // query methods
138
- queryCategorySamples,
139
- queryCategorySamplesWithAnchor,
140
- queryCorrelationSamples,
141
- queryHeartbeatSeriesSamples,
142
- queryHeartbeatSeriesSamplesWithAnchor,
143
- queryQuantitySamples,
144
- queryQuantitySamplesWithAnchor,
145
- queryStatisticsForQuantity,
146
- queryWorkouts,
147
- querySources,
148
- requestAuthorization,
149
- // delete methods
150
- deleteQuantitySample,
151
- deleteSamples,
152
- // save methods
153
- /**
154
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
155
- * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
156
- */
157
- saveCategorySample,
158
- saveCorrelationSample,
159
- saveQuantitySample,
160
- saveWorkoutSample,
161
- saveWorkoutRoute,
162
- // subscriptions
163
- subscribeToChanges,
164
- /**
165
- * @returns the most recent sample for the given category type.
166
- */
167
- useMostRecentCategorySample,
168
- /**
169
- * @returns the most recent sample for the given quantity type.
170
- */
171
- useMostRecentQuantitySample,
172
- /**
173
- * @returns the most recent workout sample.
174
- */
175
- useMostRecentWorkout,
176
- useSubscribeToChanges,
177
- /**
178
- * @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.
179
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
180
- * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
181
- */
182
- useIsHealthDataAvailable,
183
- /**
184
- * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
185
- * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
186
- * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
187
- */
188
- useHealthkitAuthorization
189
- };
190
- export * from './types';
191
- //# sourceMappingURL=index.ios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Platform","useHealthkitAuthorization","useIsHealthDataAvailable","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","Native","HKQuantityTypeIdentifier","deleteQuantitySample","deleteSamples","getDateOfBirth","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","querySources","queryStatisticsForQuantity","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutRoute","saveWorkoutSample","subscribeToChanges","currentMajorVersionIOS","OS","parseInt","Version","allQuantityTypesList","Object","values","availableQuantityTypes","majorVersionIOS","arguments","length","undefined","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","bind","isHealthDataAvailable","canAccessProtectedData","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","isProtectedDataAvailable"],"sources":["index.ios.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport useHealthkitAuthorization from './hooks/useHealthkitAuthorization'\nimport useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable'\nimport useMostRecentCategorySample from './hooks/useMostRecentCategorySample'\nimport useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample'\nimport useMostRecentWorkout from './hooks/useMostRecentWorkout'\nimport useSubscribeToChanges from './hooks/useSubscribeToChanges'\nimport Native, { HKQuantityTypeIdentifier } from './native-types'\nimport deleteQuantitySample from './utils/deleteQuantitySample'\nimport deleteSamples from './utils/deleteSamples'\nimport getDateOfBirth from './utils/getDateOfBirth'\nimport getMostRecentCategorySample from './utils/getMostRecentCategorySample'\nimport getMostRecentQuantitySample from './utils/getMostRecentQuantitySample'\nimport getMostRecentWorkout from './utils/getMostRecentWorkout'\nimport getPreferredUnit from './utils/getPreferredUnit'\nimport getPreferredUnits from './utils/getPreferredUnits'\nimport getRequestStatusForAuthorization from './utils/getRequestStatusForAuthorization'\nimport queryCategorySamples from './utils/queryCategorySamples'\nimport queryCategorySamplesWithAnchor from './utils/queryCategorySamplesWithAnchor'\nimport queryCorrelationSamples from './utils/queryCorrelationSamples'\nimport queryHeartbeatSeriesSamples from './utils/queryHeartbeatSeriesSamples'\nimport queryHeartbeatSeriesSamplesWithAnchor from './utils/queryHeartbeatSeriesSamplesWithAnchor'\nimport queryQuantitySamples from './utils/queryQuantitySamples'\nimport queryQuantitySamplesWithAnchor from './utils/queryQuantitySamplesWithAnchor'\nimport querySources from './utils/querySources'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkouts from './utils/queryWorkouts'\nimport requestAuthorization from './utils/requestAuthorization'\nimport saveCategorySample from './utils/saveCategorySample'\nimport saveCorrelationSample from './utils/saveCorrelationSample'\nimport saveQuantitySample from './utils/saveQuantitySample'\nimport saveWorkoutRoute from './utils/saveWorkoutRoute'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0\n\nconst allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)]\n\nconst availableQuantityTypes = (majorVersionIOS = currentMajorVersionIOS) => {\n if (majorVersionIOS >= 17) {\n return allQuantityTypesList\n }\n\n // remove types that are not available before iOS 17\n return allQuantityTypesList.filter((type) => ![\n HKQuantityTypeIdentifier.cyclingCadence,\n HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower,\n HKQuantityTypeIdentifier.cyclingPower,\n HKQuantityTypeIdentifier.cyclingSpeed,\n HKQuantityTypeIdentifier.physicalEffort,\n HKQuantityTypeIdentifier.timeInDaylight,\n ].includes(type))\n}\n\nconst authorizationStatusFor = Native.authorizationStatusFor.bind(Native)\nconst isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native)\n// Todo [>8]: Rename to align with Apple function name (isProtectedDataAvailable)\nconst canAccessProtectedData = Native.canAccessProtectedData.bind(Native)\nconst disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native)\nconst disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native)\nconst enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native)\nconst getBiologicalSex = Native.getBiologicalSex.bind(Native)\nconst getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native)\nconst getWheelchairUse = Native.getWheelchairUse.bind(Native)\nconst getBloodType = Native.getBloodType.bind(Native)\nconst getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native)\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}\n */\nexport default {\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }\n */\n authorizationStatusFor,\n\n /**\n *\n * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)\n */\n availableQuantityTypes,\n\n /**\n * @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.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}\n * @returns {boolean} true if HealthKit is available; otherwise, false.\n */\n isHealthDataAvailable,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n isProtectedDataAvailable: canAccessProtectedData,\n\n // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}\n * @deprecated Use {@link isProtectedDataAvailable} instead. Will be removed in next major version.\n * @returns {boolean} A Boolean value that indicates whether content protection is active.\n */\n canAccessProtectedData,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}\n */\n disableAllBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}\n */\n disableBackgroundDelivery,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}\n */\n enableBackgroundDelivery,\n\n // simple convenience getters\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}\n */\n getBiologicalSex,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}\n */\n getFitzpatrickSkinType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}\n */\n getWheelchairUse,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}\n */\n getBloodType,\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}\n */\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\n\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}\n */\n getWorkoutRoutes,\n\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n\n // query methods\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryWorkouts,\n querySources,\n\n requestAuthorization,\n\n // delete methods\n deleteQuantitySample,\n deleteSamples,\n\n // save methods\n /**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n\n // subscriptions\n subscribeToChanges,\n\n /**\n * @returns the most recent sample for the given category type.\n */\n useMostRecentCategorySample,\n /**\n * @returns the most recent sample for the given quantity type.\n */\n useMostRecentQuantitySample,\n /**\n * @returns the most recent workout sample.\n */\n useMostRecentWorkout,\n useSubscribeToChanges,\n /**\n * @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.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}\n * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.\n */\n useIsHealthDataAvailable,\n /**\n * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}\n * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}\n */\n useHealthkitAuthorization,\n}\n\nexport * from './types'\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,yBAAyB,MAAM,mCAAmC;AACzE,OAAOC,wBAAwB,MAAM,kCAAkC;AACvE,OAAOC,2BAA2B,MAAM,qCAAqC;AAC7E,OAAOC,2BAA2B,MAAM,qCAAqC;AAC7E,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,qBAAqB,MAAM,+BAA+B;AACjE,OAAOC,MAAM,IAAIC,wBAAwB,QAAQ,gBAAgB;AACjE,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,cAAc,MAAM,wBAAwB;AACnD,OAAOC,2BAA2B,MAAM,qCAAqC;AAC7E,OAAOC,2BAA2B,MAAM,qCAAqC;AAC7E,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,gBAAgB,MAAM,0BAA0B;AACvD,OAAOC,iBAAiB,MAAM,2BAA2B;AACzD,OAAOC,gCAAgC,MAAM,0CAA0C;AACvF,OAAOC,oBAAoB,MAAM,8BAA8B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BAAsB;EAEhD;EACA;AACF;AACA;AACA;AACA;AACA;EACEA,sBAAsB;EAEtB;AACF;AACA;EACEE,4BAA4B;EAC5B;AACF;AACA;EACED,yBAAyB;EACzB;AACF;AACA;EACEE,wBAAwB;EAExB;EACA;AACF;AACA;EACEC,gBAAgB;EAChB;AACF;AACA;EACEC,sBAAsB;EACtB;AACF;AACA;EACEC,gBAAgB;EAChB;AACF;AACA;EACEC,YAAY;EACZ;AACF;AACA;EACEvD,cAAc;EAEdE,2BAA2B;EAC3BD,2BAA2B;EAC3BE,oBAAoB;EAEpB;AACF;AACA;AACA;EACEqD,gBAAgB;EAEhBpD,gBAAgB;EAChBC,iBAAiB;EACjBC,gCAAgC;EAEhC;EACAC,oBAAoB;EACpBC,8BAA8B;EAC9BC,uBAAuB;EACvBC,2BAA2B;EAC3BC,qCAAqC;EACrCC,oBAAoB;EACpBC,8BAA8B;EAC9BE,0BAA0B;EAC1BC,aAAa;EACbF,YAAY;EAEZG,oBAAoB;EAEpB;EACAnB,oBAAoB;EACpBC,aAAa;EAEb;EACA;AACF;AACA;AACA;EACEmB,kBAAkB;EAClBC,qBAAqB;EACrBC,kBAAkB;EAClBE,iBAAiB;EACjBD,gBAAgB;EAEhB;EACAE,kBAAkB;EAElB;AACF;AACA;EACE/B,2BAA2B;EAC3B;AACF;AACA;EACEC,2BAA2B;EAC3B;AACF;AACA;EACEC,oBAAoB;EACpBC,qBAAqB;EACrB;AACF;AACA;AACA;AACA;EACEJ,wBAAwB;EACxB;AACF;AACA;AACA;AACA;EACED;AACF,CAAC;AAED,cAAc,SAAS"}