@@ -1430,14 +1430,6 @@ interface ServiceWorkerMessageEventInit extends EventInit {
1430
1430
source?: ServiceWorker | MessagePort | null;
1431
1431
}
1432
1432
1433
- interface SpeechSynthesisEventInit extends EventInit {
1434
- charIndex?: number;
1435
- charLength?: number;
1436
- elapsedTime?: number;
1437
- name?: string;
1438
- utterance?: SpeechSynthesisUtterance | null;
1439
- }
1440
-
1441
1433
interface StereoPannerOptions extends AudioNodeOptions {
1442
1434
pan?: number;
1443
1435
}
@@ -4463,6 +4455,9 @@ interface DocumentEvent {
4463
4455
createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent;
4464
4456
createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent;
4465
4457
createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent;
4458
+ createEvent(eventInterface: "SpeechRecognitionError"): SpeechRecognitionError;
4459
+ createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent;
4460
+ createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent;
4466
4461
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
4467
4462
createEvent(eventInterface: "StorageEvent"): StorageEvent;
4468
4463
createEvent(eventInterface: "TextEvent"): TextEvent;
@@ -13669,6 +13664,130 @@ declare var SourceBufferList: {
13669
13664
new(): SourceBufferList;
13670
13665
};
13671
13666
13667
+ interface SpeechGrammar {
13668
+ src: string;
13669
+ weight: number;
13670
+ }
13671
+
13672
+ declare var SpeechGrammar: {
13673
+ prototype: SpeechGrammar;
13674
+ new(): SpeechGrammar;
13675
+ };
13676
+
13677
+ interface SpeechGrammarList {
13678
+ readonly length: number;
13679
+ addFromString(string: string, weight?: number): void;
13680
+ addFromURI(src: string, weight?: number): void;
13681
+ item(index: number): SpeechGrammar;
13682
+ [index: number]: SpeechGrammar;
13683
+ }
13684
+
13685
+ declare var SpeechGrammarList: {
13686
+ prototype: SpeechGrammarList;
13687
+ new(): SpeechGrammarList;
13688
+ };
13689
+
13690
+ interface SpeechRecognitionEventMap {
13691
+ "audioend": Event;
13692
+ "audiostart": Event;
13693
+ "end": Event;
13694
+ "error": SpeechRecognitionError;
13695
+ "nomatch": SpeechRecognitionEvent;
13696
+ "result": SpeechRecognitionEvent;
13697
+ "soundend": Event;
13698
+ "soundstart": Event;
13699
+ "speechend": Event;
13700
+ "speechstart": Event;
13701
+ "start": Event;
13702
+ }
13703
+
13704
+ interface SpeechRecognition extends EventTarget {
13705
+ continuous: boolean;
13706
+ grammars: SpeechGrammarList;
13707
+ interimResults: boolean;
13708
+ lang: string;
13709
+ maxAlternatives: number;
13710
+ onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null;
13711
+ onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null;
13712
+ onend: ((this: SpeechRecognition, ev: Event) => any) | null;
13713
+ onerror: ((this: SpeechRecognition, ev: SpeechRecognitionError) => any) | null;
13714
+ onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
13715
+ onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
13716
+ onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null;
13717
+ onsoundstart: ((this: SpeechRecognition, ev: Event) => any) | null;
13718
+ onspeechend: ((this: SpeechRecognition, ev: Event) => any) | null;
13719
+ onspeechstart: ((this: SpeechRecognition, ev: Event) => any) | null;
13720
+ onstart: ((this: SpeechRecognition, ev: Event) => any) | null;
13721
+ serviceURI: string;
13722
+ abort(): void;
13723
+ start(): void;
13724
+ stop(): void;
13725
+ addEventListener<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
13726
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
13727
+ removeEventListener<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
13728
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
13729
+ }
13730
+
13731
+ declare var SpeechRecognition: {
13732
+ prototype: SpeechRecognition;
13733
+ new(): SpeechRecognition;
13734
+ };
13735
+
13736
+ interface SpeechRecognitionAlternative {
13737
+ readonly confidence: number;
13738
+ readonly transcript: string;
13739
+ }
13740
+
13741
+ declare var SpeechRecognitionAlternative: {
13742
+ prototype: SpeechRecognitionAlternative;
13743
+ new(): SpeechRecognitionAlternative;
13744
+ };
13745
+
13746
+ interface SpeechRecognitionError extends Event {
13747
+ readonly error: SpeechRecognitionErrorCode;
13748
+ readonly message: string;
13749
+ }
13750
+
13751
+ declare var SpeechRecognitionError: {
13752
+ prototype: SpeechRecognitionError;
13753
+ new(): SpeechRecognitionError;
13754
+ };
13755
+
13756
+ interface SpeechRecognitionEvent extends Event {
13757
+ readonly emma: Document | null;
13758
+ readonly interpretation: any;
13759
+ readonly resultIndex: number;
13760
+ readonly results: SpeechRecognitionResultList;
13761
+ }
13762
+
13763
+ declare var SpeechRecognitionEvent: {
13764
+ prototype: SpeechRecognitionEvent;
13765
+ new(): SpeechRecognitionEvent;
13766
+ };
13767
+
13768
+ interface SpeechRecognitionResult {
13769
+ readonly isFinal: boolean;
13770
+ readonly length: number;
13771
+ item(index: number): SpeechRecognitionAlternative;
13772
+ [index: number]: SpeechRecognitionAlternative;
13773
+ }
13774
+
13775
+ declare var SpeechRecognitionResult: {
13776
+ prototype: SpeechRecognitionResult;
13777
+ new(): SpeechRecognitionResult;
13778
+ };
13779
+
13780
+ interface SpeechRecognitionResultList {
13781
+ readonly length: number;
13782
+ item(index: number): SpeechRecognitionResult;
13783
+ [index: number]: SpeechRecognitionResult;
13784
+ }
13785
+
13786
+ declare var SpeechRecognitionResultList: {
13787
+ prototype: SpeechRecognitionResultList;
13788
+ new(): SpeechRecognitionResultList;
13789
+ };
13790
+
13672
13791
interface SpeechSynthesisEventMap {
13673
13792
"voiceschanged": Event;
13674
13793
}
@@ -13694,38 +13813,46 @@ declare var SpeechSynthesis: {
13694
13813
new(): SpeechSynthesis;
13695
13814
};
13696
13815
13816
+ interface SpeechSynthesisErrorEvent extends SpeechSynthesisEvent {
13817
+ readonly error: SpeechSynthesisErrorCode;
13818
+ }
13819
+
13820
+ declare var SpeechSynthesisErrorEvent: {
13821
+ prototype: SpeechSynthesisErrorEvent;
13822
+ new(): SpeechSynthesisErrorEvent;
13823
+ };
13824
+
13697
13825
interface SpeechSynthesisEvent extends Event {
13698
13826
readonly charIndex: number;
13699
- readonly charLength: number;
13700
13827
readonly elapsedTime: number;
13701
13828
readonly name: string;
13702
13829
readonly utterance: SpeechSynthesisUtterance;
13703
13830
}
13704
13831
13705
13832
declare var SpeechSynthesisEvent: {
13706
13833
prototype: SpeechSynthesisEvent;
13707
- new(type: string, eventInitDict?: SpeechSynthesisEventInit ): SpeechSynthesisEvent;
13834
+ new(): SpeechSynthesisEvent;
13708
13835
};
13709
13836
13710
13837
interface SpeechSynthesisUtteranceEventMap {
13711
- "boundary": Event ;
13712
- "end": Event ;
13713
- "error": Event ;
13714
- "mark": Event ;
13715
- "pause": Event ;
13716
- "resume": Event ;
13717
- "start": Event ;
13838
+ "boundary": SpeechSynthesisEvent ;
13839
+ "end": SpeechSynthesisEvent ;
13840
+ "error": SpeechSynthesisErrorEvent ;
13841
+ "mark": SpeechSynthesisEvent ;
13842
+ "pause": SpeechSynthesisEvent ;
13843
+ "resume": SpeechSynthesisEvent ;
13844
+ "start": SpeechSynthesisEvent ;
13718
13845
}
13719
13846
13720
13847
interface SpeechSynthesisUtterance extends EventTarget {
13721
13848
lang: string;
13722
- onboundary: ((this: SpeechSynthesisUtterance, ev: Event ) => any) | null;
13723
- onend: ((this: SpeechSynthesisUtterance, ev: Event ) => any) | null;
13724
- onerror: ((this: SpeechSynthesisUtterance, ev: Event ) => any) | null;
13725
- onmark: ((this: SpeechSynthesisUtterance, ev: Event ) => any) | null;
13726
- onpause: ((this: SpeechSynthesisUtterance, ev: Event ) => any) | null;
13727
- onresume: ((this: SpeechSynthesisUtterance, ev: Event ) => any) | null;
13728
- onstart: ((this: SpeechSynthesisUtterance, ev: Event ) => any) | null;
13849
+ onboundary: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent ) => any) | null;
13850
+ onend: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent ) => any) | null;
13851
+ onerror: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisErrorEvent ) => any) | null;
13852
+ onmark: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent ) => any) | null;
13853
+ onpause: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent ) => any) | null;
13854
+ onresume: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent ) => any) | null;
13855
+ onstart: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent ) => any) | null;
13729
13856
pitch: number;
13730
13857
rate: number;
13731
13858
text: string;
@@ -16968,6 +17095,8 @@ type ScrollSetting = "" | "up";
16968
17095
type SelectionMode = "select" | "start" | "end" | "preserve";
16969
17096
type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant";
16970
17097
type ServiceWorkerUpdateViaCache = "imports" | "all" | "none";
17098
+ type SpeechRecognitionErrorCode = "no-speech" | "aborted" | "audio-capture" | "network" | "not-allowed" | "service-not-allowed" | "bad-grammar" | "language-not-supported";
17099
+ type SpeechSynthesisErrorCode = "canceled" | "interrupted" | "audio-busy" | "audio-hardware" | "network" | "synthesis-unavailable" | "synthesis-failed" | "language-unavailable" | "voice-unavailable" | "text-too-long" | "invalid-argument";
16971
17100
type TextTrackKind = "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
16972
17101
type TextTrackMode = "disabled" | "hidden" | "showing";
16973
17102
type TouchType = "direct" | "stylus";
0 commit comments