@sberdevices/assistant-client
Version:
Модуль взаимодействия с виртуальным ассистентом
18 lines • 839 B
TypeScript
import { OriginalMessageType } from '../../../typings';
import { createVoiceListener, VoiceHandler } from '../listener/voiceListener';
declare type speechRecognizerEvents = {
hypotesis: (text: string, last: boolean, mid: OriginalMessageType['messageId']) => void;
};
export declare const createSpeechRecognizer: (voiceListener: ReturnType<typeof createVoiceListener>) => {
start: ({ sendVoice, messageId, onMessage, }: {
sendVoice: VoiceHandler;
messageId: number;
onMessage: (cb: (message: OriginalMessageType) => void) => () => void;
}) => Promise<void>;
stop: () => void;
on: <K extends "hypotesis">(event: K, cb: speechRecognizerEvents[K]) => () => void;
readonly status: "inactive" | "active";
readonly messageId: number;
};
export {};
//# sourceMappingURL=speechRecognizer.d.ts.map