/**
 * 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 NativeCodeUpdaterCxxSpecJSI : public TurboModule {
protected:
  NativeCodeUpdaterCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);

public:
  virtual void reload(jsi::Runtime &rt) = 0;
  virtual jsi::Value updateBundle(jsi::Runtime &rt, jsi::String bundleId, jsi::String zipUrl) = 0;
  virtual jsi::Value getAppVersion(jsi::Runtime &rt) = 0;
  virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0;
  virtual void removeListeners(jsi::Runtime &rt, double count) = 0;

};

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

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

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


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

    }

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

      return bridging::callFromJs<void>(
          rt, &T::reload, jsInvoker_, instance_);
    }
    jsi::Value updateBundle(jsi::Runtime &rt, jsi::String bundleId, jsi::String zipUrl) override {
      static_assert(
          bridging::getParameterCount(&T::updateBundle) == 3,
          "Expected updateBundle(...) to have 3 parameters");

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

      return bridging::callFromJs<jsi::Value>(
          rt, &T::getAppVersion, 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));
    }
    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));
    }

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

  Delegate delegate_;
};

} // namespace facebook::react
