@allwright.dev/core 0.0.32 → 0.0.34
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/browser.d.ts +24 -0
- package/dist/browser.js +137 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +177 -0
- package/dist/index.d.ts +11 -176
- package/dist/index.js +17 -938
- package/dist/locator.d.ts +17 -0
- package/dist/locator.js +45 -0
- package/dist/page.d.ts +25 -0
- package/dist/page.js +418 -0
- package/dist/runtime.d.ts +14 -0
- package/dist/runtime.js +107 -0
- package/dist/selectors.d.ts +7 -0
- package/dist/selectors.js +33 -0
- package/dist/types.d.ts +482 -0
- package/dist/types.js +33 -0
- package/package.json +1 -1
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
import grpc from "@grpc/grpc-js";
|
|
2
|
+
export interface LaunchOptions {
|
|
3
|
+
browserBinary?: string;
|
|
4
|
+
timeoutMs?: number;
|
|
5
|
+
}
|
|
6
|
+
export type BrowserKind = "chromium" | "firefox";
|
|
7
|
+
export interface CommandOptions {
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface NavigateResult {
|
|
11
|
+
url: string;
|
|
12
|
+
note: string;
|
|
13
|
+
bidiSessionId: string;
|
|
14
|
+
mapperTargetId: string;
|
|
15
|
+
mapperSessionId: string;
|
|
16
|
+
packageVersion: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ClickResult {
|
|
19
|
+
selector: string;
|
|
20
|
+
note: string;
|
|
21
|
+
bidiSessionId: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CountResult {
|
|
24
|
+
selector: string;
|
|
25
|
+
count: number;
|
|
26
|
+
note: string;
|
|
27
|
+
}
|
|
28
|
+
export interface HighlightOptions {
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
durationMs?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface HighlightResult {
|
|
33
|
+
selector: string;
|
|
34
|
+
count: number;
|
|
35
|
+
note: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ElementResult {
|
|
38
|
+
selector: string;
|
|
39
|
+
note: string;
|
|
40
|
+
}
|
|
41
|
+
export interface FillResult {
|
|
42
|
+
selector: string;
|
|
43
|
+
value: string;
|
|
44
|
+
note: string;
|
|
45
|
+
}
|
|
46
|
+
export interface PressOptions {
|
|
47
|
+
timeoutMs?: number;
|
|
48
|
+
text?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface PressResult {
|
|
51
|
+
selector: string;
|
|
52
|
+
key: string;
|
|
53
|
+
note: string;
|
|
54
|
+
}
|
|
55
|
+
export interface TextResult {
|
|
56
|
+
selector: string;
|
|
57
|
+
text: string;
|
|
58
|
+
note: string;
|
|
59
|
+
}
|
|
60
|
+
export interface WaitForSelectorOptions {
|
|
61
|
+
timeoutMs?: number;
|
|
62
|
+
visible?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface WaitForSelectorResult {
|
|
65
|
+
selector: string;
|
|
66
|
+
visible: boolean;
|
|
67
|
+
note: string;
|
|
68
|
+
}
|
|
69
|
+
export interface BrowserInfo {
|
|
70
|
+
sessionId: string;
|
|
71
|
+
browserName: string;
|
|
72
|
+
launchNote: string;
|
|
73
|
+
cdpWebSocketURL: string;
|
|
74
|
+
userDataDir: string;
|
|
75
|
+
}
|
|
76
|
+
export interface PageInfo {
|
|
77
|
+
sessionId: string;
|
|
78
|
+
browserSessionId: string;
|
|
79
|
+
}
|
|
80
|
+
export interface LocatorInfo {
|
|
81
|
+
page: Page;
|
|
82
|
+
selector: string;
|
|
83
|
+
}
|
|
84
|
+
export interface BrowserType {
|
|
85
|
+
launch(options?: LaunchOptions): Promise<Browser>;
|
|
86
|
+
}
|
|
87
|
+
export interface Browser extends BrowserInfo {
|
|
88
|
+
page(): Page;
|
|
89
|
+
initialPage(): Page;
|
|
90
|
+
initialTab(): Page;
|
|
91
|
+
pages(): Page[];
|
|
92
|
+
newPage(options?: CommandOptions): Promise<Page>;
|
|
93
|
+
newTab(options?: CommandOptions): Promise<Page>;
|
|
94
|
+
close(): Promise<void>;
|
|
95
|
+
ping(message?: string): Promise<string>;
|
|
96
|
+
browserInfo(): BrowserInfo;
|
|
97
|
+
}
|
|
98
|
+
export interface Page extends PageInfo {
|
|
99
|
+
locator(selector: string): Locator;
|
|
100
|
+
goto(url: string, options?: CommandOptions): Promise<NavigateResult>;
|
|
101
|
+
navigate(url: string, options?: CommandOptions): Promise<NavigateResult>;
|
|
102
|
+
click(selector: string, options?: CommandOptions): Promise<ClickResult>;
|
|
103
|
+
count(selector: string, options?: CommandOptions): Promise<CountResult>;
|
|
104
|
+
highlight(selector: string, options?: HighlightOptions): Promise<HighlightResult>;
|
|
105
|
+
focus(selector: string, options?: CommandOptions): Promise<ElementResult>;
|
|
106
|
+
fill(selector: string, value: string, options?: CommandOptions): Promise<FillResult>;
|
|
107
|
+
hover(selector: string, options?: CommandOptions): Promise<ElementResult>;
|
|
108
|
+
press(selector: string, key: string, options?: PressOptions): Promise<PressResult>;
|
|
109
|
+
textContent(selector: string, options?: CommandOptions): Promise<TextResult>;
|
|
110
|
+
innerText(selector: string, options?: CommandOptions): Promise<TextResult>;
|
|
111
|
+
waitForSelector(selector: string, options?: WaitForSelectorOptions): Promise<WaitForSelectorResult>;
|
|
112
|
+
close(): Promise<void>;
|
|
113
|
+
ping(message?: string): Promise<string>;
|
|
114
|
+
pageInfo(): PageInfo;
|
|
115
|
+
}
|
|
116
|
+
export interface Locator {
|
|
117
|
+
readonly page: Page;
|
|
118
|
+
readonly selector: string;
|
|
119
|
+
click(options?: CommandOptions): Promise<ClickResult>;
|
|
120
|
+
count(options?: CommandOptions): Promise<CountResult>;
|
|
121
|
+
highlight(options?: HighlightOptions): Promise<HighlightResult>;
|
|
122
|
+
focus(options?: CommandOptions): Promise<ElementResult>;
|
|
123
|
+
fill(value: string, options?: CommandOptions): Promise<FillResult>;
|
|
124
|
+
hover(options?: CommandOptions): Promise<ElementResult>;
|
|
125
|
+
press(key: string, options?: PressOptions): Promise<PressResult>;
|
|
126
|
+
textContent(options?: CommandOptions): Promise<TextResult>;
|
|
127
|
+
innerText(options?: CommandOptions): Promise<TextResult>;
|
|
128
|
+
waitFor(options?: WaitForSelectorOptions): Promise<WaitForSelectorResult>;
|
|
129
|
+
locator(selector: string): Locator;
|
|
130
|
+
}
|
|
131
|
+
export interface AllwrightConfig {
|
|
132
|
+
schemaVersion?: 1;
|
|
133
|
+
server?: {
|
|
134
|
+
addr?: string;
|
|
135
|
+
};
|
|
136
|
+
browser?: {
|
|
137
|
+
name?: BrowserKind;
|
|
138
|
+
binary?: string;
|
|
139
|
+
launchOptions?: LaunchOptions;
|
|
140
|
+
};
|
|
141
|
+
expect?: RetryConfig;
|
|
142
|
+
suites?: Record<string, AllwrightSuiteConfig>;
|
|
143
|
+
}
|
|
144
|
+
export interface AllwrightSuiteConfig {
|
|
145
|
+
server?: {
|
|
146
|
+
addr?: string;
|
|
147
|
+
};
|
|
148
|
+
browser?: {
|
|
149
|
+
name?: BrowserKind;
|
|
150
|
+
binary?: string;
|
|
151
|
+
launchOptions?: LaunchOptions;
|
|
152
|
+
};
|
|
153
|
+
expect?: RetryConfig;
|
|
154
|
+
}
|
|
155
|
+
export interface RetryConfig {
|
|
156
|
+
timeoutMs?: number;
|
|
157
|
+
intervalMs?: number;
|
|
158
|
+
}
|
|
159
|
+
export interface ResolvedAllwrightConfig {
|
|
160
|
+
configFilePath: string | null;
|
|
161
|
+
suiteName: string | null;
|
|
162
|
+
serverAddr?: string;
|
|
163
|
+
browserName: BrowserKind;
|
|
164
|
+
browserBinary?: string;
|
|
165
|
+
launchOptions: LaunchOptions;
|
|
166
|
+
expect: RetryConfig;
|
|
167
|
+
}
|
|
168
|
+
export interface ResolveConfigOptions {
|
|
169
|
+
cwd?: string;
|
|
170
|
+
configFile?: string;
|
|
171
|
+
suite?: string;
|
|
172
|
+
}
|
|
173
|
+
export interface PingResponse {
|
|
174
|
+
message?: string;
|
|
175
|
+
}
|
|
176
|
+
export interface ChromeLaunchedPayload {
|
|
177
|
+
browser?: string;
|
|
178
|
+
note?: string;
|
|
179
|
+
cdpWebsocketUrl?: string;
|
|
180
|
+
userDataDir?: string;
|
|
181
|
+
initialTabSessionId?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface BrowserLaunchedPayload {
|
|
184
|
+
browserKind?: number;
|
|
185
|
+
browser?: string;
|
|
186
|
+
note?: string;
|
|
187
|
+
userDataDir?: string;
|
|
188
|
+
initialTabSessionId?: string;
|
|
189
|
+
}
|
|
190
|
+
export interface BrowserSessionEvent {
|
|
191
|
+
sessionId?: string;
|
|
192
|
+
event?: string;
|
|
193
|
+
chromeLaunched?: ChromeLaunchedPayload;
|
|
194
|
+
browserLaunched?: BrowserLaunchedPayload;
|
|
195
|
+
tabOpened?: {
|
|
196
|
+
tabSessionId?: string;
|
|
197
|
+
note?: string;
|
|
198
|
+
};
|
|
199
|
+
pong?: {
|
|
200
|
+
message?: string;
|
|
201
|
+
};
|
|
202
|
+
closed?: {
|
|
203
|
+
reason?: string;
|
|
204
|
+
};
|
|
205
|
+
error?: {
|
|
206
|
+
message?: string;
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
export interface TabSessionEvent {
|
|
210
|
+
tabSessionId?: string;
|
|
211
|
+
event?: string;
|
|
212
|
+
attached?: {
|
|
213
|
+
note?: string;
|
|
214
|
+
};
|
|
215
|
+
pong?: {
|
|
216
|
+
message?: string;
|
|
217
|
+
};
|
|
218
|
+
closed?: {
|
|
219
|
+
reason?: string;
|
|
220
|
+
};
|
|
221
|
+
error?: {
|
|
222
|
+
message?: string;
|
|
223
|
+
};
|
|
224
|
+
navigated?: {
|
|
225
|
+
url?: string;
|
|
226
|
+
note?: string;
|
|
227
|
+
};
|
|
228
|
+
chromiumBidiInjection?: {
|
|
229
|
+
note?: string;
|
|
230
|
+
bidiSessionId?: string;
|
|
231
|
+
mapperTargetId?: string;
|
|
232
|
+
mapperSessionId?: string;
|
|
233
|
+
packageVersion?: string;
|
|
234
|
+
};
|
|
235
|
+
elementClicked?: {
|
|
236
|
+
cssSelector?: string;
|
|
237
|
+
note?: string;
|
|
238
|
+
bidiSessionId?: string;
|
|
239
|
+
};
|
|
240
|
+
elementCounted?: {
|
|
241
|
+
cssSelector?: string;
|
|
242
|
+
count?: number;
|
|
243
|
+
note?: string;
|
|
244
|
+
};
|
|
245
|
+
elementsHighlighted?: {
|
|
246
|
+
cssSelector?: string;
|
|
247
|
+
count?: number;
|
|
248
|
+
note?: string;
|
|
249
|
+
};
|
|
250
|
+
elementFocused?: {
|
|
251
|
+
cssSelector?: string;
|
|
252
|
+
note?: string;
|
|
253
|
+
};
|
|
254
|
+
elementFilled?: {
|
|
255
|
+
cssSelector?: string;
|
|
256
|
+
value?: string;
|
|
257
|
+
note?: string;
|
|
258
|
+
};
|
|
259
|
+
elementHovered?: {
|
|
260
|
+
cssSelector?: string;
|
|
261
|
+
note?: string;
|
|
262
|
+
};
|
|
263
|
+
keyPressed?: {
|
|
264
|
+
cssSelector?: string;
|
|
265
|
+
key?: string;
|
|
266
|
+
note?: string;
|
|
267
|
+
};
|
|
268
|
+
textContentResolved?: {
|
|
269
|
+
cssSelector?: string;
|
|
270
|
+
text?: string;
|
|
271
|
+
note?: string;
|
|
272
|
+
};
|
|
273
|
+
innerTextResolved?: {
|
|
274
|
+
cssSelector?: string;
|
|
275
|
+
text?: string;
|
|
276
|
+
note?: string;
|
|
277
|
+
};
|
|
278
|
+
selectorWaitSatisfied?: {
|
|
279
|
+
cssSelector?: string;
|
|
280
|
+
visible?: boolean;
|
|
281
|
+
note?: string;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
export interface LaunchChromeRequest {
|
|
285
|
+
launchChrome: {
|
|
286
|
+
chromeBinary?: string;
|
|
287
|
+
retryOptions?: {
|
|
288
|
+
timeoutMs?: number;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
export interface LaunchBrowserRequest {
|
|
293
|
+
launchBrowser: {
|
|
294
|
+
browserKind: number;
|
|
295
|
+
browserBinary?: string;
|
|
296
|
+
retryOptions?: {
|
|
297
|
+
timeoutMs?: number;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
export interface OpenTabRequest {
|
|
302
|
+
openTab: {
|
|
303
|
+
retryOptions?: {
|
|
304
|
+
timeoutMs?: number;
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
export interface BrowserPingRequest {
|
|
309
|
+
ping: {
|
|
310
|
+
message: string;
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
export interface CloseBrowserRequest {
|
|
314
|
+
close: Record<string, never>;
|
|
315
|
+
}
|
|
316
|
+
export interface TabPingRequest {
|
|
317
|
+
browserSessionId: string;
|
|
318
|
+
tabSessionId: string;
|
|
319
|
+
ping: {
|
|
320
|
+
message: string;
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
export interface NavigateRequest {
|
|
324
|
+
browserSessionId: string;
|
|
325
|
+
tabSessionId: string;
|
|
326
|
+
navigate: {
|
|
327
|
+
url: string;
|
|
328
|
+
retryOptions?: {
|
|
329
|
+
timeoutMs?: number;
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
export interface ClickRequest {
|
|
334
|
+
browserSessionId: string;
|
|
335
|
+
tabSessionId: string;
|
|
336
|
+
clickElement: {
|
|
337
|
+
cssSelector: string;
|
|
338
|
+
retryOptions?: {
|
|
339
|
+
timeoutMs?: number;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
export interface CountRequest {
|
|
344
|
+
browserSessionId: string;
|
|
345
|
+
tabSessionId: string;
|
|
346
|
+
countElements: {
|
|
347
|
+
cssSelector: string;
|
|
348
|
+
retryOptions?: {
|
|
349
|
+
timeoutMs?: number;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
export interface HighlightRequest {
|
|
354
|
+
browserSessionId: string;
|
|
355
|
+
tabSessionId: string;
|
|
356
|
+
highlightElements: {
|
|
357
|
+
cssSelector: string;
|
|
358
|
+
durationMs?: number;
|
|
359
|
+
retryOptions?: {
|
|
360
|
+
timeoutMs?: number;
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
export interface FocusRequest {
|
|
365
|
+
browserSessionId: string;
|
|
366
|
+
tabSessionId: string;
|
|
367
|
+
focusElement: {
|
|
368
|
+
cssSelector: string;
|
|
369
|
+
retryOptions?: {
|
|
370
|
+
timeoutMs?: number;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
export interface FillRequest {
|
|
375
|
+
browserSessionId: string;
|
|
376
|
+
tabSessionId: string;
|
|
377
|
+
fillElement: {
|
|
378
|
+
cssSelector: string;
|
|
379
|
+
value: string;
|
|
380
|
+
retryOptions?: {
|
|
381
|
+
timeoutMs?: number;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
export interface HoverRequest {
|
|
386
|
+
browserSessionId: string;
|
|
387
|
+
tabSessionId: string;
|
|
388
|
+
hoverElement: {
|
|
389
|
+
cssSelector: string;
|
|
390
|
+
retryOptions?: {
|
|
391
|
+
timeoutMs?: number;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
export interface PressRequest {
|
|
396
|
+
browserSessionId: string;
|
|
397
|
+
tabSessionId: string;
|
|
398
|
+
pressKey: {
|
|
399
|
+
cssSelector: string;
|
|
400
|
+
key: string;
|
|
401
|
+
text?: string;
|
|
402
|
+
retryOptions?: {
|
|
403
|
+
timeoutMs?: number;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
export interface TextContentRequest {
|
|
408
|
+
browserSessionId: string;
|
|
409
|
+
tabSessionId: string;
|
|
410
|
+
getTextContent: {
|
|
411
|
+
cssSelector: string;
|
|
412
|
+
retryOptions?: {
|
|
413
|
+
timeoutMs?: number;
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
export interface InnerTextRequest {
|
|
418
|
+
browserSessionId: string;
|
|
419
|
+
tabSessionId: string;
|
|
420
|
+
getInnerText: {
|
|
421
|
+
cssSelector: string;
|
|
422
|
+
retryOptions?: {
|
|
423
|
+
timeoutMs?: number;
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
export interface WaitForSelectorRequest {
|
|
428
|
+
browserSessionId: string;
|
|
429
|
+
tabSessionId: string;
|
|
430
|
+
waitForSelector: {
|
|
431
|
+
cssSelector: string;
|
|
432
|
+
visible?: boolean;
|
|
433
|
+
retryOptions?: {
|
|
434
|
+
timeoutMs?: number;
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
export interface CloseTabRequest {
|
|
439
|
+
browserSessionId: string;
|
|
440
|
+
tabSessionId: string;
|
|
441
|
+
close: Record<string, never>;
|
|
442
|
+
}
|
|
443
|
+
export type BrowserSessionRequest = LaunchBrowserRequest | LaunchChromeRequest | OpenTabRequest | BrowserPingRequest | CloseBrowserRequest;
|
|
444
|
+
export type TabSessionRequest = TabPingRequest | NavigateRequest | ClickRequest | CountRequest | HighlightRequest | FocusRequest | FillRequest | HoverRequest | PressRequest | TextContentRequest | InnerTextRequest | WaitForSelectorRequest | CloseTabRequest;
|
|
445
|
+
export type BrowserSessionStream = grpc.ClientDuplexStream<BrowserSessionRequest, BrowserSessionEvent>;
|
|
446
|
+
export type PageSessionStream = grpc.ClientDuplexStream<TabSessionRequest, TabSessionEvent>;
|
|
447
|
+
export interface EngineServiceClientShape {
|
|
448
|
+
Ping(request: Record<string, never>, callback: (error: grpc.ServiceError | null, response: PingResponse) => void): void;
|
|
449
|
+
BrowserSession(): BrowserSessionStream;
|
|
450
|
+
TabSession(): PageSessionStream;
|
|
451
|
+
close(): void;
|
|
452
|
+
}
|
|
453
|
+
export interface EngineProtoRoot {
|
|
454
|
+
allwright: {
|
|
455
|
+
engine: {
|
|
456
|
+
v1: {
|
|
457
|
+
EngineService: grpc.ServiceClientConstructor;
|
|
458
|
+
};
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
export interface RuntimeClient {
|
|
463
|
+
client: EngineServiceClientShape;
|
|
464
|
+
}
|
|
465
|
+
export interface BrowserLaunchState {
|
|
466
|
+
runtime: RuntimeClient;
|
|
467
|
+
stream: BrowserSessionStream;
|
|
468
|
+
queue: EventQueue<BrowserSessionEvent>;
|
|
469
|
+
sessionId: string;
|
|
470
|
+
launched: BrowserLaunchedPayload;
|
|
471
|
+
}
|
|
472
|
+
export interface PageHandle {
|
|
473
|
+
stream: PageSessionStream;
|
|
474
|
+
queue: EventQueue<TabSessionEvent>;
|
|
475
|
+
closed: boolean;
|
|
476
|
+
}
|
|
477
|
+
export declare class EventQueue<T> {
|
|
478
|
+
#private;
|
|
479
|
+
push(item: T): void;
|
|
480
|
+
fail(error: Error): void;
|
|
481
|
+
next(): Promise<T>;
|
|
482
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class EventQueue {
|
|
2
|
+
#items = [];
|
|
3
|
+
#waiters = [];
|
|
4
|
+
#endedError = null;
|
|
5
|
+
push(item) {
|
|
6
|
+
const waiter = this.#waiters.shift();
|
|
7
|
+
if (waiter) {
|
|
8
|
+
waiter.resolve(item);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
this.#items.push(item);
|
|
12
|
+
}
|
|
13
|
+
fail(error) {
|
|
14
|
+
if (this.#endedError) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
this.#endedError = error;
|
|
18
|
+
while (this.#waiters.length > 0) {
|
|
19
|
+
this.#waiters.shift().reject(error);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async next() {
|
|
23
|
+
if (this.#items.length > 0) {
|
|
24
|
+
return this.#items.shift();
|
|
25
|
+
}
|
|
26
|
+
if (this.#endedError) {
|
|
27
|
+
throw this.#endedError;
|
|
28
|
+
}
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
this.#waiters.push({ resolve, reject });
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|