web-speech-cognitive-services 8.0.0-main.aa5b13b → 8.0.0-main.ccf35da
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.
- package/dist/web-speech-cognitive-services.d.mts +148 -53
- package/dist/web-speech-cognitive-services.d.ts +148 -53
- package/dist/web-speech-cognitive-services.development.js +1465 -1397
- package/dist/web-speech-cognitive-services.development.js.map +1 -1
- package/dist/web-speech-cognitive-services.js +399 -272
- package/dist/web-speech-cognitive-services.js.map +1 -1
- package/dist/web-speech-cognitive-services.mjs +397 -270
- package/dist/web-speech-cognitive-services.mjs.map +1 -1
- package/dist/web-speech-cognitive-services.production.min.js +12 -12
- package/dist/web-speech-cognitive-services.production.min.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as memoize_one from 'memoize-one';
|
|
2
|
+
import { SpeechRecognizer } from 'microsoft-cognitiveservices-speech-sdk';
|
|
2
3
|
|
|
3
4
|
declare class SpeechSynthesisUtterance {
|
|
4
5
|
constructor(text: any);
|
|
@@ -47,7 +48,7 @@ declare class SpeechSynthesisEvent {
|
|
|
47
48
|
constructor(type: any);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
declare class _default$
|
|
51
|
+
declare class _default$3 {
|
|
51
52
|
constructor(audioContext: any);
|
|
52
53
|
audioContext: any;
|
|
53
54
|
pause(): void;
|
|
@@ -57,12 +58,12 @@ declare class _default$5 {
|
|
|
57
58
|
stop(): void;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
declare class _default$
|
|
61
|
+
declare class _default$2 {
|
|
61
62
|
constructor({ audioContext, ponyfill }: {
|
|
62
63
|
audioContext: any;
|
|
63
64
|
ponyfill: any;
|
|
64
65
|
});
|
|
65
|
-
consumer: _default$
|
|
66
|
+
consumer: _default$3 | null;
|
|
66
67
|
paused: boolean;
|
|
67
68
|
queue: any[];
|
|
68
69
|
getAudioContext: memoize_one.MemoizedFn<() => any>;
|
|
@@ -74,69 +75,163 @@ declare class _default$4 {
|
|
|
74
75
|
stop(): void;
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
declare
|
|
78
|
-
|
|
78
|
+
declare function createSpeechRecognitionPonyfill(options: any): {};
|
|
79
|
+
|
|
80
|
+
declare class SpeechGrammarList {
|
|
81
|
+
#private;
|
|
82
|
+
constructor();
|
|
79
83
|
addFromString(): void;
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
get phrases(): readonly string[];
|
|
85
|
+
set phrases(value: readonly string[]);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
type SpeechRecognitionErrorType = 'aborted' | 'audio-capture' | 'bad-grammar' | 'language-not-supported' | 'network' | 'no-speech' | 'not-allowed' | 'service-not-allowed' | 'unknown';
|
|
89
|
+
type SpeechRecognitionErrorEventInit = {
|
|
90
|
+
error: SpeechRecognitionErrorType;
|
|
91
|
+
message?: string | undefined;
|
|
92
|
+
};
|
|
93
|
+
declare class SpeechRecognitionErrorEvent extends Event {
|
|
94
|
+
#private;
|
|
95
|
+
constructor(type: 'error', { error, message }: SpeechRecognitionErrorEventInit);
|
|
96
|
+
get error(): SpeechRecognitionErrorType;
|
|
97
|
+
get message(): string | undefined;
|
|
98
|
+
get type(): 'error';
|
|
82
99
|
}
|
|
83
100
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
interface FakeArrayInterface<T> {
|
|
102
|
+
[index: number]: T | undefined;
|
|
103
|
+
get length(): number;
|
|
104
|
+
}
|
|
105
|
+
declare class FakeArray<T> implements FakeArrayInterface<T> {
|
|
106
|
+
#private;
|
|
107
|
+
constructor(array: readonly T[]);
|
|
108
|
+
[index: number]: T | undefined;
|
|
109
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
110
|
+
get length(): number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
type SpeechRecognitionResultInit = {
|
|
114
|
+
isFinal: boolean;
|
|
115
|
+
results: readonly SpeechRecognitionAlternative[];
|
|
116
|
+
};
|
|
117
|
+
declare class SpeechRecognitionResult extends FakeArray<SpeechRecognitionAlternative> {
|
|
118
|
+
#private;
|
|
119
|
+
constructor(init: SpeechRecognitionResultInit);
|
|
120
|
+
get isFinal(): boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare class SpeechRecognitionResultList extends FakeArray<SpeechRecognitionResult> {
|
|
124
|
+
constructor(result: readonly SpeechRecognitionResult[]);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
type SpeechRecognitionEventInit = {
|
|
128
|
+
data?: undefined | unknown;
|
|
129
|
+
resultIndex?: number | undefined;
|
|
130
|
+
results?: SpeechRecognitionResultList | undefined;
|
|
131
|
+
};
|
|
132
|
+
declare class SpeechRecognitionEvent<T extends 'audioend' | 'audiostart' | 'cognitiveservices' | 'end' | 'result' | 'soundend' | 'soundstart' | 'speechend' | 'speechstart' | 'start'> extends Event {
|
|
133
|
+
#private;
|
|
134
|
+
constructor(type: 'cognitiveservices', init: SpeechRecognitionEventInit & {
|
|
135
|
+
data: {
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
constructor(type: 'audioend');
|
|
140
|
+
constructor(type: 'audiostart');
|
|
141
|
+
constructor(type: 'end');
|
|
142
|
+
constructor(type: 'result', init: SpeechRecognitionEventInit);
|
|
143
|
+
constructor(type: 'soundend');
|
|
144
|
+
constructor(type: 'soundstart');
|
|
145
|
+
constructor(type: 'speechend');
|
|
146
|
+
constructor(type: 'speechstart');
|
|
147
|
+
constructor(type: 'start');
|
|
148
|
+
get data(): unknown;
|
|
149
|
+
get resultIndex(): number | undefined;
|
|
150
|
+
get results(): SpeechRecognitionResultList;
|
|
151
|
+
get type(): T;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare class EventListenerMap<T extends string, EventMap extends {
|
|
155
|
+
[Name in T]: unknown;
|
|
156
|
+
}> {
|
|
157
|
+
#private;
|
|
158
|
+
constructor(eventTarget: EventTarget);
|
|
159
|
+
getProperty<U extends T>(name: U): ((event: EventMap[U]) => void) | undefined;
|
|
160
|
+
setProperty<U extends T>(name: U, value: ((event: EventMap[U]) => void) | undefined): void;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
type SpeechRecognitionEventListenerMap = EventListenerMap<'audioend' | 'audiostart' | 'cognitiveservices' | 'end' | 'error' | 'result' | 'soundend' | 'soundstart' | 'speechend' | 'speechstart' | 'start', {
|
|
164
|
+
audioend: SpeechRecognitionEvent<'audioend'>;
|
|
165
|
+
audiostart: SpeechRecognitionEvent<'audiostart'>;
|
|
166
|
+
cognitiveservices: SpeechRecognitionEvent<'cognitiveservices'>;
|
|
167
|
+
end: SpeechRecognitionEvent<'end'>;
|
|
168
|
+
error: SpeechRecognitionErrorEvent;
|
|
169
|
+
result: SpeechRecognitionEvent<'result'>;
|
|
170
|
+
soundend: SpeechRecognitionEvent<'soundend'>;
|
|
171
|
+
soundstart: SpeechRecognitionEvent<'soundstart'>;
|
|
172
|
+
speechend: SpeechRecognitionEvent<'speechend'>;
|
|
173
|
+
speechstart: SpeechRecognitionEvent<'speechstart'>;
|
|
174
|
+
start: SpeechRecognitionEvent<'start'>;
|
|
175
|
+
}>;
|
|
176
|
+
|
|
177
|
+
type CreateSpeechRecognitionPonyfillFromRecognizerInit = {
|
|
178
|
+
createRecognizer: (lang: string) => Promise<SpeechRecognizer>;
|
|
179
|
+
enableTelemetry: boolean;
|
|
180
|
+
looseEvents: boolean;
|
|
181
|
+
referenceGrammars: [];
|
|
182
|
+
textNormalization: 'display' | 'itn' | 'lexical' | 'maskeditn';
|
|
183
|
+
};
|
|
184
|
+
declare function createSpeechRecognitionPonyfillFromRecognizer({ createRecognizer, enableTelemetry, looseEvents, referenceGrammars, textNormalization }: CreateSpeechRecognitionPonyfillFromRecognizerInit): {
|
|
185
|
+
SpeechGrammarList: typeof SpeechGrammarList;
|
|
92
186
|
SpeechRecognition: {
|
|
93
187
|
new (): {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
188
|
+
"__#8@#continuous": boolean;
|
|
189
|
+
"__#8@#eventListenerMap": SpeechRecognitionEventListenerMap;
|
|
190
|
+
"__#8@#grammars": SpeechGrammarList;
|
|
191
|
+
"__#8@#interimResults": boolean;
|
|
192
|
+
"__#8@#lang": string;
|
|
193
|
+
"__#8@#maxAlternatives": number;
|
|
194
|
+
emitCognitiveServices<T extends {
|
|
195
|
+
type: string;
|
|
196
|
+
}>(type: string, event: T): void;
|
|
100
197
|
continuous: boolean;
|
|
101
|
-
grammars:
|
|
198
|
+
grammars: SpeechGrammarList;
|
|
102
199
|
interimResults: boolean;
|
|
103
200
|
maxAlternatives: number;
|
|
104
201
|
lang: string;
|
|
105
|
-
onaudioend:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
202
|
+
get onaudioend(): ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined;
|
|
203
|
+
set onaudioend(value: ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined);
|
|
204
|
+
/** @type { ((event: SpeechRecognitionEvent<'audiostart'>) => void) | undefined } */
|
|
205
|
+
onaudiostart: ((event: SpeechRecognitionEvent<"audiostart">) => void) | undefined;
|
|
206
|
+
/** @type { ((event: SpeechRecognitionEvent<'cognitiveservices'>) => void) | undefined } */
|
|
207
|
+
oncognitiveservices: ((event: SpeechRecognitionEvent<"cognitiveservices">) => void) | undefined;
|
|
208
|
+
/** @type { ((event: SpeechRecognitionEvent<'end'>) => void) | undefined } */
|
|
209
|
+
onend: ((event: SpeechRecognitionEvent<"end">) => void) | undefined;
|
|
210
|
+
/** @type { ((event: SpeechRecognitionErrorEvent) => void) | undefined } */
|
|
211
|
+
onerror: ((event: SpeechRecognitionErrorEvent) => void) | undefined;
|
|
212
|
+
/** @type { ((event: SpeechRecognitionEvent<'result'>) => void) | undefined } */
|
|
213
|
+
onresult: ((event: SpeechRecognitionEvent<"result">) => void) | undefined;
|
|
214
|
+
/** @type { ((event: SpeechRecognitionEvent<'soundend'>) => void) | undefined } */
|
|
215
|
+
onsoundend: ((event: SpeechRecognitionEvent<"soundend">) => void) | undefined;
|
|
216
|
+
/** @type { ((event: SpeechRecognitionEvent<'soundstart'>) => void) | undefined } */
|
|
217
|
+
onsoundstart: ((event: SpeechRecognitionEvent<"soundstart">) => void) | undefined;
|
|
218
|
+
/** @type { ((event: SpeechRecognitionEvent<'speechend'>) => void) | undefined } */
|
|
219
|
+
onspeechend: ((event: SpeechRecognitionEvent<"speechend">) => void) | undefined;
|
|
220
|
+
/** @type { ((event: SpeechRecognitionEvent<'speechstart'>) => void) | undefined } */
|
|
221
|
+
onspeechstart: ((event: SpeechRecognitionEvent<"speechstart">) => void) | undefined;
|
|
222
|
+
/** @type { ((event: SpeechRecognitionEvent<'start'>) => void) | undefined } */
|
|
223
|
+
onstart: ((event: SpeechRecognitionEvent<"start">) => void) | undefined;
|
|
118
224
|
abort: (() => void) | undefined;
|
|
119
225
|
stop: (() => void) | undefined;
|
|
226
|
+
start(): void;
|
|
227
|
+
_startOnce(): Promise<void>;
|
|
228
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
229
|
+
dispatchEvent(event: Event): boolean;
|
|
230
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void;
|
|
120
231
|
};
|
|
121
232
|
};
|
|
122
233
|
SpeechRecognitionEvent: typeof SpeechRecognitionEvent;
|
|
123
234
|
};
|
|
124
|
-
declare function _default$2(options: any): {};
|
|
125
|
-
|
|
126
|
-
declare class SpeechRecognitionEvent {
|
|
127
|
-
constructor(type: any, { data, emma, interpretation, resultIndex, results }?: {
|
|
128
|
-
data: any;
|
|
129
|
-
emma: any;
|
|
130
|
-
interpretation: any;
|
|
131
|
-
resultIndex: any;
|
|
132
|
-
results: any;
|
|
133
|
-
});
|
|
134
|
-
data: any;
|
|
135
|
-
emma: any;
|
|
136
|
-
interpretation: any;
|
|
137
|
-
resultIndex: any;
|
|
138
|
-
results: any;
|
|
139
|
-
}
|
|
140
235
|
|
|
141
236
|
declare function _default$1(options: any): {
|
|
142
237
|
speechSynthesis?: never;
|
|
@@ -169,7 +264,7 @@ declare function createSpeechServicesPonyfill(options?: {}, ...args: any[]): {
|
|
|
169
264
|
SpeechSynthesisUtterance?: never;
|
|
170
265
|
} | {
|
|
171
266
|
speechSynthesis: {
|
|
172
|
-
queue: _default$
|
|
267
|
+
queue: _default$2;
|
|
173
268
|
cancel(): void;
|
|
174
269
|
getVoices(): any[];
|
|
175
270
|
onvoiceschanged: any;
|
|
@@ -183,4 +278,4 @@ declare function createSpeechServicesPonyfill(options?: {}, ...args: any[]): {
|
|
|
183
278
|
SpeechSynthesisUtterance: typeof SpeechSynthesisUtterance;
|
|
184
279
|
};
|
|
185
280
|
|
|
186
|
-
export {
|
|
281
|
+
export { createSpeechRecognitionPonyfill, createSpeechRecognitionPonyfillFromRecognizer, createSpeechServicesPonyfill, _default$1 as createSpeechSynthesisPonyfill, _default as fetchAuthorizationToken };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as memoize_one from 'memoize-one';
|
|
2
|
+
import { SpeechRecognizer } from 'microsoft-cognitiveservices-speech-sdk';
|
|
2
3
|
|
|
3
4
|
declare class SpeechSynthesisUtterance {
|
|
4
5
|
constructor(text: any);
|
|
@@ -47,7 +48,7 @@ declare class SpeechSynthesisEvent {
|
|
|
47
48
|
constructor(type: any);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
declare class _default$
|
|
51
|
+
declare class _default$3 {
|
|
51
52
|
constructor(audioContext: any);
|
|
52
53
|
audioContext: any;
|
|
53
54
|
pause(): void;
|
|
@@ -57,12 +58,12 @@ declare class _default$5 {
|
|
|
57
58
|
stop(): void;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
declare class _default$
|
|
61
|
+
declare class _default$2 {
|
|
61
62
|
constructor({ audioContext, ponyfill }: {
|
|
62
63
|
audioContext: any;
|
|
63
64
|
ponyfill: any;
|
|
64
65
|
});
|
|
65
|
-
consumer: _default$
|
|
66
|
+
consumer: _default$3 | null;
|
|
66
67
|
paused: boolean;
|
|
67
68
|
queue: any[];
|
|
68
69
|
getAudioContext: memoize_one.MemoizedFn<() => any>;
|
|
@@ -74,69 +75,163 @@ declare class _default$4 {
|
|
|
74
75
|
stop(): void;
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
declare
|
|
78
|
-
|
|
78
|
+
declare function createSpeechRecognitionPonyfill(options: any): {};
|
|
79
|
+
|
|
80
|
+
declare class SpeechGrammarList {
|
|
81
|
+
#private;
|
|
82
|
+
constructor();
|
|
79
83
|
addFromString(): void;
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
get phrases(): readonly string[];
|
|
85
|
+
set phrases(value: readonly string[]);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
type SpeechRecognitionErrorType = 'aborted' | 'audio-capture' | 'bad-grammar' | 'language-not-supported' | 'network' | 'no-speech' | 'not-allowed' | 'service-not-allowed' | 'unknown';
|
|
89
|
+
type SpeechRecognitionErrorEventInit = {
|
|
90
|
+
error: SpeechRecognitionErrorType;
|
|
91
|
+
message?: string | undefined;
|
|
92
|
+
};
|
|
93
|
+
declare class SpeechRecognitionErrorEvent extends Event {
|
|
94
|
+
#private;
|
|
95
|
+
constructor(type: 'error', { error, message }: SpeechRecognitionErrorEventInit);
|
|
96
|
+
get error(): SpeechRecognitionErrorType;
|
|
97
|
+
get message(): string | undefined;
|
|
98
|
+
get type(): 'error';
|
|
82
99
|
}
|
|
83
100
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
interface FakeArrayInterface<T> {
|
|
102
|
+
[index: number]: T | undefined;
|
|
103
|
+
get length(): number;
|
|
104
|
+
}
|
|
105
|
+
declare class FakeArray<T> implements FakeArrayInterface<T> {
|
|
106
|
+
#private;
|
|
107
|
+
constructor(array: readonly T[]);
|
|
108
|
+
[index: number]: T | undefined;
|
|
109
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
110
|
+
get length(): number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
type SpeechRecognitionResultInit = {
|
|
114
|
+
isFinal: boolean;
|
|
115
|
+
results: readonly SpeechRecognitionAlternative[];
|
|
116
|
+
};
|
|
117
|
+
declare class SpeechRecognitionResult extends FakeArray<SpeechRecognitionAlternative> {
|
|
118
|
+
#private;
|
|
119
|
+
constructor(init: SpeechRecognitionResultInit);
|
|
120
|
+
get isFinal(): boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare class SpeechRecognitionResultList extends FakeArray<SpeechRecognitionResult> {
|
|
124
|
+
constructor(result: readonly SpeechRecognitionResult[]);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
type SpeechRecognitionEventInit = {
|
|
128
|
+
data?: undefined | unknown;
|
|
129
|
+
resultIndex?: number | undefined;
|
|
130
|
+
results?: SpeechRecognitionResultList | undefined;
|
|
131
|
+
};
|
|
132
|
+
declare class SpeechRecognitionEvent<T extends 'audioend' | 'audiostart' | 'cognitiveservices' | 'end' | 'result' | 'soundend' | 'soundstart' | 'speechend' | 'speechstart' | 'start'> extends Event {
|
|
133
|
+
#private;
|
|
134
|
+
constructor(type: 'cognitiveservices', init: SpeechRecognitionEventInit & {
|
|
135
|
+
data: {
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
constructor(type: 'audioend');
|
|
140
|
+
constructor(type: 'audiostart');
|
|
141
|
+
constructor(type: 'end');
|
|
142
|
+
constructor(type: 'result', init: SpeechRecognitionEventInit);
|
|
143
|
+
constructor(type: 'soundend');
|
|
144
|
+
constructor(type: 'soundstart');
|
|
145
|
+
constructor(type: 'speechend');
|
|
146
|
+
constructor(type: 'speechstart');
|
|
147
|
+
constructor(type: 'start');
|
|
148
|
+
get data(): unknown;
|
|
149
|
+
get resultIndex(): number | undefined;
|
|
150
|
+
get results(): SpeechRecognitionResultList;
|
|
151
|
+
get type(): T;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare class EventListenerMap<T extends string, EventMap extends {
|
|
155
|
+
[Name in T]: unknown;
|
|
156
|
+
}> {
|
|
157
|
+
#private;
|
|
158
|
+
constructor(eventTarget: EventTarget);
|
|
159
|
+
getProperty<U extends T>(name: U): ((event: EventMap[U]) => void) | undefined;
|
|
160
|
+
setProperty<U extends T>(name: U, value: ((event: EventMap[U]) => void) | undefined): void;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
type SpeechRecognitionEventListenerMap = EventListenerMap<'audioend' | 'audiostart' | 'cognitiveservices' | 'end' | 'error' | 'result' | 'soundend' | 'soundstart' | 'speechend' | 'speechstart' | 'start', {
|
|
164
|
+
audioend: SpeechRecognitionEvent<'audioend'>;
|
|
165
|
+
audiostart: SpeechRecognitionEvent<'audiostart'>;
|
|
166
|
+
cognitiveservices: SpeechRecognitionEvent<'cognitiveservices'>;
|
|
167
|
+
end: SpeechRecognitionEvent<'end'>;
|
|
168
|
+
error: SpeechRecognitionErrorEvent;
|
|
169
|
+
result: SpeechRecognitionEvent<'result'>;
|
|
170
|
+
soundend: SpeechRecognitionEvent<'soundend'>;
|
|
171
|
+
soundstart: SpeechRecognitionEvent<'soundstart'>;
|
|
172
|
+
speechend: SpeechRecognitionEvent<'speechend'>;
|
|
173
|
+
speechstart: SpeechRecognitionEvent<'speechstart'>;
|
|
174
|
+
start: SpeechRecognitionEvent<'start'>;
|
|
175
|
+
}>;
|
|
176
|
+
|
|
177
|
+
type CreateSpeechRecognitionPonyfillFromRecognizerInit = {
|
|
178
|
+
createRecognizer: (lang: string) => Promise<SpeechRecognizer>;
|
|
179
|
+
enableTelemetry: boolean;
|
|
180
|
+
looseEvents: boolean;
|
|
181
|
+
referenceGrammars: [];
|
|
182
|
+
textNormalization: 'display' | 'itn' | 'lexical' | 'maskeditn';
|
|
183
|
+
};
|
|
184
|
+
declare function createSpeechRecognitionPonyfillFromRecognizer({ createRecognizer, enableTelemetry, looseEvents, referenceGrammars, textNormalization }: CreateSpeechRecognitionPonyfillFromRecognizerInit): {
|
|
185
|
+
SpeechGrammarList: typeof SpeechGrammarList;
|
|
92
186
|
SpeechRecognition: {
|
|
93
187
|
new (): {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
188
|
+
"__#8@#continuous": boolean;
|
|
189
|
+
"__#8@#eventListenerMap": SpeechRecognitionEventListenerMap;
|
|
190
|
+
"__#8@#grammars": SpeechGrammarList;
|
|
191
|
+
"__#8@#interimResults": boolean;
|
|
192
|
+
"__#8@#lang": string;
|
|
193
|
+
"__#8@#maxAlternatives": number;
|
|
194
|
+
emitCognitiveServices<T extends {
|
|
195
|
+
type: string;
|
|
196
|
+
}>(type: string, event: T): void;
|
|
100
197
|
continuous: boolean;
|
|
101
|
-
grammars:
|
|
198
|
+
grammars: SpeechGrammarList;
|
|
102
199
|
interimResults: boolean;
|
|
103
200
|
maxAlternatives: number;
|
|
104
201
|
lang: string;
|
|
105
|
-
onaudioend:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
202
|
+
get onaudioend(): ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined;
|
|
203
|
+
set onaudioend(value: ((event: SpeechRecognitionEvent<'audioend'>) => void) | undefined);
|
|
204
|
+
/** @type { ((event: SpeechRecognitionEvent<'audiostart'>) => void) | undefined } */
|
|
205
|
+
onaudiostart: ((event: SpeechRecognitionEvent<"audiostart">) => void) | undefined;
|
|
206
|
+
/** @type { ((event: SpeechRecognitionEvent<'cognitiveservices'>) => void) | undefined } */
|
|
207
|
+
oncognitiveservices: ((event: SpeechRecognitionEvent<"cognitiveservices">) => void) | undefined;
|
|
208
|
+
/** @type { ((event: SpeechRecognitionEvent<'end'>) => void) | undefined } */
|
|
209
|
+
onend: ((event: SpeechRecognitionEvent<"end">) => void) | undefined;
|
|
210
|
+
/** @type { ((event: SpeechRecognitionErrorEvent) => void) | undefined } */
|
|
211
|
+
onerror: ((event: SpeechRecognitionErrorEvent) => void) | undefined;
|
|
212
|
+
/** @type { ((event: SpeechRecognitionEvent<'result'>) => void) | undefined } */
|
|
213
|
+
onresult: ((event: SpeechRecognitionEvent<"result">) => void) | undefined;
|
|
214
|
+
/** @type { ((event: SpeechRecognitionEvent<'soundend'>) => void) | undefined } */
|
|
215
|
+
onsoundend: ((event: SpeechRecognitionEvent<"soundend">) => void) | undefined;
|
|
216
|
+
/** @type { ((event: SpeechRecognitionEvent<'soundstart'>) => void) | undefined } */
|
|
217
|
+
onsoundstart: ((event: SpeechRecognitionEvent<"soundstart">) => void) | undefined;
|
|
218
|
+
/** @type { ((event: SpeechRecognitionEvent<'speechend'>) => void) | undefined } */
|
|
219
|
+
onspeechend: ((event: SpeechRecognitionEvent<"speechend">) => void) | undefined;
|
|
220
|
+
/** @type { ((event: SpeechRecognitionEvent<'speechstart'>) => void) | undefined } */
|
|
221
|
+
onspeechstart: ((event: SpeechRecognitionEvent<"speechstart">) => void) | undefined;
|
|
222
|
+
/** @type { ((event: SpeechRecognitionEvent<'start'>) => void) | undefined } */
|
|
223
|
+
onstart: ((event: SpeechRecognitionEvent<"start">) => void) | undefined;
|
|
118
224
|
abort: (() => void) | undefined;
|
|
119
225
|
stop: (() => void) | undefined;
|
|
226
|
+
start(): void;
|
|
227
|
+
_startOnce(): Promise<void>;
|
|
228
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
229
|
+
dispatchEvent(event: Event): boolean;
|
|
230
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void;
|
|
120
231
|
};
|
|
121
232
|
};
|
|
122
233
|
SpeechRecognitionEvent: typeof SpeechRecognitionEvent;
|
|
123
234
|
};
|
|
124
|
-
declare function _default$2(options: any): {};
|
|
125
|
-
|
|
126
|
-
declare class SpeechRecognitionEvent {
|
|
127
|
-
constructor(type: any, { data, emma, interpretation, resultIndex, results }?: {
|
|
128
|
-
data: any;
|
|
129
|
-
emma: any;
|
|
130
|
-
interpretation: any;
|
|
131
|
-
resultIndex: any;
|
|
132
|
-
results: any;
|
|
133
|
-
});
|
|
134
|
-
data: any;
|
|
135
|
-
emma: any;
|
|
136
|
-
interpretation: any;
|
|
137
|
-
resultIndex: any;
|
|
138
|
-
results: any;
|
|
139
|
-
}
|
|
140
235
|
|
|
141
236
|
declare function _default$1(options: any): {
|
|
142
237
|
speechSynthesis?: never;
|
|
@@ -169,7 +264,7 @@ declare function createSpeechServicesPonyfill(options?: {}, ...args: any[]): {
|
|
|
169
264
|
SpeechSynthesisUtterance?: never;
|
|
170
265
|
} | {
|
|
171
266
|
speechSynthesis: {
|
|
172
|
-
queue: _default$
|
|
267
|
+
queue: _default$2;
|
|
173
268
|
cancel(): void;
|
|
174
269
|
getVoices(): any[];
|
|
175
270
|
onvoiceschanged: any;
|
|
@@ -183,4 +278,4 @@ declare function createSpeechServicesPonyfill(options?: {}, ...args: any[]): {
|
|
|
183
278
|
SpeechSynthesisUtterance: typeof SpeechSynthesisUtterance;
|
|
184
279
|
};
|
|
185
280
|
|
|
186
|
-
export {
|
|
281
|
+
export { createSpeechRecognitionPonyfill, createSpeechRecognitionPonyfillFromRecognizer, createSpeechServicesPonyfill, _default$1 as createSpeechSynthesisPonyfill, _default as fetchAuthorizationToken };
|