export declare type Action = () => void; export declare type Func = (item: T) => TResult; export declare namespace Speech { interface ISpeechRecognizer { locale: string; isStreamingToService: boolean; referenceGrammarId: string; conversationMode?: boolean; onIntermediateResult: Func; onFinalResult: Func; onAudioStreamingToService: Action; onRecognitionFailed: Action; warmup(): void; setGrammars(grammars?: string[]): void; startRecognizing(): Promise; stopRecognizing(): Promise; speechIsAvailable(): boolean; } interface ISpeechSynthesizer { cacheString(text: string): void; speak(text: string, lang: string, onSpeakingStarted: Action, onSpeakingFinished: Action, onEarlySpeakingFinished: Action): void; stopSpeaking(): void; stopAudio(): void; } class SpeechRecognizer { private static instance; static setSpeechRecognizer(recognizer: ISpeechRecognizer): void; static startRecognizing(locale?: string, grammars?: string[], onIntermediateResult?: Func, onFinalResult?: Func, onAudioStreamStarted?: Action, onRecognitionFailed?: Action): Promise; static stopRecognizing(): Promise; static warmup(): void; static speechIsAvailable(): boolean; static useConversationMode(): boolean; private static alreadyRecognizing; } class SpeechSynthesizer { private static instance; static setSpeechSynthesizer(speechSynthesizer: ISpeechSynthesizer): void; static cacheString(text: string): void; static speak(text: string, lang: string, onSpeakingStarted?: Action, onSpeakingFinished?: Action, onEarlySpeakingFinished?: Action): void; static stopSpeaking(): void; } class BrowserSpeechRecognizer implements ISpeechRecognizer { locale: string; isStreamingToService: boolean; referenceGrammarId: string; onIntermediateResult: Func; onFinalResult: Func; onAudioStreamingToService: Action; onRecognitionFailed: Action; private recognizer; constructor(); speechIsAvailable(): boolean; warmup(): void; startRecognizing(): Promise; stopRecognizing(): Promise; setGrammars(grammars?: string[]): void; } class BrowserSpeechSynthesizer implements ISpeechSynthesizer { private lastOperation; private audioElement; private speakRequests; cacheString(text: string): void; speak(text: string, lang: string, onSpeakingStarted?: Action, onSpeakingFinished?: Action): void; stopSpeaking(): void; stopAudio(): void; private playNextTTS; private processNodes; } }