/// /// NativeSignalQualityResult.hpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © Marc Rousavy @ Margelo /// #pragma once #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #include #include #include namespace margelo::nitro::haptika::ppg { /** * A struct which can be represented as a JavaScript object (NativeSignalQualityResult). */ struct NativeSignalQualityResult final { public: double score SWIFT_PRIVATE; std::string level SWIFT_PRIVATE; double usableDurationSeconds SWIFT_PRIVATE; double droppedFrameRatio SWIFT_PRIVATE; double saturationRatio SWIFT_PRIVATE; double rejectedIntervalRatio SWIFT_PRIVATE; std::optional signalToNoiseRatio SWIFT_PRIVATE; double motionArtifactRatio SWIFT_PRIVATE; double methodAgreementScore SWIFT_PRIVATE; double timestampJitterRatio SWIFT_PRIVATE; double longestGapSeconds SWIFT_PRIVATE; std::vector issues SWIFT_PRIVATE; public: NativeSignalQualityResult() = default; explicit NativeSignalQualityResult(double score, std::string level, double usableDurationSeconds, double droppedFrameRatio, double saturationRatio, double rejectedIntervalRatio, std::optional signalToNoiseRatio, double motionArtifactRatio, double methodAgreementScore, double timestampJitterRatio, double longestGapSeconds, std::vector issues): score(score), level(level), usableDurationSeconds(usableDurationSeconds), droppedFrameRatio(droppedFrameRatio), saturationRatio(saturationRatio), rejectedIntervalRatio(rejectedIntervalRatio), signalToNoiseRatio(signalToNoiseRatio), motionArtifactRatio(motionArtifactRatio), methodAgreementScore(methodAgreementScore), timestampJitterRatio(timestampJitterRatio), longestGapSeconds(longestGapSeconds), issues(issues) {} public: friend bool operator==(const NativeSignalQualityResult& lhs, const NativeSignalQualityResult& rhs) = default; }; } // namespace margelo::nitro::haptika::ppg namespace margelo::nitro { // C++ NativeSignalQualityResult <> JS NativeSignalQualityResult (object) template <> struct JSIConverter final { static inline margelo::nitro::haptika::ppg::NativeSignalQualityResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); return margelo::nitro::haptika::ppg::NativeSignalQualityResult( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "score"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "level"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "usableDurationSeconds"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "droppedFrameRatio"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "saturationRatio"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rejectedIntervalRatio"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signalToNoiseRatio"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "motionArtifactRatio"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "methodAgreementScore"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timestampJitterRatio"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "longestGapSeconds"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "issues"))) ); } static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::haptika::ppg::NativeSignalQualityResult& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, PropNameIDCache::get(runtime, "score"), JSIConverter::toJSI(runtime, arg.score)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "level"), JSIConverter::toJSI(runtime, arg.level)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "usableDurationSeconds"), JSIConverter::toJSI(runtime, arg.usableDurationSeconds)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "droppedFrameRatio"), JSIConverter::toJSI(runtime, arg.droppedFrameRatio)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "saturationRatio"), JSIConverter::toJSI(runtime, arg.saturationRatio)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "rejectedIntervalRatio"), JSIConverter::toJSI(runtime, arg.rejectedIntervalRatio)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "signalToNoiseRatio"), JSIConverter>::toJSI(runtime, arg.signalToNoiseRatio)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "motionArtifactRatio"), JSIConverter::toJSI(runtime, arg.motionArtifactRatio)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "methodAgreementScore"), JSIConverter::toJSI(runtime, arg.methodAgreementScore)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "timestampJitterRatio"), JSIConverter::toJSI(runtime, arg.timestampJitterRatio)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "longestGapSeconds"), JSIConverter::toJSI(runtime, arg.longestGapSeconds)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "issues"), JSIConverter>::toJSI(runtime, arg.issues)); return obj; } static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { if (!value.isObject()) { return false; } jsi::Object obj = value.getObject(runtime); if (!nitro::isPlainObject(runtime, obj)) { return false; } if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "score")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "level")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "usableDurationSeconds")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "droppedFrameRatio")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "saturationRatio")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rejectedIntervalRatio")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signalToNoiseRatio")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "motionArtifactRatio")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "methodAgreementScore")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timestampJitterRatio")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "longestGapSeconds")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "issues")))) return false; return true; } }; } // namespace margelo::nitro