/**
 * TTS Manager
 *
 * Manages Text-to-Speech providers, voice selection, and audio playback.
 */
import { EventEmitter } from 'events';
import type { TTSProvider, TTSProviderConfig, Voice, SynthesisOptions, SynthesisResult, SpeechItem, TalkModeConfig, PlaybackState } from './types.js';
export interface ITTSProvider {
    /** Provider identifier */
    readonly id: TTSProvider;
    /** Check if provider is available */
    isAvailable(): Promise<boolean>;
    /** List available voices */
    listVoices(): Promise<Voice[]>;
    /** Synthesize speech */
    synthesize(text: string, options?: SynthesisOptions): Promise<SynthesisResult>;
    /** Initialize provider */
    initialize(config: TTSProviderConfig): Promise<void>;
    /** Shutdown provider */
    shutdown(): Promise<void>;
}
export declare class MockTTSProvider implements ITTSProvider {
    readonly id: TTSProvider;
    private initialized;
    private voices;
    private synthDelay;
    initialize(_config: TTSProviderConfig): Promise<void>;
    isAvailable(): Promise<boolean>;
    listVoices(): Promise<Voice[]>;
    synthesize(text: string, options?: SynthesisOptions): Promise<SynthesisResult>;
    shutdown(): Promise<void>;
    setSynthDelay(ms: number): void;
}
export declare class TTSManager extends EventEmitter {
    private config;
    private providers;
    private activeProvider;
    private voices;
    private queue;
    private isPlaying;
    private currentItem;
    private playbackState;
    private cache;
    constructor(config?: Partial<TalkModeConfig>);
    /**
     * Register a TTS provider
     */
    registerProvider(provider: ITTSProvider): void;
    /**
     * Initialize providers
     */
    initialize(): Promise<void>;
    /**
     * Select the best available provider
     */
    private selectBestProvider;
    /**
     * Get active provider
     */
    getActiveProvider(): ITTSProvider | null;
    /**
     * Set active provider
     */
    setActiveProvider(providerId: TTSProvider): Promise<boolean>;
    /**
     * List available providers
     */
    listProviders(): Promise<Array<{
        id: TTSProvider;
        available: boolean;
    }>>;
    /**
     * Load voices from active provider
     */
    private loadVoices;
    /**
     * Get all available voices
     */
    getVoices(): Voice[];
    /**
     * Get voices for a specific language
     */
    getVoicesForLanguage(language: string): Voice[];
    /**
     * Get a specific voice
     */
    getVoice(id: string): Voice | undefined;
    /**
     * Get default voice
     */
    getDefaultVoice(): Voice | undefined;
    /**
     * Synthesize text to speech
     */
    synthesize(text: string, options?: SynthesisOptions): Promise<SynthesisResult>;
    /**
     * Get cache key for synthesis
     */
    private getCacheKey;
    /**
     * Cache synthesis result
     */
    private cacheResult;
    /**
     * Clear synthesis cache
     */
    clearCache(): void;
    /**
     * Speak text (add to queue)
     */
    speak(text: string, options?: SynthesisOptions): Promise<SpeechItem>;
    /**
     * Add item to queue
     */
    private addToQueue;
    /**
     * Pre-synthesize an item
     */
    private preSynthesize;
    /**
     * Get current queue
     */
    getQueue(): SpeechItem[];
    /**
     * Clear queue
     */
    clearQueue(): void;
    /**
     * Remove item from queue
     */
    removeFromQueue(id: string): boolean;
    /**
     * Play next item in queue
     */
    playNext(): Promise<void>;
    /**
     * Stop playback
     */
    stop(): void;
    /**
     * Pause playback
     */
    pause(): void;
    /**
     * Resume playback
     */
    resume(): void;
    /**
     * Get current playback state
     */
    getPlaybackState(): PlaybackState;
    /**
     * Get currently playing item
     */
    getCurrentItem(): SpeechItem | null;
    /**
     * Check if playing
     */
    isCurrentlyPlaying(): boolean;
    /**
     * Get configuration
     */
    getConfig(): TalkModeConfig;
    /**
     * Update configuration
     */
    updateConfig(config: Partial<TalkModeConfig>): void;
    /**
     * Get stats
     */
    getStats(): {
        providers: number;
        voices: number;
        queueLength: number;
        cacheSize: number;
        cacheEntries: number;
        isPlaying: boolean;
    };
    /**
     * Shutdown
     */
    shutdown(): Promise<void>;
}
export declare function getTTSManager(config?: Partial<TalkModeConfig>): TTSManager;
export declare function resetTTSManager(): void;
