Closed khromov closed 8 months ago
After further testing the existing types work, I think perhaps the language server wasn't picking them up automatically without a restart which confused me. I tried in a brand new projects and this correctly type narrows the value of result
:
npm i -D @capacitor-community/speech-recognition@5.0.0-dev.f11750d.1711357142
SpeechRecognition.addListener('partialResults', (result) => {
console.log('Result:', result.matches);
});
SpeechRecognition.addListener('listeningState', (result) => {
console.log('listeningState:', result.status);
});
Pull request checklist
Fixed type narrowing on event listeners