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

import Foundation
import NitroModules

/// See ``HybridTextToSpeechSpec``
public protocol HybridTextToSpeechSpec_protocol: AnyObject {
  // Properties
  

  // Methods
  func speak(text: String, options: TextToSpeechOptions?) throws -> Promise<Void>
  func stop() throws -> Promise<Bool>
  func pause() throws -> Promise<Bool>
  func resume() throws -> Promise<Bool>
  func getVoices() throws -> Promise<[TextToSpeechVoice]>
  func addEventListener(event: EventName, listener: @escaping ((_ word: String?) -> Void)) throws -> (() -> Void)
}

/// See ``HybridTextToSpeechSpec``
public class HybridTextToSpeechSpec_base: HybridObjectSpec {
  private weak var cxxWrapper: HybridTextToSpeechSpec_cxx? = nil
  public func getCxxWrapper() -> HybridTextToSpeechSpec_cxx {
  #if DEBUG
    guard self is HybridTextToSpeechSpec else {
      fatalError("`self` is not a `HybridTextToSpeechSpec`! Did you accidentally inherit from `HybridTextToSpeechSpec_base` instead of `HybridTextToSpeechSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridTextToSpeechSpec_cxx(self as! HybridTextToSpeechSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
  public var memorySize: Int { return 0 }
}

/**
 * A Swift base-protocol representing the TextToSpeech HybridObject.
 * Implement this protocol to create Swift-based instances of TextToSpeech.
 * ```swift
 * class HybridTextToSpeech : HybridTextToSpeechSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridTextToSpeechSpec = HybridTextToSpeechSpec_protocol & HybridTextToSpeechSpec_base
