///
/// UnistylesNativeMiniRuntime.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(<NitroModules/JSIConverter.hpp>)
#include <NitroModules/JSIConverter.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/NitroDefines.hpp>)
#include <NitroModules/NitroDefines.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/JSIHelpers.hpp>)
#include <NitroModules/JSIHelpers.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
#include <NitroModules/PropNameIDCache.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `ColorScheme` to properly resolve imports.
namespace margelo::nitro::unistyles { enum class ColorScheme; }
// Forward declaration of `Dimensions` to properly resolve imports.
namespace margelo::nitro::unistyles { struct Dimensions; }
// Forward declaration of `Insets` to properly resolve imports.
namespace margelo::nitro::unistyles { struct Insets; }

#include "ColorScheme.hpp"
#include "Dimensions.hpp"
#include <string>
#include "Insets.hpp"

namespace margelo::nitro::unistyles {

  /**
   * A struct which can be represented as a JavaScript object (UnistylesNativeMiniRuntime).
   */
  struct UnistylesNativeMiniRuntime final {
  public:
    ColorScheme colorScheme     SWIFT_PRIVATE;
    Dimensions screen     SWIFT_PRIVATE;
    std::string contentSizeCategory     SWIFT_PRIVATE;
    Insets insets     SWIFT_PRIVATE;
    double pixelRatio     SWIFT_PRIVATE;
    double fontScale     SWIFT_PRIVATE;
    bool rtl     SWIFT_PRIVATE;
    Dimensions statusBar     SWIFT_PRIVATE;
    Dimensions navigationBar     SWIFT_PRIVATE;
    bool isPortrait     SWIFT_PRIVATE;
    bool isLandscape     SWIFT_PRIVATE;

  public:
    UnistylesNativeMiniRuntime() = default;
    explicit UnistylesNativeMiniRuntime(ColorScheme colorScheme, Dimensions screen, std::string contentSizeCategory, Insets insets, double pixelRatio, double fontScale, bool rtl, Dimensions statusBar, Dimensions navigationBar, bool isPortrait, bool isLandscape): colorScheme(colorScheme), screen(screen), contentSizeCategory(contentSizeCategory), insets(insets), pixelRatio(pixelRatio), fontScale(fontScale), rtl(rtl), statusBar(statusBar), navigationBar(navigationBar), isPortrait(isPortrait), isLandscape(isLandscape) {}

  public:
    friend bool operator==(const UnistylesNativeMiniRuntime& lhs, const UnistylesNativeMiniRuntime& rhs) = default;
  };

} // namespace margelo::nitro::unistyles

namespace margelo::nitro {

  // C++ UnistylesNativeMiniRuntime <> JS UnistylesNativeMiniRuntime (object)
  template <>
  struct JSIConverter<margelo::nitro::unistyles::UnistylesNativeMiniRuntime> final {
    static inline margelo::nitro::unistyles::UnistylesNativeMiniRuntime fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::unistyles::UnistylesNativeMiniRuntime(
        JSIConverter<margelo::nitro::unistyles::ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "colorScheme"))),
        JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "screen"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory"))),
        JSIConverter<margelo::nitro::unistyles::Insets>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "insets"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontScale"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rtl"))),
        JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "statusBar"))),
        JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "navigationBar"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPortrait"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isLandscape")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unistyles::UnistylesNativeMiniRuntime& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "colorScheme"), JSIConverter<margelo::nitro::unistyles::ColorScheme>::toJSI(runtime, arg.colorScheme));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "screen"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.screen));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory"), JSIConverter<std::string>::toJSI(runtime, arg.contentSizeCategory));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "insets"), JSIConverter<margelo::nitro::unistyles::Insets>::toJSI(runtime, arg.insets));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio"), JSIConverter<double>::toJSI(runtime, arg.pixelRatio));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "fontScale"), JSIConverter<double>::toJSI(runtime, arg.fontScale));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "rtl"), JSIConverter<bool>::toJSI(runtime, arg.rtl));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "statusBar"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.statusBar));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "navigationBar"), JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.navigationBar));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "isPortrait"), JSIConverter<bool>::toJSI(runtime, arg.isPortrait));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "isLandscape"), JSIConverter<bool>::toJSI(runtime, arg.isLandscape));
      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<margelo::nitro::unistyles::ColorScheme>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "colorScheme")))) return false;
      if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "screen")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentSizeCategory")))) return false;
      if (!JSIConverter<margelo::nitro::unistyles::Insets>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "insets")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pixelRatio")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fontScale")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rtl")))) return false;
      if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "statusBar")))) return false;
      if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "navigationBar")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPortrait")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isLandscape")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
