feat: implement Haptika PPG and Watch V1
This commit is contained in:
Generated
+77
@@ -0,0 +1,77 @@
|
||||
///
|
||||
/// NativeHealthKitContext.swift
|
||||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
||||
/// https://github.com/mrousavy/nitro
|
||||
/// Copyright © Marc Rousavy @ Margelo
|
||||
///
|
||||
|
||||
import NitroModules
|
||||
|
||||
/**
|
||||
* Represents an instance of `NativeHealthKitContext`, backed by a C++ struct.
|
||||
*/
|
||||
public typealias NativeHealthKitContext = margelo.nitro.haptika.ppg.NativeHealthKitContext
|
||||
|
||||
public extension NativeHealthKitContext {
|
||||
private typealias bridge = margelo.nitro.haptika.ppg.bridge.swift
|
||||
|
||||
/**
|
||||
* Create a new instance of `NativeHealthKitContext`.
|
||||
*/
|
||||
init(available: Bool, authorized: Bool, latestRestingHeartRate: NativeHealthMetricSample?, latestHrvSdnn: NativeHealthMetricSample?, recentHeartRateSamples: [NativeHealthMetricSample], contextConfidence: Double, fetchedAt: String) {
|
||||
self.init(available, authorized, { () -> bridge.std__optional_NativeHealthMetricSample_ in
|
||||
if let __unwrappedValue = latestRestingHeartRate {
|
||||
return bridge.create_std__optional_NativeHealthMetricSample_(__unwrappedValue)
|
||||
} else {
|
||||
return .init()
|
||||
}
|
||||
}(), { () -> bridge.std__optional_NativeHealthMetricSample_ in
|
||||
if let __unwrappedValue = latestHrvSdnn {
|
||||
return bridge.create_std__optional_NativeHealthMetricSample_(__unwrappedValue)
|
||||
} else {
|
||||
return .init()
|
||||
}
|
||||
}(), { () -> bridge.std__vector_NativeHealthMetricSample_ in
|
||||
var __vector = bridge.create_std__vector_NativeHealthMetricSample_(recentHeartRateSamples.count)
|
||||
for __item in recentHeartRateSamples {
|
||||
__vector.push_back(__item)
|
||||
}
|
||||
return __vector
|
||||
}(), contextConfidence, std.string(fetchedAt))
|
||||
}
|
||||
|
||||
@inline(__always)
|
||||
var available: Bool {
|
||||
return self.__available
|
||||
}
|
||||
|
||||
@inline(__always)
|
||||
var authorized: Bool {
|
||||
return self.__authorized
|
||||
}
|
||||
|
||||
@inline(__always)
|
||||
var latestRestingHeartRate: NativeHealthMetricSample? {
|
||||
return self.__latestRestingHeartRate.value
|
||||
}
|
||||
|
||||
@inline(__always)
|
||||
var latestHrvSdnn: NativeHealthMetricSample? {
|
||||
return self.__latestHrvSdnn.value
|
||||
}
|
||||
|
||||
@inline(__always)
|
||||
var recentHeartRateSamples: [NativeHealthMetricSample] {
|
||||
return self.__recentHeartRateSamples.map({ __item in __item })
|
||||
}
|
||||
|
||||
@inline(__always)
|
||||
var contextConfidence: Double {
|
||||
return self.__contextConfidence
|
||||
}
|
||||
|
||||
@inline(__always)
|
||||
var fetchedAt: String {
|
||||
return String(self.__fetchedAt)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user