@adviser/cement 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- package/{sys_abstraction-CmSCeK7b.d.cts → base-sys-abstraction-BzVP_lX0.d.cts} +77 -1
- package/{sys_abstraction-CmSCeK7b.d.ts → base-sys-abstraction-BzVP_lX0.d.ts} +77 -1
- package/chunk-AO7BGISE.js +353 -0
- package/chunk-AO7BGISE.js.map +1 -0
- package/{chunk-J2IM7FHM.js → chunk-I4NUGWZ6.js} +6 -1
- package/{chunk-XJF7FQUN.js → chunk-LJRKN3XI.js} +3 -3
- package/{chunk-XJF7FQUN.js.map → chunk-LJRKN3XI.js.map} +1 -1
- package/{chunk-O4F5AURC.js → chunk-P4FB5FHU.js} +185 -179
- package/chunk-P4FB5FHU.js.map +1 -0
- package/index-_GuS2IT4.d.cts +93 -0
- package/index-_GuS2IT4.d.ts +93 -0
- package/index.cjs +362 -102
- package/index.cjs.map +1 -1
- package/index.d.cts +8 -18
- package/index.d.ts +8 -18
- package/index.js +33 -98
- package/index.js.map +1 -1
- package/node/index.cjs +5 -5
- package/node/index.cjs.map +1 -1
- package/node/index.d.cts +1 -2
- package/node/index.d.ts +1 -2
- package/node/index.js +5 -5
- package/node/index.js.map +1 -1
- package/package.json +1 -1
- package/utils/index.cjs +98 -2
- package/utils/index.cjs.map +1 -1
- package/utils/index.d.cts +2 -36
- package/utils/index.d.ts +2 -36
- package/utils/index.js +21 -221
- package/utils/index.js.map +1 -1
- package/web/index.cjs +3 -3
- package/web/index.cjs.map +1 -1
- package/web/index.d.cts +1 -2
- package/web/index.d.ts +1 -2
- package/web/index.js +3 -3
- package/base_sys_abstraction-CJqRmTui.d.ts +0 -21
- package/base_sys_abstraction-nsNTl07w.d.cts +0 -21
- package/chunk-O4F5AURC.js.map +0 -1
- /package/{chunk-J2IM7FHM.js.map → chunk-I4NUGWZ6.js.map} +0 -0
@@ -2,9 +2,9 @@ import {
|
|
2
2
|
__privateAdd,
|
3
3
|
__privateGet,
|
4
4
|
__privateSet
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-I4NUGWZ6.js";
|
6
6
|
|
7
|
-
// src/
|
7
|
+
// src/sys-abstraction.ts
|
8
8
|
var TimeMode = /* @__PURE__ */ ((TimeMode2) => {
|
9
9
|
TimeMode2["REAL"] = "real";
|
10
10
|
TimeMode2["CONST"] = "const";
|
@@ -51,6 +51,181 @@ var TimeUnits = /* @__PURE__ */ ((TimeUnits2) => {
|
|
51
51
|
return TimeUnits2;
|
52
52
|
})(TimeUnits || {});
|
53
53
|
|
54
|
+
// src/base-sys-abstraction.ts
|
55
|
+
var SysTime = class extends Time {
|
56
|
+
Now() {
|
57
|
+
return /* @__PURE__ */ new Date();
|
58
|
+
}
|
59
|
+
Sleep(duration) {
|
60
|
+
return new Promise((resolve) => {
|
61
|
+
setTimeout(() => {
|
62
|
+
resolve();
|
63
|
+
}, duration);
|
64
|
+
});
|
65
|
+
}
|
66
|
+
};
|
67
|
+
var ConstTime = class extends Time {
|
68
|
+
Now() {
|
69
|
+
return new Date(2021, 1, 1, 0, 0, 0, 0);
|
70
|
+
}
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
72
|
+
Sleep(duration) {
|
73
|
+
return Promise.resolve();
|
74
|
+
}
|
75
|
+
};
|
76
|
+
var StepTime = class extends Time {
|
77
|
+
constructor() {
|
78
|
+
super();
|
79
|
+
this._step = new ConstTime().Now();
|
80
|
+
}
|
81
|
+
Now() {
|
82
|
+
if (this._step.getTime() === 0) {
|
83
|
+
this._step = new ConstTime().Now();
|
84
|
+
return this._step;
|
85
|
+
}
|
86
|
+
this._step = new Date(this._step.getTime() + 1e3);
|
87
|
+
return this._step;
|
88
|
+
}
|
89
|
+
Sleep(duration) {
|
90
|
+
this._step = new Date(this._step.getTime() + duration);
|
91
|
+
return Promise.resolve();
|
92
|
+
}
|
93
|
+
};
|
94
|
+
function TimeFactory(timeMode) {
|
95
|
+
switch (timeMode) {
|
96
|
+
case "real" /* REAL */:
|
97
|
+
return new SysTime();
|
98
|
+
case "const" /* CONST */:
|
99
|
+
return new ConstTime();
|
100
|
+
case "step" /* STEP */:
|
101
|
+
return new StepTime();
|
102
|
+
}
|
103
|
+
return new SysTime();
|
104
|
+
}
|
105
|
+
var RandomService = class {
|
106
|
+
constructor(mode) {
|
107
|
+
this._step = 0;
|
108
|
+
this._mode = mode;
|
109
|
+
}
|
110
|
+
Random0ToValue(value) {
|
111
|
+
switch (this._mode) {
|
112
|
+
case "const" /* CONST */:
|
113
|
+
return 0.5 * value;
|
114
|
+
case "step" /* STEP */:
|
115
|
+
this._step += 1e-4;
|
116
|
+
return this._step * value;
|
117
|
+
case "random" /* RANDOM */:
|
118
|
+
return Math.random() * value;
|
119
|
+
default:
|
120
|
+
throw new Error("Unknown RandomMode");
|
121
|
+
}
|
122
|
+
}
|
123
|
+
};
|
124
|
+
var IdService = class {
|
125
|
+
constructor(mode) {
|
126
|
+
this._step = 0;
|
127
|
+
if (!mode) {
|
128
|
+
mode = "uuid" /* UUID */;
|
129
|
+
}
|
130
|
+
this._mode = mode;
|
131
|
+
}
|
132
|
+
NextId() {
|
133
|
+
switch (this._mode) {
|
134
|
+
case "uuid" /* UUID */:
|
135
|
+
return crypto.randomUUID();
|
136
|
+
case "const" /* CONST */:
|
137
|
+
return "VeryUniqueID";
|
138
|
+
case "step" /* STEP */:
|
139
|
+
return `STEPId-${this._step++}`;
|
140
|
+
default:
|
141
|
+
throw new Error("Unknown IDMode");
|
142
|
+
}
|
143
|
+
}
|
144
|
+
};
|
145
|
+
var decoder = new TextDecoder();
|
146
|
+
var BaseSysAbstraction = class {
|
147
|
+
constructor(params) {
|
148
|
+
this._time = new SysTime();
|
149
|
+
this._stdout = new WritableStream({
|
150
|
+
write(chunk) {
|
151
|
+
return new Promise((resolve) => {
|
152
|
+
const decoded = decoder.decode(chunk);
|
153
|
+
console.log(decoded.trimEnd());
|
154
|
+
resolve();
|
155
|
+
});
|
156
|
+
}
|
157
|
+
});
|
158
|
+
this._stderr = new WritableStream({
|
159
|
+
write(chunk) {
|
160
|
+
return new Promise((resolve) => {
|
161
|
+
const decoded = decoder.decode(chunk);
|
162
|
+
console.error(decoded.trimEnd());
|
163
|
+
resolve();
|
164
|
+
});
|
165
|
+
}
|
166
|
+
});
|
167
|
+
this._idService = new IdService();
|
168
|
+
this._randomService = new RandomService("random" /* RANDOM */);
|
169
|
+
this._fileSystem = params.FileSystem;
|
170
|
+
this._systemService = params.SystemService;
|
171
|
+
}
|
172
|
+
};
|
173
|
+
var WrapperSysAbstraction = class {
|
174
|
+
constructor(base, params) {
|
175
|
+
this._time = base._time;
|
176
|
+
this._stdout = base._stdout;
|
177
|
+
this._stderr = base._stderr;
|
178
|
+
this._idService = base._idService;
|
179
|
+
this._randomService = base._randomService;
|
180
|
+
this._fileSystem = base._fileSystem;
|
181
|
+
this._systemService = base._systemService;
|
182
|
+
if (params) {
|
183
|
+
if (params.TimeMode) {
|
184
|
+
this._time = TimeFactory(params.TimeMode);
|
185
|
+
}
|
186
|
+
if (params.Stdout) {
|
187
|
+
this._stdout = params.Stdout;
|
188
|
+
}
|
189
|
+
if (params.Stderr) {
|
190
|
+
this._stderr = params.Stderr;
|
191
|
+
}
|
192
|
+
if (params.IdMode) {
|
193
|
+
this._idService = new IdService(params.IdMode);
|
194
|
+
}
|
195
|
+
if (params.RandomMode) {
|
196
|
+
this._randomService = new RandomService(params.RandomMode);
|
197
|
+
}
|
198
|
+
if (params.FileSystem) {
|
199
|
+
this._fileSystem = params.FileSystem;
|
200
|
+
}
|
201
|
+
if (params.SystemService) {
|
202
|
+
this._systemService = params.SystemService;
|
203
|
+
}
|
204
|
+
}
|
205
|
+
}
|
206
|
+
Time() {
|
207
|
+
return this._time;
|
208
|
+
}
|
209
|
+
NextId() {
|
210
|
+
return this._idService.NextId();
|
211
|
+
}
|
212
|
+
Random0ToValue(value) {
|
213
|
+
return this._randomService.Random0ToValue(value);
|
214
|
+
}
|
215
|
+
Stdout() {
|
216
|
+
return this._stdout;
|
217
|
+
}
|
218
|
+
Stderr() {
|
219
|
+
return this._stderr;
|
220
|
+
}
|
221
|
+
System() {
|
222
|
+
return this._systemService;
|
223
|
+
}
|
224
|
+
FileSystem() {
|
225
|
+
return this._fileSystem;
|
226
|
+
}
|
227
|
+
};
|
228
|
+
|
54
229
|
// src/future.ts
|
55
230
|
var _promise, _resolveFn, _rejectFn;
|
56
231
|
var Future = class {
|
@@ -220,7 +395,7 @@ var KeyedResolvSeq = class extends Keyed {
|
|
220
395
|
}
|
221
396
|
};
|
222
397
|
|
223
|
-
// src/
|
398
|
+
// src/sys-env.ts
|
224
399
|
var _node;
|
225
400
|
var NodeEnvActions = class {
|
226
401
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor, @typescript-eslint/no-unused-vars
|
@@ -390,181 +565,6 @@ var EnvImpl = class {
|
|
390
565
|
}
|
391
566
|
};
|
392
567
|
|
393
|
-
// src/base_sys_abstraction.ts
|
394
|
-
var SysTime = class extends Time {
|
395
|
-
Now() {
|
396
|
-
return /* @__PURE__ */ new Date();
|
397
|
-
}
|
398
|
-
Sleep(duration) {
|
399
|
-
return new Promise((resolve) => {
|
400
|
-
setTimeout(() => {
|
401
|
-
resolve();
|
402
|
-
}, duration);
|
403
|
-
});
|
404
|
-
}
|
405
|
-
};
|
406
|
-
var ConstTime = class extends Time {
|
407
|
-
Now() {
|
408
|
-
return new Date(2021, 1, 1, 0, 0, 0, 0);
|
409
|
-
}
|
410
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
411
|
-
Sleep(duration) {
|
412
|
-
return Promise.resolve();
|
413
|
-
}
|
414
|
-
};
|
415
|
-
var StepTime = class extends Time {
|
416
|
-
constructor() {
|
417
|
-
super();
|
418
|
-
this._step = new ConstTime().Now();
|
419
|
-
}
|
420
|
-
Now() {
|
421
|
-
if (this._step.getTime() === 0) {
|
422
|
-
this._step = new ConstTime().Now();
|
423
|
-
return this._step;
|
424
|
-
}
|
425
|
-
this._step = new Date(this._step.getTime() + 1e3);
|
426
|
-
return this._step;
|
427
|
-
}
|
428
|
-
Sleep(duration) {
|
429
|
-
this._step = new Date(this._step.getTime() + duration);
|
430
|
-
return Promise.resolve();
|
431
|
-
}
|
432
|
-
};
|
433
|
-
function TimeFactory(timeMode) {
|
434
|
-
switch (timeMode) {
|
435
|
-
case "real" /* REAL */:
|
436
|
-
return new SysTime();
|
437
|
-
case "const" /* CONST */:
|
438
|
-
return new ConstTime();
|
439
|
-
case "step" /* STEP */:
|
440
|
-
return new StepTime();
|
441
|
-
}
|
442
|
-
return new SysTime();
|
443
|
-
}
|
444
|
-
var RandomService = class {
|
445
|
-
constructor(mode) {
|
446
|
-
this._step = 0;
|
447
|
-
this._mode = mode;
|
448
|
-
}
|
449
|
-
Random0ToValue(value) {
|
450
|
-
switch (this._mode) {
|
451
|
-
case "const" /* CONST */:
|
452
|
-
return 0.5 * value;
|
453
|
-
case "step" /* STEP */:
|
454
|
-
this._step += 1e-4;
|
455
|
-
return this._step * value;
|
456
|
-
case "random" /* RANDOM */:
|
457
|
-
return Math.random() * value;
|
458
|
-
default:
|
459
|
-
throw new Error("Unknown RandomMode");
|
460
|
-
}
|
461
|
-
}
|
462
|
-
};
|
463
|
-
var IdService = class {
|
464
|
-
constructor(mode) {
|
465
|
-
this._step = 0;
|
466
|
-
if (!mode) {
|
467
|
-
mode = "uuid" /* UUID */;
|
468
|
-
}
|
469
|
-
this._mode = mode;
|
470
|
-
}
|
471
|
-
NextId() {
|
472
|
-
switch (this._mode) {
|
473
|
-
case "uuid" /* UUID */:
|
474
|
-
return crypto.randomUUID();
|
475
|
-
case "const" /* CONST */:
|
476
|
-
return "VeryUniqueID";
|
477
|
-
case "step" /* STEP */:
|
478
|
-
return `STEPId-${this._step++}`;
|
479
|
-
default:
|
480
|
-
throw new Error("Unknown IDMode");
|
481
|
-
}
|
482
|
-
}
|
483
|
-
};
|
484
|
-
var decoder = new TextDecoder();
|
485
|
-
var BaseSysAbstraction = class {
|
486
|
-
constructor(params) {
|
487
|
-
this._time = new SysTime();
|
488
|
-
this._stdout = new WritableStream({
|
489
|
-
write(chunk) {
|
490
|
-
return new Promise((resolve) => {
|
491
|
-
const decoded = decoder.decode(chunk);
|
492
|
-
console.log(decoded.trimEnd());
|
493
|
-
resolve();
|
494
|
-
});
|
495
|
-
}
|
496
|
-
});
|
497
|
-
this._stderr = new WritableStream({
|
498
|
-
write(chunk) {
|
499
|
-
return new Promise((resolve) => {
|
500
|
-
const decoded = decoder.decode(chunk);
|
501
|
-
console.error(decoded.trimEnd());
|
502
|
-
resolve();
|
503
|
-
});
|
504
|
-
}
|
505
|
-
});
|
506
|
-
this._idService = new IdService();
|
507
|
-
this._randomService = new RandomService("random" /* RANDOM */);
|
508
|
-
this._fileSystem = params.FileSystem;
|
509
|
-
this._systemService = params.SystemService;
|
510
|
-
}
|
511
|
-
};
|
512
|
-
var WrapperSysAbstraction = class {
|
513
|
-
constructor(base, params) {
|
514
|
-
this._time = base._time;
|
515
|
-
this._stdout = base._stdout;
|
516
|
-
this._stderr = base._stderr;
|
517
|
-
this._idService = base._idService;
|
518
|
-
this._randomService = base._randomService;
|
519
|
-
this._fileSystem = base._fileSystem;
|
520
|
-
this._systemService = base._systemService;
|
521
|
-
if (params) {
|
522
|
-
if (params.TimeMode) {
|
523
|
-
this._time = TimeFactory(params.TimeMode);
|
524
|
-
}
|
525
|
-
if (params.Stdout) {
|
526
|
-
this._stdout = params.Stdout;
|
527
|
-
}
|
528
|
-
if (params.Stderr) {
|
529
|
-
this._stderr = params.Stderr;
|
530
|
-
}
|
531
|
-
if (params.IdMode) {
|
532
|
-
this._idService = new IdService(params.IdMode);
|
533
|
-
}
|
534
|
-
if (params.RandomMode) {
|
535
|
-
this._randomService = new RandomService(params.RandomMode);
|
536
|
-
}
|
537
|
-
if (params.FileSystem) {
|
538
|
-
this._fileSystem = params.FileSystem;
|
539
|
-
}
|
540
|
-
if (params.SystemService) {
|
541
|
-
this._systemService = params.SystemService;
|
542
|
-
}
|
543
|
-
}
|
544
|
-
}
|
545
|
-
Time() {
|
546
|
-
return this._time;
|
547
|
-
}
|
548
|
-
NextId() {
|
549
|
-
return this._idService.NextId();
|
550
|
-
}
|
551
|
-
Random0ToValue(value) {
|
552
|
-
return this._randomService.Random0ToValue(value);
|
553
|
-
}
|
554
|
-
Stdout() {
|
555
|
-
return this._stdout;
|
556
|
-
}
|
557
|
-
Stderr() {
|
558
|
-
return this._stderr;
|
559
|
-
}
|
560
|
-
System() {
|
561
|
-
return this._systemService;
|
562
|
-
}
|
563
|
-
FileSystem() {
|
564
|
-
return this._fileSystem;
|
565
|
-
}
|
566
|
-
};
|
567
|
-
|
568
568
|
export {
|
569
569
|
TimeMode,
|
570
570
|
RandomMode,
|
@@ -572,6 +572,12 @@ export {
|
|
572
572
|
String2TimeMode,
|
573
573
|
Time,
|
574
574
|
TimeUnits,
|
575
|
+
SysTime,
|
576
|
+
ConstTime,
|
577
|
+
StepTime,
|
578
|
+
TimeFactory,
|
579
|
+
RandomService,
|
580
|
+
IdService,
|
575
581
|
BaseSysAbstraction,
|
576
582
|
WrapperSysAbstraction,
|
577
583
|
Future,
|
@@ -584,4 +590,4 @@ export {
|
|
584
590
|
envFactory,
|
585
591
|
EnvImpl
|
586
592
|
};
|
587
|
-
//# sourceMappingURL=chunk-
|
593
|
+
//# sourceMappingURL=chunk-P4FB5FHU.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/sys-abstraction.ts","../../src/time.ts","../../src/base-sys-abstraction.ts","../../src/future.ts","../../src/resolve-once.ts","../../src/sys-env.ts"],"sourcesContent":["import { FileService } from \"./file-service\";\nimport { Env } from \"./sys-env\";\nimport { Time } from \"./time\";\n\nexport enum TimeMode {\n REAL = \"real\",\n CONST = \"const\",\n STEP = \"step\",\n}\n\nexport enum RandomMode {\n CONST = \"const\",\n STEP = \"step\",\n RANDOM = \"random\",\n}\n\nexport enum IDMode {\n UUID = \"uuid\",\n CONST = \"const\",\n STEP = \"step\",\n}\n\nexport function String2TimeMode(s?: string): TimeMode {\n switch (s?.toLowerCase()) {\n case \"real\":\n return TimeMode.REAL;\n case \"const\":\n return TimeMode.CONST;\n case \"step\":\n return TimeMode.STEP;\n default:\n return TimeMode.REAL;\n }\n}\n\nexport type VoidFunc = () => void | Promise<void>;\n\nexport interface SystemService {\n Env(): Env;\n Args(): string[];\n OnExit(hdl: VoidFunc): VoidFunc;\n Exit(code: number): void;\n}\n\nexport interface SysAbstraction {\n Time(): Time;\n Stdout(): WritableStream<Uint8Array>;\n Stderr(): WritableStream<Uint8Array>;\n NextId(): string;\n Random0ToValue(value: number): number;\n System(): SystemService;\n FileSystem(): FileService;\n}\n","export abstract class Time {\n abstract Now(): Date;\n abstract Sleep(duration: Duration): Promise<void>;\n TimeSince(start: Date): Duration {\n const now = this.Now();\n return now.getTime() - start.getTime();\n }\n}\n\nexport type Duration = number;\n\nexport enum TimeUnits {\n Microsecond = 1,\n // eslint-disable-next-line @typescript-eslint/prefer-literal-enum-member\n Second = 1000 * Microsecond,\n // eslint-disable-next-line @typescript-eslint/prefer-literal-enum-member\n Minute = 60 * Second,\n // eslint-disable-next-line @typescript-eslint/prefer-literal-enum-member\n Hour = 60 * Minute,\n}\n","import { FileService } from \"./file-service\";\nimport { TimeMode, RandomMode, IDMode, SystemService, VoidFunc, SysAbstraction } from \"./sys-abstraction\";\nimport { Time } from \"./time\";\n\nexport class SysTime extends Time {\n Now(): Date {\n return new Date();\n }\n Sleep(duration: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n }\n}\n\nexport class ConstTime extends Time {\n Now(): Date {\n return new Date(2021, 1, 1, 0, 0, 0, 0);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Sleep(duration: number): Promise<void> {\n return Promise.resolve();\n }\n}\n\nexport class StepTime extends Time {\n _step: Date;\n constructor() {\n super();\n this._step = new ConstTime().Now();\n }\n Now() {\n if (this._step.getTime() === 0) {\n this._step = new ConstTime().Now();\n return this._step;\n }\n this._step = new Date(this._step.getTime() + 1000);\n return this._step;\n }\n Sleep(duration: number): Promise<void> {\n this._step = new Date(this._step.getTime() + duration);\n return Promise.resolve();\n }\n}\n\nexport function TimeFactory(timeMode: TimeMode): Time {\n switch (timeMode) {\n case TimeMode.REAL:\n return new SysTime();\n case TimeMode.CONST:\n return new ConstTime();\n case TimeMode.STEP:\n return new StepTime();\n }\n return new SysTime();\n}\n\nexport class RandomService {\n readonly _mode: RandomMode;\n _step = 0;\n constructor(mode: RandomMode) {\n this._mode = mode;\n }\n Random0ToValue(value: number): number {\n switch (this._mode) {\n case RandomMode.CONST:\n return 0.5 * value;\n case RandomMode.STEP:\n this._step += 0.0001;\n return this._step * value;\n case RandomMode.RANDOM:\n return Math.random() * value;\n default:\n throw new Error(\"Unknown RandomMode\");\n }\n }\n}\n\nexport class IdService {\n readonly _mode: IDMode;\n _step = 0;\n constructor(mode?: IDMode) {\n if (!mode) {\n mode = IDMode.UUID;\n }\n this._mode = mode;\n }\n NextId(): string {\n switch (this._mode) {\n case IDMode.UUID:\n return crypto.randomUUID();\n case IDMode.CONST:\n return \"VeryUniqueID\";\n case IDMode.STEP:\n return `STEPId-${this._step++}`;\n default:\n throw new Error(\"Unknown IDMode\");\n }\n }\n}\n\nexport interface BaseSysAbstractionParams {\n readonly FileSystem: FileService;\n readonly SystemService: SystemService;\n}\n\nexport interface ExitHandler {\n readonly hdl: VoidFunc;\n readonly id: string;\n}\n\nexport interface ExitService {\n injectExitHandlers(hdls: ExitHandler[]): void;\n exit(code: number): void;\n}\n\nconst decoder = new TextDecoder();\nexport class BaseSysAbstraction {\n readonly _time = new SysTime();\n readonly _stdout = new WritableStream({\n write(chunk) {\n return new Promise((resolve) => {\n const decoded = decoder.decode(chunk);\n // eslint-disable-next-line no-console\n console.log(decoded.trimEnd());\n resolve();\n });\n },\n });\n readonly _stderr = new WritableStream({\n write(chunk) {\n return new Promise((resolve) => {\n const decoded = decoder.decode(chunk);\n // eslint-disable-next-line no-console\n console.error(decoded.trimEnd());\n resolve();\n });\n },\n });\n\n readonly _idService = new IdService();\n readonly _randomService = new RandomService(RandomMode.RANDOM);\n readonly _fileSystem: FileService;\n readonly _systemService: SystemService;\n\n constructor(params: BaseSysAbstractionParams) {\n this._fileSystem = params.FileSystem;\n this._systemService = params.SystemService;\n }\n}\n\nexport interface WrapperSysAbstractionParams {\n readonly TimeMode?: TimeMode;\n readonly IdMode?: IDMode;\n readonly Stdout?: WritableStream<Uint8Array>;\n readonly Stderr?: WritableStream<Uint8Array>;\n readonly RandomMode?: RandomMode;\n readonly FileSystem?: FileService;\n readonly SystemService?: SystemService;\n}\n\nexport class WrapperSysAbstraction implements SysAbstraction {\n readonly _time: Time;\n readonly _stdout: WritableStream<Uint8Array>;\n readonly _stderr: WritableStream<Uint8Array>;\n readonly _idService: IdService;\n readonly _randomService: RandomService;\n readonly _fileSystem: FileService;\n readonly _systemService: SystemService;\n constructor(base: BaseSysAbstraction, params?: WrapperSysAbstractionParams) {\n this._time = base._time;\n this._stdout = base._stdout;\n this._stderr = base._stderr;\n this._idService = base._idService;\n this._randomService = base._randomService;\n this._fileSystem = base._fileSystem;\n this._systemService = base._systemService;\n if (params) {\n if (params.TimeMode) {\n this._time = TimeFactory(params.TimeMode);\n }\n if (params.Stdout) {\n this._stdout = params.Stdout;\n }\n if (params.Stderr) {\n this._stderr = params.Stderr;\n }\n if (params.IdMode) {\n this._idService = new IdService(params.IdMode);\n }\n if (params.RandomMode) {\n this._randomService = new RandomService(params.RandomMode);\n }\n if (params.FileSystem) {\n this._fileSystem = params.FileSystem;\n }\n if (params.SystemService) {\n this._systemService = params.SystemService;\n }\n }\n }\n Time(): Time {\n return this._time;\n }\n NextId(): string {\n return this._idService.NextId();\n }\n Random0ToValue(value: number): number {\n return this._randomService.Random0ToValue(value);\n }\n Stdout(): WritableStream {\n return this._stdout;\n }\n Stderr(): WritableStream {\n return this._stderr;\n }\n\n System(): SystemService {\n return this._systemService;\n }\n FileSystem(): FileService {\n return this._fileSystem;\n }\n}\n// export const BaseSysAbstraction = new BaseSysAbstractionImpl()\n","export class Future<T> {\n readonly #promise: Promise<T>;\n #resolveFn: (value: T) => void = () => {\n throw new Error(\"This Promise is not working as expected.\");\n };\n #rejectFn: (reason: unknown) => void = () => {\n throw new Error(\"This Promise is not working as expected.\");\n };\n\n constructor() {\n this.#promise = new Promise<T>((resolve, reject) => {\n this.#resolveFn = resolve;\n this.#rejectFn = reject;\n });\n }\n\n async asPromise(): Promise<T> {\n return this.#promise;\n }\n\n resolve(value: T) {\n this.#resolveFn(value);\n }\n reject(reason: unknown) {\n this.#rejectFn(reason);\n }\n}\n","import { Future } from \"./future\";\n\ninterface ResolveSeqItem<T, C> {\n readonly future: Future<T>;\n readonly fn: (c: C) => Promise<T>;\n readonly id?: number;\n}\n\nexport class ResolveSeq<T, C = void> {\n readonly ctx: C;\n constructor(ctx?: C) {\n this.ctx = ctx as C;\n }\n reset() {\n /* noop */\n }\n async _step(item?: ResolveSeqItem<T, C> | undefined) {\n if (!item) {\n // done\n return;\n }\n item\n .fn(this.ctx)\n .then((value) => item.future.resolve(value))\n .catch((e) => item.future.reject(e as Error))\n .finally(() => {\n this._seqFutures.shift();\n this._step(this._seqFutures[0]);\n });\n }\n readonly _seqFutures: ResolveSeqItem<T, C>[] = [];\n async add(fn: (c: C) => Promise<T>, id?: number): Promise<T> {\n const future = new Future<T>();\n this._seqFutures.push({ future, fn, id });\n if (this._seqFutures.length === 1) {\n this._step(this._seqFutures[0]);\n }\n return future.asPromise();\n }\n}\n\nexport class ResolveOnce<T, CTX = void> {\n _onceDone = false;\n readonly _onceFutures: Future<T>[] = [];\n _onceOk = false;\n _onceValue?: T;\n _onceError?: Error;\n _isPromise = false;\n\n readonly ctx: CTX;\n\n constructor(ctx?: CTX) {\n this.ctx = ctx as CTX;\n }\n\n get ready() {\n return this._onceDone;\n }\n\n reset() {\n this._onceDone = false;\n this._onceOk = false;\n this._onceValue = undefined;\n this._onceError = undefined;\n this._onceFutures.length = 0;\n }\n\n // T extends Option<infer U> ? U : T\n once<R>(fn: (c: CTX) => R): R {\n if (this._onceDone) {\n if (this._onceError) {\n if (this._isPromise) {\n return Promise.reject(this._onceError) as unknown as R;\n } else {\n throw this._onceError;\n }\n }\n if (this._onceOk) {\n if (this._isPromise) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return Promise.resolve(this._onceValue!) as unknown as R;\n } else {\n return this._onceValue as unknown as R;\n }\n }\n throw new Error(\"ResolveOnce.once impossible\");\n }\n const future = new Future<T>();\n this._onceFutures.push(future);\n if (this._onceFutures.length === 1) {\n const okFn = (value: T) => {\n this._onceValue = value;\n this._onceOk = true;\n this._onceDone = true;\n if (this._isPromise) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this._onceFutures.forEach((f) => f.resolve(this._onceValue!));\n }\n this._onceFutures.length = 0;\n };\n const catchFn = (e: Error) => {\n this._onceError = e as Error;\n this._onceOk = false;\n this._onceValue = undefined;\n this._onceDone = true;\n if (this._isPromise) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this._onceFutures.forEach((f) => f.reject(this._onceError!));\n }\n this._onceFutures.length = 0;\n };\n try {\n const ret = fn(this.ctx);\n if (typeof (ret as Promise<T>).then === \"function\") {\n this._isPromise = true;\n (ret as Promise<T>).then(okFn).catch(catchFn);\n } else {\n okFn(ret as unknown as T);\n }\n } catch (e) {\n catchFn(e as Error);\n }\n }\n if (this._isPromise) {\n return future.asPromise() as unknown as R;\n } else {\n // abit funky but i don't want to impl the return just once\n return this.once(fn);\n }\n }\n}\n\nexport class Keyed<T extends { reset: () => void }, K = string> {\n private readonly _map = new Map<K, T>();\n\n readonly factory: (key: K) => T;\n constructor(factory: (key: K) => T) {\n this.factory = factory;\n }\n\n async asyncGet(key: () => Promise<K>): Promise<T> {\n return this.get(await key());\n }\n\n get(key: K | (() => K)): T {\n if (typeof key === \"function\") {\n key = (key as () => K)();\n }\n let keyed = this._map.get(key);\n if (!keyed) {\n keyed = this.factory(key);\n this._map.set(key, keyed);\n }\n return keyed;\n }\n\n reset() {\n this._map.forEach((keyed) => keyed.reset());\n this._map.clear();\n }\n}\n\nexport class KeyedResolvOnce<T, K = string> extends Keyed<ResolveOnce<T, K>, K> {\n constructor() {\n super((key) => new ResolveOnce<T, K>(key));\n }\n}\n\nexport class KeyedResolvSeq<T, K = string> extends Keyed<ResolveSeq<T, K>, K> {\n constructor() {\n super((key) => new ResolveSeq<T, K>(key));\n }\n}\n","import { ResolveOnce } from \"./resolve-once\";\n\nexport interface EnvMap {\n get(key: string): string | undefined;\n set(key: string, value?: string): void;\n delete(key: string): void;\n keys(): string[];\n}\nexport interface EnvActions extends EnvMap {\n active(): boolean;\n register(env: Env): Env;\n}\n\nclass NodeEnvActions implements EnvActions {\n readonly #node = globalThis as unknown as { process: { env: Record<string, string> } };\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor, @typescript-eslint/no-unused-vars\n constructor(opts: Partial<EnvFactoryOpts>) {\n // do nothing\n }\n\n register(env: Env): Env {\n return env;\n }\n\n active(): boolean {\n return typeof this.#node === \"object\" && typeof this.#node.process === \"object\" && typeof this.#node.process.env === \"object\";\n }\n readonly _env = this.active() ? this.#node.process.env : {};\n keys(): string[] {\n return Object.keys(this._env);\n }\n get(key: string): string | undefined {\n return this._env[key];\n }\n set(key: string, value?: string): void {\n if (value) {\n this._env[key] = value;\n }\n }\n delete(key: string): void {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._env[key];\n }\n}\n\nclass DenoEnvActions implements EnvActions {\n readonly #deno = globalThis as unknown as { Deno: { env: Map<string, string> } };\n\n get _env(): Map<string, string> {\n return this.#deno.Deno.env;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor, @typescript-eslint/no-unused-vars\n constructor(opts: Partial<EnvFactoryOpts>) {\n // do nothing\n }\n\n register(env: Env): Env {\n return env;\n }\n active(): boolean {\n return typeof this.#deno === \"object\" && typeof this.#deno.Deno === \"object\" && typeof this.#deno.Deno.env === \"object\";\n }\n keys(): string[] {\n return Array.from(this._env.keys());\n }\n get(key: string): string | undefined {\n return this._env.get(key);\n }\n set(key: string, value?: string): void {\n if (value) {\n this._env.set(key, value);\n }\n }\n delete(key: string): void {\n this._env.delete(key);\n }\n}\n\nexport class BrowserEnvActions implements EnvActions {\n readonly env = new Map<string, string>();\n readonly opts: Partial<EnvFactoryOpts>;\n constructor(opts: Partial<EnvFactoryOpts>) {\n this.opts = opts;\n }\n\n get(key: string): string | undefined {\n return this.env.get(key);\n }\n set(key: string, value?: string): void {\n if (value) {\n this.env.set(key, value);\n }\n }\n delete(key: string): void {\n this.env.delete(key);\n }\n keys(): string[] {\n return Array.from(this.env.keys());\n }\n active(): boolean {\n return true; // that should work on every runtime\n }\n\n register(env: Env): Env {\n const sym = Symbol.for(this.opts.symbol || \"CP_ENV\");\n const browser = globalThis as unknown as Record<symbol, Env>;\n browser[sym] = env;\n return env;\n }\n}\n\nexport interface EnvFactoryOpts {\n readonly symbol: string; // default \"CP_ENV\" used by BrowserEnvActions\n readonly presetEnv: Map<string, string>;\n}\n\ntype OnSetFn = (key: string, value?: string) => void;\nexport interface OnSetItem {\n readonly filter: Set<string>;\n readonly fn: OnSetFn;\n}\n\nexport interface Env extends EnvMap {\n onSet(fn: OnSetFn, ...filter: string[]): void;\n}\n\nconst _envFactory = new ResolveOnce<Env>();\nexport function envFactory(opts: Partial<EnvFactoryOpts> = {}): Env {\n return _envFactory.once(() => {\n const found = [new NodeEnvActions(opts), new DenoEnvActions(opts), new BrowserEnvActions(opts)].find((env) => env.active());\n if (!found) {\n throw new Error(\"SysContainer:envFactory: no env available\");\n }\n const ret = new EnvImpl(found, opts);\n found.register(ret);\n return ret;\n });\n}\n\nexport class EnvImpl implements Env {\n readonly _map: EnvMap;\n constructor(map: EnvMap, opts: Partial<EnvFactoryOpts> = {}) {\n this._map = map;\n this._updatePresets(opts.presetEnv);\n }\n _updatePresets(presetEnv?: Map<string, string>): void {\n if (!presetEnv) {\n return;\n }\n for (const [key, value] of presetEnv) {\n this._map.set(key, value);\n }\n }\n _applyOnSet(onSet: OnSetItem[], key?: string, value?: string): void {\n onSet.forEach((item) => {\n let keys: string[] = [];\n if (key) {\n keys = [key];\n } else {\n keys = this._map.keys();\n }\n keys\n .filter((k) => {\n if (item.filter.size === 0) {\n return true;\n }\n if (item.filter.has(k)) {\n return true;\n }\n return false;\n })\n .forEach((k) => {\n let v;\n if (!key && !value) {\n // init\n v = this._map.get(k);\n } else if (key && !value) {\n // del\n v = undefined;\n } else {\n // set\n v = value;\n }\n item.fn(k, v);\n });\n });\n }\n readonly _onSet: OnSetItem[] = [];\n keys(): string[] {\n return this._map.keys();\n }\n // filter is not set all sets passed\n onSet(fn: OnSetFn, ...filter: string[]): void {\n const item: OnSetItem = { filter: new Set(filter), fn };\n this._onSet.push(item);\n this._applyOnSet([item]);\n }\n get(key: string): string | undefined {\n return this._map.get(key);\n }\n set(key: string, value?: string): void {\n if (!value) {\n return;\n }\n this._map.set(key, value);\n this._applyOnSet(this._onSet, key, value);\n }\n delete(key: string): void {\n this._map.delete(key);\n this._applyOnSet(this._onSet, key);\n }\n}\n\n// export const envImpl = new EnvImpl();\n"],"mappings":";;;;;;;AAIO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;AAML,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,YAAS;AAHC,SAAAA;AAAA,GAAA;AAML,IAAK,SAAL,kBAAKC,YAAL;AACL,EAAAA,QAAA,UAAO;AACP,EAAAA,QAAA,WAAQ;AACR,EAAAA,QAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;AAML,SAAS,gBAAgB,GAAsB;AACpD,UAAQ,uBAAG,eAAe;AAAA,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EL,cAAI;AAAA,QACN;AACA,aAAK,GAAG,GAAG,CAAC;AAAA,MACd,CAAC;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,OAAiB;AACf,WAAO,KAAK,KAAK,KAAK;AAAA,EACxB;AAAA;AAAA,EAEA,MAAM,OAAgB,QAAwB;AAC5C,UAAM,OAAkB,EAAE,QAAQ,IAAI,IAAI,MAAM,GAAG,GAAG;AACtD,SAAK,OAAO,KAAK,IAAI;AACrB,SAAK,YAAY,CAAC,IAAI,CAAC;AAAA,EACzB;AAAA,EACA,IAAI,KAAiC;AACnC,WAAO,KAAK,KAAK,IAAI,GAAG;AAAA,EAC1B;AAAA,EACA,IAAI,KAAa,OAAsB;AACrC,QAAI,CAAC,OAAO;AACV;AAAA,IACF;AACA,SAAK,KAAK,IAAI,KAAK,KAAK;AACxB,SAAK,YAAY,KAAK,QAAQ,KAAK,KAAK;AAAA,EAC1C;AAAA,EACA,OAAO,KAAmB;AACxB,SAAK,KAAK,OAAO,GAAG;AACpB,SAAK,YAAY,KAAK,QAAQ,GAAG;AAAA,EACnC;AACF;","names":["TimeMode","RandomMode","IDMode","TimeUnits"]}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { Mock } from 'vitest';
|
2
|
+
|
3
|
+
declare function rebufferArray(a: Uint8Array[], chunkSize: number): Promise<Uint8Array[]>;
|
4
|
+
declare function rebuffer(a: ReadableStream<Uint8Array>, chunkSize: number): ReadableStream<Uint8Array>;
|
5
|
+
|
6
|
+
interface StreamMap<T, U> {
|
7
|
+
Map(s: T, idx: number): U | Promise<U>;
|
8
|
+
readonly Close?: () => void;
|
9
|
+
}
|
10
|
+
declare function streamMap<T, U>(s: ReadableStream<T>, sm: StreamMap<T, U>): ReadableStream<U>;
|
11
|
+
declare function devnull<T>(a: ReadableStream<T>): Promise<number>;
|
12
|
+
declare function array2stream<T>(a: T[]): ReadableStream<T>;
|
13
|
+
declare function stream2array<T>(a: ReadableStream<T>): Promise<T[]>;
|
14
|
+
|
15
|
+
declare function stream2string(stream?: ReadableStream<Uint8Array> | null, maxSize?: number): Promise<string>;
|
16
|
+
declare function stream2uint8array(stream?: ReadableStream<Uint8Array> | null): Promise<Uint8Array>;
|
17
|
+
|
18
|
+
interface mockValue {
|
19
|
+
done: boolean;
|
20
|
+
value: Uint8Array | undefined;
|
21
|
+
fillCalls: number;
|
22
|
+
reBufferCalls: number;
|
23
|
+
}
|
24
|
+
interface streamingTestState {
|
25
|
+
readonly sendChunks: number;
|
26
|
+
readonly sendChunkSize: number;
|
27
|
+
fillCalls: number;
|
28
|
+
CollectorFn: Mock<(mv: mockValue) => void>;
|
29
|
+
}
|
30
|
+
declare function receiveFromStream(reb: ReadableStream<Uint8Array>, state: streamingTestState): Promise<void>;
|
31
|
+
declare function sendToStream(reb: WritableStream<Uint8Array>, state: streamingTestState): Promise<void>;
|
32
|
+
|
33
|
+
declare function string2stream(str: string): ReadableStream<Uint8Array>;
|
34
|
+
declare function uint8array2stream(str: Uint8Array): ReadableStream<Uint8Array>;
|
35
|
+
|
36
|
+
declare class ConsoleWriterStreamDefaultWriter implements WritableStreamDefaultWriter<Uint8Array> {
|
37
|
+
private stream;
|
38
|
+
readonly desiredSize: number | null;
|
39
|
+
readonly decoder: TextDecoder;
|
40
|
+
closed: Promise<undefined>;
|
41
|
+
ready: Promise<undefined>;
|
42
|
+
readonly _stream: ConsoleWriterStream;
|
43
|
+
constructor(stream: ConsoleWriterStream);
|
44
|
+
abort(reason?: any): Promise<void>;
|
45
|
+
close(): Promise<void>;
|
46
|
+
releaseLock(): void;
|
47
|
+
write(chunk?: Uint8Array | undefined): Promise<void>;
|
48
|
+
}
|
49
|
+
declare class ConsoleWriterStream implements WritableStream<Uint8Array> {
|
50
|
+
locked: boolean;
|
51
|
+
_writer?: WritableStreamDefaultWriter<Uint8Array>;
|
52
|
+
abort(reason?: any): Promise<void>;
|
53
|
+
close(): Promise<void>;
|
54
|
+
getWriter(): WritableStreamDefaultWriter<Uint8Array>;
|
55
|
+
}
|
56
|
+
|
57
|
+
declare class FanoutWriteStream implements WritableStreamDefaultWriter<Uint8Array> {
|
58
|
+
readonly _writers: WritableStreamDefaultWriter<Uint8Array>[];
|
59
|
+
readonly ready: Promise<undefined>;
|
60
|
+
readonly closed: Promise<undefined>;
|
61
|
+
readonly desiredSize: number | null;
|
62
|
+
constructor(writers: WritableStreamDefaultWriter<Uint8Array>[]);
|
63
|
+
abort(reason?: any): Promise<void>;
|
64
|
+
close(): Promise<void>;
|
65
|
+
releaseLock(): void;
|
66
|
+
write(chunk?: Uint8Array | undefined): Promise<void>;
|
67
|
+
}
|
68
|
+
|
69
|
+
type index_ConsoleWriterStream = ConsoleWriterStream;
|
70
|
+
declare const index_ConsoleWriterStream: typeof ConsoleWriterStream;
|
71
|
+
type index_ConsoleWriterStreamDefaultWriter = ConsoleWriterStreamDefaultWriter;
|
72
|
+
declare const index_ConsoleWriterStreamDefaultWriter: typeof ConsoleWriterStreamDefaultWriter;
|
73
|
+
type index_FanoutWriteStream = FanoutWriteStream;
|
74
|
+
declare const index_FanoutWriteStream: typeof FanoutWriteStream;
|
75
|
+
type index_StreamMap<T, U> = StreamMap<T, U>;
|
76
|
+
declare const index_array2stream: typeof array2stream;
|
77
|
+
declare const index_devnull: typeof devnull;
|
78
|
+
declare const index_rebuffer: typeof rebuffer;
|
79
|
+
declare const index_rebufferArray: typeof rebufferArray;
|
80
|
+
declare const index_receiveFromStream: typeof receiveFromStream;
|
81
|
+
declare const index_sendToStream: typeof sendToStream;
|
82
|
+
declare const index_stream2array: typeof stream2array;
|
83
|
+
declare const index_stream2string: typeof stream2string;
|
84
|
+
declare const index_stream2uint8array: typeof stream2uint8array;
|
85
|
+
declare const index_streamMap: typeof streamMap;
|
86
|
+
type index_streamingTestState = streamingTestState;
|
87
|
+
declare const index_string2stream: typeof string2stream;
|
88
|
+
declare const index_uint8array2stream: typeof uint8array2stream;
|
89
|
+
declare namespace index {
|
90
|
+
export { index_ConsoleWriterStream as ConsoleWriterStream, index_ConsoleWriterStreamDefaultWriter as ConsoleWriterStreamDefaultWriter, index_FanoutWriteStream as FanoutWriteStream, type index_StreamMap as StreamMap, index_array2stream as array2stream, index_devnull as devnull, index_rebuffer as rebuffer, index_rebufferArray as rebufferArray, index_receiveFromStream as receiveFromStream, index_sendToStream as sendToStream, index_stream2array as stream2array, index_stream2string as stream2string, index_stream2uint8array as stream2uint8array, index_streamMap as streamMap, type index_streamingTestState as streamingTestState, index_string2stream as string2stream, index_uint8array2stream as uint8array2stream };
|
91
|
+
}
|
92
|
+
|
93
|
+
export { ConsoleWriterStreamDefaultWriter as C, FanoutWriteStream as F, type StreamMap as S, rebuffer as a, array2stream as b, stream2array as c, devnull as d, stream2string as e, stream2uint8array as f, type streamingTestState as g, receiveFromStream as h, index as i, sendToStream as j, string2stream as k, ConsoleWriterStream as l, rebufferArray as r, streamMap as s, uint8array2stream as u };
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { Mock } from 'vitest';
|
2
|
+
|
3
|
+
declare function rebufferArray(a: Uint8Array[], chunkSize: number): Promise<Uint8Array[]>;
|
4
|
+
declare function rebuffer(a: ReadableStream<Uint8Array>, chunkSize: number): ReadableStream<Uint8Array>;
|
5
|
+
|
6
|
+
interface StreamMap<T, U> {
|
7
|
+
Map(s: T, idx: number): U | Promise<U>;
|
8
|
+
readonly Close?: () => void;
|
9
|
+
}
|
10
|
+
declare function streamMap<T, U>(s: ReadableStream<T>, sm: StreamMap<T, U>): ReadableStream<U>;
|
11
|
+
declare function devnull<T>(a: ReadableStream<T>): Promise<number>;
|
12
|
+
declare function array2stream<T>(a: T[]): ReadableStream<T>;
|
13
|
+
declare function stream2array<T>(a: ReadableStream<T>): Promise<T[]>;
|
14
|
+
|
15
|
+
declare function stream2string(stream?: ReadableStream<Uint8Array> | null, maxSize?: number): Promise<string>;
|
16
|
+
declare function stream2uint8array(stream?: ReadableStream<Uint8Array> | null): Promise<Uint8Array>;
|
17
|
+
|
18
|
+
interface mockValue {
|
19
|
+
done: boolean;
|
20
|
+
value: Uint8Array | undefined;
|
21
|
+
fillCalls: number;
|
22
|
+
reBufferCalls: number;
|
23
|
+
}
|
24
|
+
interface streamingTestState {
|
25
|
+
readonly sendChunks: number;
|
26
|
+
readonly sendChunkSize: number;
|
27
|
+
fillCalls: number;
|
28
|
+
CollectorFn: Mock<(mv: mockValue) => void>;
|
29
|
+
}
|
30
|
+
declare function receiveFromStream(reb: ReadableStream<Uint8Array>, state: streamingTestState): Promise<void>;
|
31
|
+
declare function sendToStream(reb: WritableStream<Uint8Array>, state: streamingTestState): Promise<void>;
|
32
|
+
|
33
|
+
declare function string2stream(str: string): ReadableStream<Uint8Array>;
|
34
|
+
declare function uint8array2stream(str: Uint8Array): ReadableStream<Uint8Array>;
|
35
|
+
|
36
|
+
declare class ConsoleWriterStreamDefaultWriter implements WritableStreamDefaultWriter<Uint8Array> {
|
37
|
+
private stream;
|
38
|
+
readonly desiredSize: number | null;
|
39
|
+
readonly decoder: TextDecoder;
|
40
|
+
closed: Promise<undefined>;
|
41
|
+
ready: Promise<undefined>;
|
42
|
+
readonly _stream: ConsoleWriterStream;
|
43
|
+
constructor(stream: ConsoleWriterStream);
|
44
|
+
abort(reason?: any): Promise<void>;
|
45
|
+
close(): Promise<void>;
|
46
|
+
releaseLock(): void;
|
47
|
+
write(chunk?: Uint8Array | undefined): Promise<void>;
|
48
|
+
}
|
49
|
+
declare class ConsoleWriterStream implements WritableStream<Uint8Array> {
|
50
|
+
locked: boolean;
|
51
|
+
_writer?: WritableStreamDefaultWriter<Uint8Array>;
|
52
|
+
abort(reason?: any): Promise<void>;
|
53
|
+
close(): Promise<void>;
|
54
|
+
getWriter(): WritableStreamDefaultWriter<Uint8Array>;
|
55
|
+
}
|
56
|
+
|
57
|
+
declare class FanoutWriteStream implements WritableStreamDefaultWriter<Uint8Array> {
|
58
|
+
readonly _writers: WritableStreamDefaultWriter<Uint8Array>[];
|
59
|
+
readonly ready: Promise<undefined>;
|
60
|
+
readonly closed: Promise<undefined>;
|
61
|
+
readonly desiredSize: number | null;
|
62
|
+
constructor(writers: WritableStreamDefaultWriter<Uint8Array>[]);
|
63
|
+
abort(reason?: any): Promise<void>;
|
64
|
+
close(): Promise<void>;
|
65
|
+
releaseLock(): void;
|
66
|
+
write(chunk?: Uint8Array | undefined): Promise<void>;
|
67
|
+
}
|
68
|
+
|
69
|
+
type index_ConsoleWriterStream = ConsoleWriterStream;
|
70
|
+
declare const index_ConsoleWriterStream: typeof ConsoleWriterStream;
|
71
|
+
type index_ConsoleWriterStreamDefaultWriter = ConsoleWriterStreamDefaultWriter;
|
72
|
+
declare const index_ConsoleWriterStreamDefaultWriter: typeof ConsoleWriterStreamDefaultWriter;
|
73
|
+
type index_FanoutWriteStream = FanoutWriteStream;
|
74
|
+
declare const index_FanoutWriteStream: typeof FanoutWriteStream;
|
75
|
+
type index_StreamMap<T, U> = StreamMap<T, U>;
|
76
|
+
declare const index_array2stream: typeof array2stream;
|
77
|
+
declare const index_devnull: typeof devnull;
|
78
|
+
declare const index_rebuffer: typeof rebuffer;
|
79
|
+
declare const index_rebufferArray: typeof rebufferArray;
|
80
|
+
declare const index_receiveFromStream: typeof receiveFromStream;
|
81
|
+
declare const index_sendToStream: typeof sendToStream;
|
82
|
+
declare const index_stream2array: typeof stream2array;
|
83
|
+
declare const index_stream2string: typeof stream2string;
|
84
|
+
declare const index_stream2uint8array: typeof stream2uint8array;
|
85
|
+
declare const index_streamMap: typeof streamMap;
|
86
|
+
type index_streamingTestState = streamingTestState;
|
87
|
+
declare const index_string2stream: typeof string2stream;
|
88
|
+
declare const index_uint8array2stream: typeof uint8array2stream;
|
89
|
+
declare namespace index {
|
90
|
+
export { index_ConsoleWriterStream as ConsoleWriterStream, index_ConsoleWriterStreamDefaultWriter as ConsoleWriterStreamDefaultWriter, index_FanoutWriteStream as FanoutWriteStream, type index_StreamMap as StreamMap, index_array2stream as array2stream, index_devnull as devnull, index_rebuffer as rebuffer, index_rebufferArray as rebufferArray, index_receiveFromStream as receiveFromStream, index_sendToStream as sendToStream, index_stream2array as stream2array, index_stream2string as stream2string, index_stream2uint8array as stream2uint8array, index_streamMap as streamMap, type index_streamingTestState as streamingTestState, index_string2stream as string2stream, index_uint8array2stream as uint8array2stream };
|
91
|
+
}
|
92
|
+
|
93
|
+
export { ConsoleWriterStreamDefaultWriter as C, FanoutWriteStream as F, type StreamMap as S, rebuffer as a, array2stream as b, stream2array as c, devnull as d, stream2string as e, stream2uint8array as f, type streamingTestState as g, receiveFromStream as h, index as i, sendToStream as j, string2stream as k, ConsoleWriterStream as l, rebufferArray as r, streamMap as s, uint8array2stream as u };
|