import { ReadiumSpeechPlaybackEngine } from '../engine'; import { ReadiumSpeechEngineProvider } from '../provider'; import { ReadiumSpeechPlaybackEvent, ReadiumSpeechPlaybackState } from '../navigator'; import { ReadiumSpeechUtterance } from '../utterance'; import { ReadiumSpeechVoice } from '../voices/types'; export interface FallbackSpeechEngineOptions { primaryEngine: ReadiumSpeechPlaybackEngine; primaryProvider: ReadiumSpeechEngineProvider; fallbackProvider: ReadiumSpeechEngineProvider; onFailure?: "fallback" | "error" | "fallbackAndRecover"; healthCheckIntervalMs?: number; } export declare class FallbackSpeechEngine implements ReadiumSpeechPlaybackEngine { private activeEngine; private readonly primaryProvider; private readonly fallbackProvider; private readonly onFailure; private readonly healthCheckIntervalMs; private hasFallenBack; private healthCheckTimer; private primaryReachable; private currentUtterances; private lastVoiceRequest; private desiredIndex; private desiredPlaying; private engineStarted; private swapInFlight; private teardownEpoch; private loadToken; private readonly events; private unbindActiveEngine; constructor(options: FallbackSpeechEngineOptions); initialize(): Promise; loadUtterances(contents: ReadiumSpeechUtterance[], startIndex?: number): void; setVoice(voice: ReadiumSpeechVoice | string): void; getCurrentVoice(): ReadiumSpeechVoice | null; getAvailableVoices(): Promise; setSpeakInContentLanguage(enabled: boolean): void; getSpeakInContentLanguage(): boolean; speak(utteranceIndex?: number): void; pause(): void; resume(): void; stop(): void; setRate(rate: number): void; getRate(): number; setPitch(pitch: number): void; getPitch(): number; setVolume(volume: number): void; getVolume(): number; private isEngineTrusted; getState(): ReadiumSpeechPlaybackState; getCurrentUtteranceIndex(): number; setCurrentUtteranceIndex(index: number, onComplete?: (success: boolean) => void): void; getUtteranceCount(): number; on(event: ReadiumSpeechPlaybackEvent["type"], callback: (event: ReadiumSpeechPlaybackEvent) => void): () => void; private emitEvent; private bindActiveEngine; private handleError; private copyPlaybackParameters; private startEngineWhenReady; private startHealthCheck; private maybeRecoverNow; private swapToFallback; private recoverToPrimary; private performSwap; private pickBestFallbackVoice; destroy(): Promise; }