///
/// HybridNitroShareIntentSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2026 Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `SharePayload` to properly resolve imports.
namespace margelo::nitro::nitroshareintent { struct SharePayload; }

#include "SharePayload.hpp"
#include <optional>
#include <NitroModules/Promise.hpp>
#include <functional>
#include <string>

namespace margelo::nitro::nitroshareintent {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `NitroShareIntent`
   * Inherit this class to create instances of `HybridNitroShareIntentSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridNitroShareIntent: public HybridNitroShareIntentSpec {
   * public:
   *   HybridNitroShareIntent(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridNitroShareIntentSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridNitroShareIntentSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridNitroShareIntentSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual std::shared_ptr<Promise<std::optional<SharePayload>>> getInitialShare() = 0;
      virtual double onIntentListener(const std::function<void(const SharePayload& /* payload */)>& listener) = 0;
      virtual double onErrorListener(const std::function<void(const std::string& /* message */)>& listener) = 0;
      virtual void removeListener(double listenerId) = 0;
      virtual void clearShareIntent() = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "NitroShareIntent";
  };

} // namespace margelo::nitro::nitroshareintent
