recognition: SpeechRecognition | undefined;
this.recognition = new webkitSpeechRecognition();
this.recognition.onresult = (event: SpeechRecognitionEvent) => {});
分别针对
cannot find name
、SpeechRecognition
和 webkitSpeechRecognition
发出
SpeechRecognitionEvent
警告
我尝试了
yarn -D add @types/webspeechapi
,但它产生了一个错误,并且确实是已弃用,并显示消息Now provided by --lib dom
。不幸的是,我不知道这意味着什么!
试试这个
npm install --save @types/dom-speech-recognition
对我有用