/// /// JassubAssets.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 namespace margelo::nitro::omni { /** * A struct which can be represented as a JavaScript object (JassubAssets). */ struct JassubAssets final { public: std::optional workerUrl SWIFT_PRIVATE; std::optional wasmUrl SWIFT_PRIVATE; std::optional modernWasmUrl SWIFT_PRIVATE; std::optional fontUrl SWIFT_PRIVATE; public: JassubAssets() = default; explicit JassubAssets(std::optional workerUrl, std::optional wasmUrl, std::optional modernWasmUrl, std::optional fontUrl): workerUrl(workerUrl), wasmUrl(wasmUrl), modernWasmUrl(modernWasmUrl), fontUrl(fontUrl) {} public: friend bool operator==(const JassubAssets& lhs, const JassubAssets& rhs) = default; }; } // namespace margelo::nitro::omni namespace margelo::nitro { // C++ JassubAssets <> JS JassubAssets (object) template <> struct JSIConverter final { static inline margelo::nitro::omni::JassubAssets fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); return margelo::nitro::omni::JassubAssets( JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "workerUrl"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "wasmUrl"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "modernWasmUrl"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontUrl"))) ); } static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::omni::JassubAssets& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, PropNameIDCache::get(runtime, "workerUrl"), JSIConverter>::toJSI(runtime, arg.workerUrl)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "wasmUrl"), JSIConverter>::toJSI(runtime, arg.wasmUrl)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "modernWasmUrl"), JSIConverter>::toJSI(runtime, arg.modernWasmUrl)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "fontUrl"), JSIConverter>::toJSI(runtime, arg.fontUrl)); 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, "workerUrl")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "wasmUrl")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "modernWasmUrl")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontUrl")))) return false; return true; } }; } // namespace margelo::nitro