import { UUID } from "node:crypto"; import { EventEmitter } from "node:events"; import { TTS, TTSEvents } from "../../../interfaces/tts/tts.js"; import * as ws from "ws"; import { Message } from "../../../interfaces/message/message.js"; import { Mutex } from "../../../commons/mutex.js"; export interface CartesiaTTSOptions { apiKey: string; speechOptions: Record; url?: string; headers?: Record; timeout?: number; queueSizeLimit?: number; } export declare class CartesiaTTS extends EventEmitter implements TTS { protected internal: EventEmitter; protected apiKey: string; protected webSocket: ws.WebSocket; protected speechOptions: Record; protected url: string; protected headers: Record; protected activeMessages: Set; protected mutex: Mutex; protected timeout?: number; constructor({ apiKey, speechOptions, url, headers, timeout, queueSizeLimit }: CartesiaTTSOptions); post: (message: Message) => void; abort: (uuid: UUID) => void; dispose: () => void; protected onWebSocketMessage: (data: ws.RawData) => void; protected onWebSocketClose: (code: number, reason: Buffer) => void; protected onWebSocketOpen: () => void; protected onWebSocketError: (err: Error) => void; protected closeWebSocketconnection: () => void; protected createWebSocketConnection: () => ws.WebSocket; }