Last active
June 21, 2020 22:57
-
-
Save hrdtbs/6b0c164ef453fca6c4aa8f3dde7a65f0 to your computer and use it in GitHub Desktop.
SpeechRecognition.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface SpeechRecognitionErrorEvent { | |
readonly message: string | |
readonly error: | |
| "no-speech" | |
| "aborted" | |
| "audio-capture" | |
| "network" | |
| "not-allowed" | |
| "service-not-allowed" | |
| "bad-grammar" | |
| "language-not-supported" | |
} | |
interface SpeechRecognitionInstance extends Omit<SpeechRecognition, "onerror"> { | |
onerror: | |
| ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => any) | |
| null | |
} | |
interface Window { | |
SpeechRecognition: { | |
prototype: SpeechRecognitionInstance | |
new (): SpeechRecognitionInstance | |
} | |
webkitSpeechRecognition: { | |
new (): SpeechRecognitionInstance | |
prototype: SpeechRecognitionInstance | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment