speechstate 2.4.0 → 2.4.1-pr9-1.0

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/tts.d.ts CHANGED
@@ -1,83 +1,25 @@
1
- import { AzureSpeechCredentials, Agenda } from "./types";
2
- interface MySpeechSynthesisUtterance extends SpeechSynthesisUtterance {
3
- new (s: string): any;
4
- }
5
- interface TTSInit {
6
- audioContext: AudioContext;
7
- azureCredentials: string | AzureSpeechCredentials;
8
- azureRegion: string;
9
- ttsDefaultVoice: string;
10
- ttsLexicon?: string;
11
- }
12
- interface TTSContext extends TTSInit {
13
- azureAuthorizationToken?: string;
14
- wsaTTS?: SpeechSynthesis;
15
- wsaVoice?: SpeechSynthesisVoice;
16
- wsaUtt?: MySpeechSynthesisUtterance;
17
- agenda?: Agenda;
18
- buffer?: string;
19
- currentVoice?: string;
20
- utteranceFromStream?: string;
21
- }
22
- interface TTSPonyfillInput {
23
- audioContext: AudioContext;
24
- azureRegion: string;
25
- azureAuthorizationToken: string;
26
- }
27
- type TTSEvent = {
28
- type: "PREPARE";
29
- } | {
30
- type: "CONTROL";
31
- } | {
32
- type: "STOP";
33
- } | {
34
- type: "READY";
35
- value: {
36
- wsaTTS: SpeechSynthesis;
37
- wsaUtt: MySpeechSynthesisUtterance;
38
- };
39
- } | {
40
- type: "ERROR";
41
- } | {
42
- type: "SPEAK";
43
- value: Agenda;
44
- } | {
45
- type: "TTS_STARTED";
46
- } | {
47
- type: "STREAMING_CHUNK";
48
- value: string;
49
- } | {
50
- type: "STREAMING_SET_VOICE";
51
- value: string;
52
- } | {
53
- type: "STREAMING_DONE";
54
- } | {
55
- type: "SPEAK_COMPLETE";
56
- };
1
+ import { Agenda, TTSInit, TTSEvent, TTSContext, TTSPonyfillInput } from "./types";
57
2
  export declare const ttsMachine: import("xstate").StateMachine<TTSContext, TTSEvent, {
58
- [x: string]: import("xstate").ActorRef<import("xstate").CallbackSnapshot<{}>, import("xstate").EventObject, import("xstate").EventObject> | import("xstate").ActorRef<import("xstate").PromiseSnapshot<string, any>, {
59
- [k: string]: unknown;
60
- type: string;
61
- }, import("xstate").EventObject> | import("xstate").ActorRef<import("xstate").CallbackSnapshot<Agenda>, import("xstate").EventObject, import("xstate").EventObject> | import("xstate").ActorRef<import("xstate").CallbackSnapshot<TTSPonyfillInput>, null, import("xstate").EventObject>;
3
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>>;
62
4
  }, import("xstate").Values<{
63
5
  getToken: {
64
6
  src: "getToken";
65
- logic: import("xstate").PromiseActorLogic<string, any>;
7
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
66
8
  id: string;
67
9
  };
68
10
  createEventsFromStream: {
69
11
  src: "createEventsFromStream";
70
- logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda>;
12
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
71
13
  id: string;
72
14
  };
73
15
  ponyfill: {
74
16
  src: "ponyfill";
75
- logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput>;
17
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
76
18
  id: string;
77
19
  };
78
20
  start: {
79
21
  src: "start";
80
- logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}>;
22
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
81
23
  id: string;
82
24
  };
83
25
  }>, import("xstate").Values<{
@@ -93,6 +35,10 @@ export declare const ttsMachine: import("xstate").StateMachine<TTSContext, TTSEv
93
35
  type: "assignCurrentVoice";
94
36
  params: {};
95
37
  };
38
+ sendParentCurrentPersona: {
39
+ type: "sendParentCurrentPersona";
40
+ params: {};
41
+ };
96
42
  }>, import("xstate").Values<{
97
43
  bufferContainsUtterancePartReadyToBeSpoken: {
98
44
  type: "bufferContainsUtterancePartReadyToBeSpoken";
@@ -112,49 +58,562 @@ export declare const ttsMachine: import("xstate").StateMachine<TTSContext, TTSEv
112
58
  }>;
113
59
  Speaking?: "Go" | "Paused";
114
60
  };
115
- }, string, TTSInit, {}, import("xstate").EventObject, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, TTSEvent, import("xstate").Values<{
116
- getToken: {
117
- src: "getToken";
118
- logic: import("xstate").PromiseActorLogic<string, any>;
119
- id: string;
61
+ }, string, TTSInit, {}, import("xstate").EventObject, import("xstate").MetaObject, {
62
+ readonly id: "tts";
63
+ readonly context: ({ input }: {
64
+ spawn: {
65
+ <TSrc extends "getToken" | "createEventsFromStream" | "ponyfill" | "start">(logic: TSrc, ...[options]: ({
66
+ src: "getToken";
67
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
68
+ id: string;
69
+ } extends infer T ? T extends {
70
+ src: "getToken";
71
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
72
+ id: string;
73
+ } ? T extends {
74
+ src: TSrc;
75
+ } ? import("xstate").ConditionalRequired<[options?: {
76
+ id?: T["id"];
77
+ systemId?: string;
78
+ input?: import("xstate").InputFrom<T["logic"]>;
79
+ syncSnapshot?: boolean;
80
+ } & { [K in import("xstate").RequiredActorOptions<T>]: unknown; }], import("xstate").IsNotNever<import("xstate").RequiredActorOptions<T>>> : never : never : never) | ({
81
+ src: "createEventsFromStream";
82
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
83
+ id: string;
84
+ } extends infer T_1 ? T_1 extends {
85
+ src: "createEventsFromStream";
86
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
87
+ id: string;
88
+ } ? T_1 extends {
89
+ src: TSrc;
90
+ } ? import("xstate").ConditionalRequired<[options?: {
91
+ id?: T_1["id"];
92
+ systemId?: string;
93
+ input?: import("xstate").InputFrom<T_1["logic"]>;
94
+ syncSnapshot?: boolean;
95
+ } & { [K_1 in import("xstate").RequiredActorOptions<T_1>]: unknown; }], import("xstate").IsNotNever<import("xstate").RequiredActorOptions<T_1>>> : never : never : never) | ({
96
+ src: "ponyfill";
97
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
98
+ id: string;
99
+ } extends infer T_2 ? T_2 extends {
100
+ src: "ponyfill";
101
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
102
+ id: string;
103
+ } ? T_2 extends {
104
+ src: TSrc;
105
+ } ? import("xstate").ConditionalRequired<[options?: {
106
+ id?: T_2["id"];
107
+ systemId?: string;
108
+ input?: import("xstate").InputFrom<T_2["logic"]>;
109
+ syncSnapshot?: boolean;
110
+ } & { [K_2 in import("xstate").RequiredActorOptions<T_2>]: unknown; }], import("xstate").IsNotNever<import("xstate").RequiredActorOptions<T_2>>> : never : never : never) | ({
111
+ src: "start";
112
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
113
+ id: string;
114
+ } extends infer T_3 ? T_3 extends {
115
+ src: "start";
116
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
117
+ id: string;
118
+ } ? T_3 extends {
119
+ src: TSrc;
120
+ } ? import("xstate").ConditionalRequired<[options?: {
121
+ id?: T_3["id"];
122
+ systemId?: string;
123
+ input?: import("xstate").InputFrom<T_3["logic"]>;
124
+ syncSnapshot?: boolean;
125
+ } & { [K_3 in import("xstate").RequiredActorOptions<T_3>]: unknown; }], import("xstate").IsNotNever<import("xstate").RequiredActorOptions<T_3>>> : never : never : never)): import("xstate").ActorRefFromLogic<import("xstate").GetConcreteByKey<import("xstate").Values<{
126
+ getToken: {
127
+ src: "getToken";
128
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
129
+ id: string;
130
+ };
131
+ createEventsFromStream: {
132
+ src: "createEventsFromStream";
133
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
134
+ id: string;
135
+ };
136
+ ponyfill: {
137
+ src: "ponyfill";
138
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
139
+ id: string;
140
+ };
141
+ start: {
142
+ src: "start";
143
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
144
+ id: string;
145
+ };
146
+ }>, "src", TSrc>["logic"]>;
147
+ <TLogic extends import("xstate").AnyActorLogic>(src: TLogic, options?: {
148
+ id?: never;
149
+ systemId?: string;
150
+ input?: import("xstate").InputFrom<TLogic>;
151
+ syncSnapshot?: boolean;
152
+ }): import("xstate").ActorRefFromLogic<TLogic>;
153
+ };
154
+ input: TTSInit;
155
+ self: import("xstate").ActorRef<import("xstate").MachineSnapshot<TTSContext, TTSEvent, Record<string, import("xstate").AnyActorRef>, import("xstate").StateValue, string, unknown, any, any>, TTSEvent, import("xstate").AnyEventObject>;
156
+ }) => {
157
+ ttsDefaultVoice: string;
158
+ ttsLexicon: string;
159
+ audioContext: AudioContext;
160
+ azureCredentials: string | import("./types").AzureSpeechCredentials;
161
+ azureRegion: string;
162
+ buffer: string;
120
163
  };
121
- createEventsFromStream: {
122
- src: "createEventsFromStream";
123
- logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda>;
124
- id: string;
164
+ readonly initial: "GetToken";
165
+ readonly on: {
166
+ readonly READY: {
167
+ readonly target: ".Ready";
168
+ readonly actions: readonly [import("xstate").ActionFunction<TTSContext, {
169
+ type: "READY";
170
+ value: {
171
+ wsaTTS: SpeechSynthesis;
172
+ wsaUtt: import("./types").MySpeechSynthesisUtterance;
173
+ };
174
+ }, TTSEvent, undefined, import("xstate").Values<{
175
+ getToken: {
176
+ src: "getToken";
177
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
178
+ id: string;
179
+ };
180
+ createEventsFromStream: {
181
+ src: "createEventsFromStream";
182
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
183
+ id: string;
184
+ };
185
+ ponyfill: {
186
+ src: "ponyfill";
187
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
188
+ id: string;
189
+ };
190
+ start: {
191
+ src: "start";
192
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
193
+ id: string;
194
+ };
195
+ }>, never, never, never, never>, import("xstate").ActionFunction<TTSContext, {
196
+ type: "READY";
197
+ value: {
198
+ wsaTTS: SpeechSynthesis;
199
+ wsaUtt: import("./types").MySpeechSynthesisUtterance;
200
+ };
201
+ }, TTSEvent, undefined, never, never, never, "FILLER_DELAY", never>];
202
+ };
203
+ readonly ERROR: {
204
+ readonly actions: import("xstate").ActionFunction<TTSContext, {
205
+ type: "ERROR";
206
+ }, TTSEvent, undefined, never, never, never, "FILLER_DELAY", never>;
207
+ };
125
208
  };
126
- ponyfill: {
127
- src: "ponyfill";
128
- logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput>;
129
- id: string;
130
- };
131
- start: {
132
- src: "start";
133
- logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}>;
134
- id: string;
135
- };
136
- }>, import("xstate").Values<{
137
- ttsStop: {
138
- type: "ttsStop";
139
- params: unknown;
140
- };
141
- addFiller: {
142
- type: "addFiller";
143
- params: {};
144
- };
145
- assignCurrentVoice: {
146
- type: "assignCurrentVoice";
147
- params: {};
148
- };
149
- }>, import("xstate").Values<{
150
- bufferContainsUtterancePartReadyToBeSpoken: {
151
- type: "bufferContainsUtterancePartReadyToBeSpoken";
152
- params: unknown;
153
- };
154
- bufferIsNonEmpty: {
155
- type: "bufferIsNonEmpty";
156
- params: unknown;
209
+ readonly states: {
210
+ readonly Ready: {
211
+ readonly initial: "Idle";
212
+ readonly states: {
213
+ readonly Idle: {
214
+ readonly on: {
215
+ readonly SPEAK: readonly [{
216
+ readonly target: "BufferedSpeaker";
217
+ readonly guard: ({ event }: import("xstate/dist/declarations/src/guards").GuardArgs<TTSContext, {
218
+ type: "SPEAK";
219
+ value: Agenda;
220
+ }>) => boolean;
221
+ readonly actions: import("xstate").ActionFunction<TTSContext, {
222
+ type: "SPEAK";
223
+ value: Agenda;
224
+ }, TTSEvent, undefined, import("xstate").Values<{
225
+ getToken: {
226
+ src: "getToken";
227
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
228
+ id: string;
229
+ };
230
+ createEventsFromStream: {
231
+ src: "createEventsFromStream";
232
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
233
+ id: string;
234
+ };
235
+ ponyfill: {
236
+ src: "ponyfill";
237
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
238
+ id: string;
239
+ };
240
+ start: {
241
+ src: "start";
242
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
243
+ id: string;
244
+ };
245
+ }>, never, never, never, never>;
246
+ }, {
247
+ readonly target: "Speaking";
248
+ readonly actions: import("xstate").ActionFunction<TTSContext, {
249
+ type: "SPEAK";
250
+ value: Agenda;
251
+ }, TTSEvent, undefined, import("xstate").Values<{
252
+ getToken: {
253
+ src: "getToken";
254
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
255
+ id: string;
256
+ };
257
+ createEventsFromStream: {
258
+ src: "createEventsFromStream";
259
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
260
+ id: string;
261
+ };
262
+ ponyfill: {
263
+ src: "ponyfill";
264
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
265
+ id: string;
266
+ };
267
+ start: {
268
+ src: "start";
269
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
270
+ id: string;
271
+ };
272
+ }>, never, never, never, never>;
273
+ }];
274
+ };
275
+ };
276
+ readonly BufferedSpeaker: {
277
+ readonly type: "parallel";
278
+ readonly invoke: {
279
+ readonly id: "createEventsFromStream";
280
+ readonly src: "createEventsFromStream";
281
+ readonly input: ({ context }: {
282
+ context: TTSContext;
283
+ event: TTSEvent;
284
+ self: import("xstate").ActorRef<import("xstate").MachineSnapshot<TTSContext, TTSEvent, Record<string, import("xstate").AnyActorRef>, import("xstate").StateValue, string, unknown, any, any>, TTSEvent, import("xstate").AnyEventObject>;
285
+ }) => Agenda;
286
+ };
287
+ readonly on: {
288
+ readonly STOP: {
289
+ readonly target: "Idle";
290
+ };
291
+ readonly SPEAK_COMPLETE: readonly [{
292
+ readonly guard: import("xstate/dist/declarations/src/guards").GuardPredicate<TTSContext, {
293
+ type: "SPEAK_COMPLETE";
294
+ }, undefined, any>;
295
+ readonly target: "Idle";
296
+ readonly actions: readonly [import("xstate").ActionFunction<TTSContext, {
297
+ type: "SPEAK_COMPLETE";
298
+ }, TTSEvent, undefined, never, never, never, "FILLER_DELAY", never>];
299
+ }];
300
+ };
301
+ readonly states: {
302
+ readonly Buffer: {
303
+ readonly initial: "BufferIdle";
304
+ readonly on: {
305
+ readonly STREAMING_SET_VOICE: {
306
+ readonly actions: "assignCurrentVoice";
307
+ };
308
+ readonly STREAMING_SET_PERSONA: {
309
+ readonly actions: "sendParentCurrentPersona";
310
+ };
311
+ };
312
+ readonly states: {
313
+ readonly BufferIdle: {
314
+ readonly id: "BufferIdle";
315
+ readonly entry: readonly [({ event }: import("xstate").ActionArgs<TTSContext, TTSEvent, TTSEvent>) => void];
316
+ readonly on: {
317
+ readonly STREAMING_CHUNK: {
318
+ readonly actions: readonly [({ event }: import("xstate").ActionArgs<TTSContext, {
319
+ type: "STREAMING_CHUNK";
320
+ value: string;
321
+ }, TTSEvent>) => void];
322
+ readonly target: "Buffering";
323
+ };
324
+ };
325
+ };
326
+ readonly Buffering: {
327
+ readonly id: "Buffering";
328
+ readonly on: {
329
+ readonly STREAMING_CHUNK: readonly [{
330
+ readonly actions: readonly [({ event }: import("xstate").ActionArgs<TTSContext, {
331
+ type: "STREAMING_CHUNK";
332
+ value: string;
333
+ }, TTSEvent>) => void];
334
+ readonly target: "Buffering";
335
+ readonly reenter: true;
336
+ }];
337
+ readonly STREAMING_DONE: readonly [{
338
+ readonly target: "BufferingDone";
339
+ readonly actions: readonly [({ event }: import("xstate").ActionArgs<TTSContext, {
340
+ type: "STREAMING_DONE";
341
+ }, TTSEvent>) => void];
342
+ }];
343
+ };
344
+ readonly entry: readonly [({ event }: import("xstate").ActionArgs<TTSContext, TTSEvent, TTSEvent>) => void, import("xstate").ActionFunction<TTSContext, TTSEvent, TTSEvent, undefined, import("xstate").Values<{
345
+ getToken: {
346
+ src: "getToken";
347
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
348
+ id: string;
349
+ };
350
+ createEventsFromStream: {
351
+ src: "createEventsFromStream";
352
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
353
+ id: string;
354
+ };
355
+ ponyfill: {
356
+ src: "ponyfill";
357
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
358
+ id: string;
359
+ };
360
+ start: {
361
+ src: "start";
362
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
363
+ id: string;
364
+ };
365
+ }>, never, never, never, never>];
366
+ };
367
+ readonly BufferingDone: {
368
+ readonly entry: readonly [({ event }: import("xstate").ActionArgs<TTSContext, TTSEvent, TTSEvent>) => void];
369
+ readonly id: "BufferingDone";
370
+ };
371
+ };
372
+ };
373
+ readonly Speaker: {
374
+ readonly initial: "SpeakingIdle";
375
+ readonly states: {
376
+ readonly SpeakingIdle: {
377
+ readonly entry: readonly [({ event }: import("xstate").ActionArgs<TTSContext, TTSEvent, TTSEvent>) => void];
378
+ readonly always: readonly [{
379
+ readonly target: "Speak";
380
+ readonly guard: import("xstate/dist/declarations/src/guards").GuardPredicate<TTSContext, TTSEvent, undefined, any>;
381
+ readonly actions: readonly [({ event }: import("xstate").ActionArgs<TTSContext, TTSEvent, TTSEvent>) => void, import("xstate").ActionFunction<TTSContext, TTSEvent, TTSEvent, undefined, import("xstate").Values<{
382
+ getToken: {
383
+ src: "getToken";
384
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
385
+ id: string;
386
+ };
387
+ createEventsFromStream: {
388
+ src: "createEventsFromStream";
389
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
390
+ id: string;
391
+ };
392
+ ponyfill: {
393
+ src: "ponyfill";
394
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
395
+ id: string;
396
+ };
397
+ start: {
398
+ src: "start";
399
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
400
+ id: string;
401
+ };
402
+ }>, never, never, never, never>, import("xstate").ActionFunction<TTSContext, TTSEvent, TTSEvent, undefined, import("xstate").Values<{
403
+ getToken: {
404
+ src: "getToken";
405
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
406
+ id: string;
407
+ };
408
+ createEventsFromStream: {
409
+ src: "createEventsFromStream";
410
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
411
+ id: string;
412
+ };
413
+ ponyfill: {
414
+ src: "ponyfill";
415
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
416
+ id: string;
417
+ };
418
+ start: {
419
+ src: "start";
420
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
421
+ id: string;
422
+ };
423
+ }>, never, never, never, never>];
424
+ }, {
425
+ readonly target: "PrepareSpeech";
426
+ readonly guard: "bufferContainsUtterancePartReadyToBeSpoken";
427
+ }];
428
+ readonly after: {
429
+ readonly FILLER_DELAY: {
430
+ readonly target: "SpeakingIdle";
431
+ readonly reenter: true;
432
+ readonly actions: "addFiller";
433
+ readonly guard: ({ context }: import("xstate/dist/declarations/src/guards").GuardArgs<TTSContext, TTSEvent>) => boolean;
434
+ };
435
+ };
436
+ };
437
+ readonly PrepareSpeech: {
438
+ readonly entry: readonly [({ event }: import("xstate").ActionArgs<TTSContext, TTSEvent, TTSEvent>) => void, import("xstate").ActionFunction<TTSContext, TTSEvent, TTSEvent, undefined, import("xstate").Values<{
439
+ getToken: {
440
+ src: "getToken";
441
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
442
+ id: string;
443
+ };
444
+ createEventsFromStream: {
445
+ src: "createEventsFromStream";
446
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
447
+ id: string;
448
+ };
449
+ ponyfill: {
450
+ src: "ponyfill";
451
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
452
+ id: string;
453
+ };
454
+ start: {
455
+ src: "start";
456
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
457
+ id: string;
458
+ };
459
+ }>, never, never, never, never>];
460
+ readonly always: readonly [{
461
+ readonly target: "Speak";
462
+ }];
463
+ };
464
+ readonly Speak: {
465
+ readonly entry: readonly [({ event }: import("xstate").ActionArgs<TTSContext, TTSEvent, TTSEvent>) => void];
466
+ readonly initial: "Go";
467
+ readonly on: {
468
+ readonly TTS_STARTED: {
469
+ readonly actions: import("xstate").ActionFunction<TTSContext, {
470
+ type: "TTS_STARTED";
471
+ }, TTSEvent, undefined, never, never, never, "FILLER_DELAY", never>;
472
+ };
473
+ readonly SPEAK_COMPLETE: readonly [{
474
+ readonly guard: import("xstate/dist/declarations/src/guards").GuardPredicate<TTSContext, {
475
+ type: "SPEAK_COMPLETE";
476
+ }, undefined, any>;
477
+ readonly target: "SpeakingIdle";
478
+ }, {
479
+ readonly guard: "bufferIsNonEmpty";
480
+ readonly target: "SpeakingIdle";
481
+ }];
482
+ };
483
+ readonly states: {
484
+ readonly Go: {
485
+ readonly invoke: {
486
+ readonly src: "start";
487
+ readonly input: ({ context }: {
488
+ context: TTSContext;
489
+ event: TTSEvent;
490
+ self: import("xstate").ActorRef<import("xstate").MachineSnapshot<TTSContext, TTSEvent, Record<string, import("xstate").AnyActorRef>, import("xstate").StateValue, string, unknown, any, any>, TTSEvent, import("xstate").AnyEventObject>;
491
+ }) => {
492
+ wsaTTS: SpeechSynthesis;
493
+ wsaUtt: import("./types").MySpeechSynthesisUtterance;
494
+ ttsLexicon: string;
495
+ voice: string;
496
+ utterance: string;
497
+ };
498
+ };
499
+ readonly on: {
500
+ readonly CONTROL: "Paused";
501
+ };
502
+ readonly exit: "ttsStop";
503
+ };
504
+ readonly Paused: {
505
+ readonly on: {
506
+ readonly CONTROL: "Go";
507
+ };
508
+ };
509
+ };
510
+ };
511
+ };
512
+ };
513
+ };
514
+ };
515
+ readonly Speaking: {
516
+ readonly initial: "Go";
517
+ readonly on: {
518
+ readonly STOP: {
519
+ readonly target: "Idle";
520
+ };
521
+ readonly TTS_STARTED: {
522
+ readonly actions: import("xstate").ActionFunction<TTSContext, {
523
+ type: "TTS_STARTED";
524
+ }, TTSEvent, undefined, never, never, never, "FILLER_DELAY", never>;
525
+ };
526
+ readonly SPEAK_COMPLETE: {
527
+ readonly target: "Idle";
528
+ };
529
+ };
530
+ readonly exit: import("xstate").ActionFunction<TTSContext, TTSEvent, TTSEvent, undefined, never, never, never, "FILLER_DELAY", never>;
531
+ readonly states: {
532
+ readonly Go: {
533
+ readonly invoke: {
534
+ readonly src: "start";
535
+ readonly input: ({ context }: {
536
+ context: TTSContext;
537
+ event: TTSEvent;
538
+ self: import("xstate").ActorRef<import("xstate").MachineSnapshot<TTSContext, TTSEvent, Record<string, import("xstate").AnyActorRef>, import("xstate").StateValue, string, unknown, any, any>, TTSEvent, import("xstate").AnyEventObject>;
539
+ }) => {
540
+ wsaTTS: SpeechSynthesis;
541
+ wsaUtt: import("./types").MySpeechSynthesisUtterance;
542
+ ttsLexicon: string;
543
+ voice: string;
544
+ utterance: string;
545
+ };
546
+ };
547
+ readonly on: {
548
+ readonly CONTROL: "Paused";
549
+ };
550
+ readonly exit: "ttsStop";
551
+ };
552
+ readonly Paused: {
553
+ readonly on: {
554
+ readonly CONTROL: "Go";
555
+ };
556
+ };
557
+ };
558
+ };
559
+ };
560
+ };
561
+ readonly Fail: {};
562
+ readonly GetToken: {
563
+ readonly invoke: {
564
+ readonly id: "getAuthorizationToken";
565
+ readonly input: ({ context }: {
566
+ context: any;
567
+ }) => {
568
+ credentials: any;
569
+ };
570
+ readonly src: "getToken";
571
+ readonly onDone: {
572
+ readonly target: "Ponyfill";
573
+ readonly actions: readonly [import("xstate").ActionFunction<TTSContext, import("xstate").DoneActorEvent<string, string>, TTSEvent, undefined, import("xstate").Values<{
574
+ getToken: {
575
+ src: "getToken";
576
+ logic: import("xstate").PromiseActorLogic<string, any, import("xstate").EventObject>;
577
+ id: string;
578
+ };
579
+ createEventsFromStream: {
580
+ src: "createEventsFromStream";
581
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, Agenda, import("xstate").EventObject>;
582
+ id: string;
583
+ };
584
+ ponyfill: {
585
+ src: "ponyfill";
586
+ logic: import("xstate").CallbackActorLogic<null, TTSPonyfillInput, import("xstate").EventObject>;
587
+ id: string;
588
+ };
589
+ start: {
590
+ src: "start";
591
+ logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, {}, import("xstate").EventObject>;
592
+ id: string;
593
+ };
594
+ }>, never, never, never, never>];
595
+ };
596
+ readonly onError: {
597
+ readonly actions: readonly [import("xstate").ActionFunction<TTSContext, import("xstate").ErrorActorEvent<unknown, string>, TTSEvent, undefined, never, never, never, "FILLER_DELAY", never>, ({ event }: import("xstate").ActionArgs<TTSContext, import("xstate").ErrorActorEvent<unknown, string>, TTSEvent>) => void];
598
+ readonly target: "Fail";
599
+ };
600
+ };
601
+ };
602
+ readonly Ponyfill: {
603
+ readonly invoke: {
604
+ readonly id: "ponyTTS";
605
+ readonly src: "ponyfill";
606
+ readonly input: ({ context }: {
607
+ context: TTSContext;
608
+ event: TTSEvent;
609
+ self: import("xstate").ActorRef<import("xstate").MachineSnapshot<TTSContext, TTSEvent, Record<string, import("xstate").AnyActorRef>, import("xstate").StateValue, string, unknown, any, any>, TTSEvent, import("xstate").AnyEventObject>;
610
+ }) => {
611
+ audioContext: AudioContext;
612
+ azureAuthorizationToken: string;
613
+ azureRegion: string;
614
+ };
615
+ };
616
+ };
157
617
  };
158
- }>, "FILLER_DELAY", string, import("xstate").EventObject>>;
159
- export {};
618
+ }>;
160
619
  //# sourceMappingURL=tts.d.ts.map