web-speech-cognitive-services 7.1.4-master.9e026d9 → 8.0.0-main.181f814

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.
Files changed (100) hide show
  1. package/dist/web-speech-cognitive-services.d.mts +283 -0
  2. package/dist/web-speech-cognitive-services.d.ts +283 -0
  3. package/dist/web-speech-cognitive-services.development.js +25696 -0
  4. package/dist/web-speech-cognitive-services.development.js.map +1 -0
  5. package/dist/web-speech-cognitive-services.js +1356 -0
  6. package/dist/web-speech-cognitive-services.js.map +1 -0
  7. package/dist/web-speech-cognitive-services.mjs +1321 -0
  8. package/dist/web-speech-cognitive-services.mjs.map +1 -0
  9. package/dist/web-speech-cognitive-services.production.min.js +31 -0
  10. package/dist/web-speech-cognitive-services.production.min.js.map +1 -0
  11. package/package.json +67 -47
  12. package/CHANGELOG.md +0 -372
  13. package/lib/BingSpeech/SpeechToText/SpeechGrammarList.js +0 -94
  14. package/lib/BingSpeech/SpeechToText/SpeechGrammarList.js.map +0 -1
  15. package/lib/BingSpeech/SpeechToText/createSpeechRecognitionPonyfill.js +0 -483
  16. package/lib/BingSpeech/SpeechToText/createSpeechRecognitionPonyfill.js.map +0 -1
  17. package/lib/BingSpeech/SpeechToText.js +0 -14
  18. package/lib/BingSpeech/SpeechToText.js.map +0 -1
  19. package/lib/BingSpeech/TextToSpeech/AudioContextConsumer.js +0 -122
  20. package/lib/BingSpeech/TextToSpeech/AudioContextConsumer.js.map +0 -1
  21. package/lib/BingSpeech/TextToSpeech/AudioContextQueue.js +0 -104
  22. package/lib/BingSpeech/TextToSpeech/AudioContextQueue.js.map +0 -1
  23. package/lib/BingSpeech/TextToSpeech/SpeechSynthesisUtterance.js +0 -264
  24. package/lib/BingSpeech/TextToSpeech/SpeechSynthesisUtterance.js.map +0 -1
  25. package/lib/BingSpeech/TextToSpeech/SpeechSynthesisVoice.js +0 -61
  26. package/lib/BingSpeech/TextToSpeech/SpeechSynthesisVoice.js.map +0 -1
  27. package/lib/BingSpeech/TextToSpeech/buildSSML.js +0 -32
  28. package/lib/BingSpeech/TextToSpeech/buildSSML.js.map +0 -1
  29. package/lib/BingSpeech/TextToSpeech/createSpeechSynthesisPonyfill.js +0 -220
  30. package/lib/BingSpeech/TextToSpeech/createSpeechSynthesisPonyfill.js.map +0 -1
  31. package/lib/BingSpeech/TextToSpeech/fetchSpeechData.js +0 -74
  32. package/lib/BingSpeech/TextToSpeech/fetchSpeechData.js.map +0 -1
  33. package/lib/BingSpeech/TextToSpeech/fetchVoices.js +0 -335
  34. package/lib/BingSpeech/TextToSpeech/fetchVoices.js.map +0 -1
  35. package/lib/BingSpeech/TextToSpeech/isSSML.js +0 -13
  36. package/lib/BingSpeech/TextToSpeech/isSSML.js.map +0 -1
  37. package/lib/BingSpeech/TextToSpeech/subscribeEvent.js +0 -14
  38. package/lib/BingSpeech/TextToSpeech/subscribeEvent.js.map +0 -1
  39. package/lib/BingSpeech/TextToSpeech.js +0 -14
  40. package/lib/BingSpeech/TextToSpeech.js.map +0 -1
  41. package/lib/BingSpeech/Util/DOMEventEmitter.js +0 -61
  42. package/lib/BingSpeech/Util/DOMEventEmitter.js.map +0 -1
  43. package/lib/BingSpeech/Util/createFetchTokenUsingSubscriptionKey.js +0 -41
  44. package/lib/BingSpeech/Util/createFetchTokenUsingSubscriptionKey.js.map +0 -1
  45. package/lib/BingSpeech/fetchAuthorizationToken.js +0 -57
  46. package/lib/BingSpeech/fetchAuthorizationToken.js.map +0 -1
  47. package/lib/BingSpeech/index.js +0 -84
  48. package/lib/BingSpeech/index.js.map +0 -1
  49. package/lib/SpeechServices/SpeechSDK.js +0 -19
  50. package/lib/SpeechServices/SpeechSDK.js.map +0 -1
  51. package/lib/SpeechServices/SpeechToText/SpeechGrammarList.js +0 -45
  52. package/lib/SpeechServices/SpeechToText/SpeechGrammarList.js.map +0 -1
  53. package/lib/SpeechServices/SpeechToText/cognitiveServiceEventResultToWebSpeechRecognitionResultList.js +0 -56
  54. package/lib/SpeechServices/SpeechToText/cognitiveServiceEventResultToWebSpeechRecognitionResultList.js.map +0 -1
  55. package/lib/SpeechServices/SpeechToText/createSpeechRecognitionPonyfill.js +0 -984
  56. package/lib/SpeechServices/SpeechToText/createSpeechRecognitionPonyfill.js.map +0 -1
  57. package/lib/SpeechServices/SpeechToText.js +0 -24
  58. package/lib/SpeechServices/SpeechToText.js.map +0 -1
  59. package/lib/SpeechServices/TextToSpeech/AudioContextConsumer.js +0 -92
  60. package/lib/SpeechServices/TextToSpeech/AudioContextConsumer.js.map +0 -1
  61. package/lib/SpeechServices/TextToSpeech/AudioContextQueue.js +0 -111
  62. package/lib/SpeechServices/TextToSpeech/AudioContextQueue.js.map +0 -1
  63. package/lib/SpeechServices/TextToSpeech/SpeechSynthesisEvent.js +0 -40
  64. package/lib/SpeechServices/TextToSpeech/SpeechSynthesisEvent.js.map +0 -1
  65. package/lib/SpeechServices/TextToSpeech/SpeechSynthesisUtterance.js +0 -283
  66. package/lib/SpeechServices/TextToSpeech/SpeechSynthesisUtterance.js.map +0 -1
  67. package/lib/SpeechServices/TextToSpeech/SpeechSynthesisVoice.js +0 -63
  68. package/lib/SpeechServices/TextToSpeech/SpeechSynthesisVoice.js.map +0 -1
  69. package/lib/SpeechServices/TextToSpeech/buildSSML.js +0 -32
  70. package/lib/SpeechServices/TextToSpeech/buildSSML.js.map +0 -1
  71. package/lib/SpeechServices/TextToSpeech/createSpeechSynthesisPonyfill.js +0 -282
  72. package/lib/SpeechServices/TextToSpeech/createSpeechSynthesisPonyfill.js.map +0 -1
  73. package/lib/SpeechServices/TextToSpeech/fetchCustomVoices.js +0 -110
  74. package/lib/SpeechServices/TextToSpeech/fetchCustomVoices.js.map +0 -1
  75. package/lib/SpeechServices/TextToSpeech/fetchSpeechData.js +0 -127
  76. package/lib/SpeechServices/TextToSpeech/fetchSpeechData.js.map +0 -1
  77. package/lib/SpeechServices/TextToSpeech/fetchVoices.js +0 -87
  78. package/lib/SpeechServices/TextToSpeech/fetchVoices.js.map +0 -1
  79. package/lib/SpeechServices/TextToSpeech/isSSML.js +0 -13
  80. package/lib/SpeechServices/TextToSpeech/isSSML.js.map +0 -1
  81. package/lib/SpeechServices/TextToSpeech/subscribeEvent.js +0 -14
  82. package/lib/SpeechServices/TextToSpeech/subscribeEvent.js.map +0 -1
  83. package/lib/SpeechServices/TextToSpeech.js +0 -14
  84. package/lib/SpeechServices/TextToSpeech.js.map +0 -1
  85. package/lib/SpeechServices/fetchAuthorizationToken.js +0 -58
  86. package/lib/SpeechServices/fetchAuthorizationToken.js.map +0 -1
  87. package/lib/SpeechServices/patchOptions.js +0 -213
  88. package/lib/SpeechServices/patchOptions.js.map +0 -1
  89. package/lib/SpeechServices/resolveFunctionOrReturnValue.js +0 -11
  90. package/lib/SpeechServices/resolveFunctionOrReturnValue.js.map +0 -1
  91. package/lib/SpeechServices.js +0 -73
  92. package/lib/SpeechServices.js.map +0 -1
  93. package/lib/Util/arrayToMap.js +0 -28
  94. package/lib/Util/arrayToMap.js.map +0 -1
  95. package/lib/Util/createPromiseQueue.js +0 -40
  96. package/lib/Util/createPromiseQueue.js.map +0 -1
  97. package/lib/index.js +0 -14
  98. package/lib/index.js.map +0 -1
  99. package/umd/web-speech-cognitive-services.development.js +0 -4740
  100. package/umd/web-speech-cognitive-services.production.min.js +0 -2
@@ -0,0 +1,283 @@
1
+ import * as memoize_one from 'memoize-one';
2
+
3
+ declare class SpeechSynthesisUtterance {
4
+ constructor(text: any);
5
+ _lang: any;
6
+ _pitch: number;
7
+ _rate: number;
8
+ _voice: any;
9
+ _volume: number;
10
+ text: any;
11
+ set onboundary(value: any);
12
+ get onboundary(): any;
13
+ set onend(value: any);
14
+ get onend(): any;
15
+ set onerror(value: any);
16
+ get onerror(): any;
17
+ set onmark(value: any);
18
+ get onmark(): any;
19
+ set onpause(value: any);
20
+ get onpause(): any;
21
+ set onresume(value: any);
22
+ get onresume(): any;
23
+ set onstart(value: any);
24
+ get onstart(): any;
25
+ set lang(value: any);
26
+ get lang(): any;
27
+ set pitch(value: number);
28
+ get pitch(): number;
29
+ set rate(value: number);
30
+ get rate(): number;
31
+ set voice(value: any);
32
+ get voice(): any;
33
+ set volume(value: number);
34
+ get volume(): number;
35
+ preload({ deploymentId, fetchCredentials, outputFormat }: {
36
+ deploymentId: any;
37
+ fetchCredentials: any;
38
+ outputFormat: any;
39
+ }): void;
40
+ arrayBufferPromise: Promise<ArrayBuffer> | undefined;
41
+ play(audioContext: any): Promise<void>;
42
+ _playingSource: any;
43
+ stop(): void;
44
+ }
45
+
46
+ declare class SpeechSynthesisEvent {
47
+ constructor(type: any);
48
+ }
49
+
50
+ declare class _default$5 {
51
+ constructor(audioContext: any);
52
+ audioContext: any;
53
+ pause(): void;
54
+ resume(): void;
55
+ start(queue: any): Promise<void>;
56
+ playingUtterance: any;
57
+ stop(): void;
58
+ }
59
+
60
+ declare class _default$4 {
61
+ constructor({ audioContext, ponyfill }: {
62
+ audioContext: any;
63
+ ponyfill: any;
64
+ });
65
+ consumer: _default$5 | null;
66
+ paused: boolean;
67
+ queue: any[];
68
+ getAudioContext: memoize_one.MemoizedFn<() => any>;
69
+ pause(): void;
70
+ push(utterance: any): void;
71
+ resume(): void;
72
+ get speaking(): boolean;
73
+ startConsumer(): Promise<void>;
74
+ stop(): void;
75
+ }
76
+
77
+ declare class EventListenerMap<T extends string, EventMap extends Record<T, Event>> {
78
+ #private;
79
+ constructor(eventTarget: EventTarget);
80
+ getProperty(name: T): ((event: EventMap[typeof name]) => void) | undefined;
81
+ setProperty(name: T, value: ((event: EventMap[typeof name]) => void) | undefined): void;
82
+ }
83
+
84
+ type SpeechRecognitionErrorType = 'aborted' | 'audio-capture' | 'bad-grammar' | 'language-not-supported' | 'network' | 'no-speech' | 'not-allowed' | 'service-not-allowed';
85
+ type SpeechRecognitionErrorEventInit = {
86
+ error: SpeechRecognitionErrorType;
87
+ message?: string | undefined;
88
+ };
89
+ declare class SpeechRecognitionErrorEvent extends Event {
90
+ #private;
91
+ constructor(type: 'error', { error, message }: SpeechRecognitionErrorEventInit);
92
+ get error(): SpeechRecognitionErrorType;
93
+ get message(): string | undefined;
94
+ }
95
+
96
+ interface FakeArrayInterface<T> {
97
+ [index: number]: T | undefined;
98
+ get length(): number;
99
+ }
100
+ declare class FakeArray<T> implements FakeArrayInterface<T> {
101
+ #private;
102
+ constructor(array: readonly T[]);
103
+ [index: number]: T | undefined;
104
+ [Symbol.iterator](): IterableIterator<T>;
105
+ get length(): number;
106
+ }
107
+
108
+ type SpeechRecognitionResultInit = {
109
+ isFinal: boolean;
110
+ results: readonly SpeechRecognitionAlternative[];
111
+ };
112
+ declare class SpeechRecognitionResult extends FakeArray<SpeechRecognitionAlternative> {
113
+ #private;
114
+ constructor(init: SpeechRecognitionResultInit);
115
+ get isFinal(): boolean;
116
+ }
117
+
118
+ declare class SpeechRecognitionResultList extends FakeArray<SpeechRecognitionResult> {
119
+ constructor(result: readonly SpeechRecognitionResult[]);
120
+ }
121
+
122
+ type SpeechRecognitionEventInit = {
123
+ data?: undefined | unknown;
124
+ resultIndex?: number | undefined;
125
+ results?: SpeechRecognitionResultList | undefined;
126
+ };
127
+ declare class SpeechRecognitionEvent<T extends 'audioend' | 'audiostart' | 'cognitiveservices' | 'end' | 'result' | 'soundend' | 'soundstart' | 'speechend' | 'speechstart' | 'start'> extends Event {
128
+ #private;
129
+ constructor(type: 'cognitiveservices', init: SpeechRecognitionEventInit & {
130
+ data: {
131
+ type: string;
132
+ };
133
+ });
134
+ constructor(type: 'audioend');
135
+ constructor(type: 'audiostart');
136
+ constructor(type: 'end');
137
+ constructor(type: 'result', init: SpeechRecognitionEventInit);
138
+ constructor(type: 'soundend');
139
+ constructor(type: 'soundstart');
140
+ constructor(type: 'speechend');
141
+ constructor(type: 'speechstart');
142
+ constructor(type: 'start');
143
+ get data(): unknown;
144
+ get resultIndex(): number | undefined;
145
+ get results(): SpeechRecognitionResultList;
146
+ }
147
+
148
+ type SpeechRecognitionEventListenerMap = EventListenerMap<'audioend' | 'audiostart' | 'cognitiveservices' | 'end' | 'error' | 'result' | 'soundend' | 'soundstart' | 'speechend' | 'speechstart' | 'start', {
149
+ audioend: SpeechRecognitionEvent<'audioend'>;
150
+ audiostart: SpeechRecognitionEvent<'audiostart'>;
151
+ cognitiveservices: SpeechRecognitionEvent<'cognitiveservices'>;
152
+ end: SpeechRecognitionEvent<'end'>;
153
+ error: SpeechRecognitionErrorEvent;
154
+ result: SpeechRecognitionEvent<'result'>;
155
+ soundend: SpeechRecognitionEvent<'soundend'>;
156
+ soundstart: SpeechRecognitionEvent<'soundstart'>;
157
+ speechend: SpeechRecognitionEvent<'speechend'>;
158
+ speechstart: SpeechRecognitionEvent<'speechstart'>;
159
+ start: SpeechRecognitionEvent<'start'>;
160
+ }>;
161
+
162
+ declare class _default$3 {
163
+ _phrases: any[];
164
+ addFromString(): void;
165
+ set phrases(value: any[]);
166
+ get phrases(): any[];
167
+ }
168
+
169
+ declare function createSpeechRecognitionPonyfillFromRecognizer({ createRecognizer, enableTelemetry, looseEvents, referenceGrammars, textNormalization }: {
170
+ createRecognizer: any;
171
+ enableTelemetry: any;
172
+ looseEvents: any;
173
+ referenceGrammars: any;
174
+ textNormalization: any;
175
+ }): {
176
+ SpeechGrammarList: typeof _default$3;
177
+ SpeechRecognition: {
178
+ new (): {
179
+ _continuous: boolean;
180
+ _interimResults: boolean;
181
+ _lang: string;
182
+ _grammars: _default$3;
183
+ _maxAlternatives: number;
184
+ /** @type { import('./SpeechRecognitionEventListenerMap').SpeechRecognitionEventListenerMap } */
185
+ "__#7@#eventListenerMap": SpeechRecognitionEventListenerMap;
186
+ emitCognitiveServices(type: any, event: any): void;
187
+ continuous: boolean;
188
+ grammars: _default$3;
189
+ interimResults: boolean;
190
+ maxAlternatives: number;
191
+ lang: string;
192
+ /** @type { ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined } */
193
+ get onaudioend(): ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined;
194
+ set onaudioend(value: ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined);
195
+ /** @type { ((event: SpeechRecognitionEvent<'audiostart'>) => void) | undefined } */
196
+ get onaudiostart(): ((event: SpeechRecognitionEvent<'audiostart'>) => void) | undefined;
197
+ set onaudiostart(value: ((event: SpeechRecognitionEvent<'audiostart'>) => void) | undefined);
198
+ /** @type { ((event: SpeechRecognitionEvent<'cognitiveservices'>) => void) | undefined } */
199
+ get oncognitiveservices(): ((event: SpeechRecognitionEvent<'cognitiveservices'>) => void) | undefined;
200
+ set oncognitiveservices(value: ((event: SpeechRecognitionEvent<'cognitiveservices'>) => void) | undefined);
201
+ /** @type { ((event: SpeechRecognitionEvent<'end'>) => void) | undefined } */
202
+ get onend(): ((event: SpeechRecognitionEvent<'end'>) => void) | undefined;
203
+ set onend(value: ((event: SpeechRecognitionEvent<'end'>) => void) | undefined);
204
+ /** @type { ((event: SpeechRecognitionEvent<'error'>) => void) | undefined } */
205
+ get onerror(): ((event: SpeechRecognitionEvent<'error'>) => void) | undefined;
206
+ set onerror(value: ((event: SpeechRecognitionEvent<'error'>) => void) | undefined);
207
+ /** @type { ((event: SpeechRecognitionEvent<'result'>) => void) | undefined } */
208
+ get onresult(): ((event: SpeechRecognitionEvent<'result'>) => void) | undefined;
209
+ set onresult(value: ((event: SpeechRecognitionEvent<'result'>) => void) | undefined);
210
+ /** @type { ((event: SpeechRecognitionEvent<'soundend'>) => void) | undefined } */
211
+ get onsoundend(): ((event: SpeechRecognitionEvent<'soundend'>) => void) | undefined;
212
+ set onsoundend(value: ((event: SpeechRecognitionEvent<'soundend'>) => void) | undefined);
213
+ /** @type { ((event: SpeechRecognitionEvent<'soundstart'>) => void) | undefined } */
214
+ get onsoundstart(): ((event: SpeechRecognitionEvent<'soundstart'>) => void) | undefined;
215
+ set onsoundstart(value: ((event: SpeechRecognitionEvent<'soundstart'>) => void) | undefined);
216
+ /** @type { ((event: SpeechRecognitionEvent<'speechend'>) => void) | undefined } */
217
+ get onspeechend(): ((event: SpeechRecognitionEvent<'speechend'>) => void) | undefined;
218
+ set onspeechend(value: ((event: SpeechRecognitionEvent<'speechend'>) => void) | undefined);
219
+ /** @type { ((event: SpeechRecognitionEvent<'speechstart'>) => void) | undefined } */
220
+ get onspeechstart(): ((event: SpeechRecognitionEvent<'speechstart'>) => void) | undefined;
221
+ set onspeechstart(value: ((event: SpeechRecognitionEvent<'speechstart'>) => void) | undefined);
222
+ /** @type { ((event: SpeechRecognitionEvent<'start'>) => void) | undefined } */
223
+ get onstart(): ((event: SpeechRecognitionEvent<'start'>) => void) | undefined;
224
+ set onstart(value: ((event: SpeechRecognitionEvent<'start'>) => void) | undefined);
225
+ start(): void;
226
+ _startOnce(): Promise<void>;
227
+ abort: (() => void) | undefined;
228
+ stop: (() => void) | undefined;
229
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions | undefined): void;
230
+ dispatchEvent(event: Event): boolean;
231
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void;
232
+ };
233
+ };
234
+ SpeechRecognitionEvent: typeof SpeechRecognitionEvent;
235
+ };
236
+ declare function _default$2(options: any): {};
237
+
238
+ declare function _default$1(options: any): {
239
+ speechSynthesis?: never;
240
+ SpeechSynthesisEvent?: never;
241
+ SpeechSynthesisUtterance?: never;
242
+ } | {
243
+ speechSynthesis: {
244
+ queue: AudioContextQueue;
245
+ cancel(): void;
246
+ getVoices(): any[];
247
+ onvoiceschanged: any;
248
+ pause(): void;
249
+ resume(): void;
250
+ speak(utterance: any): Promise<any>;
251
+ readonly speaking: boolean;
252
+ updateVoices(): Promise<void>;
253
+ };
254
+ SpeechSynthesisEvent: typeof SpeechSynthesisEvent;
255
+ SpeechSynthesisUtterance: typeof SpeechSynthesisUtterance;
256
+ };
257
+
258
+ declare function _default({ region, subscriptionKey }: {
259
+ region: any;
260
+ subscriptionKey: any;
261
+ }): Promise<string>;
262
+
263
+ declare function createSpeechServicesPonyfill(options?: {}, ...args: any[]): {
264
+ speechSynthesis?: never;
265
+ SpeechSynthesisEvent?: never;
266
+ SpeechSynthesisUtterance?: never;
267
+ } | {
268
+ speechSynthesis: {
269
+ queue: _default$4;
270
+ cancel(): void;
271
+ getVoices(): any[];
272
+ onvoiceschanged: any;
273
+ pause(): void;
274
+ resume(): void;
275
+ speak(utterance: any): Promise<any>;
276
+ readonly speaking: boolean;
277
+ updateVoices(): Promise<void>;
278
+ };
279
+ SpeechSynthesisEvent: typeof SpeechSynthesisEvent;
280
+ SpeechSynthesisUtterance: typeof SpeechSynthesisUtterance;
281
+ };
282
+
283
+ export { _default$2 as createSpeechRecognitionPonyfill, createSpeechRecognitionPonyfillFromRecognizer, createSpeechServicesPonyfill, _default$1 as createSpeechSynthesisPonyfill, _default as fetchAuthorizationToken };
@@ -0,0 +1,283 @@
1
+ import * as memoize_one from 'memoize-one';
2
+
3
+ declare class SpeechSynthesisUtterance {
4
+ constructor(text: any);
5
+ _lang: any;
6
+ _pitch: number;
7
+ _rate: number;
8
+ _voice: any;
9
+ _volume: number;
10
+ text: any;
11
+ set onboundary(value: any);
12
+ get onboundary(): any;
13
+ set onend(value: any);
14
+ get onend(): any;
15
+ set onerror(value: any);
16
+ get onerror(): any;
17
+ set onmark(value: any);
18
+ get onmark(): any;
19
+ set onpause(value: any);
20
+ get onpause(): any;
21
+ set onresume(value: any);
22
+ get onresume(): any;
23
+ set onstart(value: any);
24
+ get onstart(): any;
25
+ set lang(value: any);
26
+ get lang(): any;
27
+ set pitch(value: number);
28
+ get pitch(): number;
29
+ set rate(value: number);
30
+ get rate(): number;
31
+ set voice(value: any);
32
+ get voice(): any;
33
+ set volume(value: number);
34
+ get volume(): number;
35
+ preload({ deploymentId, fetchCredentials, outputFormat }: {
36
+ deploymentId: any;
37
+ fetchCredentials: any;
38
+ outputFormat: any;
39
+ }): void;
40
+ arrayBufferPromise: Promise<ArrayBuffer> | undefined;
41
+ play(audioContext: any): Promise<void>;
42
+ _playingSource: any;
43
+ stop(): void;
44
+ }
45
+
46
+ declare class SpeechSynthesisEvent {
47
+ constructor(type: any);
48
+ }
49
+
50
+ declare class _default$5 {
51
+ constructor(audioContext: any);
52
+ audioContext: any;
53
+ pause(): void;
54
+ resume(): void;
55
+ start(queue: any): Promise<void>;
56
+ playingUtterance: any;
57
+ stop(): void;
58
+ }
59
+
60
+ declare class _default$4 {
61
+ constructor({ audioContext, ponyfill }: {
62
+ audioContext: any;
63
+ ponyfill: any;
64
+ });
65
+ consumer: _default$5 | null;
66
+ paused: boolean;
67
+ queue: any[];
68
+ getAudioContext: memoize_one.MemoizedFn<() => any>;
69
+ pause(): void;
70
+ push(utterance: any): void;
71
+ resume(): void;
72
+ get speaking(): boolean;
73
+ startConsumer(): Promise<void>;
74
+ stop(): void;
75
+ }
76
+
77
+ declare class EventListenerMap<T extends string, EventMap extends Record<T, Event>> {
78
+ #private;
79
+ constructor(eventTarget: EventTarget);
80
+ getProperty(name: T): ((event: EventMap[typeof name]) => void) | undefined;
81
+ setProperty(name: T, value: ((event: EventMap[typeof name]) => void) | undefined): void;
82
+ }
83
+
84
+ type SpeechRecognitionErrorType = 'aborted' | 'audio-capture' | 'bad-grammar' | 'language-not-supported' | 'network' | 'no-speech' | 'not-allowed' | 'service-not-allowed';
85
+ type SpeechRecognitionErrorEventInit = {
86
+ error: SpeechRecognitionErrorType;
87
+ message?: string | undefined;
88
+ };
89
+ declare class SpeechRecognitionErrorEvent extends Event {
90
+ #private;
91
+ constructor(type: 'error', { error, message }: SpeechRecognitionErrorEventInit);
92
+ get error(): SpeechRecognitionErrorType;
93
+ get message(): string | undefined;
94
+ }
95
+
96
+ interface FakeArrayInterface<T> {
97
+ [index: number]: T | undefined;
98
+ get length(): number;
99
+ }
100
+ declare class FakeArray<T> implements FakeArrayInterface<T> {
101
+ #private;
102
+ constructor(array: readonly T[]);
103
+ [index: number]: T | undefined;
104
+ [Symbol.iterator](): IterableIterator<T>;
105
+ get length(): number;
106
+ }
107
+
108
+ type SpeechRecognitionResultInit = {
109
+ isFinal: boolean;
110
+ results: readonly SpeechRecognitionAlternative[];
111
+ };
112
+ declare class SpeechRecognitionResult extends FakeArray<SpeechRecognitionAlternative> {
113
+ #private;
114
+ constructor(init: SpeechRecognitionResultInit);
115
+ get isFinal(): boolean;
116
+ }
117
+
118
+ declare class SpeechRecognitionResultList extends FakeArray<SpeechRecognitionResult> {
119
+ constructor(result: readonly SpeechRecognitionResult[]);
120
+ }
121
+
122
+ type SpeechRecognitionEventInit = {
123
+ data?: undefined | unknown;
124
+ resultIndex?: number | undefined;
125
+ results?: SpeechRecognitionResultList | undefined;
126
+ };
127
+ declare class SpeechRecognitionEvent<T extends 'audioend' | 'audiostart' | 'cognitiveservices' | 'end' | 'result' | 'soundend' | 'soundstart' | 'speechend' | 'speechstart' | 'start'> extends Event {
128
+ #private;
129
+ constructor(type: 'cognitiveservices', init: SpeechRecognitionEventInit & {
130
+ data: {
131
+ type: string;
132
+ };
133
+ });
134
+ constructor(type: 'audioend');
135
+ constructor(type: 'audiostart');
136
+ constructor(type: 'end');
137
+ constructor(type: 'result', init: SpeechRecognitionEventInit);
138
+ constructor(type: 'soundend');
139
+ constructor(type: 'soundstart');
140
+ constructor(type: 'speechend');
141
+ constructor(type: 'speechstart');
142
+ constructor(type: 'start');
143
+ get data(): unknown;
144
+ get resultIndex(): number | undefined;
145
+ get results(): SpeechRecognitionResultList;
146
+ }
147
+
148
+ type SpeechRecognitionEventListenerMap = EventListenerMap<'audioend' | 'audiostart' | 'cognitiveservices' | 'end' | 'error' | 'result' | 'soundend' | 'soundstart' | 'speechend' | 'speechstart' | 'start', {
149
+ audioend: SpeechRecognitionEvent<'audioend'>;
150
+ audiostart: SpeechRecognitionEvent<'audiostart'>;
151
+ cognitiveservices: SpeechRecognitionEvent<'cognitiveservices'>;
152
+ end: SpeechRecognitionEvent<'end'>;
153
+ error: SpeechRecognitionErrorEvent;
154
+ result: SpeechRecognitionEvent<'result'>;
155
+ soundend: SpeechRecognitionEvent<'soundend'>;
156
+ soundstart: SpeechRecognitionEvent<'soundstart'>;
157
+ speechend: SpeechRecognitionEvent<'speechend'>;
158
+ speechstart: SpeechRecognitionEvent<'speechstart'>;
159
+ start: SpeechRecognitionEvent<'start'>;
160
+ }>;
161
+
162
+ declare class _default$3 {
163
+ _phrases: any[];
164
+ addFromString(): void;
165
+ set phrases(value: any[]);
166
+ get phrases(): any[];
167
+ }
168
+
169
+ declare function createSpeechRecognitionPonyfillFromRecognizer({ createRecognizer, enableTelemetry, looseEvents, referenceGrammars, textNormalization }: {
170
+ createRecognizer: any;
171
+ enableTelemetry: any;
172
+ looseEvents: any;
173
+ referenceGrammars: any;
174
+ textNormalization: any;
175
+ }): {
176
+ SpeechGrammarList: typeof _default$3;
177
+ SpeechRecognition: {
178
+ new (): {
179
+ _continuous: boolean;
180
+ _interimResults: boolean;
181
+ _lang: string;
182
+ _grammars: _default$3;
183
+ _maxAlternatives: number;
184
+ /** @type { import('./SpeechRecognitionEventListenerMap').SpeechRecognitionEventListenerMap } */
185
+ "__#7@#eventListenerMap": SpeechRecognitionEventListenerMap;
186
+ emitCognitiveServices(type: any, event: any): void;
187
+ continuous: boolean;
188
+ grammars: _default$3;
189
+ interimResults: boolean;
190
+ maxAlternatives: number;
191
+ lang: string;
192
+ /** @type { ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined } */
193
+ get onaudioend(): ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined;
194
+ set onaudioend(value: ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined);
195
+ /** @type { ((event: SpeechRecognitionEvent<'audiostart'>) => void) | undefined } */
196
+ get onaudiostart(): ((event: SpeechRecognitionEvent<'audiostart'>) => void) | undefined;
197
+ set onaudiostart(value: ((event: SpeechRecognitionEvent<'audiostart'>) => void) | undefined);
198
+ /** @type { ((event: SpeechRecognitionEvent<'cognitiveservices'>) => void) | undefined } */
199
+ get oncognitiveservices(): ((event: SpeechRecognitionEvent<'cognitiveservices'>) => void) | undefined;
200
+ set oncognitiveservices(value: ((event: SpeechRecognitionEvent<'cognitiveservices'>) => void) | undefined);
201
+ /** @type { ((event: SpeechRecognitionEvent<'end'>) => void) | undefined } */
202
+ get onend(): ((event: SpeechRecognitionEvent<'end'>) => void) | undefined;
203
+ set onend(value: ((event: SpeechRecognitionEvent<'end'>) => void) | undefined);
204
+ /** @type { ((event: SpeechRecognitionEvent<'error'>) => void) | undefined } */
205
+ get onerror(): ((event: SpeechRecognitionEvent<'error'>) => void) | undefined;
206
+ set onerror(value: ((event: SpeechRecognitionEvent<'error'>) => void) | undefined);
207
+ /** @type { ((event: SpeechRecognitionEvent<'result'>) => void) | undefined } */
208
+ get onresult(): ((event: SpeechRecognitionEvent<'result'>) => void) | undefined;
209
+ set onresult(value: ((event: SpeechRecognitionEvent<'result'>) => void) | undefined);
210
+ /** @type { ((event: SpeechRecognitionEvent<'soundend'>) => void) | undefined } */
211
+ get onsoundend(): ((event: SpeechRecognitionEvent<'soundend'>) => void) | undefined;
212
+ set onsoundend(value: ((event: SpeechRecognitionEvent<'soundend'>) => void) | undefined);
213
+ /** @type { ((event: SpeechRecognitionEvent<'soundstart'>) => void) | undefined } */
214
+ get onsoundstart(): ((event: SpeechRecognitionEvent<'soundstart'>) => void) | undefined;
215
+ set onsoundstart(value: ((event: SpeechRecognitionEvent<'soundstart'>) => void) | undefined);
216
+ /** @type { ((event: SpeechRecognitionEvent<'speechend'>) => void) | undefined } */
217
+ get onspeechend(): ((event: SpeechRecognitionEvent<'speechend'>) => void) | undefined;
218
+ set onspeechend(value: ((event: SpeechRecognitionEvent<'speechend'>) => void) | undefined);
219
+ /** @type { ((event: SpeechRecognitionEvent<'speechstart'>) => void) | undefined } */
220
+ get onspeechstart(): ((event: SpeechRecognitionEvent<'speechstart'>) => void) | undefined;
221
+ set onspeechstart(value: ((event: SpeechRecognitionEvent<'speechstart'>) => void) | undefined);
222
+ /** @type { ((event: SpeechRecognitionEvent<'start'>) => void) | undefined } */
223
+ get onstart(): ((event: SpeechRecognitionEvent<'start'>) => void) | undefined;
224
+ set onstart(value: ((event: SpeechRecognitionEvent<'start'>) => void) | undefined);
225
+ start(): void;
226
+ _startOnce(): Promise<void>;
227
+ abort: (() => void) | undefined;
228
+ stop: (() => void) | undefined;
229
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions | undefined): void;
230
+ dispatchEvent(event: Event): boolean;
231
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void;
232
+ };
233
+ };
234
+ SpeechRecognitionEvent: typeof SpeechRecognitionEvent;
235
+ };
236
+ declare function _default$2(options: any): {};
237
+
238
+ declare function _default$1(options: any): {
239
+ speechSynthesis?: never;
240
+ SpeechSynthesisEvent?: never;
241
+ SpeechSynthesisUtterance?: never;
242
+ } | {
243
+ speechSynthesis: {
244
+ queue: AudioContextQueue;
245
+ cancel(): void;
246
+ getVoices(): any[];
247
+ onvoiceschanged: any;
248
+ pause(): void;
249
+ resume(): void;
250
+ speak(utterance: any): Promise<any>;
251
+ readonly speaking: boolean;
252
+ updateVoices(): Promise<void>;
253
+ };
254
+ SpeechSynthesisEvent: typeof SpeechSynthesisEvent;
255
+ SpeechSynthesisUtterance: typeof SpeechSynthesisUtterance;
256
+ };
257
+
258
+ declare function _default({ region, subscriptionKey }: {
259
+ region: any;
260
+ subscriptionKey: any;
261
+ }): Promise<string>;
262
+
263
+ declare function createSpeechServicesPonyfill(options?: {}, ...args: any[]): {
264
+ speechSynthesis?: never;
265
+ SpeechSynthesisEvent?: never;
266
+ SpeechSynthesisUtterance?: never;
267
+ } | {
268
+ speechSynthesis: {
269
+ queue: _default$4;
270
+ cancel(): void;
271
+ getVoices(): any[];
272
+ onvoiceschanged: any;
273
+ pause(): void;
274
+ resume(): void;
275
+ speak(utterance: any): Promise<any>;
276
+ readonly speaking: boolean;
277
+ updateVoices(): Promise<void>;
278
+ };
279
+ SpeechSynthesisEvent: typeof SpeechSynthesisEvent;
280
+ SpeechSynthesisUtterance: typeof SpeechSynthesisUtterance;
281
+ };
282
+
283
+ export { _default$2 as createSpeechRecognitionPonyfill, createSpeechRecognitionPonyfillFromRecognizer, createSpeechServicesPonyfill, _default$1 as createSpeechSynthesisPonyfill, _default as fetchAuthorizationToken };