From 5afdcf191470cfb4efc44ff12fe66231ca64f1d9 Mon Sep 17 00:00:00 2001 From: Palak Agarwal Date: Tue, 5 May 2026 11:09:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74957=20Update=20w?= =?UTF-8?q?ebkit=20prefixed=20SpeechRecognition=20to=20match=20non-prefixe?= =?UTF-8?q?d=20version=20by=20@palak8669?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dom-speech-recognition/dom-speech-recognition-tests.ts | 4 ++++ types/dom-speech-recognition/index.d.ts | 7 ++++++- .../ts5.9/dom-speech-recognition-tests.ts | 4 ++++ types/dom-speech-recognition/ts5.9/index.d.ts | 7 ++++++- 4 files changed, 20 insertions(+), 2 deletions(-) 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;