@@ -1700,6 +1700,16 @@ interface ShareData {
17001700 url?: string;
17011701}
17021702
1703+ interface SpeechRecognitionErrorEventInit extends EventInit {
1704+ error: SpeechRecognitionErrorCode;
1705+ message?: string;
1706+ }
1707+
1708+ interface SpeechRecognitionEventInit extends EventInit {
1709+ resultIndex?: number;
1710+ results: SpeechRecognitionResultList;
1711+ }
1712+
17031713interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit {
17041714 error: SpeechSynthesisErrorCode;
17051715}
@@ -4680,6 +4690,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
46804690 createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent;
46814691 createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent;
46824692 createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent;
4693+ createEvent(eventInterface: "SpeechRecognitionErrorEvent"): SpeechRecognitionErrorEvent;
46834694 createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent;
46844695 createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent;
46854696 createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
@@ -4929,6 +4940,7 @@ interface DocumentEvent {
49294940 createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent;
49304941 createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent;
49314942 createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent;
4943+ createEvent(eventInterface: "SpeechRecognitionErrorEvent"): SpeechRecognitionErrorEvent;
49324944 createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent;
49334945 createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent;
49344946 createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
@@ -15093,7 +15105,7 @@ interface SpeechRecognitionEventMap {
1509315105 "audioend": Event;
1509415106 "audiostart": Event;
1509515107 "end": Event;
15096- "error": ErrorEvent ;
15108+ "error": SpeechRecognitionErrorEvent ;
1509715109 "nomatch": SpeechRecognitionEvent;
1509815110 "result": SpeechRecognitionEvent;
1509915111 "soundend": Event;
@@ -15112,7 +15124,7 @@ interface SpeechRecognition extends EventTarget {
1511215124 onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null;
1511315125 onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null;
1511415126 onend: ((this: SpeechRecognition, ev: Event) => any) | null;
15115- onerror: ((this: SpeechRecognition, ev: ErrorEvent ) => any) | null;
15127+ onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent ) => any) | null;
1511615128 onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
1511715129 onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
1511815130 onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null;
@@ -15144,14 +15156,24 @@ declare var SpeechRecognitionAlternative: {
1514415156 new(): SpeechRecognitionAlternative;
1514515157};
1514615158
15159+ interface SpeechRecognitionErrorEvent extends Event {
15160+ readonly error: SpeechRecognitionErrorCode;
15161+ readonly message: string;
15162+ }
15163+
15164+ declare var SpeechRecognitionErrorEvent: {
15165+ prototype: SpeechRecognitionErrorEvent;
15166+ new(type: string, eventInitDict: SpeechRecognitionErrorEventInit): SpeechRecognitionErrorEvent;
15167+ };
15168+
1514715169interface SpeechRecognitionEvent extends Event {
1514815170 readonly resultIndex: number;
1514915171 readonly results: SpeechRecognitionResultList;
1515015172}
1515115173
1515215174declare var SpeechRecognitionEvent: {
1515315175 prototype: SpeechRecognitionEvent;
15154- new(): SpeechRecognitionEvent;
15176+ new(type: string, eventInitDict: SpeechRecognitionEventInit ): SpeechRecognitionEvent;
1515515177};
1515615178
1515715179interface SpeechRecognitionResult {
@@ -20102,6 +20124,7 @@ type SelectionMode = "end" | "preserve" | "select" | "start";
2010220124type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
2010320125type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";
2010420126type ShadowRootMode = "closed" | "open";
20127+ type SpeechRecognitionErrorCode = "aborted" | "audio-capture" | "bad-grammar" | "language-not-supported" | "network" | "no-speech" | "not-allowed" | "service-not-allowed";
2010520128type SpeechSynthesisErrorCode = "audio-busy" | "audio-hardware" | "canceled" | "interrupted" | "invalid-argument" | "language-unavailable" | "network" | "not-allowed" | "synthesis-failed" | "synthesis-unavailable" | "text-too-long" | "voice-unavailable";
2010620129type TextTrackKind = "captions" | "chapters" | "descriptions" | "metadata" | "subtitles";
2010720130type TextTrackMode = "disabled" | "hidden" | "showing";
0 commit comments