///
/// LDP_CustomLanguage.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 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



#include <vector>
#include <string>

namespace margelo::nitro::lunardatepicker {

  /**
   * A struct which can be represented as a JavaScript object (LDP_CustomLanguage).
   */
  struct LDP_CustomLanguage {
  public:
    std::vector<std::string> weekdayNames     SWIFT_PRIVATE;
    std::vector<std::string> monthNames     SWIFT_PRIVATE;

  public:
    LDP_CustomLanguage() = default;
    explicit LDP_CustomLanguage(std::vector<std::string> weekdayNames, std::vector<std::string> monthNames): weekdayNames(weekdayNames), monthNames(monthNames) {}
  };

} // namespace margelo::nitro::lunardatepicker

namespace margelo::nitro {

  using namespace margelo::nitro::lunardatepicker;

  // C++ LDP_CustomLanguage <> JS LDP_CustomLanguage (object)
  template <>
  struct JSIConverter<LDP_CustomLanguage> final {
    static inline LDP_CustomLanguage fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return LDP_CustomLanguage(
        JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "weekdayNames")),
        JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "monthNames"))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const LDP_CustomLanguage& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, "weekdayNames", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.weekdayNames));
      obj.setProperty(runtime, "monthNames", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.monthNames));
      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 (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "weekdayNames"))) return false;
      if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "monthNames"))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
