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

import NitroModules

/// See ``HybridOneBrowserSpec``
public protocol HybridOneBrowserSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func open(url: String, options: BrowserNativeOptions) throws -> Promise<BrowserResult>
  func dismiss() throws -> Promise<BrowserResult>
  func openAuthSession(url: String, redirectUrl: String?, options: BrowserNativeOptions) throws -> Promise<BrowserAuthResult>
  func dismissAuthSession() throws -> Void
  func warmup(browserPackage: String?) throws -> Promise<Bool>
  func mayLaunchUrl(url: String, browserPackage: String?) throws -> Promise<Bool>
}

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

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

/**
 * A Swift base-protocol representing the OneBrowser HybridObject.
 * Implement this protocol to create Swift-based instances of OneBrowser.
 * ```swift
 * class HybridOneBrowser : HybridOneBrowserSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneBrowserSpec = HybridOneBrowserSpec_protocol & HybridOneBrowserSpec_base
