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


  
#pragma mark - NativeCameraKitModuleCaptureData

template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
struct NativeCameraKitModuleCaptureData {
  P0 uri;
  P1 name;
  P2 height;
  P3 width;
  P4 id;
  P5 path;
  P6 size;
  bool operator==(const NativeCameraKitModuleCaptureData &other) const {
    return uri == other.uri && name == other.name && height == other.height && width == other.width && id == other.id && path == other.path && size == other.size;
  }
};

template <typename T>
struct NativeCameraKitModuleCaptureDataBridging {
  static T types;

  static T fromJs(
      jsi::Runtime &rt,
      const jsi::Object &value,
      const std::shared_ptr<CallInvoker> &jsInvoker) {
    T result{
      bridging::fromJs<decltype(types.uri)>(rt, value.getProperty(rt, "uri"), jsInvoker),
      bridging::fromJs<decltype(types.name)>(rt, value.getProperty(rt, "name"), jsInvoker),
      bridging::fromJs<decltype(types.height)>(rt, value.getProperty(rt, "height"), jsInvoker),
      bridging::fromJs<decltype(types.width)>(rt, value.getProperty(rt, "width"), jsInvoker),
      bridging::fromJs<decltype(types.id)>(rt, value.getProperty(rt, "id"), jsInvoker),
      bridging::fromJs<decltype(types.path)>(rt, value.getProperty(rt, "path"), jsInvoker),
      bridging::fromJs<decltype(types.size)>(rt, value.getProperty(rt, "size"), jsInvoker)};
    return result;
  }

#ifdef DEBUG
  static jsi::String uriToJs(jsi::Runtime &rt, decltype(types.uri) value) {
    return bridging::toJs(rt, value);
  }

  static jsi::String nameToJs(jsi::Runtime &rt, decltype(types.name) value) {
    return bridging::toJs(rt, value);
  }

  static int heightToJs(jsi::Runtime &rt, decltype(types.height) value) {
    return bridging::toJs(rt, value);
  }

  static int widthToJs(jsi::Runtime &rt, decltype(types.width) value) {
    return bridging::toJs(rt, value);
  }

  static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
    return bridging::toJs(rt, value);
  }

  static jsi::String pathToJs(jsi::Runtime &rt, decltype(types.path) value) {
    return bridging::toJs(rt, value);
  }

  static int sizeToJs(jsi::Runtime &rt, decltype(types.size) value) {
    return bridging::toJs(rt, value);
  }
#endif

  static jsi::Object toJs(
      jsi::Runtime &rt,
      const T &value,
      const std::shared_ptr<CallInvoker> &jsInvoker) {
    auto result = facebook::jsi::Object(rt);
    result.setProperty(rt, "uri", bridging::toJs(rt, value.uri, jsInvoker));
    result.setProperty(rt, "name", bridging::toJs(rt, value.name, jsInvoker));
    result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker));
    result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker));
    if (value.id) {
      result.setProperty(rt, "id", bridging::toJs(rt, value.id.value(), jsInvoker));
    }
    if (value.path) {
      result.setProperty(rt, "path", bridging::toJs(rt, value.path.value(), jsInvoker));
    }
    if (value.size) {
      result.setProperty(rt, "size", bridging::toJs(rt, value.size.value(), jsInvoker));
    }
    return result;
  }
};

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

public:
  virtual jsi::Value capture(jsi::Runtime &rt, std::optional<jsi::Object> options, std::optional<double> tag) = 0;
  virtual jsi::Value requestDeviceCameraAuthorization(jsi::Runtime &rt) = 0;
  virtual jsi::Value checkDeviceCameraAuthorizationStatus(jsi::Runtime &rt) = 0;

};

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

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


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

    }

    jsi::Value capture(jsi::Runtime &rt, std::optional<jsi::Object> options, std::optional<double> tag) override {
      static_assert(
          bridging::getParameterCount(&T::capture) == 3,
          "Expected capture(...) to have 3 parameters");

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

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

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

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

  Delegate delegate_;
};

} // namespace facebook::react
