@kingstinct/react-native-healthkit 8.5.0 → 8.6.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 (42) hide show
  1. package/ios/Helpers.swift +145 -0
  2. package/ios/ReactNativeHealthkit.m +14 -0
  3. package/ios/ReactNativeHealthkit.swift +194 -24
  4. package/lib/commonjs/index.ios.js +19 -1
  5. package/lib/commonjs/index.ios.js.map +1 -1
  6. package/lib/commonjs/index.native.js +7 -1
  7. package/lib/commonjs/index.native.js.map +1 -1
  8. package/lib/commonjs/native-types.js +16 -1
  9. package/lib/commonjs/native-types.js.map +1 -1
  10. package/lib/commonjs/test-setup.js +3 -1
  11. package/lib/commonjs/test-setup.js.map +1 -1
  12. package/lib/commonjs/utils/saveStateOfMindSample.js +17 -0
  13. package/lib/commonjs/utils/saveStateOfMindSample.js.map +1 -0
  14. package/lib/commonjs/utils/subscribeToChanges.js.map +1 -1
  15. package/lib/commonjs/utils/workoutSessionMirroringStartHandler.js +17 -0
  16. package/lib/commonjs/utils/workoutSessionMirroringStartHandler.js.map +1 -0
  17. package/lib/module/index.ios.js +5 -1
  18. package/lib/module/index.ios.js.map +1 -1
  19. package/lib/module/index.native.js +5 -1
  20. package/lib/module/index.native.js.map +1 -1
  21. package/lib/module/native-types.js +16 -0
  22. package/lib/module/native-types.js.map +1 -1
  23. package/lib/module/test-setup.js +3 -1
  24. package/lib/module/test-setup.js.map +1 -1
  25. package/lib/module/utils/saveStateOfMindSample.js +10 -0
  26. package/lib/module/utils/saveStateOfMindSample.js.map +1 -0
  27. package/lib/module/utils/subscribeToChanges.js.map +1 -1
  28. package/lib/module/utils/workoutSessionMirroringStartHandler.js +11 -0
  29. package/lib/module/utils/workoutSessionMirroringStartHandler.js.map +1 -0
  30. package/lib/typescript/src/index.ios.d.ts +5 -1
  31. package/lib/typescript/src/index.native.d.ts +2 -2
  32. package/lib/typescript/src/native-types.d.ts +43 -2
  33. package/lib/typescript/src/utils/saveStateOfMindSample.d.ts +11 -0
  34. package/lib/typescript/src/utils/workoutSessionMirroringStartHandler.d.ts +8 -0
  35. package/package.json +1 -1
  36. package/src/index.ios.tsx +6 -0
  37. package/src/index.native.tsx +6 -0
  38. package/src/native-types.ts +58 -3
  39. package/src/test-setup.ts +2 -0
  40. package/src/utils/saveStateOfMindSample.ts +38 -0
  41. package/src/utils/subscribeToChanges.ts +1 -1
  42. package/src/utils/workoutSessionMirroringStartHandler.ts +11 -0
package/ios/Helpers.swift CHANGED
@@ -71,6 +71,14 @@ func sampleTypeFromString(typeIdentifier: String) -> HKSampleType? {
71
71
  }
72
72
  }
73
73
 
74
+ #if compiler(>=6)
75
+ if #available(iOS 18, *) {
76
+ if typeIdentifier == HKStateOfMindTypeIdentifier {
77
+ return HKObjectType.stateOfMindType()
78
+ }
79
+ }
80
+ #endif
81
+
74
82
  if typeIdentifier == HKWorkoutTypeIdentifier {
75
83
  return HKSampleType.workoutType()
76
84
  }
@@ -247,3 +255,140 @@ func parseWorkoutConfiguration(_ dict: NSDictionary) -> HKWorkoutConfiguration {
247
255
 
248
256
  return configuration
249
257
  }
258
+
259
+ #if compiler(>=6)
260
+ @available(iOS 18.0, *)
261
+ extension HKStateOfMind.Kind: @retroactive CaseIterable, @retroactive CustomStringConvertible {
262
+ public var description: String {
263
+ switch self {
264
+ case .dailyMood: "Daily mood"
265
+ case .momentaryEmotion: "Momentary Emotion"
266
+ @unknown default: "Unknown"
267
+ }
268
+ }
269
+
270
+ public static var allCases: [HKStateOfMind.Kind] {
271
+ [.dailyMood, .momentaryEmotion]
272
+ }
273
+
274
+ static func convertToStateOfMindKind(int: Int) -> HKStateOfMind.Kind {
275
+ // default to .dailyMood if we receive an int out of bounds
276
+ return HKStateOfMind.Kind(rawValue: int) ?? .dailyMood
277
+ }
278
+ }
279
+ #endif
280
+
281
+ #if compiler(>=6)
282
+ @available(iOS 18.0, *)
283
+ extension HKStateOfMind.Label: @retroactive CaseIterable, @retroactive CustomStringConvertible {
284
+ public var description: String {
285
+ switch self {
286
+ case .amazed: "Amazed"
287
+ case .amused: "Amused"
288
+ case .angry: "Angry"
289
+ case .anxious: "Anxious"
290
+ case .ashamed: "Ashamed"
291
+ case .brave: "Brave"
292
+ case .calm: "Calm"
293
+ case .content: "Content"
294
+ case .disappointed: "Disappointed"
295
+ case .discouraged: "Discouraged"
296
+ case .disgusted: "Disgusted"
297
+ case .embarrassed: "Embarrassed"
298
+ case .excited: "Excited"
299
+ case .frustrated: "Frustrated"
300
+ case .grateful: "Grateful"
301
+ case .guilty: "Guilty"
302
+ case .happy: "Happy"
303
+ case .hopeless: "Hopeless"
304
+ case .irritated: "Irritated"
305
+ case .jealous: "Jealous"
306
+ case .joyful: "Joyful"
307
+ case .lonely: "Lonely"
308
+ case .passionate: "Passionate"
309
+ case .peaceful: "Peaceful"
310
+ case .proud: "Proud"
311
+ case .relieved: "Relieved"
312
+ case .sad: "Sad"
313
+ case .scared: "Scared"
314
+ case .stressed: "Stressed"
315
+ case .surprised: "Surprised"
316
+ case .worried: "Worried"
317
+ case .annoyed: "Annoyed"
318
+ case .confident: "Confident"
319
+ case .drained: "Drained"
320
+ case .hopeful: "Hopeful"
321
+ case .indifferent: "Indifferent"
322
+ case .overwhelmed: "Overwhelmed"
323
+ case .satisfied: "Satisfied"
324
+ @unknown default: "Unknown"
325
+ }
326
+ }
327
+
328
+ public static var allCases: [HKStateOfMind.Label] {
329
+ [
330
+ .amazed, .amused, .angry, .anxious, .ashamed,
331
+ .brave, .calm, .content, .disappointed, .discouraged,
332
+ .disgusted, .embarrassed, .excited, .frustrated, .grateful,
333
+ .guilty, .happy, .hopeless, .irritated, .jealous,
334
+ .joyful, .lonely, .passionate, .peaceful, .proud,
335
+ .relieved, .sad, .scared, .stressed, .surprised,
336
+ .worried, .annoyed, .confident, .drained, .hopeful,
337
+ .indifferent, .overwhelmed, .satisfied
338
+ ]
339
+ }
340
+
341
+ static func convertToStateOfMindLabels(intArray: [Int]) -> [HKStateOfMind.Label] {
342
+ return intArray.compactMap { index in
343
+ // if any int are out of bounds return nil instead of crashing
344
+ guard index >= 0 && index < HKStateOfMind.Label.allCases.count else { return nil }
345
+ return HKStateOfMind.Label(rawValue: index)
346
+ }
347
+ }
348
+ }
349
+ #endif
350
+
351
+ #if compiler(>=6)
352
+ @available(iOS 18.0, *)
353
+ extension HKStateOfMind.Association: @retroactive CaseIterable, @retroactive CustomStringConvertible {
354
+ public var description: String {
355
+ switch self {
356
+ case .community: "Community"
357
+ case .currentEvents: "Current Events"
358
+ case .dating: "Dating"
359
+ case .education: "Education"
360
+ case .family: "Family"
361
+ case .fitness: "Fitness"
362
+ case .friends: "Friends"
363
+ case .health: "Health"
364
+ case .hobbies: "Hobbies"
365
+ case .identity: "Identity"
366
+ case .money: "Money"
367
+ case .partner: "Partner"
368
+ case .selfCare: "Self Care"
369
+ case .spirituality: "Spirituality"
370
+ case .tasks: "Tasks"
371
+ case .travel: "Travel"
372
+ case .work: "Work"
373
+ case .weather: "Weather"
374
+ @unknown default: "Unknown"
375
+ }
376
+ }
377
+
378
+ public static var allCases: [HKStateOfMind.Association] {
379
+ [
380
+ .community, .currentEvents, .dating, .education, .family,
381
+ .fitness, .friends, .health, .hobbies, .identity,
382
+ .money, .partner, .selfCare, .spirituality, .tasks,
383
+ .travel, .work, .weather
384
+ ]
385
+ }
386
+
387
+ static func convertToStateOfMindAssociations(intArray: [Int]) -> [HKStateOfMind.Association] {
388
+ return intArray.compactMap { index in
389
+ guard index >= 0 && index < HKStateOfMind.Association.allCases.count else { return nil }
390
+ return HKStateOfMind.Association(rawValue: index)
391
+ }
392
+ }
393
+ }
394
+ #endif
@@ -88,6 +88,16 @@ RCT_EXTERN_METHOD(saveCategorySample:(NSString)typeIdentifier
88
88
  resolve:(RCTPromiseResolveBlock)resolve
89
89
  reject:(RCTPromiseRejectBlock)reject
90
90
  )
91
+ RCT_EXTERN_METHOD(saveStateOfMindSample:(NSDate)date
92
+ kind:(NSInteger)kind
93
+ valence:(double)valence
94
+ labels:(NSArray)labels
95
+ associations:(NSArray)associations
96
+ metadata:(NSDictionary)metadata
97
+ resolve:(RCTPromiseResolveBlock)resolve
98
+ reject:(RCTPromiseRejectBlock)reject
99
+ )
100
+
91
101
 
92
102
  RCT_EXTERN_METHOD(queryWorkoutSamplesWithAnchor:(NSString)energyUnitString
93
103
  distanceUnitString:(NSString)distanceUnitString
@@ -253,4 +263,8 @@ RCT_EXTERN_METHOD(queryStateOfMindSamples:(NSDate)from
253
263
  resolve:(RCTPromiseResolveBlock)resolve
254
264
  reject:(RCTPromiseRejectBlock)reject)
255
265
 
266
+ RCT_EXTERN_METHOD(workoutSessionMirroringStartHandler:(RCTPromiseResolveBlock)resolve
267
+ reject:(RCTPromiseRejectBlock)reject
268
+ )
269
+
256
270
  @end
@@ -13,6 +13,15 @@ class ReactNativeHealthkit: RCTEventEmitter {
13
13
  var _dateFormatter: ISO8601DateFormatter
14
14
  var _hasListeners = false
15
15
 
16
+ #if os(iOS)
17
+ @available(iOS 17.0, *)
18
+ var _workoutSession: HKWorkoutSession? {
19
+ get { return __session as? HKWorkoutSession }
20
+ set { __session = newValue }
21
+ }
22
+ private var __session: Any?
23
+ #endif
24
+
16
25
  override init() {
17
26
  self._runningQueries = [String: HKQuery]()
18
27
  self._dateFormatter = ISO8601DateFormatter()
@@ -646,6 +655,52 @@ class ReactNativeHealthkit: RCTEventEmitter {
646
655
  }
647
656
  }
648
657
 
658
+ @objc(saveStateOfMindSample:kind:valence:labels:associations:metadata:resolve:reject:)
659
+ func saveStateOfMindSample(
660
+ _ date: Date,
661
+ kind: Int,
662
+ valence: Double, // non-integer number, ie 0.5
663
+ labels: [Int],
664
+ associations: [Int],
665
+ metadata: NSDictionary,
666
+ resolve: @escaping RCTPromiseResolveBlock,
667
+ reject: @escaping RCTPromiseRejectBlock
668
+ ) {
669
+ guard let store = _store else {
670
+ return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
671
+ }
672
+
673
+ #if compiler(>=6)
674
+ if #available(iOS 18.0, *) {
675
+
676
+ // ensures valence does not exceed -1.0 and 1.0
677
+ let safeValence = max(-1.0, min(1.0, valence))
678
+
679
+ let sample = HKStateOfMind(
680
+ date: date,
681
+ kind: HKStateOfMind.Kind.convertToStateOfMindKind(int: kind),
682
+ valence: safeValence,
683
+ labels: HKStateOfMind.Label.convertToStateOfMindLabels(intArray: labels),
684
+ associations: HKStateOfMind.Association.convertToStateOfMindAssociations(intArray: associations),
685
+ metadata: metadata as? [String: Any]
686
+ )
687
+
688
+ store.save(sample) { (success: Bool, error: Error?) in
689
+ guard let err = error else {
690
+ return resolve(success)
691
+ }
692
+ reject(GENERIC_ERROR, err.localizedDescription, error)
693
+ }
694
+
695
+ } else {
696
+ reject("STATE_OF_MIND_ERROR", "State of Mind features require iOS 18.0 or later", nil)
697
+ }
698
+ #else
699
+ reject(
700
+ "STATE_OF_MIND_ERROR", "State of Mind features require Xcode 16 or later to compile", nil)
701
+ #endif
702
+ }
703
+
649
704
  @objc(saveCategorySample:value:start:end:metadata:resolve:reject:)
650
705
  func saveCategorySample(
651
706
  typeIdentifier: String,
@@ -683,7 +738,13 @@ class ReactNativeHealthkit: RCTEventEmitter {
683
738
  }
684
739
 
685
740
  override func supportedEvents() -> [String]! {
686
- return ["onChange"]
741
+ return [
742
+ "onChange",
743
+ "onRemoteWorkoutStateChange",
744
+ "onRemoteWorkoutError",
745
+ "onRemoteWorkoutDataReceived",
746
+ "onRemoteWorkoutEventReceived"
747
+ ]
687
748
  }
688
749
 
689
750
  @objc(enableBackgroundDelivery:updateFrequency:resolve:reject:)
@@ -2138,29 +2199,6 @@ class ReactNativeHealthkit: RCTEventEmitter {
2138
2199
  }
2139
2200
  }
2140
2201
 
2141
- @available(iOS 17.0.0, *)
2142
- @objc(startWatchAppWithWorkoutConfiguration:resolve:reject:)
2143
- func startWatchAppWithWorkoutConfiguration(
2144
- _ workoutConfiguration: NSDictionary,
2145
- resolve: @escaping RCTPromiseResolveBlock,
2146
- reject: @escaping RCTPromiseRejectBlock
2147
- ) {
2148
- guard let store = _store else {
2149
- return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
2150
- }
2151
-
2152
- let configuration = parseWorkoutConfiguration(workoutConfiguration)
2153
-
2154
- store.startWatchApp(with: configuration) { success, error in
2155
- if let error {
2156
- reject(INIT_ERROR, INIT_ERROR_MESSAGE, error)
2157
- return
2158
- }
2159
-
2160
- resolve(success)
2161
- }
2162
- }
2163
-
2164
2202
  @objc(queryStateOfMindSamples:to:limit:ascending:resolve:reject:)
2165
2203
  func queryStateOfMindSamples(
2166
2204
  from: Date,
@@ -2253,4 +2291,136 @@ class ReactNativeHealthkit: RCTEventEmitter {
2253
2291
  "STATE_OF_MIND_ERROR", "State of Mind features require Xcode 16 or later to compile", nil)
2254
2292
  #endif
2255
2293
  }
2294
+
2295
+ @available(iOS 17.0.0, *)
2296
+ @objc(startWatchAppWithWorkoutConfiguration:resolve:reject:)
2297
+ func startWatchAppWithWorkoutConfiguration(
2298
+ _ workoutConfiguration: NSDictionary,
2299
+ resolve: @escaping RCTPromiseResolveBlock,
2300
+ reject: @escaping RCTPromiseRejectBlock
2301
+ ) {
2302
+ guard let store = _store else {
2303
+ return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
2304
+ }
2305
+
2306
+ let configuration = parseWorkoutConfiguration(workoutConfiguration)
2307
+
2308
+ store.startWatchApp(with: configuration) { success, error in
2309
+ if let error {
2310
+ reject(GENERIC_ERROR, error.localizedDescription, error)
2311
+ return
2312
+ }
2313
+
2314
+ resolve(success)
2315
+ }
2316
+ }
2317
+
2318
+ @available(iOS 17.0.0, *)
2319
+ @objc(workoutSessionMirroringStartHandler:reject:)
2320
+ func workoutSessionMirroringStartHandler(
2321
+ resolve: @escaping RCTPromiseResolveBlock,
2322
+ reject: @escaping RCTPromiseRejectBlock
2323
+ ) {
2324
+ guard let store = _store else {
2325
+ return reject(INIT_ERROR, INIT_ERROR_MESSAGE, nil)
2326
+ }
2327
+
2328
+ store.workoutSessionMirroringStartHandler = { [weak self] mirroringSession in
2329
+ self?._workoutSession = mirroringSession
2330
+ self?._workoutSession?.delegate = self
2331
+ }
2332
+
2333
+ resolve(true)
2334
+ }
2335
+
2336
+ }
2337
+
2338
+ // MARK: - HKWorkoutSessionDelegate
2339
+
2340
+ extension ReactNativeHealthkit: HKWorkoutSessionDelegate {
2341
+
2342
+ @available(iOS 17.0.0, *)
2343
+ func workoutSession(
2344
+ _ workoutSession: HKWorkoutSession,
2345
+ didChangeTo toState: HKWorkoutSessionState,
2346
+ from fromState: HKWorkoutSessionState,
2347
+ date: Date
2348
+ ) {
2349
+ Task { @MainActor [weak self] in
2350
+ guard let self = self else { return }
2351
+
2352
+ if self.bridge != nil && self.bridge.isValid {
2353
+ self.sendEvent(withName: "onRemoteWorkoutStateChange", body: [
2354
+ "toState": toState.rawValue,
2355
+ "fromState": fromState.rawValue,
2356
+ "date": self._dateFormatter.string(from: date)
2357
+ ])
2358
+ }
2359
+ }
2360
+ }
2361
+
2362
+ @available(iOS 17.0.0, *)
2363
+ func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: any Error) {
2364
+ Task { @MainActor [weak self] in
2365
+ guard let self = self else { return }
2366
+
2367
+ if self.bridge != nil && self.bridge.isValid {
2368
+ self.sendEvent(
2369
+ withName: "onRemoteWorkoutError",
2370
+ body: ["error": error.localizedDescription]
2371
+ )
2372
+ }
2373
+ }
2374
+ }
2375
+
2376
+ @available(iOS 17.0.0, *)
2377
+ func workoutSession(
2378
+ _ workoutSession: HKWorkoutSession,
2379
+ didReceiveDataFromRemoteWorkoutSession data: [Data]
2380
+ ) {
2381
+ Task { [weak self] in
2382
+ guard let self = self else { return }
2383
+
2384
+ do {
2385
+ let serializedData = try data.compactMap { dataItem -> [String: Any]? in
2386
+ guard let json = try? JSONSerialization.jsonObject(with: dataItem) as? [String: Any] else {
2387
+ return nil
2388
+ }
2389
+ return json
2390
+ }
2391
+
2392
+ await MainActor.run { [weak self] in
2393
+ guard let self = self else { return }
2394
+
2395
+ if let bridge = self.bridge, bridge.isValid {
2396
+ self.sendEvent(
2397
+ withName: "onRemoteWorkoutDataReceived",
2398
+ body: ["data": serializedData]
2399
+ )
2400
+ }
2401
+ }
2402
+ } catch {
2403
+ await MainActor.run { [weak self] in
2404
+ guard let self = self else { return }
2405
+
2406
+ if self.bridge != nil && self.bridge.isValid {
2407
+ self.sendEvent(
2408
+ withName: "onRemoteWorkoutError",
2409
+ body: ["error": error.localizedDescription]
2410
+ )
2411
+ }
2412
+ }
2413
+ }
2414
+ }
2415
+ }
2416
+
2417
+ @available(iOS 17.0, *)
2418
+ func workoutSession(_ workoutSession: HKWorkoutSession, didGenerate event: HKWorkoutEvent) {
2419
+ if self.bridge != nil && self.bridge.isValid {
2420
+ self.sendEvent(
2421
+ withName: "onRemoteWorkoutEventReceived",
2422
+ body: ["type": event.type.rawValue]
2423
+ )
2424
+ }
2425
+ }
2256
2426
  }
@@ -52,10 +52,12 @@ var _exportNames = {
52
52
  saveCategorySample: true,
53
53
  saveCorrelationSample: true,
54
54
  saveQuantitySample: true,
55
+ saveStateOfMindSample: true,
55
56
  saveWorkoutRoute: true,
56
57
  saveWorkoutSample: true,
57
58
  startWatchApp: true,
58
- subscribeToChanges: true
59
+ subscribeToChanges: true,
60
+ workoutSessionMirroringStartHandler: true
59
61
  };
60
62
  exports.default = exports.availableQuantityTypes = exports.authorizationStatusFor = void 0;
61
63
  Object.defineProperty(exports, "deleteQuantitySample", {
@@ -225,6 +227,12 @@ Object.defineProperty(exports, "saveQuantitySample", {
225
227
  return _saveQuantitySample.default;
226
228
  }
227
229
  });
230
+ Object.defineProperty(exports, "saveStateOfMindSample", {
231
+ enumerable: true,
232
+ get: function () {
233
+ return _saveStateOfMindSample.default;
234
+ }
235
+ });
228
236
  Object.defineProperty(exports, "saveWorkoutRoute", {
229
237
  enumerable: true,
230
238
  get: function () {
@@ -297,6 +305,12 @@ Object.defineProperty(exports, "useSubscribeToChanges", {
297
305
  return _useSubscribeToChanges.default;
298
306
  }
299
307
  });
308
+ Object.defineProperty(exports, "workoutSessionMirroringStartHandler", {
309
+ enumerable: true,
310
+ get: function () {
311
+ return _workoutSessionMirroringStartHandler.default;
312
+ }
313
+ });
300
314
  var _reactNative = require("react-native");
301
315
  var _useHealthkitAuthorization = _interopRequireDefault(require("./hooks/useHealthkitAuthorization"));
302
316
  var _useIsHealthDataAvailable = _interopRequireDefault(require("./hooks/useIsHealthDataAvailable"));
@@ -334,10 +348,12 @@ var _requestAuthorization = _interopRequireDefault(require("./utils/requestAutho
334
348
  var _saveCategorySample = _interopRequireDefault(require("./utils/saveCategorySample"));
335
349
  var _saveCorrelationSample = _interopRequireDefault(require("./utils/saveCorrelationSample"));
336
350
  var _saveQuantitySample = _interopRequireDefault(require("./utils/saveQuantitySample"));
351
+ var _saveStateOfMindSample = _interopRequireDefault(require("./utils/saveStateOfMindSample"));
337
352
  var _saveWorkoutRoute = _interopRequireDefault(require("./utils/saveWorkoutRoute"));
338
353
  var _saveWorkoutSample = _interopRequireDefault(require("./utils/saveWorkoutSample"));
339
354
  var _startWatchApp = _interopRequireDefault(require("./utils/startWatchApp"));
340
355
  var _subscribeToChanges = _interopRequireDefault(require("./utils/subscribeToChanges"));
356
+ var _workoutSessionMirroringStartHandler = _interopRequireDefault(require("./utils/workoutSessionMirroringStartHandler"));
341
357
  var _types = require("./types");
342
358
  Object.keys(_types).forEach(function (key) {
343
359
  if (key === "default" || key === "__esModule") return;
@@ -478,9 +494,11 @@ var _default = exports.default = {
478
494
  saveQuantitySample: _saveQuantitySample.default,
479
495
  saveWorkoutSample: _saveWorkoutSample.default,
480
496
  saveWorkoutRoute: _saveWorkoutRoute.default,
497
+ saveStateOfMindSample: _saveStateOfMindSample.default,
481
498
  // subscriptions
482
499
  subscribeToChanges: _subscribeToChanges.default,
483
500
  startWatchApp: _startWatchApp.default,
501
+ workoutSessionMirroringStartHandler: _workoutSessionMirroringStartHandler.default,
484
502
  /**
485
503
  * @returns the most recent sample for the given category type.
486
504
  */
@@ -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","_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,\n}\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,O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,CAAC;AAED,MAAMtB,aAAa,GAAArE,OAAA,CAAAqE,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","_saveStateOfMindSample","_saveWorkoutRoute","_saveWorkoutSample","_startWatchApp","_subscribeToChanges","_workoutSessionMirroringStartHandler","_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","saveStateOfMindSample","subscribeToChanges","startWatchApp","workoutSessionMirroringStartHandler","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 saveStateOfMindSample from './utils/saveStateOfMindSample'\nimport saveWorkoutRoute from './utils/saveWorkoutRoute'\nimport saveWorkoutSample from './utils/saveWorkoutSample'\nimport startWatchApp from './utils/startWatchApp'\nimport subscribeToChanges from './utils/subscribeToChanges'\nimport workoutSessionMirroringStartHandler from './utils/workoutSessionMirroringStartHandler'\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 saveStateOfMindSample,\n\n // subscriptions\n subscribeToChanges,\n\n startWatchApp,\n workoutSessionMirroringStartHandler,\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 saveStateOfMindSample,\n saveCorrelationSample,\n saveQuantitySample,\n saveWorkoutSample,\n saveWorkoutRoute,\n subscribeToChanges,\n startWatchApp,\n workoutSessionMirroringStartHandler,\n useMostRecentCategorySample,\n useMostRecentQuantitySample,\n useMostRecentWorkout,\n useSubscribeToChanges,\n useHealthkitAuthorization,\n useIsHealthDataAvailable,\n useSources,\n useStatisticsForQuantity,\n isProtectedDataAvailable,\n queryStateOfMindSamples,\n}\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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lBA,2BAAkB;EAElBC,aAAa,EAAbA,sBAAa;EACbC,mCAAmC,EAAnCA,4CAAmC;EAEnC;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,iCAAwB;EACxBC,uBAAuB,EAAvBA;AACF,CAAC;AAED,MAAMxB,aAAa,GAAArE,OAAA,CAAAqE,aAAA,GAAGC,sBAAmB","ignoreList":[]}
@@ -41,12 +41,14 @@ var _exportNames = {
41
41
  queryWorkoutSamplesWithAnchor: true,
42
42
  requestAuthorization: true,
43
43
  saveCategorySample: true,
44
+ saveStateOfMindSample: true,
44
45
  saveCorrelationSample: true,
45
46
  saveQuantitySample: true,
46
47
  saveWorkoutRoute: true,
47
48
  saveWorkoutSample: true,
48
49
  subscribeToChanges: true,
49
50
  startWatchApp: true,
51
+ workoutSessionMirroringStartHandler: true,
50
52
  useHealthkitAuthorization: true,
51
53
  useIsHealthDataAvailable: true,
52
54
  useMostRecentCategorySample: true,
@@ -57,7 +59,7 @@ var _exportNames = {
57
59
  useSubscribeToChanges: true,
58
60
  queryStateOfMindSamples: true
59
61
  };
60
- exports.useSubscribeToChanges = exports.useStatisticsForQuantity = exports.useSources = exports.useMostRecentWorkout = exports.useMostRecentQuantitySample = exports.useMostRecentCategorySample = exports.useIsHealthDataAvailable = exports.useHealthkitAuthorization = exports.subscribeToChanges = exports.startWatchApp = exports.saveWorkoutSample = exports.saveWorkoutRoute = exports.saveQuantitySample = exports.saveCorrelationSample = exports.saveCategorySample = exports.requestAuthorization = exports.queryWorkouts = exports.queryWorkoutSamplesWithAnchor = exports.queryWorkoutSamples = exports.queryStatisticsForQuantity = exports.queryStatisticsCollectionForQuantity = exports.queryStateOfMindSamples = exports.querySources = exports.queryQuantitySamplesWithAnchor = exports.queryQuantitySamples = exports.queryHeartbeatSeriesSamplesWithAnchor = exports.queryHeartbeatSeriesSamples = exports.queryCorrelationSamples = exports.queryCategorySamplesWithAnchor = exports.queryCategorySamples = exports.isProtectedDataAvailable = exports.isHealthDataAvailable = exports.getWorkoutRoutes = exports.getWorkoutPlanById = exports.getWheelchairUse = exports.getRequestStatusForAuthorization = exports.getPreferredUnits = exports.getPreferredUnit = exports.getMostRecentWorkout = exports.getMostRecentQuantitySample = exports.getMostRecentCategorySample = exports.getFitzpatrickSkinType = exports.getDateOfBirth = exports.getBloodType = exports.getBiologicalSex = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = exports.deleteSamples = exports.deleteQuantitySample = exports.default = exports.availableQuantityTypes = exports.authorizationStatusFor = void 0;
62
+ exports.workoutSessionMirroringStartHandler = exports.useSubscribeToChanges = exports.useStatisticsForQuantity = exports.useSources = exports.useMostRecentWorkout = exports.useMostRecentQuantitySample = exports.useMostRecentCategorySample = exports.useIsHealthDataAvailable = exports.useHealthkitAuthorization = exports.subscribeToChanges = exports.startWatchApp = exports.saveWorkoutSample = exports.saveWorkoutRoute = exports.saveStateOfMindSample = exports.saveQuantitySample = exports.saveCorrelationSample = exports.saveCategorySample = exports.requestAuthorization = exports.queryWorkouts = exports.queryWorkoutSamplesWithAnchor = exports.queryWorkoutSamples = exports.queryStatisticsForQuantity = exports.queryStatisticsCollectionForQuantity = exports.queryStateOfMindSamples = exports.querySources = exports.queryQuantitySamplesWithAnchor = exports.queryQuantitySamples = exports.queryHeartbeatSeriesSamplesWithAnchor = exports.queryHeartbeatSeriesSamples = exports.queryCorrelationSamples = exports.queryCategorySamplesWithAnchor = exports.queryCategorySamples = exports.isProtectedDataAvailable = exports.isHealthDataAvailable = exports.getWorkoutRoutes = exports.getWorkoutPlanById = exports.getWheelchairUse = exports.getRequestStatusForAuthorization = exports.getPreferredUnits = exports.getPreferredUnit = exports.getMostRecentWorkout = exports.getMostRecentQuantitySample = exports.getMostRecentCategorySample = exports.getFitzpatrickSkinType = exports.getDateOfBirth = exports.getBloodType = exports.getBiologicalSex = exports.enableBackgroundDelivery = exports.disableBackgroundDelivery = exports.disableAllBackgroundDelivery = exports.deleteSamples = exports.deleteQuantitySample = exports.default = exports.availableQuantityTypes = exports.authorizationStatusFor = void 0;
61
63
  var _reactNative = require("react-native");
62
64
  var _nativeTypes = require("./native-types");
63
65
  var _types = require("./types");
@@ -154,12 +156,14 @@ const authorizationStatusFor = exports.authorizationStatusFor = UnavailableFn(Pr
154
156
  deleteSamples = exports.deleteSamples = UnavailableFn(Promise.resolve(false)),
155
157
  getWorkoutPlanById = exports.getWorkoutPlanById = UnavailableFn(Promise.resolve(null)),
156
158
  saveCategorySample = exports.saveCategorySample = UnavailableFn(Promise.resolve(false)),
159
+ saveStateOfMindSample = exports.saveStateOfMindSample = UnavailableFn(Promise.resolve(false)),
157
160
  saveCorrelationSample = exports.saveCorrelationSample = UnavailableFn(Promise.resolve(false)),
158
161
  saveQuantitySample = exports.saveQuantitySample = UnavailableFn(Promise.resolve(false)),
159
162
  saveWorkoutSample = exports.saveWorkoutSample = UnavailableFn(Promise.resolve(null)),
160
163
  saveWorkoutRoute = exports.saveWorkoutRoute = UnavailableFn(Promise.resolve(false)),
161
164
  subscribeToChanges = exports.subscribeToChanges = UnavailableFn(Promise.resolve(async () => Promise.resolve(false))),
162
165
  startWatchApp = exports.startWatchApp = UnavailableFn(async () => Promise.resolve(false)),
166
+ workoutSessionMirroringStartHandler = exports.workoutSessionMirroringStartHandler = UnavailableFn(Promise.resolve(false)),
163
167
  useMostRecentCategorySample = exports.useMostRecentCategorySample = UnavailableFn(null),
164
168
  useMostRecentQuantitySample = exports.useMostRecentQuantitySample = UnavailableFn(null),
165
169
  useMostRecentWorkout = exports.useMostRecentWorkout = UnavailableFn(null),
@@ -208,6 +212,7 @@ const Healthkit = {
208
212
  queryWorkoutSamples,
209
213
  queryWorkoutSamplesWithAnchor,
210
214
  requestAuthorization,
215
+ saveStateOfMindSample,
211
216
  saveCategorySample,
212
217
  saveCorrelationSample,
213
218
  saveQuantitySample,
@@ -215,6 +220,7 @@ const Healthkit = {
215
220
  saveWorkoutSample,
216
221
  subscribeToChanges,
217
222
  startWatchApp,
223
+ workoutSessionMirroringStartHandler,
218
224
  useHealthkitAuthorization,
219
225
  useIsHealthDataAvailable,
220
226
  useMostRecentCategorySample,