@emulsify/cli 1.11.0 → 1.11.2

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.
Files changed (86) hide show
  1. package/dist/handlers/systemInstall.js +3 -4
  2. package/dist/node_modules/.package-lock.json +18 -18
  3. package/dist/node_modules/@types/node/README.md +1 -1
  4. package/dist/node_modules/@types/node/assert.d.ts +2 -2
  5. package/dist/node_modules/@types/node/buffer.buffer.d.ts +385 -0
  6. package/dist/node_modules/@types/node/buffer.d.ts +30 -390
  7. package/dist/node_modules/@types/node/child_process.d.ts +32 -28
  8. package/dist/node_modules/@types/node/cluster.d.ts +1 -1
  9. package/dist/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  10. package/dist/node_modules/@types/node/compatibility/index.d.ts +9 -0
  11. package/dist/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  12. package/dist/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  13. package/dist/node_modules/@types/node/console.d.ts +2 -2
  14. package/dist/node_modules/@types/node/crypto.d.ts +3 -3
  15. package/dist/node_modules/@types/node/dns/promises.d.ts +6 -5
  16. package/dist/node_modules/@types/node/dns.d.ts +5 -5
  17. package/dist/node_modules/@types/node/domain.d.ts +2 -2
  18. package/dist/node_modules/@types/node/events.d.ts +3 -3
  19. package/dist/node_modules/@types/node/fs/promises.d.ts +2 -2
  20. package/dist/node_modules/@types/node/fs.d.ts +2 -2
  21. package/dist/node_modules/@types/node/globals.d.ts +124 -68
  22. package/dist/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  23. package/dist/node_modules/@types/node/http.d.ts +43 -7
  24. package/dist/node_modules/@types/node/http2.d.ts +238 -101
  25. package/dist/node_modules/@types/node/https.d.ts +17 -23
  26. package/dist/node_modules/@types/node/index.d.ts +11 -9
  27. package/dist/node_modules/@types/node/module.d.ts +3 -3
  28. package/dist/node_modules/@types/node/net.d.ts +8 -2
  29. package/dist/node_modules/@types/node/os.d.ts +1 -1
  30. package/dist/node_modules/@types/node/package.json +10 -2
  31. package/dist/node_modules/@types/node/path.d.ts +10 -1
  32. package/dist/node_modules/@types/node/perf_hooks.d.ts +19 -19
  33. package/dist/node_modules/@types/node/punycode.d.ts +1 -1
  34. package/dist/node_modules/@types/node/querystring.d.ts +1 -1
  35. package/dist/node_modules/@types/node/readline/promises.d.ts +1 -1
  36. package/dist/node_modules/@types/node/readline.d.ts +10 -10
  37. package/dist/node_modules/@types/node/repl.d.ts +4 -4
  38. package/dist/node_modules/@types/node/stream/promises.d.ts +8 -1
  39. package/dist/node_modules/@types/node/stream/web.d.ts +182 -25
  40. package/dist/node_modules/@types/node/stream.d.ts +36 -17
  41. package/dist/node_modules/@types/node/string_decoder.d.ts +3 -3
  42. package/dist/node_modules/@types/node/test.d.ts +85 -12
  43. package/dist/node_modules/@types/node/timers/promises.d.ts +1 -1
  44. package/dist/node_modules/@types/node/timers.d.ts +1 -1
  45. package/dist/node_modules/@types/node/tls.d.ts +5 -5
  46. package/dist/node_modules/@types/node/trace_events.d.ts +4 -4
  47. package/dist/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
  48. package/dist/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  49. package/dist/node_modules/@types/node/ts5.6/index.d.ts +91 -0
  50. package/dist/node_modules/@types/node/tty.d.ts +1 -1
  51. package/dist/node_modules/@types/node/url.d.ts +14 -11
  52. package/dist/node_modules/@types/node/util.d.ts +49 -49
  53. package/dist/node_modules/@types/node/v8.d.ts +12 -12
  54. package/dist/node_modules/@types/node/vm.d.ts +11 -12
  55. package/dist/node_modules/@types/node/worker_threads.d.ts +22 -22
  56. package/dist/node_modules/@types/node/zlib.d.ts +8 -8
  57. package/dist/node_modules/debug/README.md +1 -1
  58. package/dist/node_modules/debug/package.json +2 -2
  59. package/dist/node_modules/fast-uri/.github/workflows/ci.yml +2 -2
  60. package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +1 -1
  61. package/dist/node_modules/fast-uri/index.js +3 -9
  62. package/dist/node_modules/fast-uri/package.json +4 -4
  63. package/dist/node_modules/fast-uri/test/ajv.test.js +1 -1
  64. package/dist/node_modules/fast-uri/test/compatibility.test.js +3 -2
  65. package/dist/node_modules/fast-uri/test/equal.test.js +1 -2
  66. package/dist/node_modules/fast-uri/test/parse.test.js +1 -2
  67. package/dist/node_modules/fast-uri/test/resolve.test.js +1 -2
  68. package/dist/node_modules/fast-uri/test/serialize.test.js +1 -2
  69. package/dist/node_modules/fast-uri/test/uri-js.test.js +539 -567
  70. package/dist/node_modules/fast-uri/test/util.test.js +2 -3
  71. package/dist/node_modules/ms/index.js +1 -1
  72. package/dist/node_modules/ms/license.md +1 -1
  73. package/dist/node_modules/ms/package.json +5 -4
  74. package/dist/node_modules/ms/readme.md +1 -2
  75. package/dist/node_modules/simple-git/dist/cjs/index.js +14 -15
  76. package/dist/node_modules/simple-git/dist/cjs/index.js.map +2 -2
  77. package/dist/node_modules/simple-git/dist/esm/index.js +14 -15
  78. package/dist/node_modules/simple-git/dist/esm/index.js.map +2 -2
  79. package/dist/node_modules/simple-git/dist/typings/response.d.ts +7 -6
  80. package/dist/node_modules/simple-git/package.json +5 -5
  81. package/dist/package-lock.json +720 -643
  82. package/dist/package.json +2 -2
  83. package/dist/util/cache/copyItemFromCache.js +9 -1
  84. package/package.json +2 -2
  85. package/dist/node_modules/@types/node/globals.global.d.ts +0 -1
  86. package/dist/node_modules/fast-uri/.taprc +0 -3
@@ -1,3 +1,38 @@
1
+ type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
2
+ : import("stream/web").ByteLengthQueuingStrategy;
3
+ type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
4
+ : import("stream/web").CompressionStream;
5
+ type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
6
+ : import("stream/web").CountQueuingStrategy;
7
+ type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
8
+ : import("stream/web").DecompressionStream;
9
+ type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
10
+ : import("stream/web").ReadableByteStreamController;
11
+ type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any } ? {}
12
+ : import("stream/web").ReadableStream<R>;
13
+ type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {}
14
+ : import("stream/web").ReadableStreamBYOBReader;
15
+ type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {}
16
+ : import("stream/web").ReadableStreamBYOBRequest;
17
+ type _ReadableStreamDefaultController<R = any> = typeof globalThis extends { onmessage: any } ? {}
18
+ : import("stream/web").ReadableStreamDefaultController<R>;
19
+ type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends { onmessage: any } ? {}
20
+ : import("stream/web").ReadableStreamDefaultReader<R>;
21
+ type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {}
22
+ : import("stream/web").TextDecoderStream;
23
+ type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {}
24
+ : import("stream/web").TextEncoderStream;
25
+ type _TransformStream<I = any, O = any> = typeof globalThis extends { onmessage: any } ? {}
26
+ : import("stream/web").TransformStream<I, O>;
27
+ type _TransformStreamDefaultController<O = any> = typeof globalThis extends { onmessage: any } ? {}
28
+ : import("stream/web").TransformStreamDefaultController<O>;
29
+ type _WritableStream<W = any> = typeof globalThis extends { onmessage: any } ? {}
30
+ : import("stream/web").WritableStream<W>;
31
+ type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {}
32
+ : import("stream/web").WritableStreamDefaultController;
33
+ type _WritableStreamDefaultWriter<W = any> = typeof globalThis extends { onmessage: any } ? {}
34
+ : import("stream/web").WritableStreamDefaultWriter<W>;
35
+
1
36
  declare module "stream/web" {
2
37
  // stub module, pending copy&paste from .d.ts or manual impl
3
38
  // copy from lib.dom.d.ts
@@ -65,18 +100,7 @@ declare module "stream/web" {
65
100
  readonly closed: Promise<undefined>;
66
101
  cancel(reason?: any): Promise<void>;
67
102
  }
68
- interface ReadableStreamDefaultReadValueResult<T> {
69
- done: false;
70
- value: T;
71
- }
72
- interface ReadableStreamDefaultReadDoneResult {
73
- done: true;
74
- value?: undefined;
75
- }
76
103
  type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
77
- type ReadableStreamDefaultReadResult<T> =
78
- | ReadableStreamDefaultReadValueResult<T>
79
- | ReadableStreamDefaultReadDoneResult;
80
104
  interface ReadableStreamReadValueResult<T> {
81
105
  done: false;
82
106
  value: T;
@@ -142,17 +166,21 @@ declare module "stream/web" {
142
166
  interface ReadableStreamErrorCallback {
143
167
  (reason: any): void | PromiseLike<void>;
144
168
  }
169
+ interface ReadableStreamAsyncIterator<T> extends NodeJS.AsyncIterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
170
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
171
+ }
145
172
  /** This Streams API interface represents a readable stream of byte data. */
146
173
  interface ReadableStream<R = any> {
147
174
  readonly locked: boolean;
148
175
  cancel(reason?: any): Promise<void>;
149
- getReader(): ReadableStreamDefaultReader<R>;
150
176
  getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
177
+ getReader(): ReadableStreamDefaultReader<R>;
178
+ getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>;
151
179
  pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
152
180
  pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
153
181
  tee(): [ReadableStream<R>, ReadableStream<R>];
154
- values(options?: { preventCancel?: boolean }): AsyncIterableIterator<R>;
155
- [Symbol.asyncIterator](): AsyncIterableIterator<R>;
182
+ values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator<R>;
183
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<R>;
156
184
  }
157
185
  const ReadableStream: {
158
186
  prototype: ReadableStream;
@@ -160,20 +188,48 @@ declare module "stream/web" {
160
188
  new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
161
189
  new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
162
190
  };
191
+ type ReadableStreamReaderMode = "byob";
192
+ interface ReadableStreamGetReaderOptions {
193
+ /**
194
+ * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
195
+ *
196
+ * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
197
+ */
198
+ mode?: ReadableStreamReaderMode;
199
+ }
200
+ type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
163
201
  interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
164
- read(): Promise<ReadableStreamDefaultReadResult<R>>;
202
+ read(): Promise<ReadableStreamReadResult<R>>;
165
203
  releaseLock(): void;
166
204
  }
205
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
167
206
  interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
207
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
168
208
  read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
209
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
169
210
  releaseLock(): void;
170
211
  }
171
212
  const ReadableStreamDefaultReader: {
172
213
  prototype: ReadableStreamDefaultReader;
173
214
  new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
174
215
  };
175
- const ReadableStreamBYOBReader: any;
176
- const ReadableStreamBYOBRequest: any;
216
+ const ReadableStreamBYOBReader: {
217
+ prototype: ReadableStreamBYOBReader;
218
+ new(stream: ReadableStream): ReadableStreamBYOBReader;
219
+ };
220
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
221
+ interface ReadableStreamBYOBRequest {
222
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
223
+ readonly view: ArrayBufferView | null;
224
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
225
+ respond(bytesWritten: number): void;
226
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
227
+ respondWithNewView(view: ArrayBufferView): void;
228
+ }
229
+ const ReadableStreamBYOBRequest: {
230
+ prototype: ReadableStreamBYOBRequest;
231
+ new(): ReadableStreamBYOBRequest;
232
+ };
177
233
  interface ReadableByteStreamController {
178
234
  readonly byobRequest: undefined;
179
235
  readonly desiredSize: number | null;
@@ -345,22 +401,123 @@ declare module "stream/web" {
345
401
  prototype: TextDecoderStream;
346
402
  new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream;
347
403
  };
348
- interface CompressionStream<R = any, W = any> {
349
- readonly readable: ReadableStream<R>;
350
- readonly writable: WritableStream<W>;
404
+ interface CompressionStream {
405
+ readonly readable: ReadableStream;
406
+ readonly writable: WritableStream;
351
407
  }
352
408
  const CompressionStream: {
353
409
  prototype: CompressionStream;
354
- new<R = any, W = any>(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream<R, W>;
410
+ new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream;
355
411
  };
356
- interface DecompressionStream<R = any, W = any> {
357
- readonly readable: ReadableStream<R>;
358
- readonly writable: WritableStream<W>;
412
+ interface DecompressionStream {
413
+ readonly writable: WritableStream;
414
+ readonly readable: ReadableStream;
359
415
  }
360
416
  const DecompressionStream: {
361
417
  prototype: DecompressionStream;
362
- new<R = any, W = any>(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream<R, W>;
418
+ new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream;
363
419
  };
420
+
421
+ global {
422
+ interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
423
+ var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T }
424
+ ? T
425
+ : typeof import("stream/web").ByteLengthQueuingStrategy;
426
+
427
+ interface CompressionStream extends _CompressionStream {}
428
+ var CompressionStream: typeof globalThis extends {
429
+ onmessage: any;
430
+ // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
431
+ // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
432
+ ReportingObserver: any;
433
+ CompressionStream: infer T;
434
+ } ? T
435
+ // TS 4.8, 4.9, 5.0
436
+ : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
437
+ prototype: T;
438
+ new(format: "deflate" | "deflate-raw" | "gzip"): T;
439
+ }
440
+ : typeof import("stream/web").CompressionStream;
441
+
442
+ interface CountQueuingStrategy extends _CountQueuingStrategy {}
443
+ var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T
444
+ : typeof import("stream/web").CountQueuingStrategy;
445
+
446
+ interface DecompressionStream extends _DecompressionStream {}
447
+ var DecompressionStream: typeof globalThis extends {
448
+ onmessage: any;
449
+ // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
450
+ // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
451
+ ReportingObserver: any;
452
+ DecompressionStream: infer T;
453
+ } ? T
454
+ // TS 4.8, 4.9, 5.0
455
+ : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
456
+ prototype: T;
457
+ new(format: "deflate" | "deflate-raw" | "gzip"): T;
458
+ }
459
+ : typeof import("stream/web").DecompressionStream;
460
+
461
+ interface ReadableByteStreamController extends _ReadableByteStreamController {}
462
+ var ReadableByteStreamController: typeof globalThis extends
463
+ { onmessage: any; ReadableByteStreamController: infer T } ? T
464
+ : typeof import("stream/web").ReadableByteStreamController;
465
+
466
+ interface ReadableStream<R = any> extends _ReadableStream<R> {}
467
+ var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T
468
+ : typeof import("stream/web").ReadableStream;
469
+
470
+ interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {}
471
+ var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
472
+ ? T
473
+ : typeof import("stream/web").ReadableStreamBYOBReader;
474
+
475
+ interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {}
476
+ var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
477
+ ? T
478
+ : typeof import("stream/web").ReadableStreamBYOBRequest;
479
+
480
+ interface ReadableStreamDefaultController<R = any> extends _ReadableStreamDefaultController<R> {}
481
+ var ReadableStreamDefaultController: typeof globalThis extends
482
+ { onmessage: any; ReadableStreamDefaultController: infer T } ? T
483
+ : typeof import("stream/web").ReadableStreamDefaultController;
484
+
485
+ interface ReadableStreamDefaultReader<R = any> extends _ReadableStreamDefaultReader<R> {}
486
+ var ReadableStreamDefaultReader: typeof globalThis extends
487
+ { onmessage: any; ReadableStreamDefaultReader: infer T } ? T
488
+ : typeof import("stream/web").ReadableStreamDefaultReader;
489
+
490
+ interface TextDecoderStream extends _TextDecoderStream {}
491
+ var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T
492
+ : typeof import("stream/web").TextDecoderStream;
493
+
494
+ interface TextEncoderStream extends _TextEncoderStream {}
495
+ var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T
496
+ : typeof import("stream/web").TextEncoderStream;
497
+
498
+ interface TransformStream<I = any, O = any> extends _TransformStream<I, O> {}
499
+ var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T
500
+ : typeof import("stream/web").TransformStream;
501
+
502
+ interface TransformStreamDefaultController<O = any> extends _TransformStreamDefaultController<O> {}
503
+ var TransformStreamDefaultController: typeof globalThis extends
504
+ { onmessage: any; TransformStreamDefaultController: infer T } ? T
505
+ : typeof import("stream/web").TransformStreamDefaultController;
506
+
507
+ interface WritableStream<W = any> extends _WritableStream<W> {}
508
+ var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T
509
+ : typeof import("stream/web").WritableStream;
510
+
511
+ interface WritableStreamDefaultController extends _WritableStreamDefaultController {}
512
+ var WritableStreamDefaultController: typeof globalThis extends
513
+ { onmessage: any; WritableStreamDefaultController: infer T } ? T
514
+ : typeof import("stream/web").WritableStreamDefaultController;
515
+
516
+ interface WritableStreamDefaultWriter<W = any> extends _WritableStreamDefaultWriter<W> {}
517
+ var WritableStreamDefaultWriter: typeof globalThis extends
518
+ { onmessage: any; WritableStreamDefaultWriter: infer T } ? T
519
+ : typeof import("stream/web").WritableStreamDefaultWriter;
520
+ }
364
521
  }
365
522
  declare module "node:stream/web" {
366
523
  export * from "stream/web";
@@ -10,7 +10,7 @@
10
10
  * To access the `node:stream` module:
11
11
  *
12
12
  * ```js
13
- * const stream = require('node:stream');
13
+ * import stream from 'node:stream';
14
14
  * ```
15
15
  *
16
16
  * The `node:stream` module is useful for creating new types of stream instances.
@@ -303,7 +303,7 @@ declare module "stream" {
303
303
  * the method does nothing.
304
304
  *
305
305
  * ```js
306
- * const fs = require('node:fs');
306
+ * import fs from 'node:fs';
307
307
  * const readable = getReadableStreamSomehow();
308
308
  * const writable = fs.createWriteStream('file.txt');
309
309
  * // All the data from readable goes into 'file.txt',
@@ -341,7 +341,7 @@ declare module "stream" {
341
341
  * // Pull off a header delimited by \n\n.
342
342
  * // Use unshift() if we get too much.
343
343
  * // Call the callback with (error, header, stream).
344
- * const { StringDecoder } = require('node:string_decoder');
344
+ * import { StringDecoder } from 'node:string_decoder';
345
345
  * function parseHeader(stream, callback) {
346
346
  * stream.on('error', callback);
347
347
  * stream.on('readable', onReadable);
@@ -399,8 +399,8 @@ declare module "stream" {
399
399
  * libraries.
400
400
  *
401
401
  * ```js
402
- * const { OldReader } = require('./old-api-module.js');
403
- * const { Readable } = require('node:stream');
402
+ * import { OldReader } from './old-api-module.js';
403
+ * import { Readable } from 'node:stream';
404
404
  * const oreader = new OldReader();
405
405
  * const myReader = new Readable().wrap(oreader);
406
406
  *
@@ -422,7 +422,7 @@ declare module "stream" {
422
422
  * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
423
423
  * **Default: `true`**.
424
424
  */
425
- iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator<any>;
425
+ iterator(options?: { destroyOnReturn?: boolean }): NodeJS.AsyncIterator<any>;
426
426
  /**
427
427
  * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
428
428
  * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
@@ -651,7 +651,7 @@ declare module "stream" {
651
651
  removeListener(event: "readable", listener: () => void): this;
652
652
  removeListener(event: "resume", listener: () => void): this;
653
653
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
654
- [Symbol.asyncIterator](): AsyncIterableIterator<any>;
654
+ [Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
655
655
  /**
656
656
  * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
657
657
  * @since v20.4.0
@@ -806,7 +806,7 @@ declare module "stream" {
806
806
  *
807
807
  * ```js
808
808
  * // Write 'hello, ' and then end with 'world!'.
809
- * const fs = require('node:fs');
809
+ * import fs from 'node:fs';
810
810
  * const file = fs.createWriteStream('example.txt');
811
811
  * file.write('hello, ');
812
812
  * file.end('world!');
@@ -1250,6 +1250,25 @@ declare module "stream" {
1250
1250
  removeListener(event: "unpipe", listener: (src: Readable) => void): this;
1251
1251
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1252
1252
  }
1253
+ /**
1254
+ * The utility function `duplexPair` returns an Array with two items,
1255
+ * each being a `Duplex` stream connected to the other side:
1256
+ *
1257
+ * ```js
1258
+ * const [ sideA, sideB ] = duplexPair();
1259
+ * ```
1260
+ *
1261
+ * Whatever is written to one stream is made readable on the other. It provides
1262
+ * behavior analogous to a network connection, where the data written by the client
1263
+ * becomes readable by the server, and vice-versa.
1264
+ *
1265
+ * The Duplex streams are symmetrical; one or the other may be used without any
1266
+ * difference in behavior.
1267
+ * @param options A value to pass to both {@link Duplex} constructors,
1268
+ * to set options such as buffering.
1269
+ * @since v20.17.0
1270
+ */
1271
+ function duplexPair(options?: DuplexOptions): [Duplex, Duplex];
1253
1272
  type TransformCallback = (error?: Error | null, data?: any) => void;
1254
1273
  interface TransformOptions extends DuplexOptions {
1255
1274
  construct?(this: Transform, callback: (error?: Error | null) => void): void;
@@ -1304,7 +1323,7 @@ declare module "stream" {
1304
1323
  * stream, and `controller.error(new AbortError())` for webstreams.
1305
1324
  *
1306
1325
  * ```js
1307
- * const fs = require('node:fs');
1326
+ * import fs from 'node:fs';
1308
1327
  *
1309
1328
  * const controller = new AbortController();
1310
1329
  * const read = addAbortSignal(
@@ -1398,8 +1417,8 @@ declare module "stream" {
1398
1417
  * or has experienced an error or a premature close event.
1399
1418
  *
1400
1419
  * ```js
1401
- * const { finished } = require('node:stream');
1402
- * const fs = require('node:fs');
1420
+ * import { finished } from 'node:stream';
1421
+ * import fs from 'node:fs';
1403
1422
  *
1404
1423
  * const rs = fs.createReadStream('archive.tar');
1405
1424
  *
@@ -1482,9 +1501,9 @@ declare module "stream" {
1482
1501
  * properly cleaning up and provide a callback when the pipeline is complete.
1483
1502
  *
1484
1503
  * ```js
1485
- * const { pipeline } = require('node:stream');
1486
- * const fs = require('node:fs');
1487
- * const zlib = require('node:zlib');
1504
+ * import { pipeline } from 'node:stream';
1505
+ * import fs from 'node:fs';
1506
+ * import zlib from 'node:zlib';
1488
1507
  *
1489
1508
  * // Use the pipeline API to easily pipe a series of streams
1490
1509
  * // together and get notified when the pipeline is fully done.
@@ -1524,9 +1543,9 @@ declare module "stream" {
1524
1543
  * See the example below:
1525
1544
  *
1526
1545
  * ```js
1527
- * const fs = require('node:fs');
1528
- * const http = require('node:http');
1529
- * const { pipeline } = require('node:stream');
1546
+ * import fs from 'node:fs';
1547
+ * import http from 'node:http';
1548
+ * import { pipeline } from 'node:stream';
1530
1549
  *
1531
1550
  * const server = http.createServer((req, res) => {
1532
1551
  * const fileStream = fs.createReadStream('./fileNotExist.txt');
@@ -4,13 +4,13 @@
4
4
  * characters. It can be accessed using:
5
5
  *
6
6
  * ```js
7
- * const { StringDecoder } = require('node:string_decoder');
7
+ * import { StringDecoder } from 'node:string_decoder';
8
8
  * ```
9
9
  *
10
10
  * The following example shows the basic use of the `StringDecoder` class.
11
11
  *
12
12
  * ```js
13
- * const { StringDecoder } = require('node:string_decoder');
13
+ * import { StringDecoder } from 'node:string_decoder';
14
14
  * const decoder = new StringDecoder('utf8');
15
15
  *
16
16
  * const cent = Buffer.from([0xC2, 0xA2]);
@@ -29,7 +29,7 @@
29
29
  * symbol (`€`) are written over three separate operations:
30
30
  *
31
31
  * ```js
32
- * const { StringDecoder } = require('node:string_decoder');
32
+ * import { StringDecoder } from 'node:string_decoder';
33
33
  * const decoder = new StringDecoder('utf8');
34
34
  *
35
35
  * decoder.write(Buffer.from([0xE2]));
@@ -460,32 +460,36 @@ declare module "node:test" {
460
460
  readonly assert: TestContextAssert;
461
461
  /**
462
462
  * This function is used to create a hook running before subtest of the current test.
463
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
463
+ * @param fn The hook function. The first argument to this function is a `TestContext` object.
464
+ * If the hook uses callbacks, the callback function is passed as the second argument.
464
465
  * @param options Configuration options for the hook.
465
- * @since v20.1.0
466
+ * @since v20.1.0, v18.17.0
466
467
  */
467
- before: typeof before;
468
+ before(fn?: TestContextHookFn, options?: HookOptions): void;
468
469
  /**
469
470
  * This function is used to create a hook running before each subtest of the current test.
470
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
471
+ * @param fn The hook function. The first argument to this function is a `TestContext` object.
472
+ * If the hook uses callbacks, the callback function is passed as the second argument.
471
473
  * @param options Configuration options for the hook.
472
474
  * @since v18.8.0
473
475
  */
474
- beforeEach: typeof beforeEach;
476
+ beforeEach(fn?: TestContextHookFn, options?: HookOptions): void;
475
477
  /**
476
478
  * This function is used to create a hook that runs after the current test finishes.
477
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
479
+ * @param fn The hook function. The first argument to this function is a `TestContext` object.
480
+ * If the hook uses callbacks, the callback function is passed as the second argument.
478
481
  * @param options Configuration options for the hook.
479
482
  * @since v18.13.0
480
483
  */
481
- after: typeof after;
484
+ after(fn?: TestContextHookFn, options?: HookOptions): void;
482
485
  /**
483
486
  * This function is used to create a hook running after each subtest of the current test.
484
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
487
+ * @param fn The hook function. The first argument to this function is a `TestContext` object.
488
+ * If the hook uses callbacks, the callback function is passed as the second argument.
485
489
  * @param options Configuration options for the hook.
486
490
  * @since v18.8.0
487
491
  */
488
- afterEach: typeof afterEach;
492
+ afterEach(fn?: TestContextHookFn, options?: HookOptions): void;
489
493
  /**
490
494
  * This function is used to write diagnostics to the output. Any diagnostic
491
495
  * information is included at the end of the test's results. This function does
@@ -629,6 +633,22 @@ declare module "node:test" {
629
633
  deepEqual: typeof import("node:assert").deepEqual;
630
634
  /**
631
635
  * Identical to the `deepStrictEqual` function from the `node:assert` module, but bound to the test context.
636
+ *
637
+ * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
638
+ * type annotation, otherwise an error will be raised by the TypeScript compiler:
639
+ * ```ts
640
+ * import { test, type TestContext } from 'node:test';
641
+ *
642
+ * // The test function's context parameter must have a type annotation.
643
+ * test('example', (t: TestContext) => {
644
+ * t.assert.deepStrictEqual(actual, expected);
645
+ * });
646
+ *
647
+ * // Omitting the type annotation will result in a compilation error.
648
+ * test('example', t => {
649
+ * t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
650
+ * });
651
+ * ```
632
652
  */
633
653
  deepStrictEqual: typeof import("node:assert").deepStrictEqual;
634
654
  /**
@@ -653,6 +673,22 @@ declare module "node:test" {
653
673
  fail: typeof import("node:assert").fail;
654
674
  /**
655
675
  * Identical to the `ifError` function from the `node:assert` module, but bound to the test context.
676
+ *
677
+ * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
678
+ * type annotation, otherwise an error will be raised by the TypeScript compiler:
679
+ * ```ts
680
+ * import { test, type TestContext } from 'node:test';
681
+ *
682
+ * // The test function's context parameter must have a type annotation.
683
+ * test('example', (t: TestContext) => {
684
+ * t.assert.ifError(err);
685
+ * });
686
+ *
687
+ * // Omitting the type annotation will result in a compilation error.
688
+ * test('example', t => {
689
+ * t.assert.ifError(err); // Error: 't' needs an explicit type annotation.
690
+ * });
691
+ * ```
656
692
  */
657
693
  ifError: typeof import("node:assert").ifError;
658
694
  /**
@@ -677,6 +713,22 @@ declare module "node:test" {
677
713
  notStrictEqual: typeof import("node:assert").notStrictEqual;
678
714
  /**
679
715
  * Identical to the `ok` function from the `node:assert` module, but bound to the test context.
716
+ *
717
+ * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
718
+ * type annotation, otherwise an error will be raised by the TypeScript compiler:
719
+ * ```ts
720
+ * import { test, type TestContext } from 'node:test';
721
+ *
722
+ * // The test function's context parameter must have a type annotation.
723
+ * test('example', (t: TestContext) => {
724
+ * t.assert.ok(condition);
725
+ * });
726
+ *
727
+ * // Omitting the type annotation will result in a compilation error.
728
+ * test('example', t => {
729
+ * t.assert.ok(condition)); // Error: 't' needs an explicit type annotation.
730
+ * });
731
+ * ```
680
732
  */
681
733
  ok: typeof import("node:assert").ok;
682
734
  /**
@@ -685,6 +737,22 @@ declare module "node:test" {
685
737
  rejects: typeof import("node:assert").rejects;
686
738
  /**
687
739
  * Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context.
740
+ *
741
+ * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
742
+ * type annotation, otherwise an error will be raised by the TypeScript compiler:
743
+ * ```ts
744
+ * import { test, type TestContext } from 'node:test';
745
+ *
746
+ * // The test function's context parameter must have a type annotation.
747
+ * test('example', (t: TestContext) => {
748
+ * t.assert.strictEqual(actual, expected);
749
+ * });
750
+ *
751
+ * // Omitting the type annotation will result in a compilation error.
752
+ * test('example', t => {
753
+ * t.assert.strictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
754
+ * });
755
+ * ```
688
756
  */
689
757
  strictEqual: typeof import("node:assert").strictEqual;
690
758
  /**
@@ -826,10 +894,15 @@ declare module "node:test" {
826
894
  */
827
895
  function afterEach(fn?: HookFn, options?: HookOptions): void;
828
896
  /**
829
- * The hook function. If the hook uses callbacks, the callback function is passed as the
830
- * second argument.
897
+ * The hook function. The first argument is the context in which the hook is called.
898
+ * If the hook uses callbacks, the callback function is passed as the second argument.
899
+ */
900
+ type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any;
901
+ /**
902
+ * The hook function. The first argument is a `TestContext` object.
903
+ * If the hook uses callbacks, the callback function is passed as the second argument.
831
904
  */
832
- type HookFn = (s: SuiteContext, done: (result?: any) => void) => any;
905
+ type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any;
833
906
  /**
834
907
  * Configuration options for hooks.
835
908
  * @since v18.8.0
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `timers/promises` API provides an alternative set of timer functions
3
- * that return `Promise` objects. The API is accessible via `require('node:timers/promises')`.
3
+ * that return `Promise` objects. The API is accessible via `import timersPromises from 'node:timers/promises'`.
4
4
  *
5
5
  * ```js
6
6
  * import {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `timer` module exposes a global API for scheduling functions to
3
3
  * be called at some future period of time. Because the timer functions are
4
- * globals, there is no need to call `require('node:timers')` to use the API.
4
+ * globals, there is no need to import `node:timers` to use the API.
5
5
  *
6
6
  * The timer functions within Node.js implement a similar API as the timers API
7
7
  * provided by Web Browsers but use a different internal implementation that is
@@ -4,7 +4,7 @@
4
4
  * The module can be accessed using:
5
5
  *
6
6
  * ```js
7
- * const tls = require('node:tls');
7
+ * import tls from 'node:tls';
8
8
  * ```
9
9
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/tls.js)
10
10
  */
@@ -1000,8 +1000,8 @@ declare module "tls" {
1000
1000
  * The following illustrates a simple echo server:
1001
1001
  *
1002
1002
  * ```js
1003
- * const tls = require('node:tls');
1004
- * const fs = require('node:fs');
1003
+ * import tls from 'node:tls';
1004
+ * import fs from 'node:fs';
1005
1005
  *
1006
1006
  * const options = {
1007
1007
  * key: fs.readFileSync('server-key.pem'),
@@ -1046,8 +1046,8 @@ declare module "tls" {
1046
1046
  *
1047
1047
  * ```js
1048
1048
  * // Assumes an echo server that is listening on port 8000.
1049
- * const tls = require('node:tls');
1050
- * const fs = require('node:fs');
1049
+ * import tls from 'node:tls';
1050
+ * import fs from 'node:fs';
1051
1051
  *
1052
1052
  * const options = {
1053
1053
  * // Necessary only if the server requires client certificate authentication.