/**
 * 平台系统配置
 */
interface SystemConfig {
  /**
   * TTS请求基础URL
   */
  readonly ttsRequestBaseUrl: string
}

/**
 * 业务参数接口
 */
interface BusinessParams {

  /**
   * 音色类型
   */
  voice_type?: string

  /**
   * 语速
   * [0.2,3]，默认为1，通常保留一位小数即可
   */
  speed_ratio?: number

  /**
   * 音高
   * [0.1, 3]，默认为1，通常保留一位小数即可
   */
  volume_ratio?: number

  /**
   * [0.1, 3]，默认为1，通常保留一位小数即可
   */
  pitch_ratio?: number

  /**
   * 是否流式发返回
   */
  stream?: boolean

  /**
   * 语言类型
   */
  language?: string

  /**
   * 供应商Id
   */
  provider?: number

  /**
   * 是否使用缓存
   */
  cache?: boolean

}

/**
 * 内部使用的事件名称
 */
type PrivateCustomEventName =
  /**
   * 文本切割
   */
  | '_textSplitFinish'

  /**
   * tts请求执行
   */
  | '_ttsRequestFinish'

  /**
   * 字节流缓存
   */
  | '_byteBufferFinish'

  /**
   * 解码数据执行
   */
  | '_decodeDataFinish'

  /**
   * 音频播放执行
   */
  | '_audioActuatorFinish'
  | '_audioActuatorBeforeFirstExecute'

  /**
   * 当前整个应用
   */
  | '_appError'
  | '_appFinish'

/**
 * 对外暴露的事件名称
 */
type PublicCustomEventName =
  | 'appError'
  | 'appFinish'
  | 'audioFirstStart'

enum SystemStatus {
  /**
   * 空闲状态
   */
  OFFLINE = 'offline',
  /**
   * 执行中
   */
  EXECUTE = 'execute',
}

export type {
  BusinessParams,
  PrivateCustomEventName,
  PublicCustomEventName,
  SystemConfig,
}

export { SystemStatus }
