@@ -1700,6 +1700,16 @@ interface ShareData {
1700
1700
url?: string;
1701
1701
}
1702
1702
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
+
1703
1713
interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit {
1704
1714
error: SpeechSynthesisErrorCode;
1705
1715
}
@@ -4680,6 +4690,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4680
4690
createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent;
4681
4691
createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent;
4682
4692
createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent;
4693
+ createEvent(eventInterface: "SpeechRecognitionErrorEvent"): SpeechRecognitionErrorEvent;
4683
4694
createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent;
4684
4695
createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent;
4685
4696
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
@@ -4929,6 +4940,7 @@ interface DocumentEvent {
4929
4940
createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent;
4930
4941
createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent;
4931
4942
createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent;
4943
+ createEvent(eventInterface: "SpeechRecognitionErrorEvent"): SpeechRecognitionErrorEvent;
4932
4944
createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent;
4933
4945
createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent;
4934
4946
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
@@ -15093,7 +15105,7 @@ interface SpeechRecognitionEventMap {
15093
15105
"audioend": Event;
15094
15106
"audiostart": Event;
15095
15107
"end": Event;
15096
- "error": ErrorEvent ;
15108
+ "error": SpeechRecognitionErrorEvent ;
15097
15109
"nomatch": SpeechRecognitionEvent;
15098
15110
"result": SpeechRecognitionEvent;
15099
15111
"soundend": Event;
@@ -15112,7 +15124,7 @@ interface SpeechRecognition extends EventTarget {
15112
15124
onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null;
15113
15125
onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null;
15114
15126
onend: ((this: SpeechRecognition, ev: Event) => any) | null;
15115
- onerror: ((this: SpeechRecognition, ev: ErrorEvent ) => any) | null;
15127
+ onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent ) => any) | null;
15116
15128
onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
15117
15129
onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
15118
15130
onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null;
@@ -15144,14 +15156,24 @@ declare var SpeechRecognitionAlternative: {
15144
15156
new(): SpeechRecognitionAlternative;
15145
15157
};
15146
15158
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
+
15147
15169
interface SpeechRecognitionEvent extends Event {
15148
15170
readonly resultIndex: number;
15149
15171
readonly results: SpeechRecognitionResultList;
15150
15172
}
15151
15173
15152
15174
declare var SpeechRecognitionEvent: {
15153
15175
prototype: SpeechRecognitionEvent;
15154
- new(): SpeechRecognitionEvent;
15176
+ new(type: string, eventInitDict: SpeechRecognitionEventInit ): SpeechRecognitionEvent;
15155
15177
};
15156
15178
15157
15179
interface SpeechRecognitionResult {
@@ -20102,6 +20124,7 @@ type SelectionMode = "end" | "preserve" | "select" | "start";
20102
20124
type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
20103
20125
type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";
20104
20126
type ShadowRootMode = "closed" | "open";
20127
+ type SpeechRecognitionErrorCode = "aborted" | "audio-capture" | "bad-grammar" | "language-not-supported" | "network" | "no-speech" | "not-allowed" | "service-not-allowed";
20105
20128
type SpeechSynthesisErrorCode = "audio-busy" | "audio-hardware" | "canceled" | "interrupted" | "invalid-argument" | "language-unavailable" | "network" | "not-allowed" | "synthesis-failed" | "synthesis-unavailable" | "text-too-long" | "voice-unavailable";
20106
20129
type TextTrackKind = "captions" | "chapters" | "descriptions" | "metadata" | "subtitles";
20107
20130
type TextTrackMode = "disabled" | "hidden" | "showing";
0 commit comments