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

import NitroModules

/// See ``HybridOneSpeechSpec``
public protocol HybridOneSpeechSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func isAvailable() throws -> Bool
  func getPermissions() throws -> Promise<SpeechPermissionResponse>
  func requestPermissions() throws -> Promise<SpeechPermissionResponse>
  func start(options: SpeechStartOptions, onEvent: @escaping (_ event: SpeechEvent) -> Void) throws -> Void
  func stop() throws -> Void
  func abort() throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the OneSpeech HybridObject.
 * Implement this protocol to create Swift-based instances of OneSpeech.
 * ```swift
 * class HybridOneSpeech : HybridOneSpeechSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneSpeechSpec = HybridOneSpeechSpec_protocol & HybridOneSpeechSpec_base
