@kingstinct/react-native-healthkit 11.1.2 → 12.0.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 (94) hide show
  1. package/ios/CoreModule.swift +6 -6
  2. package/ios/Helpers.swift +4 -4
  3. package/ios/QuantityTypeModule.swift +3 -8
  4. package/ios/WorkoutsModule.swift +9 -11
  5. package/lib/commonjs/hooks/useHealthkitAuthorization.js +14 -8
  6. package/lib/module/hooks/useHealthkitAuthorization.js +14 -8
  7. package/lib/typescript/healthkit.d.ts +10 -7
  8. package/lib/typescript/healthkit.ios.d.ts +16 -13
  9. package/lib/typescript/hooks/useHealthkitAuthorization.d.ts +4 -1
  10. package/lib/typescript/specs/CharacteristicTypeModule.nitro.d.ts +2 -2
  11. package/lib/typescript/specs/CoreModule.nitro.d.ts +7 -2
  12. package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +1 -1
  13. package/lib/typescript/specs/WorkoutProxy.nitro.d.ts +3 -11
  14. package/lib/typescript/specs/WorkoutsModule.nitro.d.ts +1 -1
  15. package/lib/typescript/types/Device.d.ts +8 -8
  16. package/lib/typescript/types/Source.d.ts +2 -2
  17. package/lib/typescript/types/Workouts.d.ts +1 -1
  18. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +94 -55
  19. package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +3 -2
  20. package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +3 -2
  21. package/nitrogen/generated/ios/c++/HybridCharacteristicTypeModuleSpecSwift.hpp +3 -0
  22. package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +10 -4
  23. package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +3 -2
  24. package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +3 -2
  25. package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +3 -2
  26. package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +4 -3
  27. package/nitrogen/generated/ios/c++/HybridSourceProxySpecSwift.hpp +3 -0
  28. package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +3 -2
  29. package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +7 -22
  30. package/nitrogen/generated/ios/c++/HybridWorkoutsModuleSpecSwift.hpp +5 -4
  31. package/nitrogen/generated/ios/swift/AuthDataTypes.swift +108 -0
  32. package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +16 -2
  33. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +8 -0
  34. package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +10 -1
  35. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec.swift +8 -0
  36. package/nitrogen/generated/ios/swift/HybridCharacteristicTypeModuleSpec_cxx.swift +10 -1
  37. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +10 -2
  38. package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +24 -36
  39. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec.swift +8 -0
  40. package/nitrogen/generated/ios/swift/HybridCorrelationTypeModuleSpec_cxx.swift +10 -1
  41. package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +8 -0
  42. package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +10 -1
  43. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec.swift +8 -0
  44. package/nitrogen/generated/ios/swift/HybridHeartbeatSeriesModuleSpec_cxx.swift +10 -1
  45. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +9 -1
  46. package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +13 -12
  47. package/nitrogen/generated/ios/swift/HybridSourceProxySpec.swift +7 -0
  48. package/nitrogen/generated/ios/swift/HybridSourceProxySpec_cxx.swift +9 -1
  49. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec.swift +8 -0
  50. package/nitrogen/generated/ios/swift/HybridStateOfMindModuleSpec_cxx.swift +11 -10
  51. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +8 -4
  52. package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +10 -53
  53. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec.swift +9 -1
  54. package/nitrogen/generated/ios/swift/HybridWorkoutsModuleSpec_cxx.swift +19 -3
  55. package/nitrogen/generated/ios/swift/PredicateWithMetadataKey.swift +21 -21
  56. package/nitrogen/generated/ios/swift/PredicateWithStartAndEnd.swift +16 -2
  57. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrder.swift +8 -1
  58. package/nitrogen/generated/ios/swift/QueryOptionsWithSortOrderAndUnit.swift +8 -1
  59. package/nitrogen/generated/ios/swift/StateOfMindSample.swift +29 -21
  60. package/nitrogen/generated/ios/swift/{Variant_String_Double_Bool_Date.swift → Variant_Bool_String_Double_Date.swift} +6 -6
  61. package/nitrogen/generated/ios/swift/WorkoutQueryOptions.swift +8 -1
  62. package/nitrogen/generated/shared/c++/AuthDataTypes.hpp +85 -0
  63. package/nitrogen/generated/shared/c++/CategorySample.hpp +0 -2
  64. package/nitrogen/generated/shared/c++/CategorySampleForSaving.hpp +0 -2
  65. package/nitrogen/generated/shared/c++/CorrelationSample.hpp +0 -2
  66. package/nitrogen/generated/shared/c++/DeletedSample.hpp +1 -2
  67. package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +0 -2
  68. package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +0 -2
  69. package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +0 -2
  70. package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +5 -5
  71. package/nitrogen/generated/shared/c++/HybridCorrelationTypeModuleSpec.hpp +0 -2
  72. package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +1 -3
  73. package/nitrogen/generated/shared/c++/HybridStateOfMindModuleSpec.hpp +0 -2
  74. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +0 -4
  75. package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +4 -10
  76. package/nitrogen/generated/shared/c++/HybridWorkoutsModuleSpec.hpp +2 -3
  77. package/nitrogen/generated/shared/c++/PredicateWithMetadataKey.hpp +5 -5
  78. package/nitrogen/generated/shared/c++/QuantitySample.hpp +0 -2
  79. package/nitrogen/generated/shared/c++/QuantitySampleForSaving.hpp +0 -2
  80. package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +0 -2
  81. package/nitrogen/generated/shared/c++/WorkoutSample.hpp +0 -2
  82. package/package.json +7 -7
  83. package/src/hooks/useHealthkitAuthorization.test.ts +12 -4
  84. package/src/hooks/useHealthkitAuthorization.ts +20 -14
  85. package/src/specs/CategoryTypeModule.nitro.ts +1 -1
  86. package/src/specs/CharacteristicTypeModule.nitro.ts +2 -2
  87. package/src/specs/CoreModule.nitro.ts +8 -6
  88. package/src/specs/QuantityTypeModule.nitro.ts +1 -1
  89. package/src/specs/WorkoutProxy.nitro.ts +3 -16
  90. package/src/specs/WorkoutsModule.nitro.ts +2 -2
  91. package/src/types/Device.ts +8 -8
  92. package/src/types/InterfaceVerificationExample.ts +2 -2
  93. package/src/types/Source.ts +2 -2
  94. package/src/types/Workouts.ts +1 -1
@@ -0,0 +1,108 @@
1
+ ///
2
+ /// AuthDataTypes.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+ /**
11
+ * Represents an instance of `AuthDataTypes`, backed by a C++ struct.
12
+ */
13
+ public typealias AuthDataTypes = margelo.nitro.healthkit.AuthDataTypes
14
+
15
+ public extension AuthDataTypes {
16
+ private typealias bridge = margelo.nitro.healthkit.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `AuthDataTypes`.
20
+ */
21
+ init(toShare: [SampleTypeIdentifierWriteable]?, toRead: [ObjectTypeIdentifier]?) {
22
+ self.init({ () -> bridge.std__optional_std__vector_SampleTypeIdentifierWriteable__ in
23
+ if let __unwrappedValue = toShare {
24
+ return bridge.create_std__optional_std__vector_SampleTypeIdentifierWriteable__({ () -> bridge.std__vector_SampleTypeIdentifierWriteable_ in
25
+ var __vector = bridge.create_std__vector_SampleTypeIdentifierWriteable_(__unwrappedValue.count)
26
+ for __item in __unwrappedValue {
27
+ __vector.push_back(__item)
28
+ }
29
+ return __vector
30
+ }())
31
+ } else {
32
+ return .init()
33
+ }
34
+ }(), { () -> bridge.std__optional_std__vector_ObjectTypeIdentifier__ in
35
+ if let __unwrappedValue = toRead {
36
+ return bridge.create_std__optional_std__vector_ObjectTypeIdentifier__({ () -> bridge.std__vector_ObjectTypeIdentifier_ in
37
+ var __vector = bridge.create_std__vector_ObjectTypeIdentifier_(__unwrappedValue.count)
38
+ for __item in __unwrappedValue {
39
+ __vector.push_back(__item)
40
+ }
41
+ return __vector
42
+ }())
43
+ } else {
44
+ return .init()
45
+ }
46
+ }())
47
+ }
48
+
49
+ var toShare: [SampleTypeIdentifierWriteable]? {
50
+ @inline(__always)
51
+ get {
52
+ return { () -> [SampleTypeIdentifierWriteable]? in
53
+ if bridge.has_value_std__optional_std__vector_SampleTypeIdentifierWriteable__(self.__toShare) {
54
+ let __unwrapped = bridge.get_std__optional_std__vector_SampleTypeIdentifierWriteable__(self.__toShare)
55
+ return __unwrapped.map({ __item in __item })
56
+ } else {
57
+ return nil
58
+ }
59
+ }()
60
+ }
61
+ @inline(__always)
62
+ set {
63
+ self.__toShare = { () -> bridge.std__optional_std__vector_SampleTypeIdentifierWriteable__ in
64
+ if let __unwrappedValue = newValue {
65
+ return bridge.create_std__optional_std__vector_SampleTypeIdentifierWriteable__({ () -> bridge.std__vector_SampleTypeIdentifierWriteable_ in
66
+ var __vector = bridge.create_std__vector_SampleTypeIdentifierWriteable_(__unwrappedValue.count)
67
+ for __item in __unwrappedValue {
68
+ __vector.push_back(__item)
69
+ }
70
+ return __vector
71
+ }())
72
+ } else {
73
+ return .init()
74
+ }
75
+ }()
76
+ }
77
+ }
78
+
79
+ var toRead: [ObjectTypeIdentifier]? {
80
+ @inline(__always)
81
+ get {
82
+ return { () -> [ObjectTypeIdentifier]? in
83
+ if bridge.has_value_std__optional_std__vector_ObjectTypeIdentifier__(self.__toRead) {
84
+ let __unwrapped = bridge.get_std__optional_std__vector_ObjectTypeIdentifier__(self.__toRead)
85
+ return __unwrapped.map({ __item in __item })
86
+ } else {
87
+ return nil
88
+ }
89
+ }()
90
+ }
91
+ @inline(__always)
92
+ set {
93
+ self.__toRead = { () -> bridge.std__optional_std__vector_ObjectTypeIdentifier__ in
94
+ if let __unwrappedValue = newValue {
95
+ return bridge.create_std__optional_std__vector_ObjectTypeIdentifier__({ () -> bridge.std__vector_ObjectTypeIdentifier_ in
96
+ var __vector = bridge.create_std__vector_ObjectTypeIdentifier_(__unwrappedValue.count)
97
+ for __item in __unwrappedValue {
98
+ __vector.push_back(__item)
99
+ }
100
+ return __vector
101
+ }())
102
+ } else {
103
+ return .init()
104
+ }
105
+ }()
106
+ }
107
+ }
108
+ }
@@ -66,7 +66,14 @@ public extension ECGQueryOptionsWithSortOrder {
66
66
  var includeVoltages: Bool? {
67
67
  @inline(__always)
68
68
  get {
69
- return self.__includeVoltages.value
69
+ return { () -> Bool? in
70
+ if bridge.has_value_std__optional_bool_(self.__includeVoltages) {
71
+ let __unwrapped = bridge.get_std__optional_bool_(self.__includeVoltages)
72
+ return __unwrapped
73
+ } else {
74
+ return nil
75
+ }
76
+ }()
70
77
  }
71
78
  @inline(__always)
72
79
  set {
@@ -83,7 +90,14 @@ public extension ECGQueryOptionsWithSortOrder {
83
90
  var ascending: Bool? {
84
91
  @inline(__always)
85
92
  get {
86
- return self.__ascending.value
93
+ return { () -> Bool? in
94
+ if bridge.has_value_std__optional_bool_(self.__ascending) {
95
+ let __unwrapped = bridge.get_std__optional_bool_(self.__ascending)
96
+ return __unwrapped
97
+ } else {
98
+ return nil
99
+ }
100
+ }()
87
101
  }
88
102
  @inline(__always)
89
103
  set {
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /// See ``HybridCategoryTypeModuleSpec``
12
13
  public protocol HybridCategoryTypeModuleSpec_protocol: HybridObject {
@@ -19,6 +20,13 @@ public protocol HybridCategoryTypeModuleSpec_protocol: HybridObject {
19
20
  func queryCategorySamplesWithAnchor(identifier: CategoryTypeIdentifier, options: QueryOptionsWithAnchor) throws -> Promise<CategorySamplesWithAnchorResponse>
20
21
  }
21
22
 
23
+ public extension HybridCategoryTypeModuleSpec_protocol {
24
+ /// Default implementation of ``HybridObject.toString``
25
+ func toString() -> String {
26
+ return "[HybridObject CategoryTypeModule]"
27
+ }
28
+ }
29
+
22
30
  /// See ``HybridCategoryTypeModuleSpec``
23
31
  open class HybridCategoryTypeModuleSpec_base {
24
32
  private weak var cxxWrapper: HybridCategoryTypeModuleSpec_cxx? = nil
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /**
12
13
  * A class implementation that bridges HybridCategoryTypeModuleSpec over to C++.
@@ -76,7 +77,7 @@ open class HybridCategoryTypeModuleSpec_cxx {
76
77
  */
77
78
  public func getCxxPart() -> bridge.std__shared_ptr_HybridCategoryTypeModuleSpec_ {
78
79
  let cachedCxxPart = self.__cxxPart.lock()
79
- if cachedCxxPart.__convertToBool() {
80
+ if Bool(fromCxx: cachedCxxPart) {
80
81
  return cachedCxxPart
81
82
  } else {
82
83
  let newCxxPart = bridge.create_std__shared_ptr_HybridCategoryTypeModuleSpec_(self.toUnsafe())
@@ -105,6 +106,14 @@ open class HybridCategoryTypeModuleSpec_cxx {
105
106
  self.__implementation.dispose()
106
107
  }
107
108
 
109
+ /**
110
+ * Call toString() on the Swift class.
111
+ */
112
+ @inline(__always)
113
+ public func toString() -> String {
114
+ return self.__implementation.toString()
115
+ }
116
+
108
117
  // Properties
109
118
 
110
119
 
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /// See ``HybridCharacteristicTypeModuleSpec``
12
13
  public protocol HybridCharacteristicTypeModuleSpec_protocol: HybridObject {
@@ -26,6 +27,13 @@ public protocol HybridCharacteristicTypeModuleSpec_protocol: HybridObject {
26
27
  func getWheelchairUseAsync() throws -> Promise<WheelchairUse>
27
28
  }
28
29
 
30
+ public extension HybridCharacteristicTypeModuleSpec_protocol {
31
+ /// Default implementation of ``HybridObject.toString``
32
+ func toString() -> String {
33
+ return "[HybridObject CharacteristicTypeModule]"
34
+ }
35
+ }
36
+
29
37
  /// See ``HybridCharacteristicTypeModuleSpec``
30
38
  open class HybridCharacteristicTypeModuleSpec_base {
31
39
  private weak var cxxWrapper: HybridCharacteristicTypeModuleSpec_cxx? = nil
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /**
12
13
  * A class implementation that bridges HybridCharacteristicTypeModuleSpec over to C++.
@@ -76,7 +77,7 @@ open class HybridCharacteristicTypeModuleSpec_cxx {
76
77
  */
77
78
  public func getCxxPart() -> bridge.std__shared_ptr_HybridCharacteristicTypeModuleSpec_ {
78
79
  let cachedCxxPart = self.__cxxPart.lock()
79
- if cachedCxxPart.__convertToBool() {
80
+ if Bool(fromCxx: cachedCxxPart) {
80
81
  return cachedCxxPart
81
82
  } else {
82
83
  let newCxxPart = bridge.create_std__shared_ptr_HybridCharacteristicTypeModuleSpec_(self.toUnsafe())
@@ -105,6 +106,14 @@ open class HybridCharacteristicTypeModuleSpec_cxx {
105
106
  self.__implementation.dispose()
106
107
  }
107
108
 
109
+ /**
110
+ * Call toString() on the Swift class.
111
+ */
112
+ @inline(__always)
113
+ public func toString() -> String {
114
+ return self.__implementation.toString()
115
+ }
116
+
108
117
  // Properties
109
118
 
110
119
 
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /// See ``HybridCoreModuleSpec``
12
13
  public protocol HybridCoreModuleSpec_protocol: HybridObject {
@@ -29,8 +30,8 @@ public protocol HybridCoreModuleSpec_protocol: HybridObject {
29
30
  func unsubscribeQueries(queryIds: [String]) throws -> Double
30
31
  func unsubscribeQueriesAsync(queryIds: [String]) throws -> Promise<Double>
31
32
  func authorizationStatusFor(type: ObjectTypeIdentifier) throws -> AuthorizationStatus
32
- func getRequestStatusForAuthorization(toShare: [SampleTypeIdentifierWriteable], toRead: [ObjectTypeIdentifier]) throws -> Promise<AuthorizationRequestStatus>
33
- func requestAuthorization(toShare: [SampleTypeIdentifierWriteable], toRead: [ObjectTypeIdentifier]) throws -> Promise<Bool>
33
+ func getRequestStatusForAuthorization(toCheck: AuthDataTypes) throws -> Promise<AuthorizationRequestStatus>
34
+ func requestAuthorization(toRequest: AuthDataTypes) throws -> Promise<Bool>
34
35
  func deleteObjects(objectTypeIdentifier: ObjectTypeIdentifier, filter: FilterForSamples) throws -> Promise<Double>
35
36
  func isObjectTypeAvailable(objectTypeIdentifier: ObjectTypeIdentifier) throws -> Bool
36
37
  func areObjectTypesAvailable(objectTypeIdentifiers: [ObjectTypeIdentifier]) throws -> Dictionary<String, Bool>
@@ -38,6 +39,13 @@ public protocol HybridCoreModuleSpec_protocol: HybridObject {
38
39
  func isObjectTypeAvailableAsync(objectTypeIdentifier: ObjectTypeIdentifier) throws -> Promise<Bool>
39
40
  }
40
41
 
42
+ public extension HybridCoreModuleSpec_protocol {
43
+ /// Default implementation of ``HybridObject.toString``
44
+ func toString() -> String {
45
+ return "[HybridObject CoreModule]"
46
+ }
47
+ }
48
+
41
49
  /// See ``HybridCoreModuleSpec``
42
50
  open class HybridCoreModuleSpec_base {
43
51
  private weak var cxxWrapper: HybridCoreModuleSpec_cxx? = nil
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /**
12
13
  * A class implementation that bridges HybridCoreModuleSpec over to C++.
@@ -76,7 +77,7 @@ open class HybridCoreModuleSpec_cxx {
76
77
  */
77
78
  public func getCxxPart() -> bridge.std__shared_ptr_HybridCoreModuleSpec_ {
78
79
  let cachedCxxPart = self.__cxxPart.lock()
79
- if cachedCxxPart.__convertToBool() {
80
+ if Bool(fromCxx: cachedCxxPart) {
80
81
  return cachedCxxPart
81
82
  } else {
82
83
  let newCxxPart = bridge.create_std__shared_ptr_HybridCoreModuleSpec_(self.toUnsafe())
@@ -105,6 +106,14 @@ open class HybridCoreModuleSpec_cxx {
105
106
  self.__implementation.dispose()
106
107
  }
107
108
 
109
+ /**
110
+ * Call toString() on the Swift class.
111
+ */
112
+ @inline(__always)
113
+ public func toString() -> String {
114
+ return self.__implementation.toString()
115
+ }
116
+
108
117
  // Properties
109
118
 
110
119
 
@@ -231,11 +240,14 @@ open class HybridCoreModuleSpec_cxx {
231
240
  @inline(__always)
232
241
  public final func getPreferredUnits(identifiers: bridge.std__vector_QuantityTypeIdentifier_, forceUpdate: bridge.std__optional_bool_) -> bridge.Result_std__shared_ptr_Promise_std__vector_IdentifierWithUnit____ {
233
242
  do {
234
- let __result = try self.__implementation.getPreferredUnits(identifiers: { () -> [QuantityTypeIdentifier] in
235
- let __data = bridge.get_data_std__vector_QuantityTypeIdentifier_(identifiers)
236
- let __size = identifiers.size()
237
- return Array(UnsafeBufferPointer(start: __data, count: __size))
238
- }(), forceUpdate: forceUpdate.value)
243
+ let __result = try self.__implementation.getPreferredUnits(identifiers: identifiers.map({ __item in __item }), forceUpdate: { () -> Bool? in
244
+ if bridge.has_value_std__optional_bool_(forceUpdate) {
245
+ let __unwrapped = bridge.get_std__optional_bool_(forceUpdate)
246
+ return __unwrapped
247
+ } else {
248
+ return nil
249
+ }
250
+ }())
239
251
  let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_IdentifierWithUnit___ in
240
252
  let __promise = bridge.create_std__shared_ptr_Promise_std__vector_IdentifierWithUnit___()
241
253
  let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_IdentifierWithUnit___(__promise)
@@ -377,17 +389,9 @@ open class HybridCoreModuleSpec_cxx {
377
389
  }
378
390
 
379
391
  @inline(__always)
380
- public final func getRequestStatusForAuthorization(toShare: bridge.std__vector_SampleTypeIdentifierWriteable_, toRead: bridge.std__vector_ObjectTypeIdentifier_) -> bridge.Result_std__shared_ptr_Promise_AuthorizationRequestStatus___ {
392
+ public final func getRequestStatusForAuthorization(toCheck: AuthDataTypes) -> bridge.Result_std__shared_ptr_Promise_AuthorizationRequestStatus___ {
381
393
  do {
382
- let __result = try self.__implementation.getRequestStatusForAuthorization(toShare: { () -> [SampleTypeIdentifierWriteable] in
383
- let __data = bridge.get_data_std__vector_SampleTypeIdentifierWriteable_(toShare)
384
- let __size = toShare.size()
385
- return Array(UnsafeBufferPointer(start: __data, count: __size))
386
- }(), toRead: { () -> [ObjectTypeIdentifier] in
387
- let __data = bridge.get_data_std__vector_ObjectTypeIdentifier_(toRead)
388
- let __size = toRead.size()
389
- return Array(UnsafeBufferPointer(start: __data, count: __size))
390
- }())
394
+ let __result = try self.__implementation.getRequestStatusForAuthorization(toCheck: toCheck)
391
395
  let __resultCpp = { () -> bridge.std__shared_ptr_Promise_AuthorizationRequestStatus__ in
392
396
  let __promise = bridge.create_std__shared_ptr_Promise_AuthorizationRequestStatus__()
393
397
  let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_AuthorizationRequestStatus__(__promise)
@@ -404,17 +408,9 @@ open class HybridCoreModuleSpec_cxx {
404
408
  }
405
409
 
406
410
  @inline(__always)
407
- public final func requestAuthorization(toShare: bridge.std__vector_SampleTypeIdentifierWriteable_, toRead: bridge.std__vector_ObjectTypeIdentifier_) -> bridge.Result_std__shared_ptr_Promise_bool___ {
411
+ public final func requestAuthorization(toRequest: AuthDataTypes) -> bridge.Result_std__shared_ptr_Promise_bool___ {
408
412
  do {
409
- let __result = try self.__implementation.requestAuthorization(toShare: { () -> [SampleTypeIdentifierWriteable] in
410
- let __data = bridge.get_data_std__vector_SampleTypeIdentifierWriteable_(toShare)
411
- let __size = toShare.size()
412
- return Array(UnsafeBufferPointer(start: __data, count: __size))
413
- }(), toRead: { () -> [ObjectTypeIdentifier] in
414
- let __data = bridge.get_data_std__vector_ObjectTypeIdentifier_(toRead)
415
- let __size = toRead.size()
416
- return Array(UnsafeBufferPointer(start: __data, count: __size))
417
- }())
413
+ let __result = try self.__implementation.requestAuthorization(toRequest: toRequest)
418
414
  let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
419
415
  let __promise = bridge.create_std__shared_ptr_Promise_bool__()
420
416
  let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
@@ -491,11 +487,7 @@ open class HybridCoreModuleSpec_cxx {
491
487
  @inline(__always)
492
488
  public final func areObjectTypesAvailable(objectTypeIdentifiers: bridge.std__vector_ObjectTypeIdentifier_) -> bridge.Result_std__unordered_map_std__string__bool__ {
493
489
  do {
494
- let __result = try self.__implementation.areObjectTypesAvailable(objectTypeIdentifiers: { () -> [ObjectTypeIdentifier] in
495
- let __data = bridge.get_data_std__vector_ObjectTypeIdentifier_(objectTypeIdentifiers)
496
- let __size = objectTypeIdentifiers.size()
497
- return Array(UnsafeBufferPointer(start: __data, count: __size))
498
- }())
490
+ let __result = try self.__implementation.areObjectTypesAvailable(objectTypeIdentifiers: objectTypeIdentifiers.map({ __item in __item }))
499
491
  let __resultCpp = { () -> bridge.std__unordered_map_std__string__bool_ in
500
492
  var __map = bridge.create_std__unordered_map_std__string__bool_(__result.count)
501
493
  for (__k, __v) in __result {
@@ -513,11 +505,7 @@ open class HybridCoreModuleSpec_cxx {
513
505
  @inline(__always)
514
506
  public final func areObjectTypesAvailableAsync(objectTypeIdentifiers: bridge.std__vector_ObjectTypeIdentifier_) -> bridge.Result_std__shared_ptr_Promise_std__unordered_map_std__string__bool____ {
515
507
  do {
516
- let __result = try self.__implementation.areObjectTypesAvailableAsync(objectTypeIdentifiers: { () -> [ObjectTypeIdentifier] in
517
- let __data = bridge.get_data_std__vector_ObjectTypeIdentifier_(objectTypeIdentifiers)
518
- let __size = objectTypeIdentifiers.size()
519
- return Array(UnsafeBufferPointer(start: __data, count: __size))
520
- }())
508
+ let __result = try self.__implementation.areObjectTypesAvailableAsync(objectTypeIdentifiers: objectTypeIdentifiers.map({ __item in __item }))
521
509
  let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__unordered_map_std__string__bool___ in
522
510
  let __promise = bridge.create_std__shared_ptr_Promise_std__unordered_map_std__string__bool___()
523
511
  let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__unordered_map_std__string__bool___(__promise)
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /// See ``HybridCorrelationTypeModuleSpec``
12
13
  public protocol HybridCorrelationTypeModuleSpec_protocol: HybridObject {
@@ -18,6 +19,13 @@ public protocol HybridCorrelationTypeModuleSpec_protocol: HybridObject {
18
19
  func queryCorrelationSamples(typeIdentifier: CorrelationTypeIdentifier, from: Date, to: Date) throws -> Promise<[CorrelationSample]>
19
20
  }
20
21
 
22
+ public extension HybridCorrelationTypeModuleSpec_protocol {
23
+ /// Default implementation of ``HybridObject.toString``
24
+ func toString() -> String {
25
+ return "[HybridObject CorrelationTypeModule]"
26
+ }
27
+ }
28
+
21
29
  /// See ``HybridCorrelationTypeModuleSpec``
22
30
  open class HybridCorrelationTypeModuleSpec_base {
23
31
  private weak var cxxWrapper: HybridCorrelationTypeModuleSpec_cxx? = nil
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /**
12
13
  * A class implementation that bridges HybridCorrelationTypeModuleSpec over to C++.
@@ -76,7 +77,7 @@ open class HybridCorrelationTypeModuleSpec_cxx {
76
77
  */
77
78
  public func getCxxPart() -> bridge.std__shared_ptr_HybridCorrelationTypeModuleSpec_ {
78
79
  let cachedCxxPart = self.__cxxPart.lock()
79
- if cachedCxxPart.__convertToBool() {
80
+ if Bool(fromCxx: cachedCxxPart) {
80
81
  return cachedCxxPart
81
82
  } else {
82
83
  let newCxxPart = bridge.create_std__shared_ptr_HybridCorrelationTypeModuleSpec_(self.toUnsafe())
@@ -105,6 +106,14 @@ open class HybridCorrelationTypeModuleSpec_cxx {
105
106
  self.__implementation.dispose()
106
107
  }
107
108
 
109
+ /**
110
+ * Call toString() on the Swift class.
111
+ */
112
+ @inline(__always)
113
+ public func toString() -> String {
114
+ return self.__implementation.toString()
115
+ }
116
+
108
117
  // Properties
109
118
 
110
119
 
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /// See ``HybridElectrocardiogramModuleSpec``
12
13
  public protocol HybridElectrocardiogramModuleSpec_protocol: HybridObject {
@@ -18,6 +19,13 @@ public protocol HybridElectrocardiogramModuleSpec_protocol: HybridObject {
18
19
  func queryElectrocardiogramSamplesWithAnchor(options: ECGQueryOptionsWithAnchor) throws -> Promise<ElectrocardiogramSamplesWithAnchorResponse>
19
20
  }
20
21
 
22
+ public extension HybridElectrocardiogramModuleSpec_protocol {
23
+ /// Default implementation of ``HybridObject.toString``
24
+ func toString() -> String {
25
+ return "[HybridObject ElectrocardiogramModule]"
26
+ }
27
+ }
28
+
21
29
  /// See ``HybridElectrocardiogramModuleSpec``
22
30
  open class HybridElectrocardiogramModuleSpec_base {
23
31
  private weak var cxxWrapper: HybridElectrocardiogramModuleSpec_cxx? = nil
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /**
12
13
  * A class implementation that bridges HybridElectrocardiogramModuleSpec over to C++.
@@ -76,7 +77,7 @@ open class HybridElectrocardiogramModuleSpec_cxx {
76
77
  */
77
78
  public func getCxxPart() -> bridge.std__shared_ptr_HybridElectrocardiogramModuleSpec_ {
78
79
  let cachedCxxPart = self.__cxxPart.lock()
79
- if cachedCxxPart.__convertToBool() {
80
+ if Bool(fromCxx: cachedCxxPart) {
80
81
  return cachedCxxPart
81
82
  } else {
82
83
  let newCxxPart = bridge.create_std__shared_ptr_HybridElectrocardiogramModuleSpec_(self.toUnsafe())
@@ -105,6 +106,14 @@ open class HybridElectrocardiogramModuleSpec_cxx {
105
106
  self.__implementation.dispose()
106
107
  }
107
108
 
109
+ /**
110
+ * Call toString() on the Swift class.
111
+ */
112
+ @inline(__always)
113
+ public func toString() -> String {
114
+ return self.__implementation.toString()
115
+ }
116
+
108
117
  // Properties
109
118
 
110
119
 
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /// See ``HybridHeartbeatSeriesModuleSpec``
12
13
  public protocol HybridHeartbeatSeriesModuleSpec_protocol: HybridObject {
@@ -18,6 +19,13 @@ public protocol HybridHeartbeatSeriesModuleSpec_protocol: HybridObject {
18
19
  func queryHeartbeatSeriesSamplesWithAnchor(options: QueryOptionsWithAnchor) throws -> Promise<HeartbeatSeriesSamplesWithAnchorResponse>
19
20
  }
20
21
 
22
+ public extension HybridHeartbeatSeriesModuleSpec_protocol {
23
+ /// Default implementation of ``HybridObject.toString``
24
+ func toString() -> String {
25
+ return "[HybridObject HeartbeatSeriesModule]"
26
+ }
27
+ }
28
+
21
29
  /// See ``HybridHeartbeatSeriesModuleSpec``
22
30
  open class HybridHeartbeatSeriesModuleSpec_base {
23
31
  private weak var cxxWrapper: HybridHeartbeatSeriesModuleSpec_cxx? = nil
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /**
12
13
  * A class implementation that bridges HybridHeartbeatSeriesModuleSpec over to C++.
@@ -76,7 +77,7 @@ open class HybridHeartbeatSeriesModuleSpec_cxx {
76
77
  */
77
78
  public func getCxxPart() -> bridge.std__shared_ptr_HybridHeartbeatSeriesModuleSpec_ {
78
79
  let cachedCxxPart = self.__cxxPart.lock()
79
- if cachedCxxPart.__convertToBool() {
80
+ if Bool(fromCxx: cachedCxxPart) {
80
81
  return cachedCxxPart
81
82
  } else {
82
83
  let newCxxPart = bridge.create_std__shared_ptr_HybridHeartbeatSeriesModuleSpec_(self.toUnsafe())
@@ -105,6 +106,14 @@ open class HybridHeartbeatSeriesModuleSpec_cxx {
105
106
  self.__implementation.dispose()
106
107
  }
107
108
 
109
+ /**
110
+ * Call toString() on the Swift class.
111
+ */
112
+ @inline(__always)
113
+ public func toString() -> String {
114
+ return self.__implementation.toString()
115
+ }
116
+
108
117
  // Properties
109
118
 
110
119
 
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /// See ``HybridQuantityTypeModuleSpec``
12
13
  public protocol HybridQuantityTypeModuleSpec_protocol: HybridObject {
@@ -19,10 +20,17 @@ public protocol HybridQuantityTypeModuleSpec_protocol: HybridObject {
19
20
  func deleteQuantitySamples(identifier: QuantityTypeIdentifier, filter: FilterForSamples) throws -> Promise<Bool>
20
21
  func queryQuantitySamples(identifier: QuantityTypeIdentifier, options: QueryOptionsWithSortOrderAndUnit?) throws -> Promise<[QuantitySample]>
21
22
  func queryStatisticsForQuantity(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], options: StatisticsQueryOptions?) throws -> Promise<QueryStatisticsResponse>
22
- func queryStatisticsCollectionForQuantity(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], anchorDate: String, intervalComponents: IntervalComponents, options: StatisticsQueryOptions?) throws -> Promise<[QueryStatisticsResponse]>
23
+ func queryStatisticsCollectionForQuantity(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], anchorDate: Date, intervalComponents: IntervalComponents, options: StatisticsQueryOptions?) throws -> Promise<[QueryStatisticsResponse]>
23
24
  func queryQuantitySamplesWithAnchor(identifier: QuantityTypeIdentifier, options: QueryOptionsWithAnchorAndUnit) throws -> Promise<QuantitySamplesWithAnchorResponse>
24
25
  }
25
26
 
27
+ public extension HybridQuantityTypeModuleSpec_protocol {
28
+ /// Default implementation of ``HybridObject.toString``
29
+ func toString() -> String {
30
+ return "[HybridObject QuantityTypeModule]"
31
+ }
32
+ }
33
+
26
34
  /// See ``HybridQuantityTypeModuleSpec``
27
35
  open class HybridQuantityTypeModuleSpec_base {
28
36
  private weak var cxxWrapper: HybridQuantityTypeModuleSpec_cxx? = nil
@@ -7,6 +7,7 @@
7
7
 
8
8
  import Foundation
9
9
  import NitroModules
10
+ import NitroModules
10
11
 
11
12
  /**
12
13
  * A class implementation that bridges HybridQuantityTypeModuleSpec over to C++.
@@ -76,7 +77,7 @@ open class HybridQuantityTypeModuleSpec_cxx {
76
77
  */
77
78
  public func getCxxPart() -> bridge.std__shared_ptr_HybridQuantityTypeModuleSpec_ {
78
79
  let cachedCxxPart = self.__cxxPart.lock()
79
- if cachedCxxPart.__convertToBool() {
80
+ if Bool(fromCxx: cachedCxxPart) {
80
81
  return cachedCxxPart
81
82
  } else {
82
83
  let newCxxPart = bridge.create_std__shared_ptr_HybridQuantityTypeModuleSpec_(self.toUnsafe())
@@ -105,6 +106,14 @@ open class HybridQuantityTypeModuleSpec_cxx {
105
106
  self.__implementation.dispose()
106
107
  }
107
108
 
109
+ /**
110
+ * Call toString() on the Swift class.
111
+ */
112
+ @inline(__always)
113
+ public func toString() -> String {
114
+ return self.__implementation.toString()
115
+ }
116
+
108
117
  // Properties
109
118
 
110
119
 
@@ -214,11 +223,7 @@ open class HybridQuantityTypeModuleSpec_cxx {
214
223
  @inline(__always)
215
224
  public final func queryStatisticsForQuantity(identifier: Int32, statistics: bridge.std__vector_StatisticsOptions_, options: bridge.std__optional_StatisticsQueryOptions_) -> bridge.Result_std__shared_ptr_Promise_QueryStatisticsResponse___ {
216
225
  do {
217
- let __result = try self.__implementation.queryStatisticsForQuantity(identifier: margelo.nitro.healthkit.QuantityTypeIdentifier(rawValue: identifier)!, statistics: { () -> [StatisticsOptions] in
218
- let __data = bridge.get_data_std__vector_StatisticsOptions_(statistics)
219
- let __size = statistics.size()
220
- return Array(UnsafeBufferPointer(start: __data, count: __size))
221
- }(), options: options.value)
226
+ let __result = try self.__implementation.queryStatisticsForQuantity(identifier: margelo.nitro.healthkit.QuantityTypeIdentifier(rawValue: identifier)!, statistics: statistics.map({ __item in __item }), options: options.value)
222
227
  let __resultCpp = { () -> bridge.std__shared_ptr_Promise_QueryStatisticsResponse__ in
223
228
  let __promise = bridge.create_std__shared_ptr_Promise_QueryStatisticsResponse__()
224
229
  let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_QueryStatisticsResponse__(__promise)
@@ -235,13 +240,9 @@ open class HybridQuantityTypeModuleSpec_cxx {
235
240
  }
236
241
 
237
242
  @inline(__always)
238
- public final func queryStatisticsCollectionForQuantity(identifier: Int32, statistics: bridge.std__vector_StatisticsOptions_, anchorDate: std.string, intervalComponents: IntervalComponents, options: bridge.std__optional_StatisticsQueryOptions_) -> bridge.Result_std__shared_ptr_Promise_std__vector_QueryStatisticsResponse____ {
243
+ public final func queryStatisticsCollectionForQuantity(identifier: Int32, statistics: bridge.std__vector_StatisticsOptions_, anchorDate: margelo.nitro.chrono_time, intervalComponents: IntervalComponents, options: bridge.std__optional_StatisticsQueryOptions_) -> bridge.Result_std__shared_ptr_Promise_std__vector_QueryStatisticsResponse____ {
239
244
  do {
240
- let __result = try self.__implementation.queryStatisticsCollectionForQuantity(identifier: margelo.nitro.healthkit.QuantityTypeIdentifier(rawValue: identifier)!, statistics: { () -> [StatisticsOptions] in
241
- let __data = bridge.get_data_std__vector_StatisticsOptions_(statistics)
242
- let __size = statistics.size()
243
- return Array(UnsafeBufferPointer(start: __data, count: __size))
244
- }(), anchorDate: String(anchorDate), intervalComponents: intervalComponents, options: options.value)
245
+ let __result = try self.__implementation.queryStatisticsCollectionForQuantity(identifier: margelo.nitro.healthkit.QuantityTypeIdentifier(rawValue: identifier)!, statistics: statistics.map({ __item in __item }), anchorDate: Date(fromChrono: anchorDate), intervalComponents: intervalComponents, options: options.value)
245
246
  let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_QueryStatisticsResponse___ in
246
247
  let __promise = bridge.create_std__shared_ptr_Promise_std__vector_QueryStatisticsResponse___()
247
248
  let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_QueryStatisticsResponse___(__promise)
@@ -17,6 +17,13 @@ public protocol HybridSourceProxySpec_protocol: HybridObject {
17
17
  func toJSON(key: String?) throws -> Source
18
18
  }
19
19
 
20
+ public extension HybridSourceProxySpec_protocol {
21
+ /// Default implementation of ``HybridObject.toString``
22
+ func toString() -> String {
23
+ return "[HybridObject SourceProxy]"
24
+ }
25
+ }
26
+
20
27
  /// See ``HybridSourceProxySpec``
21
28
  open class HybridSourceProxySpec_base {
22
29
  private weak var cxxWrapper: HybridSourceProxySpec_cxx? = nil