import type FirePlayer from 'fireplayer'

interface AudioChunk {
  pcm: ArrayBuffer
  wav: ArrayBuffer
}

interface AsrPluginOption {
  length?: number
  interval?: number
  sampleRate?: number
  autoHideTimeout?: number
  onAudioChunk?: (chunk: AudioChunk) => void | Promise<void>
}

interface AsrPluginInstance {
  name: 'fireplayerPluginAsr'
  stop: () => void
  hide: () => void
  append: (subtitle: string) => void
}

declare function fireplayerPluginAsr(option?: AsrPluginOption): (fire: FirePlayer) => AsrPluginInstance

export default fireplayerPluginAsr
