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

import Foundation
import NitroModules

/// See ``HybridNitroShareIntentSpec``
public protocol HybridNitroShareIntentSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func getInitialShare() throws -> Promise<SharePayload?>
  func onIntentListener(listener: @escaping (_ payload: SharePayload) -> Void) throws -> Double
  func onErrorListener(listener: @escaping (_ message: String) -> Void) throws -> Double
  func removeListener(listenerId: Double) throws -> Void
  func clearShareIntent() throws -> Void
}

public extension HybridNitroShareIntentSpec_protocol {
  /// Default implementation of ``HybridObject.toString``
  func toString() -> String {
    return "[HybridObject NitroShareIntent]"
  }
}

/// See ``HybridNitroShareIntentSpec``
open class HybridNitroShareIntentSpec_base {
  private weak var cxxWrapper: HybridNitroShareIntentSpec_cxx? = nil
  public init() { }
  public func getCxxWrapper() -> HybridNitroShareIntentSpec_cxx {
  #if DEBUG
    guard self is HybridNitroShareIntentSpec else {
      fatalError("`self` is not a `HybridNitroShareIntentSpec`! Did you accidentally inherit from `HybridNitroShareIntentSpec_base` instead of `HybridNitroShareIntentSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridNitroShareIntentSpec_cxx(self as! HybridNitroShareIntentSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
}

/**
 * A Swift base-protocol representing the NitroShareIntent HybridObject.
 * Implement this protocol to create Swift-based instances of NitroShareIntent.
 * ```swift
 * class HybridNitroShareIntent : HybridNitroShareIntentSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridNitroShareIntentSpec = HybridNitroShareIntentSpec_protocol & HybridNitroShareIntentSpec_base
