import { shallowRef, readonly } from 'vue'; import { useVoiceQueue } from './useVoiceQueue.js'; import { TTSProvider } from '../providers/types.js'; export interface UseStreamingTTSOptions { /** Override the injected provider */ provider?: TTSProvider; } export interface UseStreamingTTSReturn { /** * Pipe an `AsyncIterable` (e.g. an LLM token stream) through the * sentence detector and into the voice queue. * * - Complete sentences are enqueued as they form. * - If the stream ends without a final sentence boundary, the remaining * buffer is spoken as-is (I-5.5). * - Returns a Promise that resolves when the stream is exhausted. * (It does NOT wait for all speech to finish.) */ pipeStream(stream: AsyncIterable): Promise; /** Sentences waiting to be spoken */ readonly queue: ReturnType['queue']; /** The sentence currently being spoken */ readonly currentItem: ReturnType['currentItem']; /** Partial token buffer being accumulated (incomplete sentence) */ readonly currentChunk: ReturnType>>>; /** Whether a stream is currently being piped */ readonly isStreaming: ReturnType>>>; /** * Stop the stream immediately and clear all pending speech. * * I-5.4: Uses `AbortController` — the async iterator exits on the next * `signal.aborted` check. Consumer iterables should also accept an * `AbortSignal` for full cancellation. * I-5.5: Partial buffer is **discarded** on stop(). */ stop(): void; } export declare function useStreamingTTS(options?: UseStreamingTTSOptions): UseStreamingTTSReturn;