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

public:
  virtual jsi::Value convertImageToWebp(jsi::Runtime &rt, jsi::String inputPath, jsi::String outputPath, double quality, double type, int preset) = 0;

};

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

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


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

    }

    jsi::Value convertImageToWebp(jsi::Runtime &rt, jsi::String inputPath, jsi::String outputPath, double quality, double type, int preset) override {
      static_assert(
          bridging::getParameterCount(&T::convertImageToWebp) == 6,
          "Expected convertImageToWebp(...) to have 6 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::convertImageToWebp, jsInvoker_, instance_, std::move(inputPath), std::move(outputPath), std::move(quality), std::move(type), std::move(preset));
    }

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

  Delegate delegate_;
};

} // namespace facebook::react
