TS Error for SpeechGrammarList,
but this is part of the Web Speech API, and the interface is implemented in "DOM". Why is TS still giving this error?
Code:
export interface SpeechRecognitionProperties {
grammars?: SpeechGrammarList; //TS2304: Cannot find name 'SpeechGrammarList'.
lang?: string;
}
"typescript": "^4.4.4"
tsconfig:
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["./src"]
}
It's a TS 4.4 libdom change. See https://github.com/Riley-Brown/react-speech-to-text/issues/23