diff --git a/types/dom-speech-recognition/dom-speech-recognition-tests.ts b/types/dom-speech-recognition/dom-speech-recognition-tests.ts index cc874eb70f3153..10fc11a2e54bc7 100644 --- a/types/dom-speech-recognition/dom-speech-recognition-tests.ts +++ b/types/dom-speech-recognition/dom-speech-recognition-tests.ts @@ -94,4 +94,8 @@ const speechRecognitionOptions: SpeechRecognitionOptions = { (async () => { const availability: AvailabilityStatus = await SpeechRecognition.available(speechRecognitionOptions); const installOutcome: boolean = await SpeechRecognition.install(speechRecognitionOptions); + + // "webkit" prefixed vars should have the same static methods + const webkitAvailability: AvailabilityStatus = await webkitSpeechRecognition.available(speechRecognitionOptions); + const webkitInstallOutcome: boolean = await webkitSpeechRecognition.install(speechRecognitionOptions); }); diff --git a/types/dom-speech-recognition/index.d.ts b/types/dom-speech-recognition/index.d.ts index e2e0082ae4240b..bb7266c40d7dc8 100644 --- a/types/dom-speech-recognition/index.d.ts +++ b/types/dom-speech-recognition/index.d.ts @@ -146,7 +146,12 @@ declare var SpeechGrammarList: { prototype: SpeechGrammarList; new(): SpeechGram // prefixed global variables in Chrome; should match the equivalents above // https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API#chrome_support -declare var webkitSpeechRecognition: { prototype: SpeechRecognition; new(): SpeechRecognition }; +declare var webkitSpeechRecognition: { + prototype: SpeechRecognition; + new(): SpeechRecognition; + available(options: SpeechRecognitionOptions): Promise; + install(options: SpeechRecognitionOptions): Promise; +}; declare var webkitSpeechGrammarList: { prototype: SpeechGrammarList; new(): SpeechGrammarList }; declare var webkitSpeechRecognitionEvent: { prototype: SpeechRecognitionEvent; diff --git a/types/dom-speech-recognition/ts5.9/dom-speech-recognition-tests.ts b/types/dom-speech-recognition/ts5.9/dom-speech-recognition-tests.ts index cc874eb70f3153..10fc11a2e54bc7 100644 --- a/types/dom-speech-recognition/ts5.9/dom-speech-recognition-tests.ts +++ b/types/dom-speech-recognition/ts5.9/dom-speech-recognition-tests.ts @@ -94,4 +94,8 @@ const speechRecognitionOptions: SpeechRecognitionOptions = { (async () => { const availability: AvailabilityStatus = await SpeechRecognition.available(speechRecognitionOptions); const installOutcome: boolean = await SpeechRecognition.install(speechRecognitionOptions); + + // "webkit" prefixed vars should have the same static methods + const webkitAvailability: AvailabilityStatus = await webkitSpeechRecognition.available(speechRecognitionOptions); + const webkitInstallOutcome: boolean = await webkitSpeechRecognition.install(speechRecognitionOptions); }); diff --git a/types/dom-speech-recognition/ts5.9/index.d.ts b/types/dom-speech-recognition/ts5.9/index.d.ts index 6b75d8b4748ca4..133e6c30aa3984 100644 --- a/types/dom-speech-recognition/ts5.9/index.d.ts +++ b/types/dom-speech-recognition/ts5.9/index.d.ts @@ -146,7 +146,12 @@ declare var SpeechGrammarList: { prototype: SpeechGrammarList; new(): SpeechGram // prefixed global variables in Chrome; should match the equivalents above // https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API#chrome_support -declare var webkitSpeechRecognition: { prototype: SpeechRecognition; new(): SpeechRecognition }; +declare var webkitSpeechRecognition: { + prototype: SpeechRecognition; + new(): SpeechRecognition; + available(options: SpeechRecognitionOptions): Promise; + install(options: SpeechRecognitionOptions): Promise; +}; declare var webkitSpeechGrammarList: { prototype: SpeechGrammarList; new(): SpeechGrammarList }; declare var webkitSpeechRecognitionEvent: { prototype: SpeechRecognitionEvent;