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

import NitroModules

/// See ``HybridOneNetworkSpec``
public protocol HybridOneNetworkSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func getState() throws -> Promise<NetworkState>
  func addStateListener(listener: @escaping (_ state: NetworkState) -> Void) throws -> () -> Void
}

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

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

/**
 * A Swift base-protocol representing the OneNetwork HybridObject.
 * Implement this protocol to create Swift-based instances of OneNetwork.
 * ```swift
 * class HybridOneNetwork : HybridOneNetworkSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneNetworkSpec = HybridOneNetworkSpec_protocol & HybridOneNetworkSpec_base
