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

import NitroModules

/// See ``HybridClarionAzureSpec``
public protocol HybridClarionAzureSpec_protocol: HybridObject {
  // Properties
  var state: String { get }

  // Methods
  func isAvailable(config: NativeAzureConfig) throws -> Promise<Bool>
  func prepare(config: NativeAzureConfig) throws -> Promise<Void>
  func start() throws -> Promise<Void>
  func stop() throws -> Promise<NativeTranscriptResult>
  func discard() throws -> Promise<Void>
  func release() throws -> Promise<Void>
  func updateAuthToken(token: String) throws -> Promise<Void>
  func addStateListener(listener: @escaping (_ state: String) -> Void) throws -> Double
  func addAudioLevelListener(listener: @escaping (_ rms: Double, _ peak: Double) -> Void) throws -> Double
  func addPartialListener(listener: @escaping (_ result: NativeTranscriptResult) -> Void) throws -> Double
  func addFinalListener(listener: @escaping (_ result: NativeTranscriptResult) -> Void) throws -> Double
  func addErrorListener(listener: @escaping (_ error: NativeAzureError) -> Void) throws -> Double
  func addSpeechBoundaryListener(listener: @escaping (_ kind: String, _ offsetMs: Double) -> Void) throws -> Double
  func removeListener(id: Double) throws -> Void
  func removeAllListeners() throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the ClarionAzure HybridObject.
 * Implement this protocol to create Swift-based instances of ClarionAzure.
 * ```swift
 * class HybridClarionAzure : HybridClarionAzureSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridClarionAzureSpec = HybridClarionAzureSpec_protocol & HybridClarionAzureSpec_base
