recognition: SpeechRecognition | undefined;
this.recognition = new webkitSpeechRecognition();
this.recognition.onresult = (event: SpeechRecognitionEvent) => {});
Each throw a cannot find name
warning for each of SpeechRecognition
, webkitSpeechRecognition
, and SpeechRecognitionEvent
I tried yarn -D add @types/webspeechapi
but it produced an error, and indeed it is deprecated with the message Now provided by --lib dom
. Unfortunately, I have no idea what this means!
try this instead npm install --save @types/dom-speech-recognition
worked for me