Skip to content

Instantly share code, notes, and snippets.

@hrdtbs
Last active June 21, 2020 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrdtbs/6b0c164ef453fca6c4aa8f3dde7a65f0 to your computer and use it in GitHub Desktop.
Save hrdtbs/6b0c164ef453fca6c4aa8f3dde7a65f0 to your computer and use it in GitHub Desktop.
SpeechRecognition.d.ts
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