/** * TTS adapter factory with type guards * * Uses discriminated unions and lazy loading following SDK patterns. */ import type { BrowserSynthesisTTSOptions, TTSAdapter } from './types.js'; /** * Options for getting a TTS adapter */ export type GetTTSOptions = (BrowserSynthesisTTSOptions & { type?: 'browser-synthesis'; }) | { type: 'transformers'; }; /** * Create a TTS adapter * * Uses lazy loading to only import the requested adapter. * * @example * ```ts * // Browser Speech Synthesis (default) * const tts = await getTTS(); * * // Explicit Browser Synthesis * const tts = await getTTS({ type: 'browser-synthesis' }); * * // With custom defaults * const tts = await getTTS({ defaultRate: 1.2, defaultVoice: 'Google US English' }); * ``` */ export declare function getTTS(options?: GetTTSOptions): Promise; /** * Auto-detect and create the best available TTS adapter * * Selection priority: * 1. Browser Speech Synthesis (no download, instant) * 2. Transformers.js TTS (requires model download) * * @throws {Error} If no TTS adapter is available * * @example * ```ts * const tts = await getTTSAuto(); * console.log(`Using ${tts.type} adapter`); * ``` */ export declare function getTTSAuto(options?: Partial>): Promise; /** * Check if a specific TTS backend is available */ export declare function isTTSAvailable(type: 'browser-synthesis' | 'transformers'): boolean; //# sourceMappingURL=factory.d.ts.map