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

import NitroModules

/// See ``HybridInappbrowserNitroSpec``
public protocol HybridInappbrowserNitroSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func isAvailable() throws -> Promise<Bool>
  func open(url: String, options: InAppBrowserOptions?) throws -> Promise<InAppBrowserResult>
  func openAuth(url: String, redirectUrl: String, options: InAppBrowserOptions?) throws -> Promise<InAppBrowserAuthResult>
  func close() throws -> Promise<Void>
  func closeAuth() throws -> Promise<Void>
}

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

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

/**
 * A Swift base-protocol representing the InappbrowserNitro HybridObject.
 * Implement this protocol to create Swift-based instances of InappbrowserNitro.
 * ```swift
 * class HybridInappbrowserNitro : HybridInappbrowserNitroSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridInappbrowserNitroSpec = HybridInappbrowserNitroSpec_protocol & HybridInappbrowserNitroSpec_base
