///
/// LDP_ConfigParams.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 `LDP_CustomStyle` to properly resolve imports.
namespace margelo::nitro::lunardatepicker { struct LDP_CustomStyle; }
// Forward declaration of `LDP_CustomLanguage` to properly resolve imports.
namespace margelo::nitro::lunardatepicker { struct LDP_CustomLanguage; }
// Forward declaration of `LDP_NativeAssetSource` to properly resolve imports.
namespace margelo::nitro::lunardatepicker { struct LDP_NativeAssetSource; }

#include <string>
#include "LDP_CustomStyle.hpp"
#include <unordered_map>
#include "LDP_CustomLanguage.hpp"
#include "LDP_NativeAssetSource.hpp"

namespace margelo::nitro::lunardatepicker {

  /**
   * A struct which can be represented as a JavaScript object (LDP_ConfigParams).
   */
  struct LDP_ConfigParams final {
  public:
    std::unordered_map<std::string, LDP_CustomStyle> themes     SWIFT_PRIVATE;
    std::unordered_map<std::string, LDP_CustomLanguage> languages     SWIFT_PRIVATE;
    double yearRangeOffset     SWIFT_PRIVATE;
    double timeZoneOffset     SWIFT_PRIVATE;
    bool showSubmitButton     SWIFT_PRIVATE;
    LDP_NativeAssetSource fromImage     SWIFT_PRIVATE;
    LDP_NativeAssetSource toImage     SWIFT_PRIVATE;
    LDP_NativeAssetSource closeImage     SWIFT_PRIVATE;

  public:
    LDP_ConfigParams() = default;
    explicit LDP_ConfigParams(std::unordered_map<std::string, LDP_CustomStyle> themes, std::unordered_map<std::string, LDP_CustomLanguage> languages, double yearRangeOffset, double timeZoneOffset, bool showSubmitButton, LDP_NativeAssetSource fromImage, LDP_NativeAssetSource toImage, LDP_NativeAssetSource closeImage): themes(themes), languages(languages), yearRangeOffset(yearRangeOffset), timeZoneOffset(timeZoneOffset), showSubmitButton(showSubmitButton), fromImage(fromImage), toImage(toImage), closeImage(closeImage) {}

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

} // namespace margelo::nitro::lunardatepicker

namespace margelo::nitro {

  // C++ LDP_ConfigParams <> JS LDP_ConfigParams (object)
  template <>
  struct JSIConverter<margelo::nitro::lunardatepicker::LDP_ConfigParams> final {
    static inline margelo::nitro::lunardatepicker::LDP_ConfigParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::lunardatepicker::LDP_ConfigParams(
        JSIConverter<std::unordered_map<std::string, margelo::nitro::lunardatepicker::LDP_CustomStyle>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "themes"))),
        JSIConverter<std::unordered_map<std::string, margelo::nitro::lunardatepicker::LDP_CustomLanguage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "languages"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "yearRangeOffset"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timeZoneOffset"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "showSubmitButton"))),
        JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fromImage"))),
        JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "toImage"))),
        JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "closeImage")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::lunardatepicker::LDP_ConfigParams& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "themes"), JSIConverter<std::unordered_map<std::string, margelo::nitro::lunardatepicker::LDP_CustomStyle>>::toJSI(runtime, arg.themes));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "languages"), JSIConverter<std::unordered_map<std::string, margelo::nitro::lunardatepicker::LDP_CustomLanguage>>::toJSI(runtime, arg.languages));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "yearRangeOffset"), JSIConverter<double>::toJSI(runtime, arg.yearRangeOffset));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "timeZoneOffset"), JSIConverter<double>::toJSI(runtime, arg.timeZoneOffset));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "showSubmitButton"), JSIConverter<bool>::toJSI(runtime, arg.showSubmitButton));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "fromImage"), JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::toJSI(runtime, arg.fromImage));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "toImage"), JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::toJSI(runtime, arg.toImage));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "closeImage"), JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::toJSI(runtime, arg.closeImage));
      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<std::unordered_map<std::string, margelo::nitro::lunardatepicker::LDP_CustomStyle>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "themes")))) return false;
      if (!JSIConverter<std::unordered_map<std::string, margelo::nitro::lunardatepicker::LDP_CustomLanguage>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "languages")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "yearRangeOffset")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timeZoneOffset")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "showSubmitButton")))) return false;
      if (!JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fromImage")))) return false;
      if (!JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "toImage")))) return false;
      if (!JSIConverter<margelo::nitro::lunardatepicker::LDP_NativeAssetSource>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "closeImage")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
