/**
 * 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 {


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

public:
  virtual jsi::Object getConstants(jsi::Runtime &rt) = 0;
  virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0;
  virtual jsi::Value getActiveServerId(jsi::Runtime &rt) = 0;
  virtual void removeListeners(jsi::Runtime &rt, double count) = 0;
  virtual jsi::Value start(jsi::Runtime &rt, double id, jsi::String configPath, jsi::String errlogPath) = 0;
  virtual jsi::Value getLocalIpAddress(jsi::Runtime &rt) = 0;
  virtual jsi::Value getOpenPort(jsi::Runtime &rt, jsi::String address) = 0;
  virtual jsi::Value stop(jsi::Runtime &rt) = 0;

};

template <typename T>
class JSI_EXPORT NativeReactNativeStaticServerCxxSpec : 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 = "ReactNativeStaticServer";

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


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

    }

    jsi::Object getConstants(jsi::Runtime &rt) override {
      static_assert(
          bridging::getParameterCount(&T::getConstants) == 1,
          "Expected getConstants(...) to have 1 parameters");

      return bridging::callFromJs<jsi::Object>(
          rt, &T::getConstants, jsInvoker_, instance_);
    }
    void addListener(jsi::Runtime &rt, jsi::String eventName) override {
      static_assert(
          bridging::getParameterCount(&T::addListener) == 2,
          "Expected addListener(...) to have 2 parameters");

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

      return bridging::callFromJs<jsi::Value>(
          rt, &T::getActiveServerId, jsInvoker_, instance_);
    }
    void removeListeners(jsi::Runtime &rt, double count) override {
      static_assert(
          bridging::getParameterCount(&T::removeListeners) == 2,
          "Expected removeListeners(...) to have 2 parameters");

      return bridging::callFromJs<void>(
          rt, &T::removeListeners, jsInvoker_, instance_, std::move(count));
    }
    jsi::Value start(jsi::Runtime &rt, double id, jsi::String configPath, jsi::String errlogPath) override {
      static_assert(
          bridging::getParameterCount(&T::start) == 4,
          "Expected start(...) to have 4 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::start, jsInvoker_, instance_, std::move(id), std::move(configPath), std::move(errlogPath));
    }
    jsi::Value getLocalIpAddress(jsi::Runtime &rt) override {
      static_assert(
          bridging::getParameterCount(&T::getLocalIpAddress) == 1,
          "Expected getLocalIpAddress(...) to have 1 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::getLocalIpAddress, jsInvoker_, instance_);
    }
    jsi::Value getOpenPort(jsi::Runtime &rt, jsi::String address) override {
      static_assert(
          bridging::getParameterCount(&T::getOpenPort) == 2,
          "Expected getOpenPort(...) to have 2 parameters");

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

      return bridging::callFromJs<jsi::Value>(
          rt, &T::stop, jsInvoker_, instance_);
    }

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

  Delegate delegate_;
};

} // namespace facebook::react
