web-speech-cognitive-services 8.0.0-main.d9ef940 → 8.0.1-main.7b3a347

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,124 +1,6 @@
1
- import * as memoize_one from 'memoize-one';
2
1
  import { AudioConfig, SpeechRecognizer } from 'microsoft-cognitiveservices-speech-sdk';
3
-
4
- declare class SpeechSynthesisUtterance {
5
- constructor(text: any);
6
- _lang: any;
7
- _pitch: number;
8
- _rate: number;
9
- _voice: any;
10
- _volume: number;
11
- text: any;
12
- set onboundary(value: any);
13
- get onboundary(): any;
14
- set onend(value: any);
15
- get onend(): any;
16
- set onerror(value: any);
17
- get onerror(): any;
18
- set onmark(value: any);
19
- get onmark(): any;
20
- set onpause(value: any);
21
- get onpause(): any;
22
- set onresume(value: any);
23
- get onresume(): any;
24
- set onstart(value: any);
25
- get onstart(): any;
26
- set lang(value: any);
27
- get lang(): any;
28
- set pitch(value: number);
29
- get pitch(): number;
30
- set rate(value: number);
31
- get rate(): number;
32
- set voice(value: any);
33
- get voice(): any;
34
- set volume(value: number);
35
- get volume(): number;
36
- preload({ deploymentId, fetchCredentials, outputFormat }: {
37
- deploymentId: any;
38
- fetchCredentials: any;
39
- outputFormat: any;
40
- }): void;
41
- arrayBufferPromise: Promise<ArrayBuffer> | undefined;
42
- play(audioContext: any): Promise<void>;
43
- _playingSource: any;
44
- stop(): void;
45
- }
46
-
47
- declare class SpeechSynthesisEvent {
48
- constructor(type: any);
49
- }
50
-
51
- declare class _default$2 {
52
- constructor(audioContext: any);
53
- audioContext: any;
54
- pause(): void;
55
- resume(): void;
56
- start(queue: any): Promise<void>;
57
- playingUtterance: any;
58
- stop(): void;
59
- }
60
-
61
- declare class _default$1 {
62
- constructor({ audioContext, ponyfill }: {
63
- audioContext: any;
64
- ponyfill: any;
65
- });
66
- consumer: _default$2 | null;
67
- paused: boolean;
68
- queue: any[];
69
- getAudioContext: memoize_one.MemoizedFn<() => any>;
70
- pause(): void;
71
- push(utterance: any): void;
72
- resume(): void;
73
- get speaking(): boolean;
74
- startConsumer(): Promise<void>;
75
- stop(): void;
76
- }
77
-
78
- type Credentials = Readonly<({
79
- authorizationToken: string;
80
- subscriptionKey?: undefined;
81
- } | {
82
- authorizationToken?: undefined;
83
- subscriptionKey: string;
84
- }) & ({
85
- customVoiceHostname?: undefined;
86
- region: string;
87
- speechRecognitionHostname?: undefined;
88
- speechSynthesisHostname?: undefined;
89
- } | {
90
- customVoiceHostname: string;
91
- region?: undefined;
92
- speechRecognitionHostname: string;
93
- speechSynthesisHostname: string;
94
- })>;
95
- type PatchOptionsInit = {
96
- audioConfig: AudioConfig;
97
- credentials?: (() => Credentials | Promise<Credentials>) | Credentials | Promise<Credentials>;
98
- enableTelemetry: boolean;
99
- looseEvent?: boolean | undefined;
100
- looseEvents?: boolean | undefined;
101
- referenceGrammars?: readonly string[] | undefined;
102
- region?: string | undefined;
103
- speechRecognitionEndpointId: string;
104
- textNormalization: 'display' | 'itn' | 'lexical' | 'maskeditn';
105
- } & ({
106
- authorizationToken: string;
107
- subscriptionKey?: undefined;
108
- } | {
109
- authorizationToken?: undefined;
110
- subscriptionKey: string;
111
- });
112
-
113
- declare function createSpeechRecognitionPonyfill(options: PatchOptionsInit): {};
114
-
115
- declare class SpeechGrammarList {
116
- #private;
117
- constructor();
118
- addFromString(): void;
119
- get phrases(): readonly string[];
120
- set phrases(value: readonly string[]);
121
- }
2
+ import * as valibot from 'valibot';
3
+ import { InferOutput } from 'valibot';
122
4
 
123
5
  type SpeechRecognitionErrorType = 'aborted' | 'audio-capture' | 'bad-grammar' | 'language-not-supported' | 'network' | 'no-speech' | 'not-allowed' | 'service-not-allowed' | 'unknown';
124
6
  type SpeechRecognitionErrorEventInit = {
@@ -209,9 +91,125 @@ type SpeechRecognitionEventListenerMap = EventListenerMap<'audioend' | 'audiosta
209
91
  start: SpeechRecognitionEvent<'start'>;
210
92
  }>;
211
93
 
94
+ interface W3CSpeechGrammar {
95
+ src: string;
96
+ weight: number;
97
+ }
98
+ interface W3CSpeechGrammarList {
99
+ readonly length: number;
100
+ addFromString(string: string, weight?: number): void;
101
+ addFromURI(src: string, weight?: number): void;
102
+ item(index: number): W3CSpeechGrammar;
103
+ [index: number]: W3CSpeechGrammar;
104
+ }
105
+ declare class SpeechGrammarList implements W3CSpeechGrammarList {
106
+ #private;
107
+ constructor();
108
+ addFromString(): void;
109
+ addFromURI(): void;
110
+ item(): W3CSpeechGrammar;
111
+ get length(): number;
112
+ [index: number]: {
113
+ src: string;
114
+ weight: number;
115
+ };
116
+ get phrases(): readonly string[];
117
+ set phrases(value: readonly string[]);
118
+ }
119
+
120
+ declare const credentialsSchema: valibot.SchemaWithPipe<[valibot.IntersectSchema<[valibot.UnionSchema<[valibot.ObjectSchema<{
121
+ readonly authorizationToken: valibot.StringSchema<undefined>;
122
+ readonly subscriptionKey: valibot.OptionalSchema<valibot.UndefinedSchema<"\"subscriptionKey\" must be unset when \"authorizationToken\" is set.">, never>;
123
+ }, undefined>, valibot.ObjectSchema<{
124
+ readonly authorizationToken: valibot.OptionalSchema<valibot.UndefinedSchema<"\"authorizationToken\" must be unset when \"subscriptionKey\" is set.">, never>;
125
+ readonly subscriptionKey: valibot.StringSchema<undefined>;
126
+ }, undefined>], "The object must either have either \"authorizationToken\" or \"subscriptionKey\" set, but not both.">, valibot.UnionSchema<[valibot.ObjectSchema<{
127
+ readonly customVoiceHostname: valibot.OptionalSchema<valibot.UndefinedSchema<"\"customVoiceHostname\" must be unest when \"region\" is set.">, never>;
128
+ readonly region: valibot.StringSchema<undefined>;
129
+ readonly speechRecognitionHostname: valibot.OptionalSchema<valibot.UndefinedSchema<"\"speechRecognitionHostname\" must be unest when \"region\" is set.">, never>;
130
+ readonly speechSynthesisHostname: valibot.OptionalSchema<valibot.UndefinedSchema<"\"speechSynthesisHostname\" must be unest when \"region\" is set.">, never>;
131
+ }, undefined>, valibot.ObjectSchema<{
132
+ readonly customVoiceHostname: valibot.OptionalSchema<valibot.UnionSchema<[valibot.StringSchema<undefined>, valibot.UndefinedSchema<undefined>], undefined>, never>;
133
+ readonly region: valibot.OptionalSchema<valibot.UndefinedSchema<"\"region\" must be unset when \"*Hostname\" is set.">, never>;
134
+ readonly speechRecognitionHostname: valibot.StringSchema<undefined>;
135
+ readonly speechSynthesisHostname: valibot.StringSchema<undefined>;
136
+ }, undefined>], "The object must either have either \"region\" or \"*Hostname\" set, but not both.">], undefined>, valibot.ReadonlyAction<({
137
+ authorizationToken: string;
138
+ subscriptionKey?: undefined;
139
+ } | {
140
+ subscriptionKey: string;
141
+ authorizationToken?: undefined;
142
+ }) & ({
143
+ region: string;
144
+ customVoiceHostname?: undefined;
145
+ speechRecognitionHostname?: undefined;
146
+ speechSynthesisHostname?: undefined;
147
+ } | {
148
+ speechRecognitionHostname: string;
149
+ speechSynthesisHostname: string;
150
+ customVoiceHostname?: string | undefined;
151
+ region?: undefined;
152
+ })>]>;
153
+
154
+ type Credentials = InferOutput<typeof credentialsSchema>;
155
+
156
+ type PatchOptionsInit = {
157
+ audioConfig?: AudioConfig | undefined;
158
+ credentials: (() => Credentials | Promise<Credentials>) | Credentials | Promise<Credentials>;
159
+ enableTelemetry?: boolean | undefined;
160
+ initialSilenceTimeout?: number | undefined;
161
+ looseEvent?: boolean | undefined;
162
+ looseEvents?: boolean | undefined;
163
+ referenceGrammars?: readonly string[] | undefined;
164
+ speechRecognitionEndpointId?: string | undefined;
165
+ textNormalization?: 'display' | 'itn' | 'lexical' | 'maskeditn' | undefined;
166
+ };
167
+
168
+ declare function createSpeechRecognitionPonyfill(options: PatchOptionsInit): {
169
+ SpeechGrammarList: typeof SpeechGrammarList;
170
+ SpeechRecognition: {
171
+ new (): {
172
+ "__#8@#continuous": boolean;
173
+ "__#8@#eventListenerMap": SpeechRecognitionEventListenerMap;
174
+ "__#8@#grammars": SpeechGrammarList;
175
+ "__#8@#interimResults": boolean;
176
+ "__#8@#lang": string;
177
+ "__#8@#maxAlternatives": number;
178
+ emitCognitiveServices<T extends {
179
+ type: string;
180
+ }>(type: string, event: T): void;
181
+ continuous: boolean;
182
+ grammars: SpeechGrammarList;
183
+ interimResults: boolean;
184
+ maxAlternatives: number;
185
+ lang: string;
186
+ get onaudioend(): ((event: SpeechRecognitionEvent<"audioend">) => void) | undefined;
187
+ set onaudioend(value: ((event: SpeechRecognitionEvent<"audioend">) => void) | undefined);
188
+ onaudiostart: ((event: SpeechRecognitionEvent<"audiostart">) => void) | undefined;
189
+ oncognitiveservices: ((event: SpeechRecognitionEvent<"cognitiveservices">) => void) | undefined;
190
+ onend: ((event: SpeechRecognitionEvent<"end">) => void) | undefined;
191
+ onerror: ((event: SpeechRecognitionErrorEvent) => void) | undefined;
192
+ onresult: ((event: SpeechRecognitionEvent<"result">) => void) | undefined;
193
+ onsoundend: ((event: SpeechRecognitionEvent<"soundend">) => void) | undefined;
194
+ onsoundstart: ((event: SpeechRecognitionEvent<"soundstart">) => void) | undefined;
195
+ onspeechend: ((event: SpeechRecognitionEvent<"speechend">) => void) | undefined;
196
+ onspeechstart: ((event: SpeechRecognitionEvent<"speechstart">) => void) | undefined;
197
+ onstart: ((event: SpeechRecognitionEvent<"start">) => void) | undefined;
198
+ abort: (() => void) | undefined;
199
+ stop: (() => void) | undefined;
200
+ start(): void;
201
+ _startOnce(): Promise<void>;
202
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions | undefined): void;
203
+ dispatchEvent(event: Event): boolean;
204
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void;
205
+ };
206
+ };
207
+ SpeechRecognitionEvent: typeof SpeechRecognitionEvent;
208
+ };
209
+
212
210
  type CreateSpeechRecognitionPonyfillFromRecognizerInit = {
213
211
  createRecognizer: (lang: string) => Promise<SpeechRecognizer>;
214
- enableTelemetry: boolean;
212
+ enableTelemetry: boolean | undefined;
215
213
  looseEvents: boolean;
216
214
  referenceGrammars?: readonly string[] | undefined;
217
215
  textNormalization: 'display' | 'itn' | 'lexical' | 'maskeditn';
@@ -268,6 +266,53 @@ declare function createSpeechRecognitionPonyfillFromRecognizer({ createRecognize
268
266
  SpeechRecognitionEvent: typeof SpeechRecognitionEvent;
269
267
  };
270
268
 
269
+ declare class SpeechSynthesisEvent {
270
+ constructor(type: any);
271
+ }
272
+
273
+ declare class SpeechSynthesisUtterance {
274
+ constructor(text: any);
275
+ _lang: any;
276
+ _pitch: number;
277
+ _rate: number;
278
+ _voice: any;
279
+ _volume: number;
280
+ text: any;
281
+ set onboundary(value: any);
282
+ get onboundary(): any;
283
+ set onend(value: any);
284
+ get onend(): any;
285
+ set onerror(value: any);
286
+ get onerror(): any;
287
+ set onmark(value: any);
288
+ get onmark(): any;
289
+ set onpause(value: any);
290
+ get onpause(): any;
291
+ set onresume(value: any);
292
+ get onresume(): any;
293
+ set onstart(value: any);
294
+ get onstart(): any;
295
+ set lang(value: any);
296
+ get lang(): any;
297
+ set pitch(value: number);
298
+ get pitch(): number;
299
+ set rate(value: number);
300
+ get rate(): number;
301
+ set voice(value: any);
302
+ get voice(): any;
303
+ set volume(value: number);
304
+ get volume(): number;
305
+ preload({ deploymentId, fetchCredentials, outputFormat }: {
306
+ deploymentId: any;
307
+ fetchCredentials: any;
308
+ outputFormat: any;
309
+ }): void;
310
+ arrayBufferPromise: Promise<ArrayBuffer> | undefined;
311
+ play(audioContext: any): Promise<void>;
312
+ _playingSource: any;
313
+ stop(): void;
314
+ }
315
+
271
316
  declare function _default(options: any): {
272
317
  speechSynthesis?: never;
273
318
  SpeechSynthesisEvent?: never;
@@ -294,24 +339,6 @@ type FetchAuthorizationTokenInit = {
294
339
  };
295
340
  declare function fetchAuthorizationToken({ region, subscriptionKey }: FetchAuthorizationTokenInit): Promise<string>;
296
341
 
297
- declare function createSpeechServicesPonyfill(options?: {}, ...args: any[]): {
298
- speechSynthesis?: never;
299
- SpeechSynthesisEvent?: never;
300
- SpeechSynthesisUtterance?: never;
301
- } | {
302
- speechSynthesis: {
303
- queue: _default$1;
304
- cancel(): void;
305
- getVoices(): any[];
306
- onvoiceschanged: any;
307
- pause(): void;
308
- resume(): void;
309
- speak(utterance: any): Promise<any>;
310
- readonly speaking: boolean;
311
- updateVoices(): Promise<void>;
312
- };
313
- SpeechSynthesisEvent: typeof SpeechSynthesisEvent;
314
- SpeechSynthesisUtterance: typeof SpeechSynthesisUtterance;
315
- };
342
+ declare function createSpeechServicesPonyfill(options?: any): any;
316
343
 
317
344
  export { createSpeechRecognitionPonyfill, createSpeechRecognitionPonyfillFromRecognizer, createSpeechServicesPonyfill, _default as createSpeechSynthesisPonyfill, fetchAuthorizationToken };
@@ -1,124 +1,6 @@
1
- import * as memoize_one from 'memoize-one';
2
1
  import { AudioConfig, SpeechRecognizer } from 'microsoft-cognitiveservices-speech-sdk';
3
-
4
- declare class SpeechSynthesisUtterance {
5
- constructor(text: any);
6
- _lang: any;
7
- _pitch: number;
8
- _rate: number;
9
- _voice: any;
10
- _volume: number;
11
- text: any;
12
- set onboundary(value: any);
13
- get onboundary(): any;
14
- set onend(value: any);
15
- get onend(): any;
16
- set onerror(value: any);
17
- get onerror(): any;
18
- set onmark(value: any);
19
- get onmark(): any;
20
- set onpause(value: any);
21
- get onpause(): any;
22
- set onresume(value: any);
23
- get onresume(): any;
24
- set onstart(value: any);
25
- get onstart(): any;
26
- set lang(value: any);
27
- get lang(): any;
28
- set pitch(value: number);
29
- get pitch(): number;
30
- set rate(value: number);
31
- get rate(): number;
32
- set voice(value: any);
33
- get voice(): any;
34
- set volume(value: number);
35
- get volume(): number;
36
- preload({ deploymentId, fetchCredentials, outputFormat }: {
37
- deploymentId: any;
38
- fetchCredentials: any;
39
- outputFormat: any;
40
- }): void;
41
- arrayBufferPromise: Promise<ArrayBuffer> | undefined;
42
- play(audioContext: any): Promise<void>;
43
- _playingSource: any;
44
- stop(): void;
45
- }
46
-
47
- declare class SpeechSynthesisEvent {
48
- constructor(type: any);
49
- }
50
-
51
- declare class _default$2 {
52
- constructor(audioContext: any);
53
- audioContext: any;
54
- pause(): void;
55
- resume(): void;
56
- start(queue: any): Promise<void>;
57
- playingUtterance: any;
58
- stop(): void;
59
- }
60
-
61
- declare class _default$1 {
62
- constructor({ audioContext, ponyfill }: {
63
- audioContext: any;
64
- ponyfill: any;
65
- });
66
- consumer: _default$2 | null;
67
- paused: boolean;
68
- queue: any[];
69
- getAudioContext: memoize_one.MemoizedFn<() => any>;
70
- pause(): void;
71
- push(utterance: any): void;
72
- resume(): void;
73
- get speaking(): boolean;
74
- startConsumer(): Promise<void>;
75
- stop(): void;
76
- }
77
-
78
- type Credentials = Readonly<({
79
- authorizationToken: string;
80
- subscriptionKey?: undefined;
81
- } | {
82
- authorizationToken?: undefined;
83
- subscriptionKey: string;
84
- }) & ({
85
- customVoiceHostname?: undefined;
86
- region: string;
87
- speechRecognitionHostname?: undefined;
88
- speechSynthesisHostname?: undefined;
89
- } | {
90
- customVoiceHostname: string;
91
- region?: undefined;
92
- speechRecognitionHostname: string;
93
- speechSynthesisHostname: string;
94
- })>;
95
- type PatchOptionsInit = {
96
- audioConfig: AudioConfig;
97
- credentials?: (() => Credentials | Promise<Credentials>) | Credentials | Promise<Credentials>;
98
- enableTelemetry: boolean;
99
- looseEvent?: boolean | undefined;
100
- looseEvents?: boolean | undefined;
101
- referenceGrammars?: readonly string[] | undefined;
102
- region?: string | undefined;
103
- speechRecognitionEndpointId: string;
104
- textNormalization: 'display' | 'itn' | 'lexical' | 'maskeditn';
105
- } & ({
106
- authorizationToken: string;
107
- subscriptionKey?: undefined;
108
- } | {
109
- authorizationToken?: undefined;
110
- subscriptionKey: string;
111
- });
112
-
113
- declare function createSpeechRecognitionPonyfill(options: PatchOptionsInit): {};
114
-
115
- declare class SpeechGrammarList {
116
- #private;
117
- constructor();
118
- addFromString(): void;
119
- get phrases(): readonly string[];
120
- set phrases(value: readonly string[]);
121
- }
2
+ import * as valibot from 'valibot';
3
+ import { InferOutput } from 'valibot';
122
4
 
123
5
  type SpeechRecognitionErrorType = 'aborted' | 'audio-capture' | 'bad-grammar' | 'language-not-supported' | 'network' | 'no-speech' | 'not-allowed' | 'service-not-allowed' | 'unknown';
124
6
  type SpeechRecognitionErrorEventInit = {
@@ -209,9 +91,125 @@ type SpeechRecognitionEventListenerMap = EventListenerMap<'audioend' | 'audiosta
209
91
  start: SpeechRecognitionEvent<'start'>;
210
92
  }>;
211
93
 
94
+ interface W3CSpeechGrammar {
95
+ src: string;
96
+ weight: number;
97
+ }
98
+ interface W3CSpeechGrammarList {
99
+ readonly length: number;
100
+ addFromString(string: string, weight?: number): void;
101
+ addFromURI(src: string, weight?: number): void;
102
+ item(index: number): W3CSpeechGrammar;
103
+ [index: number]: W3CSpeechGrammar;
104
+ }
105
+ declare class SpeechGrammarList implements W3CSpeechGrammarList {
106
+ #private;
107
+ constructor();
108
+ addFromString(): void;
109
+ addFromURI(): void;
110
+ item(): W3CSpeechGrammar;
111
+ get length(): number;
112
+ [index: number]: {
113
+ src: string;
114
+ weight: number;
115
+ };
116
+ get phrases(): readonly string[];
117
+ set phrases(value: readonly string[]);
118
+ }
119
+
120
+ declare const credentialsSchema: valibot.SchemaWithPipe<[valibot.IntersectSchema<[valibot.UnionSchema<[valibot.ObjectSchema<{
121
+ readonly authorizationToken: valibot.StringSchema<undefined>;
122
+ readonly subscriptionKey: valibot.OptionalSchema<valibot.UndefinedSchema<"\"subscriptionKey\" must be unset when \"authorizationToken\" is set.">, never>;
123
+ }, undefined>, valibot.ObjectSchema<{
124
+ readonly authorizationToken: valibot.OptionalSchema<valibot.UndefinedSchema<"\"authorizationToken\" must be unset when \"subscriptionKey\" is set.">, never>;
125
+ readonly subscriptionKey: valibot.StringSchema<undefined>;
126
+ }, undefined>], "The object must either have either \"authorizationToken\" or \"subscriptionKey\" set, but not both.">, valibot.UnionSchema<[valibot.ObjectSchema<{
127
+ readonly customVoiceHostname: valibot.OptionalSchema<valibot.UndefinedSchema<"\"customVoiceHostname\" must be unest when \"region\" is set.">, never>;
128
+ readonly region: valibot.StringSchema<undefined>;
129
+ readonly speechRecognitionHostname: valibot.OptionalSchema<valibot.UndefinedSchema<"\"speechRecognitionHostname\" must be unest when \"region\" is set.">, never>;
130
+ readonly speechSynthesisHostname: valibot.OptionalSchema<valibot.UndefinedSchema<"\"speechSynthesisHostname\" must be unest when \"region\" is set.">, never>;
131
+ }, undefined>, valibot.ObjectSchema<{
132
+ readonly customVoiceHostname: valibot.OptionalSchema<valibot.UnionSchema<[valibot.StringSchema<undefined>, valibot.UndefinedSchema<undefined>], undefined>, never>;
133
+ readonly region: valibot.OptionalSchema<valibot.UndefinedSchema<"\"region\" must be unset when \"*Hostname\" is set.">, never>;
134
+ readonly speechRecognitionHostname: valibot.StringSchema<undefined>;
135
+ readonly speechSynthesisHostname: valibot.StringSchema<undefined>;
136
+ }, undefined>], "The object must either have either \"region\" or \"*Hostname\" set, but not both.">], undefined>, valibot.ReadonlyAction<({
137
+ authorizationToken: string;
138
+ subscriptionKey?: undefined;
139
+ } | {
140
+ subscriptionKey: string;
141
+ authorizationToken?: undefined;
142
+ }) & ({
143
+ region: string;
144
+ customVoiceHostname?: undefined;
145
+ speechRecognitionHostname?: undefined;
146
+ speechSynthesisHostname?: undefined;
147
+ } | {
148
+ speechRecognitionHostname: string;
149
+ speechSynthesisHostname: string;
150
+ customVoiceHostname?: string | undefined;
151
+ region?: undefined;
152
+ })>]>;
153
+
154
+ type Credentials = InferOutput<typeof credentialsSchema>;
155
+
156
+ type PatchOptionsInit = {
157
+ audioConfig?: AudioConfig | undefined;
158
+ credentials: (() => Credentials | Promise<Credentials>) | Credentials | Promise<Credentials>;
159
+ enableTelemetry?: boolean | undefined;
160
+ initialSilenceTimeout?: number | undefined;
161
+ looseEvent?: boolean | undefined;
162
+ looseEvents?: boolean | undefined;
163
+ referenceGrammars?: readonly string[] | undefined;
164
+ speechRecognitionEndpointId?: string | undefined;
165
+ textNormalization?: 'display' | 'itn' | 'lexical' | 'maskeditn' | undefined;
166
+ };
167
+
168
+ declare function createSpeechRecognitionPonyfill(options: PatchOptionsInit): {
169
+ SpeechGrammarList: typeof SpeechGrammarList;
170
+ SpeechRecognition: {
171
+ new (): {
172
+ "__#8@#continuous": boolean;
173
+ "__#8@#eventListenerMap": SpeechRecognitionEventListenerMap;
174
+ "__#8@#grammars": SpeechGrammarList;
175
+ "__#8@#interimResults": boolean;
176
+ "__#8@#lang": string;
177
+ "__#8@#maxAlternatives": number;
178
+ emitCognitiveServices<T extends {
179
+ type: string;
180
+ }>(type: string, event: T): void;
181
+ continuous: boolean;
182
+ grammars: SpeechGrammarList;
183
+ interimResults: boolean;
184
+ maxAlternatives: number;
185
+ lang: string;
186
+ get onaudioend(): ((event: SpeechRecognitionEvent<"audioend">) => void) | undefined;
187
+ set onaudioend(value: ((event: SpeechRecognitionEvent<"audioend">) => void) | undefined);
188
+ onaudiostart: ((event: SpeechRecognitionEvent<"audiostart">) => void) | undefined;
189
+ oncognitiveservices: ((event: SpeechRecognitionEvent<"cognitiveservices">) => void) | undefined;
190
+ onend: ((event: SpeechRecognitionEvent<"end">) => void) | undefined;
191
+ onerror: ((event: SpeechRecognitionErrorEvent) => void) | undefined;
192
+ onresult: ((event: SpeechRecognitionEvent<"result">) => void) | undefined;
193
+ onsoundend: ((event: SpeechRecognitionEvent<"soundend">) => void) | undefined;
194
+ onsoundstart: ((event: SpeechRecognitionEvent<"soundstart">) => void) | undefined;
195
+ onspeechend: ((event: SpeechRecognitionEvent<"speechend">) => void) | undefined;
196
+ onspeechstart: ((event: SpeechRecognitionEvent<"speechstart">) => void) | undefined;
197
+ onstart: ((event: SpeechRecognitionEvent<"start">) => void) | undefined;
198
+ abort: (() => void) | undefined;
199
+ stop: (() => void) | undefined;
200
+ start(): void;
201
+ _startOnce(): Promise<void>;
202
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions | undefined): void;
203
+ dispatchEvent(event: Event): boolean;
204
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void;
205
+ };
206
+ };
207
+ SpeechRecognitionEvent: typeof SpeechRecognitionEvent;
208
+ };
209
+
212
210
  type CreateSpeechRecognitionPonyfillFromRecognizerInit = {
213
211
  createRecognizer: (lang: string) => Promise<SpeechRecognizer>;
214
- enableTelemetry: boolean;
212
+ enableTelemetry: boolean | undefined;
215
213
  looseEvents: boolean;
216
214
  referenceGrammars?: readonly string[] | undefined;
217
215
  textNormalization: 'display' | 'itn' | 'lexical' | 'maskeditn';
@@ -268,6 +266,53 @@ declare function createSpeechRecognitionPonyfillFromRecognizer({ createRecognize
268
266
  SpeechRecognitionEvent: typeof SpeechRecognitionEvent;
269
267
  };
270
268
 
269
+ declare class SpeechSynthesisEvent {
270
+ constructor(type: any);
271
+ }
272
+
273
+ declare class SpeechSynthesisUtterance {
274
+ constructor(text: any);
275
+ _lang: any;
276
+ _pitch: number;
277
+ _rate: number;
278
+ _voice: any;
279
+ _volume: number;
280
+ text: any;
281
+ set onboundary(value: any);
282
+ get onboundary(): any;
283
+ set onend(value: any);
284
+ get onend(): any;
285
+ set onerror(value: any);
286
+ get onerror(): any;
287
+ set onmark(value: any);
288
+ get onmark(): any;
289
+ set onpause(value: any);
290
+ get onpause(): any;
291
+ set onresume(value: any);
292
+ get onresume(): any;
293
+ set onstart(value: any);
294
+ get onstart(): any;
295
+ set lang(value: any);
296
+ get lang(): any;
297
+ set pitch(value: number);
298
+ get pitch(): number;
299
+ set rate(value: number);
300
+ get rate(): number;
301
+ set voice(value: any);
302
+ get voice(): any;
303
+ set volume(value: number);
304
+ get volume(): number;
305
+ preload({ deploymentId, fetchCredentials, outputFormat }: {
306
+ deploymentId: any;
307
+ fetchCredentials: any;
308
+ outputFormat: any;
309
+ }): void;
310
+ arrayBufferPromise: Promise<ArrayBuffer> | undefined;
311
+ play(audioContext: any): Promise<void>;
312
+ _playingSource: any;
313
+ stop(): void;
314
+ }
315
+
271
316
  declare function _default(options: any): {
272
317
  speechSynthesis?: never;
273
318
  SpeechSynthesisEvent?: never;
@@ -294,24 +339,6 @@ type FetchAuthorizationTokenInit = {
294
339
  };
295
340
  declare function fetchAuthorizationToken({ region, subscriptionKey }: FetchAuthorizationTokenInit): Promise<string>;
296
341
 
297
- declare function createSpeechServicesPonyfill(options?: {}, ...args: any[]): {
298
- speechSynthesis?: never;
299
- SpeechSynthesisEvent?: never;
300
- SpeechSynthesisUtterance?: never;
301
- } | {
302
- speechSynthesis: {
303
- queue: _default$1;
304
- cancel(): void;
305
- getVoices(): any[];
306
- onvoiceschanged: any;
307
- pause(): void;
308
- resume(): void;
309
- speak(utterance: any): Promise<any>;
310
- readonly speaking: boolean;
311
- updateVoices(): Promise<void>;
312
- };
313
- SpeechSynthesisEvent: typeof SpeechSynthesisEvent;
314
- SpeechSynthesisUtterance: typeof SpeechSynthesisUtterance;
315
- };
342
+ declare function createSpeechServicesPonyfill(options?: any): any;
316
343
 
317
344
  export { createSpeechRecognitionPonyfill, createSpeechRecognitionPonyfillFromRecognizer, createSpeechServicesPonyfill, _default as createSpeechSynthesisPonyfill, fetchAuthorizationToken };