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

import NitroModules

/// See ``HybridNitroDnsSpec``
public protocol HybridNitroDnsSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func createResolver(config: String?) throws -> (any HybridNitroResolverSpec)
  func getServers() throws -> String
  func setServers(servers: String) throws -> Void
  func lookup(hostname: String, family: Double) throws -> String
  func resolve4(hostname: String) throws -> Promise<String>
  func resolve6(hostname: String) throws -> Promise<String>
  func resolveMx(hostname: String) throws -> Promise<String>
  func resolveTxt(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 lookupService(address: String, port: Double) throws -> Promise<String>
  func setNativeInterceptionEnabled(enabled: Bool) throws -> Void
  func setVerbose(enabled: Bool) throws -> Void
  func clearCache() throws -> Void
  func setCacheSize(size: Double) throws -> Void
  func setCachePolicy(policy: CachePolicy, staleTtl: Double) throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the NitroDns HybridObject.
 * Implement this protocol to create Swift-based instances of NitroDns.
 * ```swift
 * class HybridNitroDns : HybridNitroDnsSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridNitroDnsSpec = HybridNitroDnsSpec_protocol & HybridNitroDnsSpec_base
