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

public:
  virtual jsi::Value decodeWavPack(jsi::Runtime &rt, jsi::String inputPath, jsi::String outputPath, std::optional<double> maxSamples, std::optional<double> bitsPerSample) = 0;
  virtual void addListener(jsi::Runtime &rt, jsi::String eventType) = 0;
  virtual void removeListeners(jsi::Runtime &rt, double count) = 0;

};

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

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


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

    }

    jsi::Value decodeWavPack(jsi::Runtime &rt, jsi::String inputPath, jsi::String outputPath, std::optional<double> maxSamples, std::optional<double> bitsPerSample) override {
      static_assert(
          bridging::getParameterCount(&T::decodeWavPack) == 5,
          "Expected decodeWavPack(...) to have 5 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt, &T::decodeWavPack, jsInvoker_, instance_, std::move(inputPath), std::move(outputPath), std::move(maxSamples), std::move(bitsPerSample));
    }
    void addListener(jsi::Runtime &rt, jsi::String eventType) 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(eventType));
    }
    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 NativeTinyWavPackDecoderCxxSpec;
    T *instance_;
  };

  Delegate delegate_;
};

} // namespace facebook::react
