@kingstinct/react-native-healthkit 7.0.4 → 7.0.6

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 (49) hide show
  1. package/README.md +7 -31
  2. package/ios/ReactNativeHealthkit.swift +3 -2
  3. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +5 -0
  4. package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -1
  5. package/lib/commonjs/index.ios.js +121 -15
  6. package/lib/commonjs/index.ios.js.map +1 -1
  7. package/lib/commonjs/index.js +3 -1
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/jest.setup.js +1 -0
  10. package/lib/commonjs/jest.setup.js.map +1 -1
  11. package/lib/commonjs/native-types.js +36 -27
  12. package/lib/commonjs/native-types.js.map +1 -1
  13. package/lib/commonjs/types.js.map +1 -1
  14. package/lib/commonjs/utils/getMostRecentCategorySample.js +1 -1
  15. package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -1
  16. package/lib/commonjs/utils/getMostRecentQuantitySample.js +5 -1
  17. package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -1
  18. package/lib/module/hooks/useIsHealthDataAvailable.js +6 -0
  19. package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -1
  20. package/lib/module/index.ios.js +119 -15
  21. package/lib/module/index.ios.js.map +1 -1
  22. package/lib/module/index.js +3 -1
  23. package/lib/module/index.js.map +1 -1
  24. package/lib/module/jest.setup.js +1 -0
  25. package/lib/module/jest.setup.js.map +1 -1
  26. package/lib/module/native-types.js +36 -27
  27. package/lib/module/native-types.js.map +1 -1
  28. package/lib/module/types.js +59 -0
  29. package/lib/module/types.js.map +1 -1
  30. package/lib/module/utils/getMostRecentCategorySample.js +1 -1
  31. package/lib/module/utils/getMostRecentCategorySample.js.map +1 -1
  32. package/lib/module/utils/getMostRecentQuantitySample.js +5 -1
  33. package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -1
  34. package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +5 -0
  35. package/lib/typescript/src/index.d.ts +50 -3
  36. package/lib/typescript/src/index.ios.d.ts +84 -3
  37. package/lib/typescript/src/native-types.d.ts +515 -34
  38. package/lib/typescript/src/types.d.ts +49 -0
  39. package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +2 -1
  40. package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +2 -1
  41. package/package.json +1 -1
  42. package/src/hooks/useIsHealthDataAvailable.ts +5 -0
  43. package/src/index.ios.tsx +132 -21
  44. package/src/index.tsx +6 -4
  45. package/src/jest.setup.ts +1 -0
  46. package/src/native-types.ts +615 -81
  47. package/src/types.ts +51 -2
  48. package/src/utils/getMostRecentCategorySample.ts +3 -2
  49. package/src/utils/getMostRecentQuantitySample.ts +9 -2
@@ -1,10 +1,11 @@
1
+ import { Platform } from 'react-native';
1
2
  import useHealthkitAuthorization from './hooks/useHealthkitAuthorization';
2
3
  import useIsHealthDataAvailable from './hooks/useIsHealthDataAvailable';
3
4
  import useMostRecentCategorySample from './hooks/useMostRecentCategorySample';
4
5
  import useMostRecentQuantitySample from './hooks/useMostRecentQuantitySample';
5
6
  import useMostRecentWorkout from './hooks/useMostRecentWorkout';
6
7
  import useSubscribeToChanges from './hooks/useSubscribeToChanges';
7
- import Native from './native-types';
8
+ import Native, { HKQuantityTypeIdentifier } from './native-types';
8
9
  import deleteQuantitySample from './utils/deleteQuantitySample';
9
10
  import deleteSamples from './utils/deleteSamples';
10
11
  import getDateOfBirth from './utils/getDateOfBirth';
@@ -30,23 +31,105 @@ import saveCorrelationSample from './utils/saveCorrelationSample';
30
31
  import saveQuantitySample from './utils/saveQuantitySample';
31
32
  import saveWorkoutSample from './utils/saveWorkoutSample';
32
33
  import subscribeToChanges from './utils/subscribeToChanges';
33
- const Healthkit = {
34
- authorizationStatusFor: Native.authorizationStatusFor.bind(Native),
35
- isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),
36
- canAccessProtectedData: Native.canAccessProtectedData.bind(Native),
37
- disableAllBackgroundDelivery: Native.disableAllBackgroundDelivery.bind(Native),
38
- disableBackgroundDelivery: Native.disableBackgroundDelivery.bind(Native),
39
- enableBackgroundDelivery: Native.enableBackgroundDelivery.bind(Native),
34
+ const currentMajorVersionIOS = Platform.OS === 'ios' ? parseInt(Platform.Version, 10) : 0;
35
+ const allQuantityTypesList = [...Object.values(HKQuantityTypeIdentifier)];
36
+ const availableQuantityTypes = function () {
37
+ let majorVersionIOS = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : currentMajorVersionIOS;
38
+ if (majorVersionIOS >= 17) {
39
+ return allQuantityTypesList;
40
+ }
41
+
42
+ // remove types that are not available before iOS 17
43
+ return allQuantityTypesList.filter(type => ![HKQuantityTypeIdentifier.cyclingCadence, HKQuantityTypeIdentifier.cyclingFunctionalThresholdPower, HKQuantityTypeIdentifier.cyclingPower, HKQuantityTypeIdentifier.cyclingSpeed, HKQuantityTypeIdentifier.physicalEffort, HKQuantityTypeIdentifier.timeInDaylight].includes(type));
44
+ };
45
+ const authorizationStatusFor = Native.authorizationStatusFor.bind(Native);
46
+ const isHealthDataAvailable = Native.isHealthDataAvailable.bind(Native);
47
+ // Todo [>8]: Rename to align with Apple function name (isProtectedDataAvailable)
48
+ const canAccessProtectedData = Native.canAccessProtectedData.bind(Native);
49
+ const disableBackgroundDelivery = Native.disableBackgroundDelivery.bind(Native);
50
+ const disableAllBackgroundDelivery = Native.disableAllBackgroundDelivery.bind(Native);
51
+ const enableBackgroundDelivery = Native.enableBackgroundDelivery.bind(Native);
52
+ const getBiologicalSex = Native.getBiologicalSex.bind(Native);
53
+ const getFitzpatrickSkinType = Native.getFitzpatrickSkinType.bind(Native);
54
+ const getWheelchairUse = Native.getWheelchairUse.bind(Native);
55
+ const getBloodType = Native.getBloodType.bind(Native);
56
+ const getWorkoutRoutes = Native.getWorkoutRoutes.bind(Native);
57
+
58
+ /**
59
+ * @see {@link https://developer.apple.com/documentation/healthkit/about_the_healthkit_framework About the HealthKit Framework (Apple Docs)}
60
+ */
61
+ export default {
62
+ /**
63
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus authorizationStatus(for:) (Apple Docs) }
64
+ * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Authorizing access to health data (Apple Docs) }
65
+ */
66
+ authorizationStatusFor,
67
+ /**
68
+ *
69
+ * @returns All available quantity types for the current iOS version (currently excluding types that are not available before iOS 17)
70
+ */
71
+ availableQuantityTypes,
72
+ /**
73
+ * @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.
74
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable isHealthDataAvailable() (Apple Docs)}
75
+ * @returns {boolean} true if HealthKit is available; otherwise, false.
76
+ */
77
+ isHealthDataAvailable,
78
+ /**
79
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
80
+ * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
81
+ * @returns {boolean} A Boolean value that indicates whether content protection is active.
82
+ */
83
+ isProtectedDataAvailable: canAccessProtectedData,
84
+ // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)
85
+ /**
86
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614181-isprotecteddataavailable isProtectedDataAvailable() (Apple Docs)}
87
+ * @see {@link https://developer.apple.com/documentation/healthkit/protecting_user_privacy#3705074 Protecting User Privacy - Access encrypted data (Apple Docs)}
88
+ * @deprecated Use {@link isProtectedDataAvailable} instead. Will be removed in next major version.
89
+ * @returns {boolean} A Boolean value that indicates whether content protection is active.
90
+ */
91
+ canAccessProtectedData,
92
+ /**
93
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614158-disableallbackgrounddelivery disableAllBackgroundDelivery(completion:) (Apple Docs)}
94
+ */
95
+ disableAllBackgroundDelivery,
96
+ /**
97
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614177-disablebackgrounddelivery disableBackgroundDelivery(for:withCompletion:) (Apple Docs)}
98
+ */
99
+ disableBackgroundDelivery,
100
+ /**
101
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery enableBackgroundDelivery(for:frequency:withCompletion:) (Apple Docs)}
102
+ */
103
+ enableBackgroundDelivery,
40
104
  // simple convenience getters
41
- getBiologicalSex: Native.getBiologicalSex.bind(Native),
42
- getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),
43
- getWheelchairUse: Native.getWheelchairUse.bind(Native),
44
- getBloodType: Native.getBloodType.bind(Native),
45
- getWorkoutRoutes: Native.getWorkoutRoutes.bind(Native),
105
+ /**
106
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614171-biologicalsex biologicalSex() (Apple Docs)}
107
+ */
108
+ getBiologicalSex,
109
+ /**
110
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614161-fitzpatrickskintype fitzpatrickSkinType() (Apple Docs)}
111
+ */
112
+ getFitzpatrickSkinType,
113
+ /**
114
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648356-wheelchairuse wheelchairUse() (Apple Docs)}
115
+ */
116
+ getWheelchairUse,
117
+ /**
118
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614164-bloodtype bloodType() (Apple Docs)}
119
+ */
120
+ getBloodType,
121
+ /**
122
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1648357-dateofbirthcomponents dateOfBirthComponents() (Apple Docs)}
123
+ */
46
124
  getDateOfBirth,
47
125
  getMostRecentQuantitySample,
48
126
  getMostRecentCategorySample,
49
127
  getMostRecentWorkout,
128
+ /**
129
+ * @see {@link https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/reading_route_data Reading route data (Apple Docs)}
130
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutequery HKWorkoutRouteQuery (Apple Docs)}
131
+ */
132
+ getWorkoutRoutes,
50
133
  getPreferredUnit,
51
134
  getPreferredUnits,
52
135
  getRequestStatusForAuthorization,
@@ -66,20 +149,41 @@ const Healthkit = {
66
149
  deleteQuantitySample,
67
150
  deleteSamples,
68
151
  // save methods
152
+ /**
153
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
154
+ * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
155
+ */
69
156
  saveCategorySample,
70
157
  saveCorrelationSample,
71
158
  saveQuantitySample,
72
159
  saveWorkoutSample,
73
160
  // subscriptions
74
161
  subscribeToChanges,
75
- // hooks
162
+ /**
163
+ * @returns the most recent sample for the given category type.
164
+ */
76
165
  useMostRecentCategorySample,
166
+ /**
167
+ * @returns the most recent sample for the given quantity type.
168
+ */
77
169
  useMostRecentQuantitySample,
170
+ /**
171
+ * @returns the most recent workout sample.
172
+ */
78
173
  useMostRecentWorkout,
79
174
  useSubscribeToChanges,
175
+ /**
176
+ * @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.
177
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614180-ishealthdataavailable Apple Docs}
178
+ * @returns {boolean | null} true if HealthKit is available; otherwise, false. null while initializing.
179
+ */
80
180
  useIsHealthDataAvailable,
181
+ /**
182
+ * @description Hook to retrieve the current authorization status for the given types, and request authorization if needed.
183
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization Apple Docs - requestAuthorization}
184
+ * @see {@link https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data Apple Docs - Authorizing access to health data}
185
+ */
81
186
  useHealthkitAuthorization
82
187
  };
83
188
  export * from './types';
84
- export default Healthkit;
85
189
  //# sourceMappingURL=index.ios.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useHealthkitAuthorization","useIsHealthDataAvailable","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","Native","deleteQuantitySample","deleteSamples","getDateOfBirth","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","querySources","queryStatisticsForQuantity","queryWorkouts","requestAuthorization","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","Healthkit","authorizationStatusFor","bind","isHealthDataAvailable","canAccessProtectedData","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes"],"sources":["index.ios.tsx"],"sourcesContent":["import 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 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 saveWorkoutSample from './utils/saveWorkoutSample'\nimport subscribeToChanges from './utils/subscribeToChanges'\n\nconst Healthkit = {\n authorizationStatusFor: Native.authorizationStatusFor.bind(Native),\n\n isHealthDataAvailable: Native.isHealthDataAvailable.bind(Native),\n canAccessProtectedData: Native.canAccessProtectedData.bind(Native),\n\n disableAllBackgroundDelivery:\n Native.disableAllBackgroundDelivery.bind(Native),\n disableBackgroundDelivery: Native.disableBackgroundDelivery.bind(Native),\n enableBackgroundDelivery: Native.enableBackgroundDelivery.bind(Native),\n\n // simple convenience getters\n getBiologicalSex: Native.getBiologicalSex.bind(Native),\n getFitzpatrickSkinType: Native.getFitzpatrickSkinType.bind(Native),\n getWheelchairUse: Native.getWheelchairUse.bind(Native),\n getBloodType: Native.getBloodType.bind(Native),\n\n getWorkoutRoutes: Native.getWorkoutRoutes.bind(Native),\n\n getDateOfBirth,\n\n getMostRecentQuantitySample,\n getMostRecentCategorySample,\n getMostRecentWorkout,\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 saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n\n // subscriptions\n subscribeToChanges,\n\n // hooks\n useMostRecentCategorySample,\n\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n\n useSubscribeToChanges,\n\n useIsHealthDataAvailable,\n useHealthkitAuthorization,\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":"AAAA,OAAOA,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,MAAM,gBAAgB;AACnC,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;AAC/D,OAAOC,8BAA8B,MAAM,wCAAwC;AACnF,OAAOC,uBAAuB,MAAM,iCAAiC;AACrE,OAAOC,2BAA2B,MAAM,qCAAqC;AAC7E,OAAOC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C5B,MAAM,CAAC;EAE9CsC,gBAAgB,EAAEtC,MAAM,CAACsC,gBAAgB,CAACV,IAAI,CAAC5B,MAAM,CAAC;EAEtDG,cAAc;EAEdE,2BAA2B;EAC3BD,2BAA2B;EAC3BE,oBAAoB;EAEpBC,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;EACAmB,kBAAkB;EAClBC,qBAAqB;EACrBC,kBAAkB;EAClBC,iBAAiB;EAEjB;EACAC,kBAAkB;EAElB;EACA7B,2BAA2B;EAE3BC,2BAA2B;EAC3BC,oBAAoB;EAEpBC,qBAAqB;EAErBJ,wBAAwB;EACxBD;AACF,CAAC;AAED,cAAc,SAAS;AAEvB,eAAegC,SAAS"}
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","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 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\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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,CAAC;;AAE7D;AACA;AACA;AACA,eAAe;EACb;AACF;AACA;AACA;EACEgD,sBAAsB;EAEtB;AACF;AACA;AACA;EACEd,sBAAsB;EAEtB;AACF;AACA;AACA;AACA;EACEgB,qBAAqB;EAErB;AACF;AACA;AACA;AACA;EACEU,wBAAwB,EAAET,sBAAsB;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;EACEtD,cAAc;EAEdE,2BAA2B;EAC3BD,2BAA2B;EAC3BE,oBAAoB;EAEpB;AACF;AACA;AACA;EACEoD,gBAAgB;EAEhBnD,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;EAClBC,iBAAiB;EAEjB;EACAC,kBAAkB;EAElB;AACF;AACA;EACE9B,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"}
@@ -14,6 +14,7 @@ function UnavailableFn(retVal) {
14
14
  }
15
15
  const Healthkit = {
16
16
  authorizationStatusFor: UnavailableFn(Promise.resolve(HKAuthorizationStatus.notDetermined)),
17
+ availableQuantityTypes: UnavailableFn([]),
17
18
  disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),
18
19
  disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),
19
20
  enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),
@@ -74,7 +75,8 @@ const Healthkit = {
74
75
  useSubscribeToChanges: UnavailableFn([null, () => null]),
75
76
  useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)]),
76
77
  useIsHealthDataAvailable: () => false,
77
- canAccessProtectedData: async () => Promise.resolve(false)
78
+ canAccessProtectedData: async () => Promise.resolve(false),
79
+ isProtectedDataAvailable: async () => Promise.resolve(false)
78
80
  };
79
81
  export * from './types';
80
82
  export default Healthkit;
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBiologicalSex","HKBloodType","HKFitzpatrickSkinType","HKUnits","HKWheelchairUse","notAvailableError","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","notDetermined","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","notSet","getBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","Count","getPreferredUnits","getRequestStatusForAuthorization","unknown","getWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","queryCategorySamplesWithAnchor","samples","deletedSamples","newAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable","canAccessProtectedData"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKAuthorizationStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse, QueryQuantitySamplesResponseRaw,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\nimport type { QueryCategorySamplesFn } from './utils/queryCategorySamples'\nimport type { QueryQuantitySamplesFn } from './utils/queryQuantitySamples'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n // eslint-disable-next-line no-console\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit: typeof ReactNativeHealthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(HKAuthorizationStatus.notDetermined)),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve([])) as unknown as QueryCategorySamplesFn,\n queryCategorySamplesWithAnchor: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamples: UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamplesWithAnchor: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryQuantitySamples: UnavailableFn(Promise.resolve([])) as unknown as QueryQuantitySamplesFn,\n queryQuantitySamplesWithAnchor: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n querySources: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n deleteQuantitySample: UnavailableFn(Promise.resolve(false)),\n deleteSamples: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n canAccessProtectedData: async () => Promise.resolve(false),\n}\n\nexport * from './types'\n\nexport default Healthkit\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SACEC,4BAA4B,EAAEC,qBAAqB,EAAEC,eAAe,EAAEC,WAAW,EAAEC,qBAAqB,EAAEC,OAAO,EAAEC,eAAe,QAC7H,gBAAgB;AAMvB,MAAMC,iBAAiB,GAAI,kDACzBR,QAAQ,CAACS,EACV,iBAAgB;AAEjB,IAAIC,SAAS,GAAG,KAAK;AAErB,SAASC,aAAaA,CAAcC,MAAS,EAAE;EAC7C,OAAO,MAAM;IACX,IAAI,CAACF,SAAS,EAAE;MACd;MACAG,OAAO,CAACC,IAAI,CAACN,iBAAiB,CAAC;MAC/BE,SAAS,GAAG,IAAI;IAClB;IACA,OAAOE,MAAM;EACf,CAAC;AACH;AAEA,MAAMG,SAAsC,GAAG;EAC7CC,sBAAsB,EAAEL,aAAa,CAACM,OAAO,CAACC,OAAO,CAAChB,qBAAqB,CAACiB,aAAa,CAAC,CAAC;EAC3FC,4BAA4B,EAAET,aAAa,CAACM,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC,CAAC;EACnEG,yBAAyB,EAAEV,aAAa,CAACM,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC,CAAC;EAChEI,wBAAwB,EAAEX,aAAa,CAACM,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC,CAAC;EAC/DK,gBAAgB,EAAEZ,aAAa,CAACM,OAAO,CAACC,OAAO,CAACf,eAAe,CAACqB,MAAM,CAAC,CAAC;EACxEC,YAAY,EAAEd,aAAa,CAACM,OAAO,CAACC,OAAO,CAACd,WAAW,CAACoB,MAAM,CAAC,CAAC;EAChEE,cAAc,EAAEf,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qB,EAAEtD,aAAa,CAACM,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC,CAAC;EAC5DgD,kBAAkB,EAAEvD,aAAa,CAACM,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC,CAAC;EACzDiD,iBAAiB,EAAExD,aAAa,CAACM,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC,CAAC;EACxDkD,kBAAkB,EAAEzD,aAAa,CAACM,OAAO,CAACC,OAAO,CAAC,YAAYD,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;EACtFmD,2BAA2B,EAAE1D,aAAa,CAAC,IAAI,CAAC;EAChD2D,2BAA2B,EAAE3D,aAAa,CAAC,IAAI,CAAC;EAChD4D,oBAAoB,EAAE5D,aAAa,CAAC,IAAI,CAAC;EACzC6D,qBAAqB,EAAE7D,aAAa,CAAC,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,CAAC;EACxD8D,yBAAyB,EAAE9D,aAAa,CAAC,CAAC,IAAI,EAAE,YAAYM,OAAO,CAACC,OAAO,CAACjB,4BAA4B,CAACmC,OAAO,CAAC,CAAU,CAAC;EAC5HsC,wBAAwB,EAAEA,CAAA,KAAM,KAAK;EACrCC,sBAAsB,EAAE,MAAAA,CAAA,KAAY1D,OAAO,CAACC,OAAO,CAAC,KAAK;AAC3D,CAAC;AAED,cAAc,SAAS;AAEvB,eAAeH,SAAS"}
1
+ {"version":3,"names":["Platform","HKAuthorizationRequestStatus","HKAuthorizationStatus","HKBiologicalSex","HKBloodType","HKFitzpatrickSkinType","HKUnits","HKWheelchairUse","notAvailableError","OS","hasWarned","UnavailableFn","retVal","console","warn","Healthkit","authorizationStatusFor","Promise","resolve","notDetermined","availableQuantityTypes","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","notSet","getBloodType","getDateOfBirth","Date","getFitzpatrickSkinType","getMostRecentCategorySample","getMostRecentQuantitySample","getMostRecentWorkout","getPreferredUnit","Count","getPreferredUnits","getRequestStatusForAuthorization","unknown","getWheelchairUse","getWorkoutRoutes","isHealthDataAvailable","queryCategorySamples","queryCategorySamplesWithAnchor","samples","deletedSamples","newAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","averageQuantity","undefined","maximumQuantity","minimumQuantity","sumQuantity","mostRecentQuantity","mostRecentQuantityDateInterval","duration","queryWorkouts","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useHealthkitAuthorization","useIsHealthDataAvailable","canAccessProtectedData","isProtectedDataAvailable"],"sources":["index.tsx"],"sourcesContent":["import { Platform } from 'react-native'\n\nimport {\n HKAuthorizationRequestStatus, HKAuthorizationStatus, HKBiologicalSex, HKBloodType, HKFitzpatrickSkinType, HKUnits, HKWheelchairUse,\n} from './native-types'\n\nimport type ReactNativeHealthkit from './index.ios'\nimport type { QueryCategorySamplesFn } from './utils/queryCategorySamples'\nimport type { QueryQuantitySamplesFn } from './utils/queryQuantitySamples'\n\nconst notAvailableError = `[@kingstinct/react-native-healthkit] Platform \"${\n Platform.OS\n}\" not supported`\n\nlet hasWarned = false\n\nfunction UnavailableFn<T = unknown>(retVal: T) {\n return () => {\n if (!hasWarned) {\n // eslint-disable-next-line no-console\n console.warn(notAvailableError)\n hasWarned = true\n }\n return retVal\n }\n}\n\nconst Healthkit = {\n authorizationStatusFor: UnavailableFn(Promise.resolve(HKAuthorizationStatus.notDetermined)),\n availableQuantityTypes: UnavailableFn([]),\n disableAllBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n disableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n enableBackgroundDelivery: UnavailableFn(Promise.resolve(false)),\n getBiologicalSex: UnavailableFn(Promise.resolve(HKBiologicalSex.notSet)),\n getBloodType: UnavailableFn(Promise.resolve(HKBloodType.notSet)),\n getDateOfBirth: UnavailableFn(Promise.resolve(new Date(0))),\n getFitzpatrickSkinType: UnavailableFn(Promise.resolve(HKFitzpatrickSkinType.notSet)),\n getMostRecentCategorySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentQuantitySample: UnavailableFn(Promise.resolve(null)),\n getMostRecentWorkout: UnavailableFn(Promise.resolve(null)),\n getPreferredUnit: UnavailableFn(Promise.resolve(HKUnits.Count)),\n getPreferredUnits: UnavailableFn(Promise.resolve([])),\n getRequestStatusForAuthorization: UnavailableFn(Promise.resolve(HKAuthorizationRequestStatus.unknown)),\n getWheelchairUse: UnavailableFn(Promise.resolve(HKWheelchairUse.notSet)),\n getWorkoutRoutes: UnavailableFn(Promise.resolve([])),\n isHealthDataAvailable: async () => Promise.resolve(false),\n queryCategorySamples: UnavailableFn(Promise.resolve([])) as unknown as QueryCategorySamplesFn,\n queryCategorySamplesWithAnchor: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryCorrelationSamples: UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamples: UnavailableFn(Promise.resolve([])),\n queryHeartbeatSeriesSamplesWithAnchor: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryQuantitySamples: UnavailableFn(Promise.resolve([])) as unknown as QueryQuantitySamplesFn,\n queryQuantitySamplesWithAnchor: UnavailableFn(Promise.resolve({\n samples: [],\n deletedSamples: [],\n newAnchor: '',\n })),\n queryStatisticsForQuantity: UnavailableFn(Promise.resolve({\n averageQuantity: undefined,\n maximumQuantity: undefined,\n minimumQuantity: undefined,\n sumQuantity: undefined,\n mostRecentQuantity: undefined,\n mostRecentQuantityDateInterval: undefined,\n duration: undefined,\n })),\n queryWorkouts: UnavailableFn(Promise.resolve([])),\n querySources: UnavailableFn(Promise.resolve([])),\n requestAuthorization: UnavailableFn(Promise.resolve(false)),\n deleteQuantitySample: UnavailableFn(Promise.resolve(false)),\n deleteSamples: UnavailableFn(Promise.resolve(false)),\n saveCategorySample: UnavailableFn(Promise.resolve(false)),\n saveCorrelationSample: UnavailableFn(Promise.resolve(false)),\n saveQuantitySample: UnavailableFn(Promise.resolve(false)),\n saveWorkoutSample: UnavailableFn(Promise.resolve(false)),\n subscribeToChanges: UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),\n useMostRecentCategorySample: UnavailableFn(null),\n useMostRecentQuantitySample: UnavailableFn(null),\n useMostRecentWorkout: UnavailableFn(null),\n useSubscribeToChanges: UnavailableFn([null, () => null]),\n useHealthkitAuthorization: UnavailableFn([null, async () => Promise.resolve(HKAuthorizationRequestStatus.unknown)] as const),\n useIsHealthDataAvailable: () => false,\n canAccessProtectedData: async () => Promise.resolve(false),\n isProtectedDataAvailable: async () => Promise.resolve(false),\n} as typeof ReactNativeHealthkit\n\nexport * from './types'\n\nexport default Healthkit as typeof ReactNativeHealthkit\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SACEC,4BAA4B,EAAEC,qBAAqB,EAAEC,eAAe,EAAEC,WAAW,EAAEC,qBAAqB,EAAEC,OAAO,EAAEC,eAAe,QAC7H,gBAAgB;AAMvB,MAAMC,iBAAiB,GAAI,kDACzBR,QAAQ,CAACS,EACV,iBAAgB;AAEjB,IAAIC,SAAS,GAAG,KAAK;AAErB,SAASC,aAAaA,CAAcC,MAAS,EAAE;EAC7C,OAAO,MAAM;IACX,IAAI,CAACF,SAAS,EAAE;MACd;MACAG,OAAO,CAACC,IAAI,CAACN,iBAAiB,CAAC;MAC/BE,SAAS,GAAG,IAAI;IAClB;IACA,OAAOE,MAAM;EACf,CAAC;AACH;AAEA,MAAMG,SAAS,GAAG;EAChBC,sBAAsB,EAAEL,aAAa,CAACM,OAAO,CAACC,OAAO,CAAChB,qBAAqB,CAACiB,aAAa,CAAC,CAAC;EAC3FC,sBAAsB,EAAET,aAAa,CAAC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,CAACC,OAAO,CAAC,KAAK,CAAC;EAC1D2D,wBAAwB,EAAE,MAAAA,CAAA,KAAY5D,OAAO,CAACC,OAAO,CAAC,KAAK;AAC7D,CAAgC;AAEhC,cAAc,SAAS;AAEvB,eAAeH,SAAS"}
@@ -34,6 +34,7 @@ const mockModule = {
34
34
  saveWorkoutSample: jest.fn(),
35
35
  subscribeToObserverQuery: jest.fn(),
36
36
  unsubscribeQuery: jest.fn(),
37
+ // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)
37
38
  canAccessProtectedData: jest.fn()
38
39
  };
39
40
  NativeModules.ReactNativeHealthkit = mockModule;
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","mockModule","isHealthDataAvailable","jest","fn","addListener","removeListeners","authorizationStatusFor","requestAuthorization","saveQuantitySample","deleteQuantitySample","deleteSamples","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","queryCategorySamplesWithAnchor","queryQuantitySamplesWithAnchor","getBiologicalSex","getBloodType","getDateOfBirth","getFitzpatrickSkinType","getPreferredUnits","getRequestStatusForAuthorization","getWheelchairUse","getWorkoutRoutes","queryCategorySamples","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","querySources","queryStatisticsForQuantity","queryWorkoutSamples","saveCategorySample","saveCorrelationSample","saveWorkoutSample","subscribeToObserverQuery","unsubscribeQuery","canAccessProtectedData","ReactNativeHealthkit"],"sources":["jest.setup.ts"],"sourcesContent":["import { NativeModule, NativeModules } from 'react-native'\n\nimport type Native from './native-types'\n\nconst mockModule: (NativeModule & typeof Native) = {\n isHealthDataAvailable: jest.fn(),\n addListener: jest.fn(),\n removeListeners: jest.fn(),\n authorizationStatusFor: jest.fn(),\n requestAuthorization: jest.fn(),\n saveQuantitySample: jest.fn(),\n deleteQuantitySample: jest.fn(),\n deleteSamples: jest.fn(),\n disableAllBackgroundDelivery: jest.fn(),\n disableBackgroundDelivery: jest.fn(),\n enableBackgroundDelivery: jest.fn(),\n queryCategorySamplesWithAnchor: jest.fn(),\n queryQuantitySamplesWithAnchor: jest.fn(),\n getBiologicalSex: jest.fn(),\n getBloodType: jest.fn(),\n getDateOfBirth: jest.fn(),\n getFitzpatrickSkinType: jest.fn(),\n getPreferredUnits: jest.fn(),\n getRequestStatusForAuthorization: jest.fn(),\n getWheelchairUse: jest.fn(),\n getWorkoutRoutes: jest.fn(),\n queryCategorySamples: jest.fn(),\n queryCorrelationSamples: jest.fn(),\n queryHeartbeatSeriesSamples: jest.fn(),\n queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),\n queryQuantitySamples: jest.fn(),\n querySources: jest.fn(),\n queryStatisticsForQuantity: jest.fn(),\n queryWorkoutSamples: jest.fn(),\n saveCategorySample: jest.fn(),\n saveCorrelationSample: jest.fn(),\n saveWorkoutSample: jest.fn(),\n subscribeToObserverQuery: jest.fn(),\n unsubscribeQuery: jest.fn(),\n canAccessProtectedData: jest.fn(),\n}\n\nNativeModules.ReactNativeHealthkit = mockModule\n"],"mappings":"AAAA,SAAuBA,aAAa,QAAQ,cAAc;AAI1D,MAAMC,UAA0C,GAAG;EACjDC,qBAAqB,EAAEC,IAAI,CAACC,EAAE,CAAC,CAAC;EAChCC,WAAW,EAAEF,IAAI,CAACC,EAAE,CAAC,CAAC;EACtBE,eAAe,EAAEH,IAAI,CAACC,EAAE,CAAC,CAAC;EAC1BG,sBAAsB,EAAEJ,IAAI,CAACC,EAAE,CAAC,CAAC;EACjCI,oBAAoB,EAAEL,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BK,kBAAkB,EAAEN,IAAI,CAACC,EAAE,CAAC,CAAC;EAC7BM,oBAAoB,EAAEP,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BO,aAAa,EAAER,IAAI,CAACC,EAAE,CAAC,CAAC;EACxBQ,4BAA4B,EAAET,IAAI,CAACC,EAAE,CAAC,CAAC;EACvCS,yBAAyB,EAAEV,IAAI,CAACC,EAAE,C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wB,EAAEjC,IAAI,CAACC,EAAE,CAAC,CAAC;EACnCiC,gBAAgB,EAAElC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC3BkC,sBAAsB,EAAEnC,IAAI,CAACC,EAAE,CAAC;AAClC,CAAC;AAEDJ,aAAa,CAACuC,oBAAoB,GAAGtC,UAAU"}
1
+ {"version":3,"names":["NativeModules","mockModule","isHealthDataAvailable","jest","fn","addListener","removeListeners","authorizationStatusFor","requestAuthorization","saveQuantitySample","deleteQuantitySample","deleteSamples","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","queryCategorySamplesWithAnchor","queryQuantitySamplesWithAnchor","getBiologicalSex","getBloodType","getDateOfBirth","getFitzpatrickSkinType","getPreferredUnits","getRequestStatusForAuthorization","getWheelchairUse","getWorkoutRoutes","queryCategorySamples","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","querySources","queryStatisticsForQuantity","queryWorkoutSamples","saveCategorySample","saveCorrelationSample","saveWorkoutSample","subscribeToObserverQuery","unsubscribeQuery","canAccessProtectedData","ReactNativeHealthkit"],"sources":["jest.setup.ts"],"sourcesContent":["import { NativeModule, NativeModules } from 'react-native'\n\nimport type Native from './native-types'\n\nconst mockModule: (NativeModule & typeof Native) = {\n isHealthDataAvailable: jest.fn(),\n addListener: jest.fn(),\n removeListeners: jest.fn(),\n authorizationStatusFor: jest.fn(),\n requestAuthorization: jest.fn(),\n saveQuantitySample: jest.fn(),\n deleteQuantitySample: jest.fn(),\n deleteSamples: jest.fn(),\n disableAllBackgroundDelivery: jest.fn(),\n disableBackgroundDelivery: jest.fn(),\n enableBackgroundDelivery: jest.fn(),\n queryCategorySamplesWithAnchor: jest.fn(),\n queryQuantitySamplesWithAnchor: jest.fn(),\n getBiologicalSex: jest.fn(),\n getBloodType: jest.fn(),\n getDateOfBirth: jest.fn(),\n getFitzpatrickSkinType: jest.fn(),\n getPreferredUnits: jest.fn(),\n getRequestStatusForAuthorization: jest.fn(),\n getWheelchairUse: jest.fn(),\n getWorkoutRoutes: jest.fn(),\n queryCategorySamples: jest.fn(),\n queryCorrelationSamples: jest.fn(),\n queryHeartbeatSeriesSamples: jest.fn(),\n queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),\n queryQuantitySamples: jest.fn(),\n querySources: jest.fn(),\n queryStatisticsForQuantity: jest.fn(),\n queryWorkoutSamples: jest.fn(),\n saveCategorySample: jest.fn(),\n saveCorrelationSample: jest.fn(),\n saveWorkoutSample: jest.fn(),\n subscribeToObserverQuery: jest.fn(),\n unsubscribeQuery: jest.fn(),\n // Todo [>8]: Remove to align with Apple function name (isProtectedDataAvailable)\n canAccessProtectedData: jest.fn(),\n}\n\nNativeModules.ReactNativeHealthkit = mockModule\n"],"mappings":"AAAA,SAAuBA,aAAa,QAAQ,cAAc;AAI1D,MAAMC,UAA0C,GAAG;EACjDC,qBAAqB,EAAEC,IAAI,CAACC,EAAE,CAAC,CAAC;EAChCC,WAAW,EAAEF,IAAI,CAACC,EAAE,CAAC,CAAC;EACtBE,eAAe,EAAEH,IAAI,CAACC,EAAE,CAAC,CAAC;EAC1BG,sBAAsB,EAAEJ,IAAI,CAACC,EAAE,CAAC,CAAC;EACjCI,oBAAoB,EAAEL,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BK,kBAAkB,EAAEN,IAAI,CAACC,EAAE,CAAC,CAAC;EAC7BM,oBAAoB,EAAEP,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/BO,aAAa,EAAER,IAAI,CAACC,EAAE,CAAC,CAAC;EACxBQ,4BAA4B,EAAET,IAAI,CAACC,EAAE,CAAC,CAAC;EACvCS,yBAAyB,EAAEV,IAAI,CAACC,EAAE,CAAC,CAAC;EACpCU,wBAAwB,EAAEX,IAAI,CAACC,EAAE,CAAC,CAAC;EACnCW,8BAA8B,EAAEZ,IAAI,CAACC,EAAE,CAAC,CAAC;EACzCY,8BAA8B,EAAEb,IAAI,CAACC,EAAE,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AAC;AAEDJ,aAAa,CAACuC,oBAAoB,GAAGtC,UAAU"}
@@ -1,18 +1,25 @@
1
1
  import { NativeEventEmitter, NativeModules } from 'react-native';
2
2
  /**
3
- * See https://developer.apple.com/documentation/healthkit/hkworkouttypeidentifier
3
+ * Represents a workout type identifier.
4
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkworkouttypeidentifier Apple Docs HKWorkoutTypeIdentifier}
4
5
  */
5
6
  export const HKWorkoutTypeIdentifier = 'HKWorkoutTypeIdentifier';
7
+
8
+ /**
9
+ * Represents an audiogram type identifier.
10
+ */
6
11
  export const HKAudiogramTypeIdentifier = 'HKAudiogramTypeIdentifier';
7
12
 
8
13
  /**
9
- * See https://developer.apple.com/documentation/healthkit/hkworkoutroutetypeidentifier
14
+ * Represents a workout route type identifier.
15
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkworkoutroutetypeidentifier Apple Docs HKWorkoutRouteTypeIdentifier}
10
16
  */
11
17
  export const HKWorkoutRouteTypeIdentifier = 'HKWorkoutRouteTypeIdentifier';
12
18
  export const HKDataTypeIdentifierHeartbeatSeries = 'HKDataTypeIdentifierHeartbeatSeries';
13
19
 
14
20
  /**
15
- * See https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier
21
+ * Represents a quantity type identifier.
22
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier Apple Docs HKQuantityTypeIdentifier}
16
23
  */
17
24
  export let HKQuantityTypeIdentifier = /*#__PURE__*/function (HKQuantityTypeIdentifier) {
18
25
  HKQuantityTypeIdentifier["bodyMassIndex"] = "HKQuantityTypeIdentifierBodyMassIndex";
@@ -134,7 +141,7 @@ export let HKHeartRateMotionContext = /*#__PURE__*/function (HKHeartRateMotionCo
134
141
  }({});
135
142
 
136
143
  /**
137
- * See https://developer.apple.com/documentation/healthkit/hkcorrelationtypeidentifier
144
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcorrelationtypeidentifier Apple Docs }
138
145
  */
139
146
  export let HKCorrelationTypeIdentifier = /*#__PURE__*/function (HKCorrelationTypeIdentifier) {
140
147
  HKCorrelationTypeIdentifier["bloodPressure"] = "HKCorrelationTypeIdentifierBloodPressure";
@@ -143,7 +150,7 @@ export let HKCorrelationTypeIdentifier = /*#__PURE__*/function (HKCorrelationTyp
143
150
  }({});
144
151
 
145
152
  /**
146
- * See https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifier
153
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorytypeidentifier Apple Docs }
147
154
  */
148
155
  export let HKCategoryTypeIdentifier = /*#__PURE__*/function (HKCategoryTypeIdentifier) {
149
156
  HKCategoryTypeIdentifier["sleepAnalysis"] = "HKCategoryTypeIdentifierSleepAnalysis";
@@ -333,7 +340,7 @@ var HKIndoorWorkout = /*#__PURE__*/function (HKIndoorWorkout) {
333
340
  return HKIndoorWorkout;
334
341
  }(HKIndoorWorkout || {});
335
342
  /**
336
- * See https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus
343
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus Apple Docs }
337
344
  */
338
345
  export let HKAuthorizationRequestStatus = /*#__PURE__*/function (HKAuthorizationRequestStatus) {
339
346
  HKAuthorizationRequestStatus[HKAuthorizationRequestStatus["unknown"] = 0] = "unknown";
@@ -343,7 +350,7 @@ export let HKAuthorizationRequestStatus = /*#__PURE__*/function (HKAuthorization
343
350
  }({});
344
351
 
345
352
  /**
346
- * See https://developer.apple.com/documentation/healthkit/hkauthorizationstatus
353
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkauthorizationstatus Apple Docs }
347
354
  */
348
355
  export let HKAuthorizationStatus = /*#__PURE__*/function (HKAuthorizationStatus) {
349
356
  HKAuthorizationStatus[HKAuthorizationStatus["notDetermined"] = 0] = "notDetermined";
@@ -352,7 +359,7 @@ export let HKAuthorizationStatus = /*#__PURE__*/function (HKAuthorizationStatus)
352
359
  return HKAuthorizationStatus;
353
360
  }({});
354
361
  /**
355
- * See https://developer.apple.com/documentation/healthkit/hkbloodtype
362
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkbloodtype Apple Docs }
356
363
  */
357
364
  export let HKBloodType = /*#__PURE__*/function (HKBloodType) {
358
365
  HKBloodType[HKBloodType["notSet"] = 0] = "notSet";
@@ -368,7 +375,7 @@ export let HKBloodType = /*#__PURE__*/function (HKBloodType) {
368
375
  }({});
369
376
 
370
377
  /**
371
- * See https://developer.apple.com/documentation/healthkit/hkbiologicalsex
378
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkbiologicalsex Apple Docs }
372
379
  */
373
380
  export let HKBiologicalSex = /*#__PURE__*/function (HKBiologicalSex) {
374
381
  HKBiologicalSex[HKBiologicalSex["notSet"] = 0] = "notSet";
@@ -379,7 +386,7 @@ export let HKBiologicalSex = /*#__PURE__*/function (HKBiologicalSex) {
379
386
  }({});
380
387
 
381
388
  /**
382
- * See https://developer.apple.com/documentation/healthkit/hkfitzpatrickskintype
389
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkfitzpatrickskintype Apple Docs }
383
390
  */
384
391
  export let HKFitzpatrickSkinType = /*#__PURE__*/function (HKFitzpatrickSkinType) {
385
392
  HKFitzpatrickSkinType[HKFitzpatrickSkinType["notSet"] = 0] = "notSet";
@@ -393,7 +400,7 @@ export let HKFitzpatrickSkinType = /*#__PURE__*/function (HKFitzpatrickSkinType)
393
400
  }({});
394
401
 
395
402
  /**
396
- * See https://developer.apple.com/documentation/healthkit/hkstatisticsoptions
403
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkstatisticsoptions Apple Docs }
397
404
  */
398
405
  export let HKStatisticsOptions = /*#__PURE__*/function (HKStatisticsOptions) {
399
406
  HKStatisticsOptions["cumulativeSum"] = "cumulativeSum";
@@ -407,7 +414,7 @@ export let HKStatisticsOptions = /*#__PURE__*/function (HKStatisticsOptions) {
407
414
  return HKStatisticsOptions;
408
415
  }({});
409
416
  /**
410
- * https://developer.apple.com/documentation/healthkit/hkcategoryvaluecervicalmucusquality
417
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluecervicalmucusquality Apple Docs }
411
418
  */
412
419
  export let HKCategoryValueCervicalMucusQuality = /*#__PURE__*/function (HKCategoryValueCervicalMucusQuality) {
413
420
  HKCategoryValueCervicalMucusQuality[HKCategoryValueCervicalMucusQuality["dry"] = 1] = "dry";
@@ -419,7 +426,7 @@ export let HKCategoryValueCervicalMucusQuality = /*#__PURE__*/function (HKCatego
419
426
  }({});
420
427
 
421
428
  /**
422
- * See https://developer.apple.com/documentation/healthkit/hkcategoryvaluemenstrualflow
429
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluemenstrualflow Apple Docs }
423
430
  */
424
431
  export let HKCategoryValueMenstrualFlow = /*#__PURE__*/function (HKCategoryValueMenstrualFlow) {
425
432
  HKCategoryValueMenstrualFlow[HKCategoryValueMenstrualFlow["unspecified"] = 1] = "unspecified";
@@ -431,7 +438,7 @@ export let HKCategoryValueMenstrualFlow = /*#__PURE__*/function (HKCategoryValue
431
438
  }({});
432
439
 
433
440
  /**
434
- * See https://developer.apple.com/documentation/healthkit/hkcategoryvalueovulationtestresult
441
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueovulationtestresult Apple Docs }
435
442
  */
436
443
  export let HKCategoryValueOvulationTestResult = /*#__PURE__*/function (HKCategoryValueOvulationTestResult) {
437
444
  HKCategoryValueOvulationTestResult[HKCategoryValueOvulationTestResult["negative"] = 1] = "negative";
@@ -442,7 +449,7 @@ export let HKCategoryValueOvulationTestResult = /*#__PURE__*/function (HKCategor
442
449
  }({});
443
450
 
444
451
  /**
445
- * See https://developer.apple.com/documentation/healthkit/hkcategoryvaluesleepanalysis
452
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluesleepanalysis Apple Docs }
446
453
  */
447
454
  export let HKCategoryValueSleepAnalysis = /*#__PURE__*/function (HKCategoryValueSleepAnalysis) {
448
455
  HKCategoryValueSleepAnalysis[HKCategoryValueSleepAnalysis["inBed"] = 0] = "inBed";
@@ -455,7 +462,7 @@ export let HKCategoryValueSleepAnalysis = /*#__PURE__*/function (HKCategoryValue
455
462
  }({});
456
463
 
457
464
  /**
458
- * https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges
465
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueappetitechanges
459
466
  */
460
467
  export let HKCategoryValueAppetiteChanges = /*#__PURE__*/function (HKCategoryValueAppetiteChanges) {
461
468
  HKCategoryValueAppetiteChanges[HKCategoryValueAppetiteChanges["decreased"] = 2] = "decreased";
@@ -466,7 +473,7 @@ export let HKCategoryValueAppetiteChanges = /*#__PURE__*/function (HKCategoryVal
466
473
  }({});
467
474
 
468
475
  /**
469
- * https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence
476
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepresence
470
477
  */
471
478
  export let HKCategoryValuePresence = /*#__PURE__*/function (HKCategoryValuePresence) {
472
479
  HKCategoryValuePresence[HKCategoryValuePresence["notPresent"] = 1] = "notPresent";
@@ -475,7 +482,7 @@ export let HKCategoryValuePresence = /*#__PURE__*/function (HKCategoryValuePrese
475
482
  }({});
476
483
 
477
484
  /**
478
- * See https://developer.apple.com/documentation/healthkit/hkcategoryvalueseverity
485
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalueseverity Apple Docs }
479
486
  */
480
487
  export let HKCategoryValueSeverity = /*#__PURE__*/function (HKCategoryValueSeverity) {
481
488
  HKCategoryValueSeverity[HKCategoryValueSeverity["notPresent"] = 1] = "notPresent";
@@ -487,7 +494,7 @@ export let HKCategoryValueSeverity = /*#__PURE__*/function (HKCategoryValueSever
487
494
  }({});
488
495
 
489
496
  /**
490
- * See https://developer.apple.com/documentation/healthkit/hkcategoryvalue/notapplicable
497
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalue/notapplicable Apple Docs }
491
498
  */
492
499
  export let HKCategoryValueNotApplicable = /*#__PURE__*/function (HKCategoryValueNotApplicable) {
493
500
  HKCategoryValueNotApplicable[HKCategoryValueNotApplicable["notApplicable"] = 0] = "notApplicable";
@@ -495,11 +502,11 @@ export let HKCategoryValueNotApplicable = /*#__PURE__*/function (HKCategoryValue
495
502
  }({});
496
503
 
497
504
  /**
498
- * See https://developer.apple.com/documentation/healthkit/hkcategoryvalue
505
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvalue Apple Docs }
499
506
  */
500
507
 
501
508
  /**
502
- * See https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason
509
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason Apple Docs }
503
510
  */
504
511
  export let HKInsulinDeliveryReason = /*#__PURE__*/function (HKInsulinDeliveryReason) {
505
512
  HKInsulinDeliveryReason[HKInsulinDeliveryReason["basal"] = 1] = "basal";
@@ -507,7 +514,7 @@ export let HKInsulinDeliveryReason = /*#__PURE__*/function (HKInsulinDeliveryRea
507
514
  return HKInsulinDeliveryReason;
508
515
  }({});
509
516
  /**
510
- * See https://developer.apple.com/documentation/healthkit/hkcategoryvaluepregnancytestresult
517
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkcategoryvaluepregnancytestresult Apple Docs }
511
518
  */
512
519
  var HKCategoryValuePregnancyTestResult = /*#__PURE__*/function (HKCategoryValuePregnancyTestResult) {
513
520
  HKCategoryValuePregnancyTestResult[HKCategoryValuePregnancyTestResult["positive"] = 2] = "positive";
@@ -678,19 +685,19 @@ export let BloodGlucoseUnit = /*#__PURE__*/function (BloodGlucoseUnit) {
678
685
  }({});
679
686
 
680
687
  /**
681
- * See https://developer.apple.com/documentation/healthkit/hkdevice
688
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkdevice Apple Docs }
682
689
  */
683
690
 
684
691
  /**
685
- * See https://developer.apple.com/documentation/healthkit/hkobject/1615781-source
692
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615781-source Apple Docs }
686
693
  */
687
694
 
688
695
  /**
689
- * See https://developer.apple.com/documentation/healthkit/hkobject/1615483-sourcerevision
696
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkobject/1615483-sourcerevision Apple Docs }
690
697
  */
691
698
 
692
699
  /**
693
- * See https://developer.apple.com/documentation/healthkit/hkquantitysample
700
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs }
694
701
  */
695
702
 
696
703
  // Straight mapping to https://developer.apple.com/documentation/healthkit/hkcharacteristictypeidentifier
@@ -703,7 +710,9 @@ export let HKCharacteristicTypeIdentifier = /*#__PURE__*/function (HKCharacteris
703
710
  HKCharacteristicTypeIdentifier["activityMoveMode"] = "HKCharacteristicTypeIdentifierActivityMoveMode";
704
711
  return HKCharacteristicTypeIdentifier;
705
712
  }({}); // HKActivityMoveModeObject
706
- /** See https://developer.apple.com/documentation/healthkit/hkupdatefrequency */
713
+ /**
714
+ * @see {@link https://developer.apple.com/documentation/healthkit/hkupdatefrequency Apple Docs }
715
+ */
707
716
  export let HKUpdateFrequency = /*#__PURE__*/function (HKUpdateFrequency) {
708
717
  HKUpdateFrequency[HKUpdateFrequency["immediate"] = 1] = "immediate";
709
718
  HKUpdateFrequency[HKUpdateFrequency["hourly"] = 2] = "hourly";