cdk-common 2.0.1289 → 2.0.1291

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 (93) hide show
  1. package/.jsii +2 -2
  2. package/lib/main.js +1 -1
  3. package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
  4. package/node_modules/@types/concat-stream/node_modules/@types/node/assert/strict.d.ts +105 -2
  5. package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +119 -95
  6. package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +117 -7
  7. package/node_modules/@types/concat-stream/node_modules/@types/node/events.d.ts +79 -0
  8. package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +224 -0
  9. package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +28 -3
  10. package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +3 -3
  11. package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +2 -23
  12. package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +5 -0
  13. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/events.d.ts +3 -0
  14. package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +33 -47
  15. package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +6 -0
  16. package/node_modules/@types/concat-stream/node_modules/undici-types/agent.d.ts +0 -4
  17. package/node_modules/@types/concat-stream/node_modules/undici-types/client.d.ts +0 -2
  18. package/node_modules/@types/concat-stream/node_modules/undici-types/dispatcher.d.ts +0 -6
  19. package/node_modules/@types/concat-stream/node_modules/undici-types/h2c-client.d.ts +0 -2
  20. package/node_modules/@types/concat-stream/node_modules/undici-types/index.d.ts +3 -1
  21. package/node_modules/@types/concat-stream/node_modules/undici-types/mock-interceptor.d.ts +0 -1
  22. package/node_modules/@types/concat-stream/node_modules/undici-types/package.json +1 -1
  23. package/node_modules/@types/concat-stream/node_modules/undici-types/snapshot-agent.d.ts +107 -0
  24. package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
  25. package/node_modules/@types/form-data/node_modules/@types/node/assert/strict.d.ts +105 -2
  26. package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +119 -95
  27. package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +117 -7
  28. package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +79 -0
  29. package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +224 -0
  30. package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +28 -3
  31. package/node_modules/@types/form-data/node_modules/@types/node/package.json +3 -3
  32. package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +2 -23
  33. package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +5 -0
  34. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/events.d.ts +3 -0
  35. package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +33 -47
  36. package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +6 -0
  37. package/node_modules/@types/form-data/node_modules/undici-types/agent.d.ts +0 -4
  38. package/node_modules/@types/form-data/node_modules/undici-types/client.d.ts +0 -2
  39. package/node_modules/@types/form-data/node_modules/undici-types/dispatcher.d.ts +0 -6
  40. package/node_modules/@types/form-data/node_modules/undici-types/h2c-client.d.ts +0 -2
  41. package/node_modules/@types/form-data/node_modules/undici-types/index.d.ts +3 -1
  42. package/node_modules/@types/form-data/node_modules/undici-types/mock-interceptor.d.ts +0 -1
  43. package/node_modules/@types/form-data/node_modules/undici-types/package.json +1 -1
  44. package/node_modules/@types/form-data/node_modules/undici-types/snapshot-agent.d.ts +107 -0
  45. package/node_modules/async-function/.eslintrc +16 -0
  46. package/node_modules/async-function/.github/FUNDING.yml +12 -0
  47. package/node_modules/async-function/.nycrc +9 -0
  48. package/node_modules/async-function/CHANGELOG.md +16 -0
  49. package/node_modules/async-function/LICENSE +21 -0
  50. package/node_modules/async-function/README.md +51 -0
  51. package/node_modules/async-function/index.d.mts +3 -0
  52. package/node_modules/async-function/index.d.ts +13 -0
  53. package/node_modules/async-function/index.js +8 -0
  54. package/node_modules/async-function/index.mjs +4 -0
  55. package/node_modules/async-function/legacy.js +18 -0
  56. package/node_modules/async-function/package.json +86 -0
  57. package/node_modules/async-function/require.mjs +5 -0
  58. package/node_modules/async-function/test/index.js +40 -0
  59. package/node_modules/async-function/tsconfig.json +9 -0
  60. package/node_modules/async-generator-function/.eslintrc +26 -0
  61. package/node_modules/async-generator-function/.github/FUNDING.yml +12 -0
  62. package/node_modules/async-generator-function/.nycrc +9 -0
  63. package/node_modules/async-generator-function/CHANGELOG.md +15 -0
  64. package/node_modules/async-generator-function/LICENSE +21 -0
  65. package/node_modules/async-generator-function/README.md +52 -0
  66. package/node_modules/async-generator-function/index.d.mts +3 -0
  67. package/node_modules/async-generator-function/index.d.ts +22 -0
  68. package/node_modules/async-generator-function/index.js +8 -0
  69. package/node_modules/async-generator-function/index.mjs +4 -0
  70. package/node_modules/async-generator-function/legacy.js +18 -0
  71. package/node_modules/async-generator-function/package.json +87 -0
  72. package/node_modules/async-generator-function/require.mjs +5 -0
  73. package/node_modules/async-generator-function/test/index.js +40 -0
  74. package/node_modules/async-generator-function/tsconfig.json +9 -0
  75. package/node_modules/generator-function/.eslintrc +16 -0
  76. package/node_modules/generator-function/.github/FUNDING.yml +12 -0
  77. package/node_modules/generator-function/.nycrc +9 -0
  78. package/node_modules/generator-function/CHANGELOG.md +21 -0
  79. package/node_modules/generator-function/LICENSE.md +7 -0
  80. package/node_modules/generator-function/README.md +51 -0
  81. package/node_modules/generator-function/index.d.mts +3 -0
  82. package/node_modules/generator-function/index.d.ts +3 -0
  83. package/node_modules/generator-function/index.js +8 -0
  84. package/node_modules/generator-function/index.mjs +4 -0
  85. package/node_modules/generator-function/legacy.js +18 -0
  86. package/node_modules/generator-function/package.json +88 -0
  87. package/node_modules/generator-function/require.mjs +5 -0
  88. package/node_modules/generator-function/test/index.js +42 -0
  89. package/node_modules/generator-function/tsconfig.json +9 -0
  90. package/node_modules/get-intrinsic/CHANGELOG.md +7 -0
  91. package/node_modules/get-intrinsic/index.js +8 -13
  92. package/node_modules/get-intrinsic/package.json +7 -4
  93. package/package.json +3 -3
@@ -584,6 +584,85 @@ declare module "events" {
584
584
  */
585
585
  readonly asyncResource: EventEmitterReferencingAsyncResource;
586
586
  }
587
+ /**
588
+ * The `NodeEventTarget` is a Node.js-specific extension to `EventTarget`
589
+ * that emulates a subset of the `EventEmitter` API.
590
+ * @since v14.5.0
591
+ */
592
+ export interface NodeEventTarget extends EventTarget {
593
+ /**
594
+ * Node.js-specific extension to the `EventTarget` class that emulates the
595
+ * equivalent `EventEmitter` API. The only difference between `addListener()` and
596
+ * `addEventListener()` is that `addListener()` will return a reference to the
597
+ * `EventTarget`.
598
+ * @since v14.5.0
599
+ */
600
+ addListener(type: string, listener: (arg: any) => void): this;
601
+ /**
602
+ * Node.js-specific extension to the `EventTarget` class that dispatches the
603
+ * `arg` to the list of handlers for `type`.
604
+ * @since v15.2.0
605
+ * @returns `true` if event listeners registered for the `type` exist,
606
+ * otherwise `false`.
607
+ */
608
+ emit(type: string, arg: any): boolean;
609
+ /**
610
+ * Node.js-specific extension to the `EventTarget` class that returns an array
611
+ * of event `type` names for which event listeners are registered.
612
+ * @since 14.5.0
613
+ */
614
+ eventNames(): string[];
615
+ /**
616
+ * Node.js-specific extension to the `EventTarget` class that returns the number
617
+ * of event listeners registered for the `type`.
618
+ * @since v14.5.0
619
+ */
620
+ listenerCount(type: string): number;
621
+ /**
622
+ * Node.js-specific extension to the `EventTarget` class that sets the number
623
+ * of max event listeners as `n`.
624
+ * @since v14.5.0
625
+ */
626
+ setMaxListeners(n: number): void;
627
+ /**
628
+ * Node.js-specific extension to the `EventTarget` class that returns the number
629
+ * of max event listeners.
630
+ * @since v14.5.0
631
+ */
632
+ getMaxListeners(): number;
633
+ /**
634
+ * Node.js-specific alias for `eventTarget.removeEventListener()`.
635
+ * @since v14.5.0
636
+ */
637
+ off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
638
+ /**
639
+ * Node.js-specific alias for `eventTarget.addEventListener()`.
640
+ * @since v14.5.0
641
+ */
642
+ on(type: string, listener: (arg: any) => void): this;
643
+ /**
644
+ * Node.js-specific extension to the `EventTarget` class that adds a `once`
645
+ * listener for the given event `type`. This is equivalent to calling `on`
646
+ * with the `once` option set to `true`.
647
+ * @since v14.5.0
648
+ */
649
+ once(type: string, listener: (arg: any) => void): this;
650
+ /**
651
+ * Node.js-specific extension to the `EventTarget` class. If `type` is specified,
652
+ * removes all registered listeners for `type`, otherwise removes all registered
653
+ * listeners.
654
+ * @since v14.5.0
655
+ */
656
+ removeAllListeners(type?: string): this;
657
+ /**
658
+ * Node.js-specific extension to the `EventTarget` class that removes the
659
+ * `listener` for the given `type`. The only difference between `removeListener()`
660
+ * and `removeEventListener()` is that `removeListener()` will return a reference
661
+ * to the `EventTarget`.
662
+ * @since v14.5.0
663
+ */
664
+ removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
665
+ }
587
666
  }
588
667
  global {
589
668
  namespace NodeJS {
@@ -450,6 +450,230 @@ declare module "fs" {
450
450
  prependListener<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
451
451
  prependOnceListener<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
452
452
  }
453
+ export interface Utf8StreamOptions {
454
+ /**
455
+ * Appends writes to dest file instead of truncating it.
456
+ * @default true
457
+ */
458
+ append?: boolean | undefined;
459
+ /**
460
+ * Which type of data you can send to the write
461
+ * function, supported values are `'utf8'` or `'buffer'`.
462
+ * @default 'utf8'
463
+ */
464
+ contentMode?: "utf8" | "buffer" | undefined;
465
+ /**
466
+ * A path to a file to be written to (mode controlled by the
467
+ * append option).
468
+ */
469
+ dest?: string | undefined;
470
+ /**
471
+ * A file descriptor, something that is returned by `fs.open()`
472
+ * or `fs.openSync()`.
473
+ */
474
+ fd?: number | undefined;
475
+ /**
476
+ * An object that has the same API as the `fs` module, useful
477
+ * for mocking, testing, or customizing the behavior of the stream.
478
+ */
479
+ fs?: object | undefined;
480
+ /**
481
+ * Perform a `fs.fsyncSync()` every time a write is
482
+ * completed.
483
+ */
484
+ fsync?: boolean | undefined;
485
+ /**
486
+ * The maximum length of the internal buffer. If a write
487
+ * operation would cause the buffer to exceed `maxLength`, the data written is
488
+ * dropped and a drop event is emitted with the dropped data
489
+ */
490
+ maxLength?: number | undefined;
491
+ /**
492
+ * The maximum number of bytes that can be written;
493
+ * @default 16384
494
+ */
495
+ maxWrite?: number | undefined;
496
+ /**
497
+ * The minimum length of the internal buffer that is
498
+ * required to be full before flushing.
499
+ */
500
+ minLength?: number | undefined;
501
+ /**
502
+ * Ensure directory for `dest` file exists when true.
503
+ * @default false
504
+ */
505
+ mkdir?: boolean | undefined;
506
+ /**
507
+ * Specify the creating file mode (see `fs.open()`).
508
+ */
509
+ mode?: number | string | undefined;
510
+ /**
511
+ * Calls flush every `periodicFlush` milliseconds.
512
+ */
513
+ periodicFlush?: number | undefined;
514
+ /**
515
+ * A function that will be called when `write()`,
516
+ * `writeSync()`, or `flushSync()` encounters an `EAGAIN` or `EBUSY` error.
517
+ * If the return value is `true` the operation will be retried, otherwise it
518
+ * will bubble the error. The `err` is the error that caused this function to
519
+ * be called, `writeBufferLen` is the length of the buffer that was written,
520
+ * and `remainingBufferLen` is the length of the remaining buffer that the
521
+ * stream did not try to write.
522
+ */
523
+ retryEAGAIN?: ((err: Error | null, writeBufferLen: number, remainingBufferLen: number) => boolean) | undefined;
524
+ /**
525
+ * Perform writes synchronously.
526
+ */
527
+ sync?: boolean | undefined;
528
+ }
529
+ /**
530
+ * An optimized UTF-8 stream writer that allows for flushing all the internal
531
+ * buffering on demand. It handles `EAGAIN` errors correctly, allowing for
532
+ * customization, for example, by dropping content if the disk is busy.
533
+ * @since v24.6.0
534
+ * @experimental
535
+ */
536
+ export class Utf8Stream extends EventEmitter {
537
+ constructor(options: Utf8StreamOptions);
538
+ /**
539
+ * Whether the stream is appending to the file or truncating it.
540
+ */
541
+ readonly append: boolean;
542
+ /**
543
+ * The type of data that can be written to the stream. Supported
544
+ * values are `'utf8'` or `'buffer'`.
545
+ * @default 'utf8'
546
+ */
547
+ readonly contentMode: "utf8" | "buffer";
548
+ /**
549
+ * Close the stream immediately, without flushing the internal buffer.
550
+ */
551
+ destroy(): void;
552
+ /**
553
+ * Close the stream gracefully, flushing the internal buffer before closing.
554
+ */
555
+ end(): void;
556
+ /**
557
+ * The file descriptor that is being written to.
558
+ */
559
+ readonly fd: number;
560
+ /**
561
+ * The file that is being written to.
562
+ */
563
+ readonly file: string;
564
+ /**
565
+ * Writes the current buffer to the file if a write was not in progress. Do
566
+ * nothing if `minLength` is zero or if it is already writing.
567
+ */
568
+ flush(callback: (err: Error | null) => void): void;
569
+ /**
570
+ * Flushes the buffered data synchronously. This is a costly operation.
571
+ */
572
+ flushSync(): void;
573
+ /**
574
+ * Whether the stream is performing a `fs.fsyncSync()` after every
575
+ * write operation.
576
+ */
577
+ readonly fsync: boolean;
578
+ /**
579
+ * The maximum length of the internal buffer. If a write
580
+ * operation would cause the buffer to exceed `maxLength`, the data written is
581
+ * dropped and a drop event is emitted with the dropped data.
582
+ */
583
+ readonly maxLength: number;
584
+ /**
585
+ * The minimum length of the internal buffer that is required to be
586
+ * full before flushing.
587
+ */
588
+ readonly minLength: number;
589
+ /**
590
+ * Whether the stream should ensure that the directory for the
591
+ * `dest` file exists. If `true`, it will create the directory if it does not
592
+ * exist.
593
+ * @default false
594
+ */
595
+ readonly mkdir: boolean;
596
+ /**
597
+ * The mode of the file that is being written to.
598
+ */
599
+ readonly mode: number | string;
600
+ /**
601
+ * The number of milliseconds between flushes. If set to `0`, no
602
+ * periodic flushes will be performed.
603
+ */
604
+ readonly periodicFlush: number;
605
+ /**
606
+ * Reopen the file in place, useful for log rotation.
607
+ * @param file A path to a file to be written to (mode
608
+ * controlled by the append option).
609
+ */
610
+ reopen(file: PathLike): void;
611
+ /**
612
+ * Whether the stream is writing synchronously or asynchronously.
613
+ */
614
+ readonly sync: boolean;
615
+ /**
616
+ * When the `options.contentMode` is set to `'utf8'` when the stream is created,
617
+ * the `data` argument must be a string. If the `contentMode` is set to `'buffer'`,
618
+ * the `data` argument must be a `Buffer`.
619
+ * @param data The data to write.
620
+ */
621
+ write(data: string | Buffer): boolean;
622
+ /**
623
+ * Whether the stream is currently writing data to the file.
624
+ */
625
+ readonly writing: boolean;
626
+ /**
627
+ * Calls `utf8Stream.destroy()`.
628
+ */
629
+ [Symbol.dispose](): void;
630
+ /**
631
+ * events.EventEmitter
632
+ * 1. change
633
+ * 2. close
634
+ * 3. error
635
+ */
636
+ addListener(event: "close", listener: () => void): this;
637
+ addListener(event: "drain", listener: () => void): this;
638
+ addListener(event: "drop", listener: (data: string | Buffer) => void): this;
639
+ addListener(event: "error", listener: (error: Error) => void): this;
640
+ addListener(event: "finish", listener: () => void): this;
641
+ addListener(event: "ready", listener: () => void): this;
642
+ addListener(event: "write", listener: (n: number) => void): this;
643
+ addListener(event: string, listener: (...args: any[]) => void): this;
644
+ on(event: "close", listener: () => void): this;
645
+ on(event: "drain", listener: () => void): this;
646
+ on(event: "drop", listener: (data: string | Buffer) => void): this;
647
+ on(event: "error", listener: (error: Error) => void): this;
648
+ on(event: "finish", listener: () => void): this;
649
+ on(event: "ready", listener: () => void): this;
650
+ on(event: "write", listener: (n: number) => void): this;
651
+ on(event: string, listener: (...args: any[]) => void): this;
652
+ once(event: "close", listener: () => void): this;
653
+ once(event: "drain", listener: () => void): this;
654
+ once(event: "drop", listener: (data: string | Buffer) => void): this;
655
+ once(event: "error", listener: (error: Error) => void): this;
656
+ once(event: "finish", listener: () => void): this;
657
+ once(event: "ready", listener: () => void): this;
658
+ once(event: "write", listener: (n: number) => void): this;
659
+ once(event: string, listener: (...args: any[]) => void): this;
660
+ prependListener(event: "close", listener: () => void): this;
661
+ prependListener(event: "drain", listener: () => void): this;
662
+ prependListener(event: "drop", listener: (data: string | Buffer) => void): this;
663
+ prependListener(event: "error", listener: (error: Error) => void): this;
664
+ prependListener(event: "finish", listener: () => void): this;
665
+ prependListener(event: "ready", listener: () => void): this;
666
+ prependListener(event: "write", listener: (n: number) => void): this;
667
+ prependListener(event: string, listener: (...args: any[]) => void): this;
668
+ prependOnceListener(event: "close", listener: () => void): this;
669
+ prependOnceListener(event: "drain", listener: () => void): this;
670
+ prependOnceListener(event: "drop", listener: (data: string | Buffer) => void): this;
671
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
672
+ prependOnceListener(event: "finish", listener: () => void): this;
673
+ prependOnceListener(event: "ready", listener: () => void): this;
674
+ prependOnceListener(event: "write", listener: (n: number) => void): this;
675
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
676
+ }
453
677
 
454
678
  /**
455
679
  * The Keys are events of the ReadStream and the values are the functions that are called when the event is emitted.
@@ -269,6 +269,13 @@ declare module "http" {
269
269
  * @since v18.0.0
270
270
  */
271
271
  keepAliveTimeout?: number | undefined;
272
+ /**
273
+ * An additional buffer time added to the
274
+ * `server.keepAliveTimeout` to extend the internal socket timeout.
275
+ * @since 24.6.0
276
+ * @default 1000
277
+ */
278
+ keepAliveTimeoutBuffer?: number | undefined;
272
279
  /**
273
280
  * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.
274
281
  * @default 30000
@@ -413,12 +420,18 @@ declare module "http" {
413
420
  /**
414
421
  * The number of milliseconds of inactivity a server needs to wait for additional
415
422
  * incoming data, after it has finished writing the last response, before a socket
416
- * will be destroyed. If the server receives new data before the keep-alive
417
- * timeout has fired, it will reset the regular inactivity timeout, i.e., `server.timeout`.
423
+ * will be destroyed.
424
+ *
425
+ * This timeout value is combined with the
426
+ * `server.keepAliveTimeoutBuffer` option to determine the actual socket
427
+ * timeout, calculated as:
428
+ * socketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer
429
+ * If the server receives new data before the keep-alive timeout has fired, it
430
+ * will reset the regular inactivity timeout, i.e., `server.timeout`.
418
431
  *
419
432
  * A value of `0` will disable the keep-alive timeout behavior on incoming
420
433
  * connections.
421
- * A value of `0` makes the http server behave similarly to Node.js versions prior
434
+ * A value of `0` makes the HTTP server behave similarly to Node.js versions prior
422
435
  * to 8.0.0, which did not have a keep-alive timeout.
423
436
  *
424
437
  * The socket timeout logic is set up on connection, so changing this value only
@@ -426,6 +439,18 @@ declare module "http" {
426
439
  * @since v8.0.0
427
440
  */
428
441
  keepAliveTimeout: number;
442
+ /**
443
+ * An additional buffer time added to the
444
+ * `server.keepAliveTimeout` to extend the internal socket timeout.
445
+ *
446
+ * This buffer helps reduce connection reset (`ECONNRESET`) errors by increasing
447
+ * the socket timeout slightly beyond the advertised keep-alive timeout.
448
+ *
449
+ * This option applies only to new incoming connections.
450
+ * @since v24.6.0
451
+ * @default 1000
452
+ */
453
+ keepAliveTimeoutBuffer: number;
429
454
  /**
430
455
  * Sets the timeout value in milliseconds for receiving the entire request from
431
456
  * the client.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "24.5.2",
3
+ "version": "24.6.0",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -147,9 +147,9 @@
147
147
  },
148
148
  "scripts": {},
149
149
  "dependencies": {
150
- "undici-types": "~7.12.0"
150
+ "undici-types": "~7.13.0"
151
151
  },
152
152
  "peerDependencies": {},
153
- "typesPublisherContentHash": "5df6870a3de1de1f3716802276fe0c64c2b3a2903d725578b50f533f42cfea46",
153
+ "typesPublisherContentHash": "c6b8073e736969ffdeaa3a20924802bc140d9c3e2953bb101d6da23c9409708b",
154
154
  "typeScriptVersion": "5.2"
155
155
  }
@@ -79,6 +79,7 @@
79
79
  * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/test.js)
80
80
  */
81
81
  declare module "node:test" {
82
+ import { AssertMethodNames } from "node:assert";
82
83
  import { Readable } from "node:stream";
83
84
  import TestFn = test.TestFn;
84
85
  import TestOptions = test.TestOptions;
@@ -1171,29 +1172,7 @@ declare module "node:test" {
1171
1172
  */
1172
1173
  readonly mock: MockTracker;
1173
1174
  }
1174
- interface TestContextAssert extends
1175
- Pick<
1176
- typeof import("assert"),
1177
- | "deepEqual"
1178
- | "deepStrictEqual"
1179
- | "doesNotMatch"
1180
- | "doesNotReject"
1181
- | "doesNotThrow"
1182
- | "equal"
1183
- | "fail"
1184
- | "ifError"
1185
- | "match"
1186
- | "notDeepEqual"
1187
- | "notDeepStrictEqual"
1188
- | "notEqual"
1189
- | "notStrictEqual"
1190
- | "ok"
1191
- | "partialDeepStrictEqual"
1192
- | "rejects"
1193
- | "strictEqual"
1194
- | "throws"
1195
- >
1196
- {
1175
+ interface TestContextAssert extends Pick<typeof import("assert"), AssertMethodNames> {
1197
1176
  /**
1198
1177
  * This function serializes `value` and writes it to the file specified by `path`.
1199
1178
  *
@@ -338,6 +338,11 @@ declare module "util" {
338
338
  * @since v9.7.0
339
339
  */
340
340
  export function getSystemErrorName(err: number): string;
341
+ /**
342
+ * Enable or disable printing a stack trace on `SIGINT`. The API is only available on the main thread.
343
+ * @since 24.6.0
344
+ */
345
+ export function setTraceSigInt(enable: boolean): void;
341
346
  /**
342
347
  * Returns a Map of all system error codes available from the Node.js API.
343
348
  * The mapping between error codes and error names is platform-dependent.
@@ -51,6 +51,7 @@ interface EventListenerObject {
51
51
  handleEvent(object: Event): void;
52
52
  }
53
53
 
54
+ type _EventListenerOptions = typeof globalThis extends { onmessage: any } ? {} : EventListenerOptions;
54
55
  interface EventListenerOptions {
55
56
  capture?: boolean;
56
57
  }
@@ -85,6 +86,8 @@ declare global {
85
86
  new(type: string, eventInitDict?: EventInit): Event;
86
87
  };
87
88
 
89
+ interface EventListenerOptions extends _EventListenerOptions {}
90
+
88
91
  interface EventTarget extends _EventTarget {}
89
92
  var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
90
93
  : {
@@ -56,7 +56,7 @@
56
56
  */
57
57
  declare module "worker_threads" {
58
58
  import { Context } from "node:vm";
59
- import { EventEmitter } from "node:events";
59
+ import { EventEmitter, NodeEventTarget } from "node:events";
60
60
  import { EventLoopUtilityFunction } from "node:perf_hooks";
61
61
  import { FileHandle } from "node:fs/promises";
62
62
  import { Readable, Writable } from "node:stream";
@@ -70,6 +70,7 @@ declare module "worker_threads" {
70
70
  const resourceLimits: ResourceLimits;
71
71
  const SHARE_ENV: unique symbol;
72
72
  const threadId: number;
73
+ const threadName: string | null;
73
74
  const workerData: any;
74
75
  /**
75
76
  * Instances of the `worker.MessageChannel` class represent an asynchronous,
@@ -112,7 +113,7 @@ declare module "worker_threads" {
112
113
  * This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
113
114
  * @since v10.5.0
114
115
  */
115
- class MessagePort extends EventEmitter {
116
+ class MessagePort extends EventTarget {
116
117
  /**
117
118
  * Disables further sending of messages on either side of the connection.
118
119
  * This method can be called when no further communication will happen over this `MessagePort`.
@@ -225,42 +226,32 @@ declare module "worker_threads" {
225
226
  * @since v10.5.0
226
227
  */
227
228
  start(): void;
228
- addListener(event: "close", listener: () => void): this;
229
+ addListener(event: "close", listener: (ev: Event) => void): this;
229
230
  addListener(event: "message", listener: (value: any) => void): this;
230
231
  addListener(event: "messageerror", listener: (error: Error) => void): this;
231
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
232
- emit(event: "close"): boolean;
232
+ addListener(event: string, listener: (arg: any) => void): this;
233
+ emit(event: "close", ev: Event): boolean;
233
234
  emit(event: "message", value: any): boolean;
234
235
  emit(event: "messageerror", error: Error): boolean;
235
- emit(event: string | symbol, ...args: any[]): boolean;
236
- on(event: "close", listener: () => void): this;
236
+ emit(event: string, arg: any): boolean;
237
+ off(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this;
238
+ off(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this;
239
+ off(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this;
240
+ off(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
241
+ on(event: "close", listener: (ev: Event) => void): this;
237
242
  on(event: "message", listener: (value: any) => void): this;
238
243
  on(event: "messageerror", listener: (error: Error) => void): this;
239
- on(event: string | symbol, listener: (...args: any[]) => void): this;
240
- once(event: "close", listener: () => void): this;
244
+ on(event: string, listener: (arg: any) => void): this;
245
+ once(event: "close", listener: (ev: Event) => void): this;
241
246
  once(event: "message", listener: (value: any) => void): this;
242
247
  once(event: "messageerror", listener: (error: Error) => void): this;
243
- once(event: string | symbol, listener: (...args: any[]) => void): this;
244
- prependListener(event: "close", listener: () => void): this;
245
- prependListener(event: "message", listener: (value: any) => void): this;
246
- prependListener(event: "messageerror", listener: (error: Error) => void): this;
247
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
248
- prependOnceListener(event: "close", listener: () => void): this;
249
- prependOnceListener(event: "message", listener: (value: any) => void): this;
250
- prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
251
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
252
- removeListener(event: "close", listener: () => void): this;
253
- removeListener(event: "message", listener: (value: any) => void): this;
254
- removeListener(event: "messageerror", listener: (error: Error) => void): this;
255
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
256
- off(event: "close", listener: () => void): this;
257
- off(event: "message", listener: (value: any) => void): this;
258
- off(event: "messageerror", listener: (error: Error) => void): this;
259
- off(event: string | symbol, listener: (...args: any[]) => void): this;
260
- addEventListener: EventTarget["addEventListener"];
261
- dispatchEvent: EventTarget["dispatchEvent"];
262
- removeEventListener: EventTarget["removeEventListener"];
248
+ once(event: string, listener: (arg: any) => void): this;
249
+ removeListener(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this;
250
+ removeListener(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this;
251
+ removeListener(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this;
252
+ removeListener(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
263
253
  }
254
+ interface MessagePort extends NodeEventTarget {}
264
255
  interface WorkerOptions {
265
256
  /**
266
257
  * List of arguments which would be stringified and appended to
@@ -402,6 +393,12 @@ declare module "worker_threads" {
402
393
  * @since v10.5.0
403
394
  */
404
395
  readonly threadId: number;
396
+ /**
397
+ * A string identifier for the referenced thread or null if the thread is not running.
398
+ * Inside the worker thread, it is available as `require('node:worker_threads').threadName`.
399
+ * @since v24.6.0
400
+ */
401
+ readonly threadName: string | null;
405
402
  /**
406
403
  * Provides the set of JS engine resource constraints for this Worker thread.
407
404
  * If the `resourceLimits` option was passed to the `Worker` constructor,
@@ -429,24 +426,6 @@ declare module "worker_threads" {
429
426
  * @since v10.5.0
430
427
  */
431
428
  postMessage(value: any, transferList?: readonly Transferable[]): void;
432
- /**
433
- * Sends a value to another worker, identified by its thread ID.
434
- * @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
435
- * If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.
436
- * @param value The value to send.
437
- * @param transferList If one or more `MessagePort`-like objects are passed in value, a `transferList` is required for those items
438
- * or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.
439
- * @param timeout Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever.
440
- * If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.
441
- * @since v22.5.0
442
- */
443
- postMessageToThread(threadId: number, value: any, timeout?: number): Promise<void>;
444
- postMessageToThread(
445
- threadId: number,
446
- value: any,
447
- transferList: readonly Transferable[],
448
- timeout?: number,
449
- ): Promise<void>;
450
429
  /**
451
430
  * Opposite of `unref()`, calling `ref()` on a previously `unref()`ed worker does _not_ let the program exit if it's the only active handle left (the default
452
431
  * behavior). If the worker is `ref()`ed, calling `ref()` again has
@@ -466,6 +445,13 @@ declare module "worker_threads" {
466
445
  * @since v10.5.0
467
446
  */
468
447
  terminate(): Promise<number>;
448
+ /**
449
+ * This method returns a `Promise` that will resolve to an object identical to `process.threadCpuUsage()`,
450
+ * or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
451
+ * This methods allows the statistics to be observed from outside the actual thread.
452
+ * @since v24.6.0
453
+ */
454
+ cpuUsage(prev?: NodeJS.CpuUsage): Promise<NodeJS.CpuUsage>;
469
455
  /**
470
456
  * Returns a readable stream for a V8 snapshot of the current state of the Worker.
471
457
  * See `v8.getHeapSnapshot()` for more details.
@@ -180,6 +180,12 @@ declare module "zlib" {
180
180
  * If `true`, returns an object with `buffer` and `engine`.
181
181
  */
182
182
  info?: boolean | undefined;
183
+ /**
184
+ * Optional dictionary used to improve compression efficiency when compressing or decompressing data that
185
+ * shares common patterns with the dictionary.
186
+ * @since v24.6.0
187
+ */
188
+ dictionary?: NodeJS.ArrayBufferView | undefined;
183
189
  }
184
190
  interface Zlib {
185
191
  readonly bytesWritten: number;
@@ -22,14 +22,10 @@ declare namespace Agent {
22
22
  export interface Options extends Pool.Options {
23
23
  /** Default: `(origin, opts) => new Pool(origin, opts)`. */
24
24
  factory?(origin: string | URL, opts: Object): Dispatcher;
25
- /** Integer. Default: `0` */
26
- maxRedirections?: number;
27
25
 
28
26
  interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
29
27
  }
30
28
 
31
29
  export interface DispatchOptions extends Dispatcher.DispatchOptions {
32
- /** Integer. */
33
- maxRedirections?: number;
34
30
  }
35
31
  }
@@ -71,8 +71,6 @@ export declare namespace Client {
71
71
  /** TODO */
72
72
  maxCachedSessions?: number;
73
73
  /** TODO */
74
- maxRedirections?: number;
75
- /** TODO */
76
74
  connect?: Partial<buildConnector.BuildOptions> | buildConnector.connector;
77
75
  /** TODO */
78
76
  maxRequestsPerClient?: number;
@@ -135,8 +135,6 @@ declare namespace Dispatcher {
135
135
  signal?: AbortSignal | EventEmitter | null;
136
136
  /** This argument parameter is passed through to `ConnectData` */
137
137
  opaque?: TOpaque;
138
- /** Default: 0 */
139
- maxRedirections?: number;
140
138
  /** Default: false */
141
139
  redirectionLimitReached?: boolean;
142
140
  /** Default: `null` */
@@ -147,8 +145,6 @@ declare namespace Dispatcher {
147
145
  opaque?: TOpaque;
148
146
  /** Default: `null` */
149
147
  signal?: AbortSignal | EventEmitter | null;
150
- /** Default: 0 */
151
- maxRedirections?: number;
152
148
  /** Default: false */
153
149
  redirectionLimitReached?: boolean;
154
150
  /** Default: `null` */
@@ -172,8 +168,6 @@ declare namespace Dispatcher {
172
168
  protocol?: string;
173
169
  /** Default: `null` */
174
170
  signal?: AbortSignal | EventEmitter | null;
175
- /** Default: 0 */
176
- maxRedirections?: number;
177
171
  /** Default: false */
178
172
  redirectionLimitReached?: boolean;
179
173
  /** Default: `null` */