@fkn/lib 0.3.2 → 0.3.5
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/{background-BKX-_a5c.js → background-DkW0j6iK.js} +2 -2
- package/{background-CJX0MYvT.cjs → background-Y_zGUlba.cjs} +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +973 -788
- package/index.js +98 -103
- package/locator-CcAGamNm.cjs +31 -0
- package/{locator-BcexQUF6.js → locator-DpMUq6q3.js} +4 -4
- package/package.json +2 -6
- package/locator-i9-DjgYk.cjs +0 -31
package/index.d.ts
CHANGED
|
@@ -1,788 +1,973 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
declare
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
declare
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
declare
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
readonly
|
|
199
|
-
readonly
|
|
200
|
-
readonly
|
|
201
|
-
readonly
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
readonly
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
readonly
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
declare const
|
|
439
|
-
|
|
440
|
-
declare const
|
|
441
|
-
|
|
442
|
-
declare const
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
declare const
|
|
455
|
-
|
|
456
|
-
declare const
|
|
457
|
-
|
|
458
|
-
declare const
|
|
459
|
-
|
|
460
|
-
declare const
|
|
461
|
-
|
|
462
|
-
declare
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
};
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
declare namespace
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
declare type
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
declare const
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
1
|
+
import * as ip_address from 'ip-address';
|
|
2
|
+
import { Address4, Address6 } from 'ip-address';
|
|
3
|
+
import { Server as Server$1, ServerOpts, Socket as Socket$2, SocketConstructorOpts, SocketConnectOpts, AddressInfo, ListenOptions } from 'net';
|
|
4
|
+
import { Stream, DuplexOptions } from 'stream';
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
import { Socket as Socket$3, SocketOptions, BindOptions, SocketType, RemoteInfo } from 'dgram';
|
|
7
|
+
import { Buffer } from 'buffer';
|
|
8
|
+
import { BoxBase, Capable, UnderlyingType, RevivableContext } from 'osra';
|
|
9
|
+
|
|
10
|
+
declare const parseServerMetadataUdpSocketBoundPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
11
|
+
readonly _type: "ServerMetadataUdpSocketBoundPacket";
|
|
12
|
+
readonly offset: number;
|
|
13
|
+
readonly id: number;
|
|
14
|
+
readonly socketId: number;
|
|
15
|
+
readonly localAddressType: 0 | 1;
|
|
16
|
+
readonly localAddress: ip_address.Address4 | ip_address.Address6;
|
|
17
|
+
readonly localPort: number;
|
|
18
|
+
readonly errorLength: number;
|
|
19
|
+
readonly error: string;
|
|
20
|
+
};
|
|
21
|
+
type ServerMetadataUdpSocketBoundPacket = ReturnType<typeof parseServerMetadataUdpSocketBoundPacket>;
|
|
22
|
+
declare const parseServerMetadataUdpSocketUnboundPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
23
|
+
readonly _type: "ServerMetadataUdpSocketUnboundPacket";
|
|
24
|
+
readonly offset: number;
|
|
25
|
+
readonly id: number;
|
|
26
|
+
readonly socketId: number;
|
|
27
|
+
};
|
|
28
|
+
type ServerMetadataUdpSocketUnboundPacket = ReturnType<typeof parseServerMetadataUdpSocketUnboundPacket>;
|
|
29
|
+
declare const parseServerMetadataUdpSocketConnectedPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
30
|
+
readonly _type: "ServerMetadataUdpSocketConnectedPacket";
|
|
31
|
+
readonly offset: number;
|
|
32
|
+
readonly id: number;
|
|
33
|
+
readonly socketId: number;
|
|
34
|
+
readonly remoteAddressType: 0 | 1;
|
|
35
|
+
readonly remoteAddress: ip_address.Address4 | ip_address.Address6;
|
|
36
|
+
readonly remotePort: number;
|
|
37
|
+
readonly errorLength: number;
|
|
38
|
+
readonly error: string;
|
|
39
|
+
};
|
|
40
|
+
type ServerMetadataUdpSocketConnectedPacket = ReturnType<typeof parseServerMetadataUdpSocketConnectedPacket>;
|
|
41
|
+
declare const UDP_OPTION_BROADCAST: 0;
|
|
42
|
+
declare const UDP_OPTION_TTL: 1;
|
|
43
|
+
declare const UDP_OPTION_MULTICAST_TTL_V4: 2;
|
|
44
|
+
declare const UDP_OPTION_MULTICAST_LOOP_V4: 3;
|
|
45
|
+
declare const UDP_OPTION_MULTICAST_LOOP_V6: 4;
|
|
46
|
+
declare const UDP_OPTION_ADD_MEMBERSHIP_V4: 5;
|
|
47
|
+
declare const UDP_OPTION_DROP_MEMBERSHIP_V4: 6;
|
|
48
|
+
declare const UDP_OPTION_ADD_MEMBERSHIP_V6: 7;
|
|
49
|
+
declare const UDP_OPTION_DROP_MEMBERSHIP_V6: 8;
|
|
50
|
+
declare const UDP_OPTION_SEND_BUFFER_SIZE: 9;
|
|
51
|
+
declare const UDP_OPTION_RECV_BUFFER_SIZE: 10;
|
|
52
|
+
type UdpSocketOption = {
|
|
53
|
+
type: typeof UDP_OPTION_BROADCAST;
|
|
54
|
+
value: boolean;
|
|
55
|
+
} | {
|
|
56
|
+
type: typeof UDP_OPTION_TTL;
|
|
57
|
+
value: number;
|
|
58
|
+
} | {
|
|
59
|
+
type: typeof UDP_OPTION_MULTICAST_TTL_V4;
|
|
60
|
+
value: number;
|
|
61
|
+
} | {
|
|
62
|
+
type: typeof UDP_OPTION_MULTICAST_LOOP_V4;
|
|
63
|
+
value: boolean;
|
|
64
|
+
} | {
|
|
65
|
+
type: typeof UDP_OPTION_MULTICAST_LOOP_V6;
|
|
66
|
+
value: boolean;
|
|
67
|
+
} | {
|
|
68
|
+
type: typeof UDP_OPTION_ADD_MEMBERSHIP_V4;
|
|
69
|
+
group: Uint8Array;
|
|
70
|
+
interface: Uint8Array;
|
|
71
|
+
} | {
|
|
72
|
+
type: typeof UDP_OPTION_DROP_MEMBERSHIP_V4;
|
|
73
|
+
group: Uint8Array;
|
|
74
|
+
interface: Uint8Array;
|
|
75
|
+
} | {
|
|
76
|
+
type: typeof UDP_OPTION_ADD_MEMBERSHIP_V6;
|
|
77
|
+
group: Uint8Array;
|
|
78
|
+
ifIndex: number;
|
|
79
|
+
} | {
|
|
80
|
+
type: typeof UDP_OPTION_DROP_MEMBERSHIP_V6;
|
|
81
|
+
group: Uint8Array;
|
|
82
|
+
ifIndex: number;
|
|
83
|
+
} | {
|
|
84
|
+
type: typeof UDP_OPTION_SEND_BUFFER_SIZE;
|
|
85
|
+
value: number;
|
|
86
|
+
} | {
|
|
87
|
+
type: typeof UDP_OPTION_RECV_BUFFER_SIZE;
|
|
88
|
+
value: number;
|
|
89
|
+
};
|
|
90
|
+
declare const parseServerMetadataUdpSetOptionAckPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
91
|
+
_type: "ServerMetadataUdpSetOptionAckPacket";
|
|
92
|
+
offset: number;
|
|
93
|
+
id: number;
|
|
94
|
+
socketId: number;
|
|
95
|
+
errorLength: number;
|
|
96
|
+
error: string;
|
|
97
|
+
};
|
|
98
|
+
type ServerMetadataUdpSetOptionAckPacket = ReturnType<typeof parseServerMetadataUdpSetOptionAckPacket>;
|
|
99
|
+
|
|
100
|
+
declare const parseServerMetadataTcpSocketConnectedPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
101
|
+
readonly _type: "ServerMetadataTcpSocketConnectedPacket";
|
|
102
|
+
readonly offset: number;
|
|
103
|
+
readonly id: number;
|
|
104
|
+
readonly socketId: number;
|
|
105
|
+
readonly localAddressType: 0 | 1;
|
|
106
|
+
readonly localAddress: ip_address.Address4 | ip_address.Address6;
|
|
107
|
+
readonly localPort: number;
|
|
108
|
+
readonly remoteAddressType: 0 | 1;
|
|
109
|
+
readonly remoteAddress: ip_address.Address4 | ip_address.Address6;
|
|
110
|
+
readonly remotePort: number;
|
|
111
|
+
readonly errorLength: number;
|
|
112
|
+
readonly error: string;
|
|
113
|
+
};
|
|
114
|
+
type ServerMetadataTcpSocketConnectedPacket = ReturnType<typeof parseServerMetadataTcpSocketConnectedPacket>;
|
|
115
|
+
declare const parseServerMetadataTcpSocketShutdownPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
116
|
+
readonly _type: "ServerMetadataTcpSocketShutdownPacket";
|
|
117
|
+
readonly offset: number;
|
|
118
|
+
readonly id: number;
|
|
119
|
+
readonly socketId: number;
|
|
120
|
+
};
|
|
121
|
+
type ServerMetadataTcpSocketShutdownPacket = ReturnType<typeof parseServerMetadataTcpSocketShutdownPacket>;
|
|
122
|
+
declare const TCP_OPTION_NODELAY: 0;
|
|
123
|
+
declare const TCP_OPTION_TTL: 1;
|
|
124
|
+
declare const TCP_OPTION_KEEPALIVE: 2;
|
|
125
|
+
declare const TCP_OPTION_SEND_BUFFER_SIZE: 3;
|
|
126
|
+
declare const TCP_OPTION_RECV_BUFFER_SIZE: 4;
|
|
127
|
+
type TcpSocketOption = {
|
|
128
|
+
type: typeof TCP_OPTION_NODELAY;
|
|
129
|
+
value: boolean;
|
|
130
|
+
} | {
|
|
131
|
+
type: typeof TCP_OPTION_TTL;
|
|
132
|
+
value: number;
|
|
133
|
+
} | {
|
|
134
|
+
type: typeof TCP_OPTION_KEEPALIVE;
|
|
135
|
+
enabled: boolean;
|
|
136
|
+
initialDelaySeconds: number;
|
|
137
|
+
} | {
|
|
138
|
+
type: typeof TCP_OPTION_SEND_BUFFER_SIZE;
|
|
139
|
+
value: number;
|
|
140
|
+
} | {
|
|
141
|
+
type: typeof TCP_OPTION_RECV_BUFFER_SIZE;
|
|
142
|
+
value: number;
|
|
143
|
+
};
|
|
144
|
+
declare const parseServerMetadataTcpSetOptionAckPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
145
|
+
_type: "ServerMetadataTcpSetOptionAckPacket";
|
|
146
|
+
offset: number;
|
|
147
|
+
id: number;
|
|
148
|
+
socketId: number;
|
|
149
|
+
errorLength: number;
|
|
150
|
+
error: string;
|
|
151
|
+
};
|
|
152
|
+
type ServerMetadataTcpSetOptionAckPacket = ReturnType<typeof parseServerMetadataTcpSetOptionAckPacket>;
|
|
153
|
+
|
|
154
|
+
declare const parseServerMetadataTcpSocketListenerBoundPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
155
|
+
readonly _type: "ServerMetadataTcpSocketListenerBoundPacket";
|
|
156
|
+
readonly offset: number;
|
|
157
|
+
readonly id: number;
|
|
158
|
+
readonly socketId: number;
|
|
159
|
+
readonly localAddressType: 0 | 1;
|
|
160
|
+
readonly localAddress: ip_address.Address4 | ip_address.Address6;
|
|
161
|
+
readonly localPort: number;
|
|
162
|
+
readonly errorLength: number;
|
|
163
|
+
readonly error: string;
|
|
164
|
+
};
|
|
165
|
+
type ServerMetadataTcpSocketListenerBoundPacket = ReturnType<typeof parseServerMetadataTcpSocketListenerBoundPacket>;
|
|
166
|
+
declare const parseServerMetadataTcpSocketListenerUnboundPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
167
|
+
readonly _type: "ServerMetadataTcpSocketListenerUnboundPacket";
|
|
168
|
+
readonly offset: number;
|
|
169
|
+
readonly id: number;
|
|
170
|
+
readonly socketId: number;
|
|
171
|
+
};
|
|
172
|
+
type ServerMetadataTcpSocketListenerUnboundPacket = ReturnType<typeof parseServerMetadataTcpSocketListenerUnboundPacket>;
|
|
173
|
+
|
|
174
|
+
declare const parseServerMetadataHeaderPacket: (offset: number, buffer: ArrayBuffer, view: DataView) => {
|
|
175
|
+
readonly _type: "ServerMetadataHeaderPacket";
|
|
176
|
+
readonly offset: number;
|
|
177
|
+
readonly agentLength: number;
|
|
178
|
+
readonly agent: string;
|
|
179
|
+
readonly versionLength: number;
|
|
180
|
+
readonly version: string;
|
|
181
|
+
};
|
|
182
|
+
type ServerMetadataHeaderPacket = ReturnType<typeof parseServerMetadataHeaderPacket>;
|
|
183
|
+
type ServerMetadataPacket = ServerMetadataHeaderPacket | ServerMetadataTcpSocketConnectedPacket | ServerMetadataTcpSocketShutdownPacket | ServerMetadataTcpSocketListenerBoundPacket | ServerMetadataTcpSocketListenerUnboundPacket | ServerMetadataUdpSocketBoundPacket | ServerMetadataUdpSocketUnboundPacket | ServerMetadataUdpSocketConnectedPacket | ServerMetadataTcpSetOptionAckPacket | ServerMetadataUdpSetOptionAckPacket;
|
|
184
|
+
|
|
185
|
+
type BidirectionalStreams = {
|
|
186
|
+
readable: ReadableStream<Uint8Array>;
|
|
187
|
+
writable: WritableStream<Uint8Array>;
|
|
188
|
+
};
|
|
189
|
+
declare const makeWebVPNWebTransport: () => Promise<{
|
|
190
|
+
webtransport: WebTransport;
|
|
191
|
+
getNewPacketId: () => number;
|
|
192
|
+
getTcpDataReadableStreamForSocketId: (socketId: number, options?: {
|
|
193
|
+
signal?: AbortSignal;
|
|
194
|
+
}) => Promise<BidirectionalStreams>;
|
|
195
|
+
getUdpDataReadableStreamForSocketId: (socketId: number) => ReadableStream<{
|
|
196
|
+
readonly _type: "ServerUdpDataPacket";
|
|
197
|
+
readonly offset: number;
|
|
198
|
+
readonly socketId: number;
|
|
199
|
+
readonly remoteAddressType: 0 | 1 | 2;
|
|
200
|
+
readonly remoteAddress: Address4 | Address6 | undefined;
|
|
201
|
+
readonly remotePort: number | undefined;
|
|
202
|
+
readonly dataLength: number;
|
|
203
|
+
readonly data: ArrayBuffer;
|
|
204
|
+
}>;
|
|
205
|
+
getPacketForId: (packetId: number) => Promise<ServerMetadataPacket>;
|
|
206
|
+
getMetadataReadableStreamForSocketId: (socketId: number) => ReadableStream<ServerMetadataPacket>;
|
|
207
|
+
getMetadataReadableStreamForLocalAddress: (address: Address4 | Address6) => ReadableStream<ServerMetadataPacket>;
|
|
208
|
+
getMetadataWritableStream: () => WritableStream<Uint8Array<ArrayBufferLike>>;
|
|
209
|
+
getDatagramWritableStream: () => WritableStream<Uint8Array<ArrayBufferLike>>;
|
|
210
|
+
}>;
|
|
211
|
+
type WebVPNWebTransport = Awaited<ReturnType<typeof makeWebVPNWebTransport>>;
|
|
212
|
+
|
|
213
|
+
declare const processTcpSocket: ({ connectedPacket, dataReadableStream, dataWritableStream, metadataReadableStream, metadataWriter, dataStreamAbort, webVpnWebTransport }: {
|
|
214
|
+
connectedPacket: ServerMetadataTcpSocketConnectedPacket;
|
|
215
|
+
dataReadableStream: ReadableStream<Uint8Array>;
|
|
216
|
+
dataWritableStream: WritableStream<Uint8Array>;
|
|
217
|
+
metadataReadableStream: ReadableStream<ServerMetadataPacket>;
|
|
218
|
+
metadataWriter: WritableStreamDefaultWriter<Uint8Array>;
|
|
219
|
+
dataStreamAbort?: AbortController;
|
|
220
|
+
webVpnWebTransport: WebVPNWebTransport;
|
|
221
|
+
}) => Promise<{
|
|
222
|
+
localAddress: string;
|
|
223
|
+
localFamily: "IPv4" | "IPv6";
|
|
224
|
+
localPort: number;
|
|
225
|
+
remoteAddress: string;
|
|
226
|
+
remoteFamily: "IPv4" | "IPv6";
|
|
227
|
+
remotePort: number;
|
|
228
|
+
dataReadableStream: ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
229
|
+
dataWritableStream: WritableStream<Uint8Array<ArrayBufferLike>>;
|
|
230
|
+
end: () => Promise<void>;
|
|
231
|
+
destroy: () => Promise<void>;
|
|
232
|
+
destroySoon: () => Promise<void>;
|
|
233
|
+
resetAndDestroy: () => Promise<void>;
|
|
234
|
+
setOption: (option: TcpSocketOption) => Promise<void>;
|
|
235
|
+
}>;
|
|
236
|
+
type TcpSocketResult = Awaited<ReturnType<typeof processTcpSocket>>;
|
|
237
|
+
|
|
238
|
+
type AddressLookupResult = {
|
|
239
|
+
address: string;
|
|
240
|
+
family: 0 | 4 | 6;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
declare const resolvers: {
|
|
244
|
+
readonly dnsLookup: <T extends boolean = false>(hostname: string, options?: {
|
|
245
|
+
all?: T;
|
|
246
|
+
family: 0 | 4 | 6;
|
|
247
|
+
}) => Promise<T extends true ? AddressLookupResult[] : AddressLookupResult | undefined>;
|
|
248
|
+
readonly webVpnTcpSocket: ({ remoteAddress: _remoteAddress, remotePort }: {
|
|
249
|
+
remoteAddress: string;
|
|
250
|
+
remotePort: number;
|
|
251
|
+
}) => Promise<{
|
|
252
|
+
localAddress: string;
|
|
253
|
+
localFamily: "IPv4" | "IPv6";
|
|
254
|
+
localPort: number;
|
|
255
|
+
remoteAddress: string;
|
|
256
|
+
remoteFamily: "IPv4" | "IPv6";
|
|
257
|
+
remotePort: number;
|
|
258
|
+
dataReadableStream: ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
259
|
+
dataWritableStream: WritableStream<Uint8Array<ArrayBufferLike>>;
|
|
260
|
+
end: () => Promise<void>;
|
|
261
|
+
destroy: () => Promise<void>;
|
|
262
|
+
destroySoon: () => Promise<void>;
|
|
263
|
+
resetAndDestroy: () => Promise<void>;
|
|
264
|
+
setOption: (option: TcpSocketOption) => Promise<void>;
|
|
265
|
+
}>;
|
|
266
|
+
readonly webVpnTcpSocketListener: ({ localAddress: _localAddress, localPort, onConnection }: {
|
|
267
|
+
localAddress: string;
|
|
268
|
+
localPort: number;
|
|
269
|
+
onConnection: (connection: TcpSocketResult) => void;
|
|
270
|
+
}) => Promise<{
|
|
271
|
+
localAddress: string;
|
|
272
|
+
localFamily: "IPv4" | "IPv6";
|
|
273
|
+
localPort: number;
|
|
274
|
+
close: () => Promise<void>;
|
|
275
|
+
}>;
|
|
276
|
+
readonly webVpnUdpSocket: ({ type, port, address }: {
|
|
277
|
+
type: "udp4" | "udp6";
|
|
278
|
+
port: number;
|
|
279
|
+
address: string;
|
|
280
|
+
}) => Promise<{
|
|
281
|
+
localAddress: string;
|
|
282
|
+
localFamily: "IPv4" | "IPv6";
|
|
283
|
+
localPort: number;
|
|
284
|
+
dataReadableStream: ReadableStream<{
|
|
285
|
+
data: ArrayBuffer;
|
|
286
|
+
size: number;
|
|
287
|
+
family: "IPv4" | "IPv6";
|
|
288
|
+
address: string;
|
|
289
|
+
port: number;
|
|
290
|
+
}>;
|
|
291
|
+
connect: ({ remoteAddress: _remoteAddress, remotePort }: {
|
|
292
|
+
remoteAddress: string;
|
|
293
|
+
remotePort: number;
|
|
294
|
+
}) => Promise<void>;
|
|
295
|
+
send: ({ message, address: _remoteAddress, port: remotePort }: {
|
|
296
|
+
message: ArrayBuffer;
|
|
297
|
+
address?: string;
|
|
298
|
+
port?: number;
|
|
299
|
+
}) => Promise<void>;
|
|
300
|
+
close: () => Promise<void>;
|
|
301
|
+
setOption: (option: UdpSocketOption) => Promise<void>;
|
|
302
|
+
}>;
|
|
303
|
+
readonly proxyFetch: (input: string | URL | Request, init?: (RequestInit | undefined) & {
|
|
304
|
+
render?: boolean;
|
|
305
|
+
}) => Promise<Response>;
|
|
306
|
+
};
|
|
307
|
+
type Resolvers = typeof resolvers;
|
|
308
|
+
|
|
309
|
+
type ProxyFetch = Resolvers['proxyFetch'];
|
|
310
|
+
type FetchParameters = Parameters<ProxyFetch>;
|
|
311
|
+
declare const serverProxyFetch: (input: FetchParameters[0], init?: FetchParameters[1]) => Promise<Response>;
|
|
312
|
+
|
|
313
|
+
declare const isIPv4: (input: string) => boolean;
|
|
314
|
+
declare const isIPv6: (input: string) => boolean;
|
|
315
|
+
declare const isIP: (input: string) => 0 | 4 | 6;
|
|
316
|
+
|
|
317
|
+
declare class Socket$1 extends Stream.Duplex implements Socket$2 {
|
|
318
|
+
_localAddress?: {
|
|
319
|
+
address: string;
|
|
320
|
+
family: string;
|
|
321
|
+
port: number;
|
|
322
|
+
};
|
|
323
|
+
_remoteAddress?: {
|
|
324
|
+
address: string;
|
|
325
|
+
family: string;
|
|
326
|
+
port: number;
|
|
327
|
+
};
|
|
328
|
+
_webVPNTcpSocketPromise?: Promise<(Awaited<ReturnType<Resolvers['webVpnTcpSocket']>> & {
|
|
329
|
+
reader: ReadableStreamDefaultReader<Uint8Array>;
|
|
330
|
+
writer: WritableStreamDefaultWriter<Uint8Array>;
|
|
331
|
+
}) | undefined>;
|
|
332
|
+
constructor(options?: SocketConstructorOpts & DuplexOptions & {
|
|
333
|
+
connection?: ReturnType<Resolvers['webVpnTcpSocket']>;
|
|
334
|
+
});
|
|
335
|
+
__webvpn_tcp_socket_init__(connection: ReturnType<Resolvers['webVpnTcpSocket']>): Promise<({
|
|
336
|
+
localAddress: string;
|
|
337
|
+
localFamily: "IPv4" | "IPv6";
|
|
338
|
+
localPort: number;
|
|
339
|
+
remoteAddress: string;
|
|
340
|
+
remoteFamily: "IPv4" | "IPv6";
|
|
341
|
+
remotePort: number;
|
|
342
|
+
dataReadableStream: ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
343
|
+
dataWritableStream: WritableStream<Uint8Array<ArrayBufferLike>>;
|
|
344
|
+
end: () => Promise<void>;
|
|
345
|
+
destroy: () => Promise<void>;
|
|
346
|
+
destroySoon: () => Promise<void>;
|
|
347
|
+
resetAndDestroy: () => Promise<void>;
|
|
348
|
+
setOption: (option: TcpSocketOption) => Promise<void>;
|
|
349
|
+
} & {
|
|
350
|
+
reader: ReadableStreamDefaultReader<Uint8Array>;
|
|
351
|
+
writer: WritableStreamDefaultWriter<Uint8Array>;
|
|
352
|
+
}) | undefined>;
|
|
353
|
+
/** STREAM IMPL */
|
|
354
|
+
_read(size: number): void;
|
|
355
|
+
_write(chunk: Uint8Array, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
356
|
+
/** SOCKET IMPL */
|
|
357
|
+
connect(options: SocketConnectOpts, connectionListener?: (() => void) | undefined): this;
|
|
358
|
+
connect(port: number, host: string, connectionListener?: (() => void) | undefined): this;
|
|
359
|
+
connect(port: number, connectionListener?: (() => void) | undefined): this;
|
|
360
|
+
connect(path: string, connectionListener?: (() => void) | undefined): this;
|
|
361
|
+
connect(port: unknown, host?: unknown, connectionListener?: unknown): this;
|
|
362
|
+
_end(chunk: any, cb?: () => void): this;
|
|
363
|
+
_end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
|
|
364
|
+
_destroy(error?: Error | null | undefined): this;
|
|
365
|
+
destroySoon(): void;
|
|
366
|
+
resetAndDestroy(): this;
|
|
367
|
+
_timeoutMs?: number;
|
|
368
|
+
_timeoutTimer?: ReturnType<typeof setTimeout>;
|
|
369
|
+
_restartTimeoutTimer(): void;
|
|
370
|
+
setTimeout(timeout: number, callback?: (() => void) | undefined): this;
|
|
371
|
+
setNoDelay(noDelay?: boolean | undefined): this;
|
|
372
|
+
setKeepAlive(enable?: boolean | undefined, initialDelay?: number | undefined): this;
|
|
373
|
+
setSendBufferSize(size: number): this;
|
|
374
|
+
setRecvBufferSize(size: number): this;
|
|
375
|
+
_setTcpOption(option: TcpSocketOption): void;
|
|
376
|
+
write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
|
|
377
|
+
write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
|
|
378
|
+
address(): AddressInfo | {};
|
|
379
|
+
unref(): this;
|
|
380
|
+
ref(): this;
|
|
381
|
+
autoSelectFamilyAttemptedAddresses: string[];
|
|
382
|
+
bufferSize: number;
|
|
383
|
+
bytesRead: number;
|
|
384
|
+
bytesWritten: number;
|
|
385
|
+
connecting: boolean;
|
|
386
|
+
pending: boolean;
|
|
387
|
+
get localAddress(): string;
|
|
388
|
+
get localPort(): number;
|
|
389
|
+
get localFamily(): string;
|
|
390
|
+
readyState: 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed';
|
|
391
|
+
get remoteAddress(): string;
|
|
392
|
+
get remotePort(): number;
|
|
393
|
+
get remoteFamily(): string;
|
|
394
|
+
timeout?: number | undefined;
|
|
395
|
+
}
|
|
396
|
+
interface EventEmitterOptions$1 {
|
|
397
|
+
/**
|
|
398
|
+
* Enables automatic capturing of promise rejection.
|
|
399
|
+
*/
|
|
400
|
+
captureRejections?: boolean | undefined;
|
|
401
|
+
}
|
|
402
|
+
declare class Server extends EventEmitter implements Server$1 {
|
|
403
|
+
_localAddress?: {
|
|
404
|
+
address: string;
|
|
405
|
+
family: string;
|
|
406
|
+
port: number;
|
|
407
|
+
};
|
|
408
|
+
_webVPNTcpSocketListenerPromise?: Promise<Awaited<ReturnType<Resolvers['webVpnTcpSocketListener']>> | undefined>;
|
|
409
|
+
constructor(options?: ServerOpts & EventEmitterOptions$1 & {
|
|
410
|
+
connection?: ReturnType<Resolvers['webVpnTcpSocketListener']>;
|
|
411
|
+
}, connectionListener?: (socket: Socket$1) => void);
|
|
412
|
+
__webvpn_tcp_socket_listener_init__(connection: ReturnType<Resolvers['webVpnTcpSocketListener']>): Promise<{
|
|
413
|
+
localAddress: string;
|
|
414
|
+
localFamily: "IPv4" | "IPv6";
|
|
415
|
+
localPort: number;
|
|
416
|
+
close: () => Promise<void>;
|
|
417
|
+
} | undefined>;
|
|
418
|
+
listen(port?: number | undefined, hostname?: string | undefined, backlog?: number | undefined, listeningListener?: (() => void) | undefined): this;
|
|
419
|
+
listen(port?: number | undefined, hostname?: string | undefined, listeningListener?: (() => void) | undefined): this;
|
|
420
|
+
listen(port?: number | undefined, backlog?: number | undefined, listeningListener?: (() => void) | undefined): this;
|
|
421
|
+
listen(port?: number | undefined, listeningListener?: (() => void) | undefined): this;
|
|
422
|
+
listen(path: string, backlog?: number | undefined, listeningListener?: (() => void) | undefined): this;
|
|
423
|
+
listen(path: string, listeningListener?: (() => void) | undefined): this;
|
|
424
|
+
listen(options: ListenOptions, listeningListener?: (() => void) | undefined): this;
|
|
425
|
+
listen(handle: any, backlog?: number | undefined, listeningListener?: (() => void) | undefined): this;
|
|
426
|
+
listen(handle: any, listeningListener?: (() => void) | undefined): this;
|
|
427
|
+
listen(port?: unknown, hostname?: unknown, backlog?: unknown, listeningListener?: unknown): this;
|
|
428
|
+
close(callback?: ((err?: Error | undefined) => void) | undefined): this;
|
|
429
|
+
address(): string | AddressInfo | null;
|
|
430
|
+
getConnections(cb: (error: Error | null, count: number) => void): this;
|
|
431
|
+
ref(): this;
|
|
432
|
+
unref(): this;
|
|
433
|
+
maxConnections: number;
|
|
434
|
+
connections: number;
|
|
435
|
+
listening: boolean;
|
|
436
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
437
|
+
}
|
|
438
|
+
declare const connect: (options: SocketConnectOpts, connectionListener?: () => void) => Socket$1;
|
|
439
|
+
declare const createConnection: (options: SocketConnectOpts, connectionListener?: () => void) => Socket$1;
|
|
440
|
+
declare const createServer: (options: ServerOpts, connectionListener?: (socket: Socket$1) => void) => Server;
|
|
441
|
+
|
|
442
|
+
declare const _default: {
|
|
443
|
+
Socket: typeof Socket$1;
|
|
444
|
+
Server: typeof Server;
|
|
445
|
+
connect: (options: SocketConnectOpts, connectionListener?: () => void) => Socket$1;
|
|
446
|
+
createConnection: (options: SocketConnectOpts, connectionListener?: () => void) => Socket$1;
|
|
447
|
+
createServer: (options: ServerOpts, connectionListener?: (socket: Socket$1) => void) => Server;
|
|
448
|
+
isIP: (input: string) => 0 | 4 | 6;
|
|
449
|
+
isIPv4: (input: string) => boolean;
|
|
450
|
+
isIPv6: (input: string) => boolean;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
type net_Server = Server;
|
|
454
|
+
declare const net_Server: typeof Server;
|
|
455
|
+
declare const net__default: typeof _default;
|
|
456
|
+
declare const net_connect: typeof connect;
|
|
457
|
+
declare const net_createConnection: typeof createConnection;
|
|
458
|
+
declare const net_createServer: typeof createServer;
|
|
459
|
+
declare const net_isIP: typeof isIP;
|
|
460
|
+
declare const net_isIPv4: typeof isIPv4;
|
|
461
|
+
declare const net_isIPv6: typeof isIPv6;
|
|
462
|
+
declare namespace net {
|
|
463
|
+
export {
|
|
464
|
+
net_Server as Server,
|
|
465
|
+
Socket$1 as Socket,
|
|
466
|
+
net__default as _default,
|
|
467
|
+
net_connect as connect,
|
|
468
|
+
net_createConnection as createConnection,
|
|
469
|
+
net_createServer as createServer,
|
|
470
|
+
_default as default,
|
|
471
|
+
net_isIP as isIP,
|
|
472
|
+
net_isIPv4 as isIPv4,
|
|
473
|
+
net_isIPv6 as isIPv6,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
interface EventEmitterOptions {
|
|
478
|
+
/**
|
|
479
|
+
* Enables automatic capturing of promise rejection.
|
|
480
|
+
*/
|
|
481
|
+
captureRejections?: boolean | undefined;
|
|
482
|
+
}
|
|
483
|
+
declare class Socket extends EventEmitter implements Socket$3 {
|
|
484
|
+
_type: 'udp4' | 'udp6';
|
|
485
|
+
_localAddress?: {
|
|
486
|
+
address: string;
|
|
487
|
+
family: string;
|
|
488
|
+
port: number;
|
|
489
|
+
};
|
|
490
|
+
_remoteAddress?: {
|
|
491
|
+
address: string;
|
|
492
|
+
family: string;
|
|
493
|
+
port: number;
|
|
494
|
+
};
|
|
495
|
+
_webVPNUdpSocketPromise?: Promise<Awaited<ReturnType<Resolvers['webVpnUdpSocket']>> | undefined>;
|
|
496
|
+
constructor(options: SocketOptions & EventEmitterOptions & {
|
|
497
|
+
connection?: ReturnType<Resolvers['webVpnUdpSocket']>;
|
|
498
|
+
});
|
|
499
|
+
_lastRecvBufferSize: number;
|
|
500
|
+
_lastSendBufferSize: number;
|
|
501
|
+
_lastTtl: number;
|
|
502
|
+
_lastMulticastTtl: number;
|
|
503
|
+
_lastMulticastLoopback: boolean;
|
|
504
|
+
_setUdpOption(option: UdpSocketOption): void;
|
|
505
|
+
addMembership(multicastAddress: string, multicastInterface?: string | undefined): void;
|
|
506
|
+
address(): AddressInfo;
|
|
507
|
+
bind(port?: number | undefined, address?: string | undefined, callback?: (() => void) | undefined): this;
|
|
508
|
+
bind(port?: number | undefined, callback?: (() => void) | undefined): this;
|
|
509
|
+
bind(callback?: (() => void) | undefined): this;
|
|
510
|
+
bind(options: BindOptions, callback?: (() => void) | undefined): this;
|
|
511
|
+
close(callback?: (() => void) | undefined): this;
|
|
512
|
+
connect(port: number, address?: string, callback?: () => void): void;
|
|
513
|
+
connect(port: number, callback: () => void): void;
|
|
514
|
+
disconnect(): void;
|
|
515
|
+
dropMembership(multicastAddress: string, multicastInterface?: string | undefined): void;
|
|
516
|
+
getRecvBufferSize(): number;
|
|
517
|
+
getSendBufferSize(): number;
|
|
518
|
+
getSendQueueSize(): number;
|
|
519
|
+
getSendQueueCount(): number;
|
|
520
|
+
ref(): this;
|
|
521
|
+
remoteAddress(): AddressInfo;
|
|
522
|
+
send(msg: string | readonly any[] | Uint8Array, port?: number | undefined, address?: string | undefined, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
|
|
523
|
+
send(msg: string | readonly any[] | Uint8Array, port?: number | undefined, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
|
|
524
|
+
send(msg: string | readonly any[] | Uint8Array, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
|
|
525
|
+
send(msg: string | Uint8Array, offset: number, length: number, port?: number | undefined, address?: string | undefined, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
|
|
526
|
+
send(msg: string | Uint8Array, offset: number, length: number, port?: number | undefined, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
|
|
527
|
+
send(msg: string | Uint8Array, offset: number, length: number, callback?: ((error: Error | null, bytes: number) => void) | undefined): void;
|
|
528
|
+
send(msg: unknown, offset?: unknown, length?: unknown, port?: unknown, address?: unknown, callback?: unknown): void;
|
|
529
|
+
setBroadcast(flag: boolean): void;
|
|
530
|
+
setMulticastInterface(multicastInterface: string): void;
|
|
531
|
+
setMulticastLoopback(flag: boolean): boolean;
|
|
532
|
+
setMulticastTTL(ttl: number): number;
|
|
533
|
+
setRecvBufferSize(size: number): void;
|
|
534
|
+
setSendBufferSize(size: number): void;
|
|
535
|
+
setTTL(ttl: number): number;
|
|
536
|
+
unref(): this;
|
|
537
|
+
addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string | undefined): void;
|
|
538
|
+
dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string | undefined): void;
|
|
539
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
540
|
+
}
|
|
541
|
+
declare const createSocket: (options: SocketType | SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void) => Socket;
|
|
542
|
+
|
|
543
|
+
type dgram_Socket = Socket;
|
|
544
|
+
declare const dgram_Socket: typeof Socket;
|
|
545
|
+
declare const dgram_createSocket: typeof createSocket;
|
|
546
|
+
declare namespace dgram {
|
|
547
|
+
export {
|
|
548
|
+
dgram_Socket as Socket,
|
|
549
|
+
dgram_createSocket as createSocket,
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
type ExtractType<M> = M extends {
|
|
554
|
+
type: infer T extends string;
|
|
555
|
+
} ? T : never;
|
|
556
|
+
type ExtractResolverArgs<M> = M extends {
|
|
557
|
+
resolve: (context: any, ...args: infer A) => Element[];
|
|
558
|
+
} ? A : never;
|
|
559
|
+
type ExtractOperationArgs<M> = M extends {
|
|
560
|
+
resolve: (context: any, ...args: infer A) => any;
|
|
561
|
+
} ? A : never;
|
|
562
|
+
type ExtractResolverReturn<M> = M extends {
|
|
563
|
+
resolve: (context: any, ...args: any[]) => infer R;
|
|
564
|
+
} ? R : never;
|
|
565
|
+
|
|
566
|
+
declare const type$i: 'locator';
|
|
567
|
+
declare const resolve$h: (context: LocatorContext, selector: string) => Element[];
|
|
568
|
+
declare const render$7: SelectorRenderer;
|
|
569
|
+
|
|
570
|
+
declare namespace locatorSel {
|
|
571
|
+
export {
|
|
572
|
+
render$7 as render,
|
|
573
|
+
resolve$h as resolve,
|
|
574
|
+
type$i as type,
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
declare const type$h: 'getByRole';
|
|
579
|
+
declare const resolve$g: (context: LocatorContext, role: string) => Element[];
|
|
580
|
+
declare const render$6: SelectorRenderer;
|
|
581
|
+
|
|
582
|
+
declare namespace getByRole {
|
|
583
|
+
export {
|
|
584
|
+
render$6 as render,
|
|
585
|
+
resolve$g as resolve,
|
|
586
|
+
type$h as type,
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
declare const type$g: 'getByText';
|
|
591
|
+
declare const resolve$f: (context: LocatorContext, text: string) => Element[];
|
|
592
|
+
declare const render$5: SelectorRenderer;
|
|
593
|
+
|
|
594
|
+
declare namespace getByText {
|
|
595
|
+
export {
|
|
596
|
+
render$5 as render,
|
|
597
|
+
resolve$f as resolve,
|
|
598
|
+
type$g as type,
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
declare const type$f: 'getByTestId';
|
|
603
|
+
declare const resolve$e: (context: LocatorContext, testId: string) => Element[];
|
|
604
|
+
declare const render$4: SelectorRenderer;
|
|
605
|
+
|
|
606
|
+
declare namespace getByTestId {
|
|
607
|
+
export {
|
|
608
|
+
render$4 as render,
|
|
609
|
+
resolve$e as resolve,
|
|
610
|
+
type$f as type,
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
declare const type$e: 'first';
|
|
615
|
+
declare const resolve$d: (context: LocatorContext) => Element[];
|
|
616
|
+
declare const render$3: SelectorRenderer;
|
|
617
|
+
|
|
618
|
+
declare namespace first {
|
|
619
|
+
export {
|
|
620
|
+
render$3 as render,
|
|
621
|
+
resolve$d as resolve,
|
|
622
|
+
type$e as type,
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
declare const type$d: 'nth';
|
|
627
|
+
declare const resolve$c: (context: LocatorContext, index: number) => Element[];
|
|
628
|
+
declare const render$2: SelectorRenderer;
|
|
629
|
+
|
|
630
|
+
declare namespace nth {
|
|
631
|
+
export {
|
|
632
|
+
render$2 as render,
|
|
633
|
+
resolve$c as resolve,
|
|
634
|
+
type$d as type,
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
declare const type$c: 'click';
|
|
639
|
+
declare const resolve$b: (context: LocatorContext, options?: OperationTimeoutOptions & {
|
|
640
|
+
position?: {
|
|
641
|
+
x?: number;
|
|
642
|
+
y?: number;
|
|
643
|
+
};
|
|
644
|
+
}) => void;
|
|
645
|
+
|
|
646
|
+
declare namespace click {
|
|
647
|
+
export {
|
|
648
|
+
resolve$b as resolve,
|
|
649
|
+
type$c as type,
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
declare const type$b: 'fill';
|
|
654
|
+
declare const resolve$a: (context: LocatorContext, value: string, _options?: OperationTimeoutOptions) => void;
|
|
655
|
+
|
|
656
|
+
declare namespace fill {
|
|
657
|
+
export {
|
|
658
|
+
resolve$a as resolve,
|
|
659
|
+
type$b as type,
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
declare const type$a: 'hover';
|
|
664
|
+
declare const resolve$9: (context: LocatorContext, _options?: OperationTimeoutOptions) => void;
|
|
665
|
+
|
|
666
|
+
declare namespace hover {
|
|
667
|
+
export {
|
|
668
|
+
resolve$9 as resolve,
|
|
669
|
+
type$a as type,
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
declare const type$9: 'textContent';
|
|
674
|
+
declare const resolve$8: (context: LocatorContext, _options?: OperationTimeoutOptions) => string;
|
|
675
|
+
|
|
676
|
+
declare namespace textContent {
|
|
677
|
+
export {
|
|
678
|
+
resolve$8 as resolve,
|
|
679
|
+
type$9 as type,
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
declare const type$8: 'isVisible';
|
|
684
|
+
declare const resolve$7: (context: LocatorContext, _options?: OperationTimeoutOptions) => boolean;
|
|
685
|
+
|
|
686
|
+
declare namespace isVisible {
|
|
687
|
+
export {
|
|
688
|
+
resolve$7 as resolve,
|
|
689
|
+
type$8 as type,
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
declare const type$7: 'count';
|
|
694
|
+
declare const resolve$6: (context: LocatorContext, _options?: OperationTimeoutOptions) => number;
|
|
695
|
+
|
|
696
|
+
declare namespace count {
|
|
697
|
+
export {
|
|
698
|
+
resolve$6 as resolve,
|
|
699
|
+
type$7 as type,
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
declare const type$6: 'exists';
|
|
704
|
+
declare const resolve$5: (context: LocatorContext, _options?: OperationTimeoutOptions) => boolean;
|
|
705
|
+
|
|
706
|
+
declare namespace exists {
|
|
707
|
+
export {
|
|
708
|
+
resolve$5 as resolve,
|
|
709
|
+
type$6 as type,
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
declare const type$5: 'getAttribute';
|
|
714
|
+
declare const resolve$4: (context: LocatorContext, name: string, _options?: OperationTimeoutOptions) => string | null;
|
|
715
|
+
|
|
716
|
+
declare namespace getAttribute {
|
|
717
|
+
export {
|
|
718
|
+
resolve$4 as resolve,
|
|
719
|
+
type$5 as type,
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
type RemoteVideoElement$1 = EventTarget & {
|
|
724
|
+
currentTime: number;
|
|
725
|
+
volume: number;
|
|
726
|
+
muted: boolean;
|
|
727
|
+
playbackRate: number;
|
|
728
|
+
src: string;
|
|
729
|
+
loop: boolean;
|
|
730
|
+
autoplay: boolean;
|
|
731
|
+
preload: string;
|
|
732
|
+
poster: string;
|
|
733
|
+
disableRemotePlayback: boolean;
|
|
734
|
+
readonly duration: number;
|
|
735
|
+
readonly paused: boolean;
|
|
736
|
+
readonly ended: boolean;
|
|
737
|
+
readonly seeking: boolean;
|
|
738
|
+
readonly readyState: number;
|
|
739
|
+
readonly currentSrc: string;
|
|
740
|
+
readonly error: MediaError | null;
|
|
741
|
+
readonly buffered: TimeRanges;
|
|
742
|
+
readonly seekable: TimeRanges;
|
|
743
|
+
play(): Promise<void>;
|
|
744
|
+
pause(): void;
|
|
745
|
+
load(): void;
|
|
746
|
+
requestPictureInPicture(): Promise<void>;
|
|
747
|
+
exitPictureInPicture(): Promise<void>;
|
|
748
|
+
readonly HAVE_FUTURE_DATA: 3;
|
|
749
|
+
readonly HAVE_ENOUGH_DATA: 4;
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
declare const type$4: 'videoElement';
|
|
753
|
+
declare const resolve$3: (context: LocatorContext, _options?: OperationTimeoutOptions) => RemoteVideoElement$1;
|
|
754
|
+
|
|
755
|
+
declare namespace videoElement {
|
|
756
|
+
export {
|
|
757
|
+
resolve$3 as resolve,
|
|
758
|
+
type$4 as type,
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
declare const locatorModule: {
|
|
763
|
+
readonly type: "locator";
|
|
764
|
+
readonly selectorModules: readonly [typeof locatorSel, {
|
|
765
|
+
readonly type: 'frameLocator';
|
|
766
|
+
readonly resolve: (context: LocatorContext, selector: string) => HTMLIFrameElement[];
|
|
767
|
+
readonly resolvePeer: BarrierResolver;
|
|
768
|
+
readonly render: SelectorRenderer;
|
|
769
|
+
readonly nextLocatorType: 'frameLocator';
|
|
770
|
+
}, typeof getByRole, typeof getByText, typeof getByTestId, typeof first, typeof nth];
|
|
771
|
+
readonly operationModules: readonly [typeof click, typeof fill, typeof hover, typeof textContent, typeof isVisible, typeof count, typeof exists, typeof getAttribute, typeof videoElement];
|
|
772
|
+
};
|
|
773
|
+
type LocatorModule = typeof locatorModule;
|
|
774
|
+
interface Locator extends LocatorChain<LocatorModule, Locator> {
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
declare const type$3: 'frameLocator';
|
|
778
|
+
declare const resolve$2: (context: LocatorContext, selector: string) => HTMLIFrameElement[];
|
|
779
|
+
declare const resolvePeer$1: BarrierResolver;
|
|
780
|
+
declare const render$1: SelectorRenderer;
|
|
781
|
+
|
|
782
|
+
declare namespace frameLocatorSel {
|
|
783
|
+
export {
|
|
784
|
+
render$1 as render,
|
|
785
|
+
resolve$2 as resolve,
|
|
786
|
+
resolvePeer$1 as resolvePeer,
|
|
787
|
+
type$3 as type,
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
declare const type$2: 'owner';
|
|
792
|
+
declare const resolve$1: (_: LocatorContext) => never;
|
|
793
|
+
declare const resolvePeer: BarrierResolver;
|
|
794
|
+
declare const render: SelectorRenderer;
|
|
795
|
+
|
|
796
|
+
declare const owner_render: typeof render;
|
|
797
|
+
declare const owner_resolvePeer: typeof resolvePeer;
|
|
798
|
+
declare namespace owner {
|
|
799
|
+
export {
|
|
800
|
+
owner_render as render,
|
|
801
|
+
resolve$1 as resolve,
|
|
802
|
+
owner_resolvePeer as resolvePeer,
|
|
803
|
+
type$2 as type,
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
declare const type$1: 'addStyleTag';
|
|
808
|
+
type AddStyleTagOptions = OperationTimeoutOptions & {
|
|
809
|
+
content: string;
|
|
810
|
+
noSanitize?: boolean;
|
|
811
|
+
};
|
|
812
|
+
declare const resolve: (_context: LocatorContext, options: AddStyleTagOptions) => Promise<void>;
|
|
813
|
+
|
|
814
|
+
type addStyleTag_AddStyleTagOptions = AddStyleTagOptions;
|
|
815
|
+
declare const addStyleTag_resolve: typeof resolve;
|
|
816
|
+
declare namespace addStyleTag {
|
|
817
|
+
export { addStyleTag_resolve as resolve, type$1 as type };
|
|
818
|
+
export type { addStyleTag_AddStyleTagOptions as AddStyleTagOptions };
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
declare const frameLocatorModule: {
|
|
822
|
+
readonly type: "frameLocator";
|
|
823
|
+
readonly selectorModules: readonly [{
|
|
824
|
+
readonly type: 'locator';
|
|
825
|
+
readonly resolve: (context: LocatorContext, selector: string) => Element[];
|
|
826
|
+
readonly render: SelectorRenderer;
|
|
827
|
+
readonly nextLocatorType: 'locator';
|
|
828
|
+
}, typeof frameLocatorSel, typeof owner];
|
|
829
|
+
readonly operationModules: readonly [typeof addStyleTag];
|
|
830
|
+
};
|
|
831
|
+
type FrameLocatorModule = typeof frameLocatorModule;
|
|
832
|
+
interface FrameLocator extends LocatorChain<FrameLocatorModule, FrameLocator> {
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
type FrameId = `${number}-${number}`;
|
|
836
|
+
|
|
837
|
+
type LocatorContext = {
|
|
838
|
+
elements: Element[];
|
|
839
|
+
};
|
|
840
|
+
type OperationTimeoutOptions = {
|
|
841
|
+
timeout?: number;
|
|
842
|
+
};
|
|
843
|
+
type BarrierContext = {
|
|
844
|
+
parts: SelectorPart[];
|
|
845
|
+
selfIndex: number;
|
|
846
|
+
resolveLocal: (parts: SelectorPart[]) => Element[];
|
|
847
|
+
};
|
|
848
|
+
type BarrierResolver = (context: BarrierContext) => Promise<FrameId>;
|
|
849
|
+
type SelectorRenderResult = {
|
|
850
|
+
fragment: string;
|
|
851
|
+
separator?: 'descend' | 'frame-down' | 'frame-up';
|
|
852
|
+
};
|
|
853
|
+
type SelectorRenderer = (...args: any[]) => SelectorRenderResult;
|
|
854
|
+
type SelectorModule = {
|
|
855
|
+
type: string;
|
|
856
|
+
resolve: (context: LocatorContext, ...args: any[]) => Element[];
|
|
857
|
+
nextLocatorType?: 'locator' | 'frameLocator';
|
|
858
|
+
resolvePeer?: BarrierResolver;
|
|
859
|
+
render?: SelectorRenderer;
|
|
860
|
+
};
|
|
861
|
+
type OperationModule = {
|
|
862
|
+
type: string;
|
|
863
|
+
resolve: (context: LocatorContext, ...args: any[]) => unknown;
|
|
864
|
+
};
|
|
865
|
+
type LocatorKindModule = {
|
|
866
|
+
readonly type: string;
|
|
867
|
+
readonly selectorModules: readonly SelectorModule[];
|
|
868
|
+
readonly operationModules: readonly OperationModule[];
|
|
869
|
+
};
|
|
870
|
+
type LocatorModules = [LocatorModule, FrameLocatorModule];
|
|
871
|
+
type LocatorModuleUnion = LocatorModules[number];
|
|
872
|
+
type SelectorPart<L extends LocatorModuleUnion = LocatorModuleUnion> = L extends LocatorModuleUnion ? L['selectorModules'][number] extends infer M extends SelectorModule ? {
|
|
873
|
+
locatorType: L['type'];
|
|
874
|
+
type: ExtractType<M>;
|
|
875
|
+
args: ExtractResolverArgs<M>;
|
|
876
|
+
} : never : never;
|
|
877
|
+
type NextLocator<M> = M extends {
|
|
878
|
+
nextLocatorType: 'frameLocator';
|
|
879
|
+
} ? FrameLocator : M extends {
|
|
880
|
+
nextLocatorType: 'locator';
|
|
881
|
+
} ? Locator : never;
|
|
882
|
+
type LocatorChain<L extends LocatorKindModule, Self> = {
|
|
883
|
+
[M in L['selectorModules'][number] as ExtractType<M>]: [
|
|
884
|
+
NextLocator<M>
|
|
885
|
+
] extends [never] ? (...args: ExtractResolverArgs<M>) => Self : (...args: ExtractResolverArgs<M>) => NextLocator<M>;
|
|
886
|
+
} & {
|
|
887
|
+
[M in L['operationModules'][number] as ExtractType<M>]: (...args: ExtractOperationArgs<M>) => Promise<Awaited<ExtractResolverReturn<M>>>;
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
declare const ATTACH_FRAME_EVENT_KEY = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY";
|
|
891
|
+
type GotoOptions = {
|
|
892
|
+
waitUntil?: 'documentstart' | 'load';
|
|
893
|
+
domains?: string[];
|
|
894
|
+
};
|
|
895
|
+
type Frame = FrameLocator & {
|
|
896
|
+
goto(url: string, options?: GotoOptions): Promise<void>;
|
|
897
|
+
url(): string;
|
|
898
|
+
};
|
|
899
|
+
type AttachFrameOptions = {
|
|
900
|
+
iframe: HTMLIFrameElement;
|
|
901
|
+
domains?: string[];
|
|
902
|
+
};
|
|
903
|
+
declare const attachFrame: ({ iframe, domains }: AttachFrameOptions) => Promise<Frame>;
|
|
904
|
+
|
|
905
|
+
declare const type: 'videoElement';
|
|
906
|
+
type TimeRangesTuple = [number, number][];
|
|
907
|
+
type VideoElementState = {
|
|
908
|
+
currentTime: number;
|
|
909
|
+
volume: number;
|
|
910
|
+
muted: boolean;
|
|
911
|
+
playbackRate: number;
|
|
912
|
+
src: string;
|
|
913
|
+
loop: boolean;
|
|
914
|
+
autoplay: boolean;
|
|
915
|
+
preload: string;
|
|
916
|
+
poster: string;
|
|
917
|
+
disableRemotePlayback: boolean;
|
|
918
|
+
duration: number;
|
|
919
|
+
paused: boolean;
|
|
920
|
+
ended: boolean;
|
|
921
|
+
seeking: boolean;
|
|
922
|
+
readyState: number;
|
|
923
|
+
currentSrc: string;
|
|
924
|
+
buffered: TimeRangesTuple;
|
|
925
|
+
seekable: TimeRangesTuple;
|
|
926
|
+
error: {
|
|
927
|
+
code: number;
|
|
928
|
+
message: string;
|
|
929
|
+
} | null;
|
|
930
|
+
};
|
|
931
|
+
type RemoteVideoElement = EventTarget & {
|
|
932
|
+
currentTime: number;
|
|
933
|
+
volume: number;
|
|
934
|
+
muted: boolean;
|
|
935
|
+
playbackRate: number;
|
|
936
|
+
src: string;
|
|
937
|
+
loop: boolean;
|
|
938
|
+
autoplay: boolean;
|
|
939
|
+
preload: string;
|
|
940
|
+
poster: string;
|
|
941
|
+
disableRemotePlayback: boolean;
|
|
942
|
+
readonly duration: number;
|
|
943
|
+
readonly paused: boolean;
|
|
944
|
+
readonly ended: boolean;
|
|
945
|
+
readonly seeking: boolean;
|
|
946
|
+
readonly readyState: number;
|
|
947
|
+
readonly currentSrc: string;
|
|
948
|
+
readonly error: MediaError | null;
|
|
949
|
+
readonly buffered: TimeRanges;
|
|
950
|
+
readonly seekable: TimeRanges;
|
|
951
|
+
play(): Promise<void>;
|
|
952
|
+
pause(): void;
|
|
953
|
+
load(): void;
|
|
954
|
+
requestPictureInPicture(): Promise<void>;
|
|
955
|
+
exitPictureInPicture(): Promise<void>;
|
|
956
|
+
readonly HAVE_FUTURE_DATA: 3;
|
|
957
|
+
readonly HAVE_ENOUGH_DATA: 4;
|
|
958
|
+
};
|
|
959
|
+
type BoxedVideoElement = BoxBase<typeof type> & {
|
|
960
|
+
initialState: VideoElementState;
|
|
961
|
+
controller: Capable;
|
|
962
|
+
} & {
|
|
963
|
+
[UnderlyingType]: RemoteVideoElement;
|
|
964
|
+
};
|
|
965
|
+
declare const createVideoElementHandle: (element: HTMLVideoElement) => RemoteVideoElement;
|
|
966
|
+
declare const isType: (value: unknown) => value is RemoteVideoElement;
|
|
967
|
+
declare const box: <T extends RemoteVideoElement, T2 extends RevivableContext>(value: T, context: T2) => BoxedVideoElement;
|
|
968
|
+
declare const revive: <T extends BoxedVideoElement, T2 extends RevivableContext>(value: T, context: T2) => T[UnderlyingType];
|
|
969
|
+
|
|
970
|
+
declare const handleRevivableModules: any;
|
|
971
|
+
|
|
972
|
+
export { ATTACH_FRAME_EVENT_KEY, attachFrame, box, createVideoElementHandle, dgram, handleRevivableModules, isType, net, revive, serverProxyFetch, type };
|
|
973
|
+
export type { AttachFrameOptions, BoxedVideoElement, Frame, GotoOptions, RemoteVideoElement, VideoElementState };
|