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

public:
  virtual jsi::Value create(jsi::Runtime &rt, jsi::String config) = 0;
  virtual jsi::Value unpack(jsi::Runtime &rt, jsi::String bundlePath, jsi::String unpackDir) = 0;
  virtual jsi::Value free(jsi::Runtime &rt, double context) = 0;
  virtual jsi::Value process(jsi::Runtime &rt, double context, jsi::String input) = 0;
  virtual jsi::Value query(jsi::Runtime &rt, double context, jsi::String input) = 0;
  virtual jsi::Value setStopWords(jsi::Runtime &rt, double context, jsi::String stopWords) = 0;
  virtual jsi::Value applySamplerConfig(jsi::Runtime &rt, double context, jsi::String config) = 0;
  virtual jsi::Value saveSession(jsi::Runtime &rt, double context, jsi::String filename) = 0;
  virtual jsi::Value restoreSession(jsi::Runtime &rt, double context, jsi::String filename) = 0;
  virtual jsi::Value abort(jsi::Runtime &rt, double context) = 0;

};

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

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


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

    }

    jsi::Value create(jsi::Runtime &rt, jsi::String config) override {
      static_assert(
          bridging::getParameterCount(&T::create) == 2,
          "Expected create(...) to have 2 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::create, jsInvoker_, instance_, std::move(config));
    }
    jsi::Value unpack(jsi::Runtime &rt, jsi::String bundlePath, jsi::String unpackDir) override {
      static_assert(
          bridging::getParameterCount(&T::unpack) == 3,
          "Expected unpack(...) to have 3 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::unpack, jsInvoker_, instance_, std::move(bundlePath), std::move(unpackDir));
    }
    jsi::Value free(jsi::Runtime &rt, double context) override {
      static_assert(
          bridging::getParameterCount(&T::free) == 2,
          "Expected free(...) to have 2 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::free, jsInvoker_, instance_, std::move(context));
    }
    jsi::Value process(jsi::Runtime &rt, double context, jsi::String input) override {
      static_assert(
          bridging::getParameterCount(&T::process) == 3,
          "Expected process(...) to have 3 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::process, jsInvoker_, instance_, std::move(context), std::move(input));
    }
    jsi::Value query(jsi::Runtime &rt, double context, jsi::String input) override {
      static_assert(
          bridging::getParameterCount(&T::query) == 3,
          "Expected query(...) to have 3 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::query, jsInvoker_, instance_, std::move(context), std::move(input));
    }
    jsi::Value setStopWords(jsi::Runtime &rt, double context, jsi::String stopWords) override {
      static_assert(
          bridging::getParameterCount(&T::setStopWords) == 3,
          "Expected setStopWords(...) to have 3 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::setStopWords, jsInvoker_, instance_, std::move(context), std::move(stopWords));
    }
    jsi::Value applySamplerConfig(jsi::Runtime &rt, double context, jsi::String config) override {
      static_assert(
          bridging::getParameterCount(&T::applySamplerConfig) == 3,
          "Expected applySamplerConfig(...) to have 3 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::applySamplerConfig, jsInvoker_, instance_, std::move(context), std::move(config));
    }
    jsi::Value saveSession(jsi::Runtime &rt, double context, jsi::String filename) override {
      static_assert(
          bridging::getParameterCount(&T::saveSession) == 3,
          "Expected saveSession(...) to have 3 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::saveSession, jsInvoker_, instance_, std::move(context), std::move(filename));
    }
    jsi::Value restoreSession(jsi::Runtime &rt, double context, jsi::String filename) override {
      static_assert(
          bridging::getParameterCount(&T::restoreSession) == 3,
          "Expected restoreSession(...) to have 3 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::restoreSession, jsInvoker_, instance_, std::move(context), std::move(filename));
    }
    jsi::Value abort(jsi::Runtime &rt, double context) override {
      static_assert(
          bridging::getParameterCount(&T::abort) == 2,
          "Expected abort(...) to have 2 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::abort, jsInvoker_, instance_, std::move(context));
    }

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

  Delegate delegate_;
};

} // namespace facebook::react
