/**
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by codegen project: GenerateModuleH.js
 */

#pragma once

#include <ReactCommon/TurboModule.h>
#include <react/bridging/Bridging.h>

namespace facebook::react {


  
#pragma mark - NativeSplashViewSplashOptions

template <typename P0, typename P1, typename P2>
struct NativeSplashViewSplashOptions {
  P0 lottie;
  P1 duration;
  P2 backgroundColor;
  bool operator==(const NativeSplashViewSplashOptions &other) const {
    return lottie == other.lottie && duration == other.duration && backgroundColor == other.backgroundColor;
  }
};

template <typename T>
struct NativeSplashViewSplashOptionsBridging {
  static T types;

  static T fromJs(
      jsi::Runtime &rt,
      const jsi::Object &value,
      const std::shared_ptr<CallInvoker> &jsInvoker) {
    T result{
      bridging::fromJs<decltype(types.lottie)>(rt, value.getProperty(rt, "lottie"), jsInvoker),
      bridging::fromJs<decltype(types.duration)>(rt, value.getProperty(rt, "duration"), jsInvoker),
      bridging::fromJs<decltype(types.backgroundColor)>(rt, value.getProperty(rt, "backgroundColor"), jsInvoker)};
    return result;
  }

#ifdef DEBUG
  static jsi::String lottieToJs(jsi::Runtime &rt, decltype(types.lottie) value) {
    return bridging::toJs(rt, value);
  }

  static double durationToJs(jsi::Runtime &rt, decltype(types.duration) value) {
    return bridging::toJs(rt, value);
  }

  static jsi::String backgroundColorToJs(jsi::Runtime &rt, decltype(types.backgroundColor) value) {
    return bridging::toJs(rt, value);
  }
#endif

  static jsi::Object toJs(
      jsi::Runtime &rt,
      const T &value,
      const std::shared_ptr<CallInvoker> &jsInvoker) {
    auto result = facebook::jsi::Object(rt);
    if (value.lottie) {
      result.setProperty(rt, "lottie", bridging::toJs(rt, value.lottie.value(), jsInvoker));
    }
    if (value.duration) {
      result.setProperty(rt, "duration", bridging::toJs(rt, value.duration.value(), jsInvoker));
    }
    if (value.backgroundColor) {
      result.setProperty(rt, "backgroundColor", bridging::toJs(rt, value.backgroundColor.value(), jsInvoker));
    }
    return result;
  }
};

class JSI_EXPORT NativeSplashViewCxxSpecJSI : public TurboModule {
protected:
  NativeSplashViewCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);

public:
  virtual void showSplash(jsi::Runtime &rt, std::optional<jsi::Object> options) = 0;
  virtual void hideSplash(jsi::Runtime &rt) = 0;

};

template <typename T>
class JSI_EXPORT NativeSplashViewCxxSpec : public TurboModule {
public:
  jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
    return delegate_.create(rt, propName);
  }

  std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
    return delegate_.getPropertyNames(runtime);
  }

  static constexpr std::string_view kModuleName = "SplashView";

protected:
  NativeSplashViewCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
    : TurboModule(std::string{NativeSplashViewCxxSpec::kModuleName}, jsInvoker),
      delegate_(reinterpret_cast<T*>(this), jsInvoker) {}


private:
  class Delegate : public NativeSplashViewCxxSpecJSI {
  public:
    Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
      NativeSplashViewCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {

    }

    void showSplash(jsi::Runtime &rt, std::optional<jsi::Object> options) override {
      static_assert(
          bridging::getParameterCount(&T::showSplash) == 2,
          "Expected showSplash(...) to have 2 parameters");

      return bridging::callFromJs<void>(
          rt, &T::showSplash, jsInvoker_, instance_, std::move(options));
    }
    void hideSplash(jsi::Runtime &rt) override {
      static_assert(
          bridging::getParameterCount(&T::hideSplash) == 1,
          "Expected hideSplash(...) to have 1 parameters");

      return bridging::callFromJs<void>(
          rt, &T::hideSplash, jsInvoker_, instance_);
    }

  private:
    friend class NativeSplashViewCxxSpec;
    T *instance_;
  };

  Delegate delegate_;
};

} // namespace facebook::react
