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

import NitroModules

/// See ``HybridNitroResolverSpec``
public protocol HybridNitroResolverSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func cancel() throws -> Void
  func getServers() throws -> String
  func setServers(servers: String) throws -> Void
  func resolveipv4(hostname: String) throws -> Promise<String>
  func resolveipv6(hostname: String) throws -> Promise<String>
  func resolveMx(hostname: String) throws -> Promise<String>
  func resolveTxt(hostname: String) throws -> Promise<String>
  func resolveBase64Txt(hostname: String) throws -> Promise<String>
  func resolveCname(hostname: String) throws -> Promise<String>
  func resolveNs(hostname: String) throws -> Promise<String>
  func resolveSoa(hostname: String) throws -> Promise<String>
  func resolveSrv(hostname: String) throws -> Promise<String>
  func resolveCaa(hostname: String) throws -> Promise<String>
  func resolveNaptr(hostname: String) throws -> Promise<String>
  func resolvePtr(hostname: String) throws -> Promise<String>
  func resolveTlsa(hostname: String) throws -> Promise<String>
  func resolveAny(hostname: String) throws -> Promise<String>
  func reverse(ip: String) throws -> Promise<String>
  func setLocalAddress(v4: String, v6: String) throws -> Void
  func clearCache() throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the NitroResolver HybridObject.
 * Implement this protocol to create Swift-based instances of NitroResolver.
 * ```swift
 * class HybridNitroResolver : HybridNitroResolverSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridNitroResolverSpec = HybridNitroResolverSpec_protocol & HybridNitroResolverSpec_base
