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

import NitroModules

/// See ``HybridOneSpeechSynthesisSpec``
public protocol HybridOneSpeechSynthesisSpec_protocol: HybridObject {
  // Properties
  var maxInputLength: Double { get }

  // Methods
  func speak(utterance: SpeechSynthesisUtterance, onEvent: @escaping (_ event: SpeechSynthesisEvent) -> Void) throws -> Void
  func stop() throws -> Promise<Void>
  func pause() throws -> Promise<Void>
  func resume() throws -> Promise<Void>
  func isSpeaking() throws -> Promise<Bool>
  func getAvailableVoices() throws -> Promise<[SpeechSynthesisVoice]>
}

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

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

/**
 * A Swift base-protocol representing the OneSpeechSynthesis HybridObject.
 * Implement this protocol to create Swift-based instances of OneSpeechSynthesis.
 * ```swift
 * class HybridOneSpeechSynthesis : HybridOneSpeechSynthesisSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneSpeechSynthesisSpec = HybridOneSpeechSynthesisSpec_protocol & HybridOneSpeechSynthesisSpec_base
