@kingstinct/react-native-healthkit 8.2.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +28 -7
  2. package/ios/Constants.swift +5 -0
  3. package/ios/Helpers.swift +87 -0
  4. package/ios/ReactNativeHealthkit.m +22 -0
  5. package/ios/ReactNativeHealthkit.swift +184 -0
  6. package/ios/Serializers.swift +18 -0
  7. package/lib/commonjs/index.ios.js +28 -1
  8. package/lib/commonjs/index.ios.js.map +1 -1
  9. package/lib/commonjs/index.native.js +21 -4
  10. package/lib/commonjs/index.native.js.map +1 -1
  11. package/lib/commonjs/native-types.js +107 -1
  12. package/lib/commonjs/native-types.js.map +1 -1
  13. package/lib/commonjs/test-setup.js +4 -1
  14. package/lib/commonjs/test-setup.js.map +1 -1
  15. package/lib/commonjs/utils/queryStateOfMindSamples.js +22 -0
  16. package/lib/commonjs/utils/queryStateOfMindSamples.js.map +1 -0
  17. package/lib/commonjs/utils/queryStatisticsCollectionForQuantity.js +16 -0
  18. package/lib/commonjs/utils/queryStatisticsCollectionForQuantity.js.map +1 -0
  19. package/lib/commonjs/utils/startWatchApp.js +11 -0
  20. package/lib/commonjs/utils/startWatchApp.js.map +1 -0
  21. package/lib/module/index.ios.js +9 -3
  22. package/lib/module/index.ios.js.map +1 -1
  23. package/lib/module/index.native.js +17 -3
  24. package/lib/module/index.native.js.map +1 -1
  25. package/lib/module/native-types.js +111 -0
  26. package/lib/module/native-types.js.map +1 -1
  27. package/lib/module/test-setup.js +4 -1
  28. package/lib/module/test-setup.js.map +1 -1
  29. package/lib/module/utils/queryStateOfMindSamples.js +14 -0
  30. package/lib/module/utils/queryStateOfMindSamples.js.map +1 -0
  31. package/lib/module/utils/queryStatisticsCollectionForQuantity.js +9 -0
  32. package/lib/module/utils/queryStatisticsCollectionForQuantity.js.map +1 -0
  33. package/lib/module/utils/startWatchApp.js +4 -0
  34. package/lib/module/utils/startWatchApp.js.map +1 -0
  35. package/lib/typescript/src/index.ios.d.ts +13 -2
  36. package/lib/typescript/src/index.native.d.ts +11 -3
  37. package/lib/typescript/src/native-types.d.ts +146 -2
  38. package/lib/typescript/src/utils/queryStateOfMindSamples.d.ts +7 -0
  39. package/lib/typescript/src/utils/queryStatisticsCollectionForQuantity.d.ts +3 -0
  40. package/lib/typescript/src/utils/startWatchApp.d.ts +3 -0
  41. package/package.json +1 -1
  42. package/src/index.ios.tsx +10 -0
  43. package/src/index.native.tsx +20 -1
  44. package/src/native-types.ts +176 -1
  45. package/src/test-setup.ts +3 -0
  46. package/src/utils/queryStateOfMindSamples.ts +14 -0
  47. package/src/utils/queryStatisticsCollectionForQuantity.ts +38 -0
  48. package/src/utils/startWatchApp.ts +7 -0
  49. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  50. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  51. package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcuserdata/robertherber.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  52. package/ios/ReactNativeHealthkit.xcodeproj/xcuserdata/robertherber.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/README.md CHANGED
@@ -91,12 +91,26 @@ Some imperative examples:
91
91
  console.log(quantity) // 17.5
92
92
  console.log(unit) // %
93
93
 
94
- /* Listen to data */
95
94
  await HealthKit.requestAuthorization([HKQuantityTypeIdentifier.heartRate]); // request read permission for heart rate
96
95
 
97
- const unsubscribe = HealthKit.subscribeToChanges(HKQuantityTypeIdentifier.heartRate, () => {
98
- // refetch whichever queries you need
99
- });
96
+ /* Subscribe to data (Make sure to request permissions before subscribing to changes) */
97
+ const [hasRequestedAuthorization, setHasRequestedAuthorization] = useState(false);
98
+
99
+ useEffect(() => {
100
+ HealthKit.requestAuthorization([HKQuantityTypeIdentifier.heartRate]).then(() => {
101
+ setHasRequestedAuthorization(true);
102
+ });
103
+ }, []);
104
+
105
+ useEffect(() => {
106
+ if (hasRequestedAuthorization) {
107
+ const unsubscribe = HealthKit.subscribeToChanges(HKQuantityTypeIdentifier.heartRate, () => {
108
+ // refetch data as needed
109
+ });
110
+ }
111
+
112
+ return () => unsubscribe();
113
+ }, [hasRequestedAuthorization]);
100
114
 
101
115
  /* write data */
102
116
  await HealthKit.requestAuthorization([], [HKQuantityTypeIdentifier.insulinDelivery]); // request write permission for insulin delivery
@@ -117,13 +131,20 @@ Some imperative examples:
117
131
  ```
118
132
 
119
133
  ### HealthKit Anchors (breaking change in 6.0)
120
- In 6.0 you can use HealthKit anchors to get changes and deleted items which is very useful for syncing. This is a breaking change - but a very easy one to handle that TypeScript should help you with. Most queries now return an object containing samples which is what was returned as only an array before. In addition you also get deletedSamples and a newAnchor you can use for more advanced use cases, example:
134
+ In 6.0 you can use HealthKit anchors to get changes and deleted items which is very useful for syncing. This is a breaking change - but a very easy one to handle that TypeScript should help you with. Most queries now return an object containing samples which is what was returned as only an array before.
135
+
136
+ ```newAnchor``` is a base64-encoded string returned from HealthKit that contain sync information. After each successful sync, store the anchor for the next time your anchor query is called to only return the values that have changed.
137
+
138
+ ```limit``` will indicate how many records to consider when sycning data, you can set this value to 0 indicate no limit.
139
+
140
+ Example:
141
+
121
142
  ```TypeScript
122
- const { newAnchor, samples, deletedSamples } = await queryQuantitySamples(HKQuantityTypeIdentifier.stepCount, {
143
+ const { newAnchor, samples, deletedSamples } = await queryQuantitySamplesWithAnchor(HKQuantityTypeIdentifier.stepCount, {
123
144
  limit: 2,
124
145
  })
125
146
 
126
- const nextResult = await queryQuantitySamples(HKQuantityTypeIdentifier.stepCount, {
147
+ const nextResult = await queryQuantitySamplesWithAnchor(HKQuantityTypeIdentifier.stepCount, {
127
148
  limit: 2,
128
149
  anchor: newAnchor,
129
150
  })
@@ -11,6 +11,7 @@ import HealthKit
11
11
  let INIT_ERROR = "HEALTHKIT_INIT_ERROR"
12
12
  let INIT_ERROR_MESSAGE = "HealthKit not initialized"
13
13
  let TYPE_IDENTIFIER_ERROR = "HEALTHKIT_TYPE_IDENTIFIER_NOT_RECOGNIZED_ERROR"
14
+ let QUERY_ERROR = "HEALTHKIT_QUERY_ERROR"
14
15
  let GENERIC_ERROR = "HEALTHKIT_ERROR"
15
16
 
16
17
  let HKCharacteristicTypeIdentifier_PREFIX = "HKCharacteristicTypeIdentifier"
@@ -22,6 +23,10 @@ let HKAudiogramTypeIdentifier = "HKAudiogramTypeIdentifier"
22
23
  let HKWorkoutTypeIdentifier = "HKWorkoutTypeIdentifier"
23
24
  let HKWorkoutRouteTypeIdentifier = "HKWorkoutRouteTypeIdentifier"
24
25
  let HKDataTypeIdentifierHeartbeatSeries = "HKDataTypeIdentifierHeartbeatSeries"
26
+ let HKStateOfMindTypeIdentifier = "HKStateOfMindTypeIdentifier"
27
+
28
+ let HKWorkoutActivityTypePropertyName = "activityType"
29
+ let HKWorkoutSessionLocationTypePropertyName = "locationType"
25
30
 
26
31
  let SpeedUnit = HKUnit(from: "m/s") // HKUnit.meter().unitDivided(by: HKUnit.second())
27
32
  // Support for MET data: HKAverageMETs 8.24046 kcal/hr·kg
package/ios/Helpers.swift CHANGED
@@ -134,6 +134,12 @@ func objectTypeFromString(typeIdentifier: String) -> HKObjectType? {
134
134
  return HKObjectType.activitySummaryType()
135
135
  }
136
136
 
137
+ if #available(iOS 18, *) {
138
+ if typeIdentifier == HKStateOfMindTypeIdentifier {
139
+ return HKObjectType.stateOfMindType()
140
+ }
141
+ }
142
+
137
143
  if #available(iOS 13, *) {
138
144
  if typeIdentifier == HKAudiogramTypeIdentifier {
139
145
  return HKObjectType.audiogramSampleType()
@@ -156,3 +162,84 @@ func objectTypeFromString(typeIdentifier: String) -> HKObjectType? {
156
162
 
157
163
  return nil
158
164
  }
165
+
166
+ func hkStatisticsOptionsFromOptions(_ options: NSArray) -> HKStatisticsOptions {
167
+ var opts = HKStatisticsOptions()
168
+
169
+ for o in options {
170
+ guard let str = o as? String else { continue }
171
+
172
+ switch str {
173
+ case "cumulativeSum":
174
+ opts.insert(.cumulativeSum)
175
+ case "discreteAverage":
176
+ opts.insert(.discreteAverage)
177
+ case "discreteMax":
178
+ opts.insert(.discreteMax)
179
+ case "discreteMin":
180
+ opts.insert(.discreteMin)
181
+ case "discreteMostRecent":
182
+ if #available(iOS 12, *) {
183
+ opts.insert(.discreteMostRecent)
184
+ }
185
+ case "duration":
186
+ if #available(iOS 13, *) {
187
+ opts.insert(.duration)
188
+ }
189
+ case "mostRecent":
190
+ if #available(iOS 13, *) {
191
+ opts.insert(.mostRecent)
192
+ }
193
+ case "separateBySource":
194
+ opts.insert(.separateBySource)
195
+ default:
196
+ continue
197
+ }
198
+ }
199
+
200
+ return opts
201
+ }
202
+
203
+ func componentsFromInterval(_ interval: NSDictionary) -> DateComponents {
204
+ let componentKeys: [String: WritableKeyPath<DateComponents, Int?>] = [
205
+ "minute": \.minute,
206
+ "hour": \.hour,
207
+ "day": \.day,
208
+ "month": \.month,
209
+ "year": \.year
210
+ ]
211
+
212
+ var intervalComponents = DateComponents()
213
+ for (key, keyPath) in componentKeys {
214
+ if let value = interval[key] as? Int {
215
+ intervalComponents[keyPath: keyPath] = value
216
+ }
217
+ }
218
+ return intervalComponents
219
+ }
220
+
221
+ func serializeQuantityIfExists(unit: HKUnit, quantity: HKQuantity?) -> [String: Any]? {
222
+ guard let quantity = quantity else { return nil }
223
+ return serializeQuantity(unit: unit, quantity: quantity)
224
+ }
225
+
226
+ func serializeStatisticIfExists(unit: HKUnit, quantity: HKQuantity?, stats: HKStatistics) -> [String: Any]? {
227
+ guard let quantity = quantity else { return nil }
228
+ return serializeStatistic(unit: unit, quantity: quantity, stats: stats)
229
+ }
230
+
231
+ func parseWorkoutConfiguration(_ dict: NSDictionary) -> HKWorkoutConfiguration {
232
+ let configuration = HKWorkoutConfiguration()
233
+
234
+ if let activityTypeRaw = dict[HKWorkoutActivityTypePropertyName] as? UInt,
235
+ let activityType = HKWorkoutActivityType(rawValue: activityTypeRaw) {
236
+ configuration.activityType = activityType
237
+ }
238
+
239
+ if let locationTypeRaw = dict[HKWorkoutSessionLocationTypePropertyName] as? Int,
240
+ let locationType = HKWorkoutSessionLocationType(rawValue: locationTypeRaw) {
241
+ configuration.locationType = locationType
242
+ }
243
+
244
+ return configuration
245
+ }
@@ -214,6 +214,17 @@ RCT_EXTERN_METHOD(queryStatisticsForQuantity:(NSString)typeIdentifier
214
214
  reject:(RCTPromiseRejectBlock)reject
215
215
  )
216
216
 
217
+ RCT_EXTERN_METHOD(queryStatisticsCollectionForQuantity:(NSString)typeIdentifier
218
+ unitString:(NSString)unitString
219
+ options:(NSArray)options
220
+ anchorDate:(NSDate)anchorDate
221
+ interval:(NSDictionary)interval
222
+ startDate:(NSDate)startDate
223
+ endDate:(NSDate)endDate
224
+ resolve:(RCTPromiseResolveBlock)resolve
225
+ reject:(RCTPromiseRejectBlock)reject
226
+ )
227
+
217
228
  RCT_EXTERN_METHOD(getWheelchairUse:(RCTPromiseResolveBlock)resolve
218
229
  withRejecter:(RCTPromiseRejectBlock)reject)
219
230
 
@@ -230,5 +241,16 @@ RCT_EXTERN_METHOD(getWorkoutPlanById:(NSString)workoutUUID
230
241
  RCT_EXTERN_METHOD(isProtectedDataAvailable:(RCTPromiseResolveBlock)resolve
231
242
  withRejecter:(RCTPromiseRejectBlock)reject)
232
243
 
244
+ RCT_EXTERN_METHOD(startWatchAppWithWorkoutConfiguration:(NSDictionary)workoutConfiguration
245
+ resolve:(RCTPromiseResolveBlock)resolve
246
+ reject:(RCTPromiseRejectBlock)reject
247
+ )
248
+
249
+ RCT_EXTERN_METHOD(queryStateOfMindSamples:(NSDate)from
250
+ to:(NSDate)to
251
+ limit:(NSInteger)limit
252
+ ascending:(BOOL)ascending
253
+ resolve:(RCTPromiseResolveBlock)resolve
254
+ reject:(RCTPromiseRejectBlock)reject)
233
255
 
234
256
  @end
@@ -930,6 +930,85 @@ class ReactNativeHealthkit: RCTEventEmitter {
930
930
  store.execute(query)
931
931
  }
932
932
 
933
+ @objc(queryStatisticsCollectionForQuantity:unitString:options:anchorDate:interval:startDate:endDate:resolve:reject:)
934
+ func queryStatisticsCollectionForQuantity(
935
+ typeIdentifier: String,
936
+ unitString: String,
937
+ options: NSArray,
938
+ anchorDate: Date,
939
+ interval: NSDictionary,
940
+ startDate: Date,
941
+ endDate: Date,
942
+ resolve: @escaping RCTPromiseResolveBlock,
943
+ reject: @escaping RCTPromiseRejectBlock
944
+ ) {
945
+ guard let store = _store else {
946
+ return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
947
+ }
948
+
949
+ guard let quantityType = HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier(rawValue: typeIdentifier)) else {
950
+ return reject(TYPE_IDENTIFIER_ERROR, "Failed to initialize quantity type for identifier: \(typeIdentifier)", nil)
951
+ }
952
+
953
+ let opts = hkStatisticsOptionsFromOptions(options)
954
+ let intervalComponents = componentsFromInterval(interval)
955
+
956
+ let query = HKStatisticsCollectionQuery(
957
+ quantityType: quantityType,
958
+ quantitySamplePredicate: nil, // We will use enumerateStatistics to filter with date
959
+ options: opts,
960
+ anchorDate: anchorDate,
961
+ intervalComponents: intervalComponents
962
+ )
963
+
964
+ query.initialResultsHandler = { _, statsCollection, error in
965
+ if let error = error {
966
+ return reject(QUERY_ERROR, error.localizedDescription, error)
967
+ }
968
+
969
+ var results = [[String: [String: Any]?]]()
970
+
971
+ guard let collection = statsCollection else {
972
+ return resolve(results)
973
+ }
974
+
975
+ let unit = HKUnit(from: unitString)
976
+
977
+ collection.enumerateStatistics(from: startDate, to: endDate) { stats, _ in
978
+ var dic = [String: [String: Any]?]()
979
+
980
+ let startDate = self._dateFormatter.string(from: stats.startDate)
981
+ let endDate = self._dateFormatter.string(from: stats.endDate)
982
+
983
+ dic["averageQuantity"] = serializeQuantityIfExists(unit: unit, quantity: stats.averageQuantity())
984
+ dic["maximumQuantity"] = serializeQuantityIfExists(unit: unit, quantity: stats.maximumQuantity())
985
+ dic["minimumQuantity"] = serializeQuantityIfExists(unit: unit, quantity: stats.minimumQuantity())
986
+ dic["sumQuantity"] = serializeStatisticIfExists(unit: unit, quantity: stats.sumQuantity(), stats: stats)
987
+
988
+ if #available(iOS 12, *) {
989
+ dic["mostRecentQuantity"] = serializeQuantityIfExists(unit: unit, quantity: stats.mostRecentQuantity())
990
+ if let mostRecentDateInterval = stats.mostRecentQuantityDateInterval() {
991
+ dic["mostRecentQuantityDateInterval"] = [
992
+ "start": self._dateFormatter.string(from: mostRecentDateInterval.start),
993
+ "end": self._dateFormatter.string(from: mostRecentDateInterval.end)
994
+ ]
995
+ }
996
+ }
997
+
998
+ if #available(iOS 13, *) {
999
+ let durationUnit = HKUnit.second()
1000
+ dic["duration"] = serializeQuantityIfExists(unit: durationUnit, quantity: stats.duration())
1001
+ }
1002
+
1003
+ results.append(dic)
1004
+ }
1005
+
1006
+ resolve(results)
1007
+ }
1008
+
1009
+ store.execute(query)
1010
+ }
1011
+
933
1012
  func mapWorkout(
934
1013
  workout: HKWorkout,
935
1014
  distanceUnit: HKUnit,
@@ -2003,4 +2082,109 @@ class ReactNativeHealthkit: RCTEventEmitter {
2003
2082
  }
2004
2083
  }
2005
2084
 
2085
+ @available(iOS 17.0.0, *)
2086
+ @objc(startWatchAppWithWorkoutConfiguration:resolve:reject:)
2087
+ func startWatchAppWithWorkoutConfiguration(
2088
+ _ workoutConfiguration: NSDictionary,
2089
+ resolve: @escaping RCTPromiseResolveBlock,
2090
+ reject: @escaping RCTPromiseRejectBlock
2091
+ ) {
2092
+ guard let store = _store else {
2093
+ return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
2094
+ }
2095
+
2096
+ let configuration = parseWorkoutConfiguration(workoutConfiguration)
2097
+
2098
+ store.startWatchApp(with: configuration) { success, error in
2099
+ if let error {
2100
+ reject(INIT_ERROR, INIT_ERROR_MESSAGE, error)
2101
+ return
2102
+ }
2103
+
2104
+ resolve(success)
2105
+ }
2106
+ }
2107
+
2108
+ @available(iOS 18.0, *)
2109
+ @objc(queryStateOfMindSamples:to:limit:ascending:resolve:reject:)
2110
+ func queryStateOfMindSamples(
2111
+ from: Date,
2112
+ to: Date,
2113
+ limit: Int,
2114
+ ascending: Bool,
2115
+ resolve: @escaping RCTPromiseResolveBlock,
2116
+ reject: @escaping RCTPromiseRejectBlock
2117
+ ) {
2118
+ guard let store = _store else {
2119
+ return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
2120
+ }
2121
+
2122
+ Task {
2123
+ let from = dateOrNilIfZero(date: from)
2124
+ let to = dateOrNilIfZero(date: to)
2125
+
2126
+ let predicate = createPredicate(
2127
+ from: from,
2128
+ to: to
2129
+ )
2130
+
2131
+ let limit = limitOrNilIfZero(
2132
+ limit: limit
2133
+ )
2134
+
2135
+ let type = HKStateOfMindType.stateOfMindType()
2136
+
2137
+ let query = HKSampleQuery(
2138
+ sampleType: type,
2139
+ predicate: predicate,
2140
+ limit: limit,
2141
+ sortDescriptors: [NSSortDescriptor(key: HKSampleSortIdentifierStartDate, ascending: ascending)]
2142
+ ) { (_, samples, error) in
2143
+ if let error = error {
2144
+ reject(GENERIC_ERROR, error.localizedDescription, error)
2145
+ return
2146
+ }
2147
+
2148
+ guard let samples = samples as? [HKStateOfMind] else {
2149
+ resolve([])
2150
+ return
2151
+ }
2152
+
2153
+ let serializedSamples = samples.map { sample in
2154
+ var associations: [Int] = []
2155
+ if #available(iOS 18.0, *) {
2156
+ associations = sample.associations.map({ association in
2157
+ return association.rawValue
2158
+ })
2159
+ }
2160
+
2161
+ var labels: [Int] = []
2162
+ if #available(iOS 18.0, *) {
2163
+ labels = sample.labels.map({ label in
2164
+ return label.rawValue
2165
+ })
2166
+ }
2167
+
2168
+ return [
2169
+ "uuid": sample.uuid.uuidString,
2170
+ "device": serializeDevice(_device: sample.device) as Any,
2171
+ "startDate": self._dateFormatter.string(from: sample.startDate),
2172
+ "endDate": self._dateFormatter.string(from: sample.endDate),
2173
+ "valence": sample.valence,
2174
+ "kind": sample.kind.rawValue,
2175
+ "valenceClassification": sample.valenceClassification.rawValue,
2176
+ "associations": associations,
2177
+ "labels": labels,
2178
+ "metadata": serializeMetadata(metadata: sample.metadata),
2179
+ "sourceRevision": serializeSourceRevision(_sourceRevision: sample.sourceRevision) as Any
2180
+ ]
2181
+ }
2182
+
2183
+ resolve(serializedSamples)
2184
+ }
2185
+
2186
+ store.execute(query)
2187
+ }
2188
+ }
2189
+
2006
2190
  }
@@ -218,3 +218,21 @@ func serializeAnchor(anchor: HKQueryAnchor?) -> String? {
218
218
 
219
219
  return encoded
220
220
  }
221
+
222
+ func serializeStatistic(unit: HKUnit, quantity: HKQuantity?, stats: HKStatistics?) -> [String: Any]? {
223
+ guard let q = quantity, let stats = stats else {
224
+ return nil
225
+ }
226
+
227
+ let endDate = _dateFormatter.string(from: stats.endDate)
228
+ let startDate = _dateFormatter.string(from: stats.startDate)
229
+ let quantityType = stats.quantityType.identifier
230
+
231
+ return [
232
+ "quantityType": quantityType,
233
+ "startDate": startDate,
234
+ "endDate": endDate,
235
+ "quantity": q.doubleValue(for: unit),
236
+ "unit": unit.unitString
237
+ ]
238
+ }
@@ -43,6 +43,8 @@ var _exportNames = {
43
43
  queryQuantitySamples: true,
44
44
  queryQuantitySamplesWithAnchor: true,
45
45
  querySources: true,
46
+ queryStateOfMindSamples: true,
47
+ queryStatisticsCollectionForQuantity: true,
46
48
  queryStatisticsForQuantity: true,
47
49
  queryWorkoutSamples: true,
48
50
  queryWorkoutSamplesWithAnchor: true,
@@ -52,6 +54,7 @@ var _exportNames = {
52
54
  saveQuantitySample: true,
53
55
  saveWorkoutRoute: true,
54
56
  saveWorkoutSample: true,
57
+ startWatchApp: true,
55
58
  subscribeToChanges: true
56
59
  };
57
60
  exports.default = exports.availableQuantityTypes = exports.authorizationStatusFor = void 0;
@@ -167,6 +170,18 @@ Object.defineProperty(exports, "querySources", {
167
170
  return _querySources.default;
168
171
  }
169
172
  });
173
+ Object.defineProperty(exports, "queryStateOfMindSamples", {
174
+ enumerable: true,
175
+ get: function () {
176
+ return _queryStateOfMindSamples.queryStateOfMindSamples;
177
+ }
178
+ });
179
+ Object.defineProperty(exports, "queryStatisticsCollectionForQuantity", {
180
+ enumerable: true,
181
+ get: function () {
182
+ return _queryStatisticsCollectionForQuantity.default;
183
+ }
184
+ });
170
185
  Object.defineProperty(exports, "queryStatisticsForQuantity", {
171
186
  enumerable: true,
172
187
  get: function () {
@@ -222,6 +237,12 @@ Object.defineProperty(exports, "saveWorkoutSample", {
222
237
  return _saveWorkoutSample.default;
223
238
  }
224
239
  });
240
+ Object.defineProperty(exports, "startWatchApp", {
241
+ enumerable: true,
242
+ get: function () {
243
+ return _startWatchApp.default;
244
+ }
245
+ });
225
246
  Object.defineProperty(exports, "subscribeToChanges", {
226
247
  enumerable: true,
227
248
  get: function () {
@@ -304,6 +325,8 @@ var _queryHeartbeatSeriesSamplesWithAnchor = _interopRequireDefault(require("./u
304
325
  var _queryQuantitySamples = _interopRequireDefault(require("./utils/queryQuantitySamples"));
305
326
  var _queryQuantitySamplesWithAnchor = _interopRequireDefault(require("./utils/queryQuantitySamplesWithAnchor"));
306
327
  var _querySources = _interopRequireDefault(require("./utils/querySources"));
328
+ var _queryStateOfMindSamples = require("./utils/queryStateOfMindSamples");
329
+ var _queryStatisticsCollectionForQuantity = _interopRequireDefault(require("./utils/queryStatisticsCollectionForQuantity"));
307
330
  var _queryStatisticsForQuantity = _interopRequireDefault(require("./utils/queryStatisticsForQuantity"));
308
331
  var _queryWorkouts = _interopRequireDefault(require("./utils/queryWorkouts"));
309
332
  var _queryWorkoutSamplesWithAnchor = _interopRequireDefault(require("./utils/queryWorkoutSamplesWithAnchor"));
@@ -313,6 +336,7 @@ var _saveCorrelationSample = _interopRequireDefault(require("./utils/saveCorrela
313
336
  var _saveQuantitySample = _interopRequireDefault(require("./utils/saveQuantitySample"));
314
337
  var _saveWorkoutRoute = _interopRequireDefault(require("./utils/saveWorkoutRoute"));
315
338
  var _saveWorkoutSample = _interopRequireDefault(require("./utils/saveWorkoutSample"));
339
+ var _startWatchApp = _interopRequireDefault(require("./utils/startWatchApp"));
316
340
  var _subscribeToChanges = _interopRequireDefault(require("./utils/subscribeToChanges"));
317
341
  var _types = require("./types");
318
342
  Object.keys(_types).forEach(function (key) {
@@ -432,6 +456,7 @@ var _default = exports.default = {
432
456
  queryQuantitySamples: _queryQuantitySamples.default,
433
457
  queryQuantitySamplesWithAnchor: _queryQuantitySamplesWithAnchor.default,
434
458
  queryStatisticsForQuantity: _queryStatisticsForQuantity.default,
459
+ queryStatisticsCollectionForQuantity: _queryStatisticsCollectionForQuantity.default,
435
460
  /**
436
461
  * @deprecated Use queryWorkoutSamples instead
437
462
  */
@@ -455,6 +480,7 @@ var _default = exports.default = {
455
480
  saveWorkoutRoute: _saveWorkoutRoute.default,
456
481
  // subscriptions
457
482
  subscribeToChanges: _subscribeToChanges.default,
483
+ startWatchApp: _startWatchApp.default,
458
484
  /**
459
485
  * @returns the most recent sample for the given category type.
460
486
  */
@@ -481,7 +507,8 @@ var _default = exports.default = {
481
507
  */
482
508
  useHealthkitAuthorization: _useHealthkitAuthorization.default,
483
509
  useSources: _useSources.default,
484
- useStatisticsForQuantity: _useStatisticsForQuantity.default
510
+ useStatisticsForQuantity: _useStatisticsForQuantity.default,
511
+ queryStateOfMindSamples: _queryStateOfMindSamples.queryStateOfMindSamples
485
512
  };
486
513
  const queryWorkouts = exports.queryWorkouts = _queryWorkouts.default;
487
514
  //# sourceMappingURL=index.ios.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_useHealthkitAuthorization","_interopRequireDefault","_useIsHealthDataAvailable","_useMostRecentCategorySample","_useMostRecentQuantitySample","_useMostRecentWorkout","_useSources","_useStatisticsForQuantity","_useSubscribeToChanges","_nativeTypes","_interopRequireWildcard","_deleteQuantitySample","_deleteSamples","_getDateOfBirth","_getMostRecentCategorySample","_getMostRecentQuantitySample","_getMostRecentWorkout","_getPreferredUnit","_getPreferredUnits","_getRequestStatusForAuthorization","_getWorkoutPlanById","_queryCategorySamples","_queryCategorySamplesWithAnchor","_queryCorrelationSamples","_queryHeartbeatSeriesSamples","_queryHeartbeatSeriesSamplesWithAnchor","_queryQuantitySamples","_queryQuantitySamplesWithAnchor","_querySources","_queryStatisticsForQuantity","_queryWorkouts","_queryWorkoutSamplesWithAnchor","_requestAuthorization","_saveCategorySample","_saveCorrelationSample","_saveQuantitySample","_saveWorkoutRoute","_saveWorkoutSample","_subscribeToChanges","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","currentMajorVersionIOS","Platform","OS","parseInt","Version","allQuantityTypesList","values","HKQuantityTypeIdentifier","availableQuantityTypes","majorVersionIOS","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","Native","bind","isHealthDataAvailable","isProtectedDataAvailable","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","_default","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getWorkoutPlanById","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","queryWorkouts","queryWorkoutSamples","queryWorkoutSamplesWithAnchor","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","subscribeToChanges","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization","useSources","useStatisticsForQuantity"],"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 useSources from './hooks/useSources'\nimport useStatisticsForQuantity from './hooks/useStatisticsForQuantity'\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 getWorkoutPlanById from './utils/getWorkoutPlanById'\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 queryWorkoutSamples from './utils/queryWorkouts'\nimport queryWorkoutSamplesWithAnchor from './utils/queryWorkoutSamplesWithAnchor'\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)\nconst isProtectedDataAvailable = Native.isProtectedDataAvailable.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,\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 getWorkoutPlanById,\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 /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts: queryWorkoutSamples,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\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 useSources,\n useStatisticsForQuantity,\n}\n\nconst queryWorkouts = queryWorkoutSamples\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n getWorkoutPlanById,\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useSources,\n useStatisticsForQuantity,\n isProtectedDataAvailable,\n}\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,4BAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,4BAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,qBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,yBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,sBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,YAAA,GAAAC,uBAAA,CAAAX,OAAA;AACA,IAAAY,qBAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,cAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,eAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,IAAAe,4BAAA,GAAAb,sBAAA,CAAAF,OAAA;AACA,IAAAgB,4BAAA,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;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,kCAAyB;EACzBC,UAAU,EAAVA,mBAAU;EACVC,wBAAwB,EAAxBA;AACF,CAAC;AAED,MAAMpB,aAAa,GAAApE,OAAA,CAAAoE,aAAA,GAAGC,sBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_useHealthkitAuthorization","_interopRequireDefault","_useIsHealthDataAvailable","_useMostRecentCategorySample","_useMostRecentQuantitySample","_useMostRecentWorkout","_useSources","_useStatisticsForQuantity","_useSubscribeToChanges","_nativeTypes","_interopRequireWildcard","_deleteQuantitySample","_deleteSamples","_getDateOfBirth","_getMostRecentCategorySample","_getMostRecentQuantitySample","_getMostRecentWorkout","_getPreferredUnit","_getPreferredUnits","_getRequestStatusForAuthorization","_getWorkoutPlanById","_queryCategorySamples","_queryCategorySamplesWithAnchor","_queryCorrelationSamples","_queryHeartbeatSeriesSamples","_queryHeartbeatSeriesSamplesWithAnchor","_queryQuantitySamples","_queryQuantitySamplesWithAnchor","_querySources","_queryStateOfMindSamples","_queryStatisticsCollectionForQuantity","_queryStatisticsForQuantity","_queryWorkouts","_queryWorkoutSamplesWithAnchor","_requestAuthorization","_saveCategorySample","_saveCorrelationSample","_saveQuantitySample","_saveWorkoutRoute","_saveWorkoutSample","_startWatchApp","_subscribeToChanges","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","currentMajorVersionIOS","Platform","OS","parseInt","Version","allQuantityTypesList","values","HKQuantityTypeIdentifier","availableQuantityTypes","majorVersionIOS","filter","type","cyclingCadence","cyclingFunctionalThresholdPower","cyclingPower","cyclingSpeed","physicalEffort","timeInDaylight","includes","authorizationStatusFor","Native","bind","isHealthDataAvailable","isProtectedDataAvailable","disableBackgroundDelivery","disableAllBackgroundDelivery","enableBackgroundDelivery","getBiologicalSex","getFitzpatrickSkinType","getWheelchairUse","getBloodType","getWorkoutRoutes","_default","getDateOfBirth","getMostRecentQuantitySample","getMostRecentCategorySample","getMostRecentWorkout","getWorkoutPlanById","getPreferredUnit","getPreferredUnits","getRequestStatusForAuthorization","queryCategorySamples","queryCategorySamplesWithAnchor","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","queryQuantitySamplesWithAnchor","queryStatisticsForQuantity","queryStatisticsCollectionForQuantity","queryWorkouts","queryWorkoutSamples","queryWorkoutSamplesWithAnchor","querySources","requestAuthorization","deleteQuantitySample","deleteSamples","saveCategorySample","saveCorrelationSample","saveQuantitySample","saveWorkoutSample","saveWorkoutRoute","subscribeToChanges","startWatchApp","useMostRecentCategorySample","useMostRecentQuantitySample","useMostRecentWorkout","useSubscribeToChanges","useIsHealthDataAvailable","useHealthkitAuthorization","useSources","useStatisticsForQuantity","queryStateOfMindSamples"],"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 useSources from './hooks/useSources'\nimport useStatisticsForQuantity from './hooks/useStatisticsForQuantity'\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 getWorkoutPlanById from './utils/getWorkoutPlanById'\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 { queryStateOfMindSamples } from './utils/queryStateOfMindSamples'\nimport queryStatisticsCollectionForQuantity from './utils/queryStatisticsCollectionForQuantity'\nimport queryStatisticsForQuantity from './utils/queryStatisticsForQuantity'\nimport queryWorkoutSamples from './utils/queryWorkouts'\nimport queryWorkoutSamplesWithAnchor from './utils/queryWorkoutSamplesWithAnchor'\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 startWatchApp from './utils/startWatchApp'\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)\nconst isProtectedDataAvailable = Native.isProtectedDataAvailable.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,\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 getWorkoutPlanById,\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 queryStatisticsCollectionForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts: queryWorkoutSamples,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\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 startWatchApp,\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 useSources,\n useStatisticsForQuantity,\n queryStateOfMindSamples,\n}\n\nconst queryWorkouts = queryWorkoutSamples\n\nexport {\n authorizationStatusFor,\n availableQuantityTypes,\n disableAllBackgroundDelivery,\n disableBackgroundDelivery,\n enableBackgroundDelivery,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getMostRecentCategorySample,\n getMostRecentQuantitySample,\n getMostRecentWorkout,\n getPreferredUnit,\n getPreferredUnits,\n getRequestStatusForAuthorization,\n getWheelchairUse,\n getWorkoutRoutes,\n isHealthDataAvailable,\n queryCategorySamples,\n queryCategorySamplesWithAnchor,\n queryCorrelationSamples,\n queryHeartbeatSeriesSamples,\n queryHeartbeatSeriesSamplesWithAnchor,\n queryQuantitySamples,\n queryQuantitySamplesWithAnchor,\n queryStatisticsForQuantity,\n queryStatisticsCollectionForQuantity,\n /**\n * @deprecated Use queryWorkoutSamples instead\n */\n queryWorkouts,\n queryWorkoutSamples,\n queryWorkoutSamplesWithAnchor,\n querySources,\n requestAuthorization,\n deleteQuantitySample,\n deleteSamples,\n getWorkoutPlanById,\n saveCategorySample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n startWatchApp,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useSources,\n useStatisticsForQuantity,\n isProtectedDataAvailable,\n queryStateOfMindSamples,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