@kingstinct/react-native-healthkit 11.0.0 → 11.1.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.
- package/README.md +2 -2
- package/ios/ElectrocardiogramModule.swift +210 -0
- package/ios/QuantityTypeModule.swift +52 -15
- package/lib/commonjs/healthkit.ios.js +6 -2
- package/lib/commonjs/healthkit.js +10 -2
- package/lib/commonjs/modules.js +2 -1
- package/lib/commonjs/specs/ElectrocardiogramModule.nitro.js +2 -0
- package/lib/commonjs/types/ElectrocardiogramSample.js +2 -0
- package/lib/module/healthkit.ios.js +5 -1
- package/lib/module/healthkit.js +8 -0
- package/lib/module/modules.js +1 -0
- package/lib/module/specs/ElectrocardiogramModule.nitro.js +1 -0
- package/lib/module/types/ElectrocardiogramSample.js +1 -0
- package/lib/typescript/healthkit.d.ts +2 -0
- package/lib/typescript/healthkit.ios.d.ts +4 -0
- package/lib/typescript/modules.d.ts +2 -0
- package/lib/typescript/specs/ElectrocardiogramModule.nitro.d.ts +8 -0
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +39 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.cpp +33 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +176 -0
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +29 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeHealthkitAutolinking.swift +15 -0
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +152 -0
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithAnchor.swift +179 -0
- package/nitrogen/generated/ios/swift/ECGQueryOptionsWithSortOrder.swift +184 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramClassification.swift +60 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramLead.swift +40 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +298 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramSamplesWithAnchorResponse.swift +81 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramSymptomsStatus.swift +44 -0
- package/nitrogen/generated/ios/swift/ElectrocardiogramVoltage.swift +57 -0
- package/nitrogen/generated/ios/swift/Func_void_ElectrocardiogramSamplesWithAnchorResponse.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_ElectrocardiogramSample_.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec.swift +50 -0
- package/nitrogen/generated/ios/swift/HybridElectrocardiogramModuleSpec_cxx.swift +162 -0
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithAnchor.hpp +101 -0
- package/nitrogen/generated/shared/c++/ECGQueryOptionsWithSortOrder.hpp +100 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramClassification.hpp +96 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramLead.hpp +76 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +135 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramSamplesWithAnchorResponse.hpp +81 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramSymptomsStatus.hpp +80 -0
- package/nitrogen/generated/shared/c++/ElectrocardiogramVoltage.hpp +76 -0
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridElectrocardiogramModuleSpec.hpp +76 -0
- package/package.json +1 -1
- package/src/healthkit.ios.ts +9 -0
- package/src/healthkit.ts +16 -0
- package/src/modules.ts +6 -0
- package/src/specs/ElectrocardiogramModule.nitro.ts +18 -0
- package/src/types/ElectrocardiogramSample.ts +60 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ElectrocardiogramSample.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 `ElectrocardiogramSample`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ElectrocardiogramSample = margelo.nitro.healthkit.ElectrocardiogramSample
|
|
14
|
+
|
|
15
|
+
public extension ElectrocardiogramSample {
|
|
16
|
+
private typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ElectrocardiogramSample`.
|
|
20
|
+
*/
|
|
21
|
+
init(uuid: String, device: Device?, startDate: Date, endDate: Date, classification: ElectrocardiogramClassification, symptomsStatus: ElectrocardiogramSymptomsStatus, averageHeartRateBpm: Double?, samplingFrequencyHz: Double?, numberOfVoltageMeasurements: Double, algorithmVersion: String?, voltages: [ElectrocardiogramVoltage]?, metadata: AnyMap?, sourceRevision: SourceRevision?) {
|
|
22
|
+
self.init(std.string(uuid), { () -> bridge.std__optional_Device_ in
|
|
23
|
+
if let __unwrappedValue = device {
|
|
24
|
+
return bridge.create_std__optional_Device_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), startDate.toCpp(), endDate.toCpp(), classification, symptomsStatus, { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = averageHeartRateBpm {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
35
|
+
if let __unwrappedValue = samplingFrequencyHz {
|
|
36
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), numberOfVoltageMeasurements, { () -> bridge.std__optional_std__string_ in
|
|
41
|
+
if let __unwrappedValue = algorithmVersion {
|
|
42
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_std__vector_ElectrocardiogramVoltage__ in
|
|
47
|
+
if let __unwrappedValue = voltages {
|
|
48
|
+
return bridge.create_std__optional_std__vector_ElectrocardiogramVoltage__({ () -> bridge.std__vector_ElectrocardiogramVoltage_ in
|
|
49
|
+
var __vector = bridge.create_std__vector_ElectrocardiogramVoltage_(__unwrappedValue.count)
|
|
50
|
+
for __item in __unwrappedValue {
|
|
51
|
+
__vector.push_back(__item)
|
|
52
|
+
}
|
|
53
|
+
return __vector
|
|
54
|
+
}())
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_std__shared_ptr_AnyMap__ in
|
|
59
|
+
if let __unwrappedValue = metadata {
|
|
60
|
+
return bridge.create_std__optional_std__shared_ptr_AnyMap__(__unwrappedValue.cppPart)
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_SourceRevision_ in
|
|
65
|
+
if let __unwrappedValue = sourceRevision {
|
|
66
|
+
return bridge.create_std__optional_SourceRevision_(__unwrappedValue)
|
|
67
|
+
} else {
|
|
68
|
+
return .init()
|
|
69
|
+
}
|
|
70
|
+
}())
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
var uuid: String {
|
|
74
|
+
@inline(__always)
|
|
75
|
+
get {
|
|
76
|
+
return String(self.__uuid)
|
|
77
|
+
}
|
|
78
|
+
@inline(__always)
|
|
79
|
+
set {
|
|
80
|
+
self.__uuid = std.string(newValue)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var device: Device? {
|
|
85
|
+
@inline(__always)
|
|
86
|
+
get {
|
|
87
|
+
return { () -> Device? in
|
|
88
|
+
if bridge.has_value_std__optional_Device_(self.__device) {
|
|
89
|
+
let __unwrapped = bridge.get_std__optional_Device_(self.__device)
|
|
90
|
+
return __unwrapped
|
|
91
|
+
} else {
|
|
92
|
+
return nil
|
|
93
|
+
}
|
|
94
|
+
}()
|
|
95
|
+
}
|
|
96
|
+
@inline(__always)
|
|
97
|
+
set {
|
|
98
|
+
self.__device = { () -> bridge.std__optional_Device_ in
|
|
99
|
+
if let __unwrappedValue = newValue {
|
|
100
|
+
return bridge.create_std__optional_Device_(__unwrappedValue)
|
|
101
|
+
} else {
|
|
102
|
+
return .init()
|
|
103
|
+
}
|
|
104
|
+
}()
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var startDate: Date {
|
|
109
|
+
@inline(__always)
|
|
110
|
+
get {
|
|
111
|
+
return Date(fromChrono: self.__startDate)
|
|
112
|
+
}
|
|
113
|
+
@inline(__always)
|
|
114
|
+
set {
|
|
115
|
+
self.__startDate = newValue.toCpp()
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var endDate: Date {
|
|
120
|
+
@inline(__always)
|
|
121
|
+
get {
|
|
122
|
+
return Date(fromChrono: self.__endDate)
|
|
123
|
+
}
|
|
124
|
+
@inline(__always)
|
|
125
|
+
set {
|
|
126
|
+
self.__endDate = newValue.toCpp()
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
var classification: ElectrocardiogramClassification {
|
|
131
|
+
@inline(__always)
|
|
132
|
+
get {
|
|
133
|
+
return self.__classification
|
|
134
|
+
}
|
|
135
|
+
@inline(__always)
|
|
136
|
+
set {
|
|
137
|
+
self.__classification = newValue
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
var symptomsStatus: ElectrocardiogramSymptomsStatus {
|
|
142
|
+
@inline(__always)
|
|
143
|
+
get {
|
|
144
|
+
return self.__symptomsStatus
|
|
145
|
+
}
|
|
146
|
+
@inline(__always)
|
|
147
|
+
set {
|
|
148
|
+
self.__symptomsStatus = newValue
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
var averageHeartRateBpm: Double? {
|
|
153
|
+
@inline(__always)
|
|
154
|
+
get {
|
|
155
|
+
return self.__averageHeartRateBpm.value
|
|
156
|
+
}
|
|
157
|
+
@inline(__always)
|
|
158
|
+
set {
|
|
159
|
+
self.__averageHeartRateBpm = { () -> bridge.std__optional_double_ in
|
|
160
|
+
if let __unwrappedValue = newValue {
|
|
161
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
162
|
+
} else {
|
|
163
|
+
return .init()
|
|
164
|
+
}
|
|
165
|
+
}()
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
var samplingFrequencyHz: Double? {
|
|
170
|
+
@inline(__always)
|
|
171
|
+
get {
|
|
172
|
+
return self.__samplingFrequencyHz.value
|
|
173
|
+
}
|
|
174
|
+
@inline(__always)
|
|
175
|
+
set {
|
|
176
|
+
self.__samplingFrequencyHz = { () -> bridge.std__optional_double_ in
|
|
177
|
+
if let __unwrappedValue = newValue {
|
|
178
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
179
|
+
} else {
|
|
180
|
+
return .init()
|
|
181
|
+
}
|
|
182
|
+
}()
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
var numberOfVoltageMeasurements: Double {
|
|
187
|
+
@inline(__always)
|
|
188
|
+
get {
|
|
189
|
+
return self.__numberOfVoltageMeasurements
|
|
190
|
+
}
|
|
191
|
+
@inline(__always)
|
|
192
|
+
set {
|
|
193
|
+
self.__numberOfVoltageMeasurements = newValue
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
var algorithmVersion: String? {
|
|
198
|
+
@inline(__always)
|
|
199
|
+
get {
|
|
200
|
+
return { () -> String? in
|
|
201
|
+
if bridge.has_value_std__optional_std__string_(self.__algorithmVersion) {
|
|
202
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__algorithmVersion)
|
|
203
|
+
return String(__unwrapped)
|
|
204
|
+
} else {
|
|
205
|
+
return nil
|
|
206
|
+
}
|
|
207
|
+
}()
|
|
208
|
+
}
|
|
209
|
+
@inline(__always)
|
|
210
|
+
set {
|
|
211
|
+
self.__algorithmVersion = { () -> bridge.std__optional_std__string_ in
|
|
212
|
+
if let __unwrappedValue = newValue {
|
|
213
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
214
|
+
} else {
|
|
215
|
+
return .init()
|
|
216
|
+
}
|
|
217
|
+
}()
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
var voltages: [ElectrocardiogramVoltage]? {
|
|
222
|
+
@inline(__always)
|
|
223
|
+
get {
|
|
224
|
+
return { () -> [ElectrocardiogramVoltage]? in
|
|
225
|
+
if bridge.has_value_std__optional_std__vector_ElectrocardiogramVoltage__(self.__voltages) {
|
|
226
|
+
let __unwrapped = bridge.get_std__optional_std__vector_ElectrocardiogramVoltage__(self.__voltages)
|
|
227
|
+
return __unwrapped.map({ __item in __item })
|
|
228
|
+
} else {
|
|
229
|
+
return nil
|
|
230
|
+
}
|
|
231
|
+
}()
|
|
232
|
+
}
|
|
233
|
+
@inline(__always)
|
|
234
|
+
set {
|
|
235
|
+
self.__voltages = { () -> bridge.std__optional_std__vector_ElectrocardiogramVoltage__ in
|
|
236
|
+
if let __unwrappedValue = newValue {
|
|
237
|
+
return bridge.create_std__optional_std__vector_ElectrocardiogramVoltage__({ () -> bridge.std__vector_ElectrocardiogramVoltage_ in
|
|
238
|
+
var __vector = bridge.create_std__vector_ElectrocardiogramVoltage_(__unwrappedValue.count)
|
|
239
|
+
for __item in __unwrappedValue {
|
|
240
|
+
__vector.push_back(__item)
|
|
241
|
+
}
|
|
242
|
+
return __vector
|
|
243
|
+
}())
|
|
244
|
+
} else {
|
|
245
|
+
return .init()
|
|
246
|
+
}
|
|
247
|
+
}()
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
var metadata: AnyMap? {
|
|
252
|
+
@inline(__always)
|
|
253
|
+
get {
|
|
254
|
+
return { () -> AnyMap? in
|
|
255
|
+
if bridge.has_value_std__optional_std__shared_ptr_AnyMap__(self.__metadata) {
|
|
256
|
+
let __unwrapped = bridge.get_std__optional_std__shared_ptr_AnyMap__(self.__metadata)
|
|
257
|
+
return AnyMap(withCppPart: __unwrapped)
|
|
258
|
+
} else {
|
|
259
|
+
return nil
|
|
260
|
+
}
|
|
261
|
+
}()
|
|
262
|
+
}
|
|
263
|
+
@inline(__always)
|
|
264
|
+
set {
|
|
265
|
+
self.__metadata = { () -> bridge.std__optional_std__shared_ptr_AnyMap__ in
|
|
266
|
+
if let __unwrappedValue = newValue {
|
|
267
|
+
return bridge.create_std__optional_std__shared_ptr_AnyMap__(__unwrappedValue.cppPart)
|
|
268
|
+
} else {
|
|
269
|
+
return .init()
|
|
270
|
+
}
|
|
271
|
+
}()
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
var sourceRevision: SourceRevision? {
|
|
276
|
+
@inline(__always)
|
|
277
|
+
get {
|
|
278
|
+
return { () -> SourceRevision? in
|
|
279
|
+
if bridge.has_value_std__optional_SourceRevision_(self.__sourceRevision) {
|
|
280
|
+
let __unwrapped = bridge.get_std__optional_SourceRevision_(self.__sourceRevision)
|
|
281
|
+
return __unwrapped
|
|
282
|
+
} else {
|
|
283
|
+
return nil
|
|
284
|
+
}
|
|
285
|
+
}()
|
|
286
|
+
}
|
|
287
|
+
@inline(__always)
|
|
288
|
+
set {
|
|
289
|
+
self.__sourceRevision = { () -> bridge.std__optional_SourceRevision_ in
|
|
290
|
+
if let __unwrappedValue = newValue {
|
|
291
|
+
return bridge.create_std__optional_SourceRevision_(__unwrappedValue)
|
|
292
|
+
} else {
|
|
293
|
+
return .init()
|
|
294
|
+
}
|
|
295
|
+
}()
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ElectrocardiogramSamplesWithAnchorResponse.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 `ElectrocardiogramSamplesWithAnchorResponse`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ElectrocardiogramSamplesWithAnchorResponse = margelo.nitro.healthkit.ElectrocardiogramSamplesWithAnchorResponse
|
|
14
|
+
|
|
15
|
+
public extension ElectrocardiogramSamplesWithAnchorResponse {
|
|
16
|
+
private typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ElectrocardiogramSamplesWithAnchorResponse`.
|
|
20
|
+
*/
|
|
21
|
+
init(samples: [ElectrocardiogramSample], deletedSamples: [DeletedSample], newAnchor: String) {
|
|
22
|
+
self.init({ () -> bridge.std__vector_ElectrocardiogramSample_ in
|
|
23
|
+
var __vector = bridge.create_std__vector_ElectrocardiogramSample_(samples.count)
|
|
24
|
+
for __item in samples {
|
|
25
|
+
__vector.push_back(__item)
|
|
26
|
+
}
|
|
27
|
+
return __vector
|
|
28
|
+
}(), { () -> bridge.std__vector_DeletedSample_ in
|
|
29
|
+
var __vector = bridge.create_std__vector_DeletedSample_(deletedSamples.count)
|
|
30
|
+
for __item in deletedSamples {
|
|
31
|
+
__vector.push_back(__item)
|
|
32
|
+
}
|
|
33
|
+
return __vector
|
|
34
|
+
}(), std.string(newAnchor))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var samples: [ElectrocardiogramSample] {
|
|
38
|
+
@inline(__always)
|
|
39
|
+
get {
|
|
40
|
+
return self.__samples.map({ __item in __item })
|
|
41
|
+
}
|
|
42
|
+
@inline(__always)
|
|
43
|
+
set {
|
|
44
|
+
self.__samples = { () -> bridge.std__vector_ElectrocardiogramSample_ in
|
|
45
|
+
var __vector = bridge.create_std__vector_ElectrocardiogramSample_(newValue.count)
|
|
46
|
+
for __item in newValue {
|
|
47
|
+
__vector.push_back(__item)
|
|
48
|
+
}
|
|
49
|
+
return __vector
|
|
50
|
+
}()
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var deletedSamples: [DeletedSample] {
|
|
55
|
+
@inline(__always)
|
|
56
|
+
get {
|
|
57
|
+
return self.__deletedSamples.map({ __item in __item })
|
|
58
|
+
}
|
|
59
|
+
@inline(__always)
|
|
60
|
+
set {
|
|
61
|
+
self.__deletedSamples = { () -> bridge.std__vector_DeletedSample_ in
|
|
62
|
+
var __vector = bridge.create_std__vector_DeletedSample_(newValue.count)
|
|
63
|
+
for __item in newValue {
|
|
64
|
+
__vector.push_back(__item)
|
|
65
|
+
}
|
|
66
|
+
return __vector
|
|
67
|
+
}()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
var newAnchor: String {
|
|
72
|
+
@inline(__always)
|
|
73
|
+
get {
|
|
74
|
+
return String(self.__newAnchor)
|
|
75
|
+
}
|
|
76
|
+
@inline(__always)
|
|
77
|
+
set {
|
|
78
|
+
self.__newAnchor = std.string(newValue)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ElectrocardiogramSymptomsStatus.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
|
+
/**
|
|
9
|
+
* Represents the JS union `ElectrocardiogramSymptomsStatus`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias ElectrocardiogramSymptomsStatus = margelo.nitro.healthkit.ElectrocardiogramSymptomsStatus
|
|
12
|
+
|
|
13
|
+
public extension ElectrocardiogramSymptomsStatus {
|
|
14
|
+
/**
|
|
15
|
+
* Get a ElectrocardiogramSymptomsStatus for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "notSet":
|
|
21
|
+
self = .notset
|
|
22
|
+
case "none":
|
|
23
|
+
self = .none
|
|
24
|
+
case "present":
|
|
25
|
+
self = .present
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this ElectrocardiogramSymptomsStatus represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .notset:
|
|
37
|
+
return "notSet"
|
|
38
|
+
case .none:
|
|
39
|
+
return "none"
|
|
40
|
+
case .present:
|
|
41
|
+
return "present"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ElectrocardiogramVoltage.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 `ElectrocardiogramVoltage`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ElectrocardiogramVoltage = margelo.nitro.healthkit.ElectrocardiogramVoltage
|
|
14
|
+
|
|
15
|
+
public extension ElectrocardiogramVoltage {
|
|
16
|
+
private typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ElectrocardiogramVoltage`.
|
|
20
|
+
*/
|
|
21
|
+
init(timeSinceSampleStart: Double, voltage: Double, lead: ElectrocardiogramLead) {
|
|
22
|
+
self.init(timeSinceSampleStart, voltage, lead)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var timeSinceSampleStart: Double {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__timeSinceSampleStart
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__timeSinceSampleStart = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var voltage: Double {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__voltage
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__voltage = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var lead: ElectrocardiogramLead {
|
|
48
|
+
@inline(__always)
|
|
49
|
+
get {
|
|
50
|
+
return self.__lead
|
|
51
|
+
}
|
|
52
|
+
@inline(__always)
|
|
53
|
+
set {
|
|
54
|
+
self.__lead = newValue
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
package/nitrogen/generated/ios/swift/Func_void_ElectrocardiogramSamplesWithAnchorResponse.swift
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_ElectrocardiogramSamplesWithAnchorResponse.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
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: ElectrocardiogramSamplesWithAnchorResponse) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_ElectrocardiogramSamplesWithAnchorResponse {
|
|
16
|
+
public typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: ElectrocardiogramSamplesWithAnchorResponse) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: ElectrocardiogramSamplesWithAnchorResponse) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: ElectrocardiogramSamplesWithAnchorResponse) -> Void {
|
|
26
|
+
self.closure(value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_ElectrocardiogramSamplesWithAnchorResponse`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_ElectrocardiogramSamplesWithAnchorResponse>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_ElectrocardiogramSamplesWithAnchorResponse {
|
|
45
|
+
return Unmanaged<Func_void_ElectrocardiogramSamplesWithAnchorResponse>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__vector_ElectrocardiogramSample_.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
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: [ElectrocardiogramSample]) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_std__vector_ElectrocardiogramSample_ {
|
|
16
|
+
public typealias bridge = margelo.nitro.healthkit.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: [ElectrocardiogramSample]) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: [ElectrocardiogramSample]) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: bridge.std__vector_ElectrocardiogramSample_) -> Void {
|
|
26
|
+
self.closure(value.map({ __item in __item }))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_std__vector_ElectrocardiogramSample_`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_ElectrocardiogramSample_>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_ElectrocardiogramSample_ {
|
|
45
|
+
return Unmanaged<Func_void_std__vector_ElectrocardiogramSample_>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridElectrocardiogramModuleSpec.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/// See ``HybridElectrocardiogramModuleSpec``
|
|
12
|
+
public protocol HybridElectrocardiogramModuleSpec_protocol: HybridObject {
|
|
13
|
+
// Properties
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// Methods
|
|
17
|
+
func queryElectrocardiogramSamples(options: ECGQueryOptionsWithSortOrder?) throws -> Promise<[ElectrocardiogramSample]>
|
|
18
|
+
func queryElectrocardiogramSamplesWithAnchor(options: ECGQueryOptionsWithAnchor) throws -> Promise<ElectrocardiogramSamplesWithAnchorResponse>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/// See ``HybridElectrocardiogramModuleSpec``
|
|
22
|
+
open class HybridElectrocardiogramModuleSpec_base {
|
|
23
|
+
private weak var cxxWrapper: HybridElectrocardiogramModuleSpec_cxx? = nil
|
|
24
|
+
public init() { }
|
|
25
|
+
public func getCxxWrapper() -> HybridElectrocardiogramModuleSpec_cxx {
|
|
26
|
+
#if DEBUG
|
|
27
|
+
guard self is HybridElectrocardiogramModuleSpec else {
|
|
28
|
+
fatalError("`self` is not a `HybridElectrocardiogramModuleSpec`! Did you accidentally inherit from `HybridElectrocardiogramModuleSpec_base` instead of `HybridElectrocardiogramModuleSpec`?")
|
|
29
|
+
}
|
|
30
|
+
#endif
|
|
31
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
32
|
+
return cxxWrapper
|
|
33
|
+
} else {
|
|
34
|
+
let cxxWrapper = HybridElectrocardiogramModuleSpec_cxx(self as! HybridElectrocardiogramModuleSpec)
|
|
35
|
+
self.cxxWrapper = cxxWrapper
|
|
36
|
+
return cxxWrapper
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A Swift base-protocol representing the ElectrocardiogramModule HybridObject.
|
|
43
|
+
* Implement this protocol to create Swift-based instances of ElectrocardiogramModule.
|
|
44
|
+
* ```swift
|
|
45
|
+
* class HybridElectrocardiogramModule : HybridElectrocardiogramModuleSpec {
|
|
46
|
+
* // ...
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
public typealias HybridElectrocardiogramModuleSpec = HybridElectrocardiogramModuleSpec_protocol & HybridElectrocardiogramModuleSpec_base
|