import type { Command } from 'commander'; export declare const TTS_STREAM_ENDPOINT = "/tts/stream"; export declare const TTS_MODELS_ENDPOINT = "/tts/models"; export interface TtsStreamOptions { model?: string; voice?: string; format?: string; sampleRate?: string; speed?: string; language?: string; output?: string; file?: string; } export interface TtsStreamBody { text: string; model?: string; voice?: string; format?: string; sample_rate?: number; speed?: number; language?: string; } /** Destination resolved from `-o`: stdout, a WAV file (header added), or a raw file. */ export type TtsDestination = { kind: 'stdout'; } | { kind: 'file'; path: string; wav: boolean; }; export declare function resolveTtsDestination(output: string | undefined): TtsDestination; /** * Build the request body from the positional text (or `--file`) and options. * Returns an error string instead of throwing, for a clean CLI exit. */ export declare function buildTtsStreamBody(text: string | undefined, opts: TtsStreamOptions, readFile?: (p: string) => string): { body?: TtsStreamBody; error?: string; }; /** 44-byte RIFF/WAVE header for s16le PCM. `dataBytes` may be patched later. */ export declare function wavHeader(sampleRate: number, channels: number, dataBytes: number): Buffer; /** * Wait until a backpressured stream drains. Resolves false when it errors * (EPIPE: the reader exited) or closes first, so a dead pipe never hangs us. */ export declare function waitForDrain(stream: NodeJS.WritableStream): Promise; export interface TtsStreamResult { bytes: number; ttfbMs: number | null; totalMs: number; } /** * Pump the response body to the destination chunk by chunk (never buffered: * stdout consumers start playing on the first chunk). */ export declare function pumpTtsAudio(response: Response, dest: TtsDestination, startedAt: number, now?: () => number): Promise; /** Format the `gsk tts models` table for humans (stderr / text mode). */ export declare function formatTtsModels(models: Array>): string; export interface TtsCommandDeps { postStream: (endpoint: string, body: unknown) => Promise; getModels: () => Promise; output: (data: unknown) => void; progress: (message: string) => void; logError: (message: string) => void; exit: (code: number) => never; } export declare function registerTtsCommand(program: Command, deps: () => TtsCommandDeps): Command; //# sourceMappingURL=tts-stream.d.ts.map