cdk-common 2.0.1290 → 2.0.1292
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +2 -2
- package/lib/main.js +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +119 -95
- package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +117 -7
- package/node_modules/@types/concat-stream/node_modules/@types/node/events.d.ts +79 -33
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +224 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +28 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +2 -23
- package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +5 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/events.d.ts +3 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +33 -47
- package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +6 -0
- package/node_modules/@types/concat-stream/node_modules/undici-types/agent.d.ts +0 -4
- package/node_modules/@types/concat-stream/node_modules/undici-types/client.d.ts +0 -2
- package/node_modules/@types/concat-stream/node_modules/undici-types/dispatcher.d.ts +0 -6
- package/node_modules/@types/concat-stream/node_modules/undici-types/h2c-client.d.ts +0 -2
- package/node_modules/@types/concat-stream/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/@types/concat-stream/node_modules/undici-types/mock-interceptor.d.ts +0 -1
- package/node_modules/@types/concat-stream/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/concat-stream/node_modules/undici-types/snapshot-agent.d.ts +107 -0
- package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +119 -95
- package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +117 -7
- package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +79 -33
- package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +224 -0
- package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +28 -3
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +2 -23
- package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +5 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/events.d.ts +3 -0
- package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +33 -47
- package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +6 -0
- package/node_modules/@types/form-data/node_modules/undici-types/agent.d.ts +0 -4
- package/node_modules/@types/form-data/node_modules/undici-types/client.d.ts +0 -2
- package/node_modules/@types/form-data/node_modules/undici-types/dispatcher.d.ts +0 -6
- package/node_modules/@types/form-data/node_modules/undici-types/h2c-client.d.ts +0 -2
- package/node_modules/@types/form-data/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/@types/form-data/node_modules/undici-types/mock-interceptor.d.ts +0 -1
- package/node_modules/@types/form-data/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/form-data/node_modules/undici-types/snapshot-agent.d.ts +107 -0
- package/package.json +4 -4
|
@@ -36,39 +36,6 @@
|
|
|
36
36
|
*/
|
|
37
37
|
declare module "events" {
|
|
38
38
|
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
|
39
|
-
// NOTE: This class is in the docs but is **not actually exported** by Node.
|
|
40
|
-
// If https://github.com/nodejs/node/issues/39903 gets resolved and Node
|
|
41
|
-
// actually starts exporting the class, uncomment below.
|
|
42
|
-
// import { EventListener, EventListenerObject } from '__dom-events';
|
|
43
|
-
// /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */
|
|
44
|
-
// interface NodeEventTarget extends EventTarget {
|
|
45
|
-
// /**
|
|
46
|
-
// * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API.
|
|
47
|
-
// * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget.
|
|
48
|
-
// */
|
|
49
|
-
// addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
|
|
50
|
-
// /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */
|
|
51
|
-
// eventNames(): string[];
|
|
52
|
-
// /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */
|
|
53
|
-
// listenerCount(type: string): number;
|
|
54
|
-
// /** Node.js-specific alias for `eventTarget.removeListener()`. */
|
|
55
|
-
// off(type: string, listener: EventListener | EventListenerObject): this;
|
|
56
|
-
// /** Node.js-specific alias for `eventTarget.addListener()`. */
|
|
57
|
-
// on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
|
|
58
|
-
// /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */
|
|
59
|
-
// once(type: string, listener: EventListener | EventListenerObject): this;
|
|
60
|
-
// /**
|
|
61
|
-
// * Node.js-specific extension to the `EventTarget` class.
|
|
62
|
-
// * If `type` is specified, removes all registered listeners for `type`,
|
|
63
|
-
// * otherwise removes all registered listeners.
|
|
64
|
-
// */
|
|
65
|
-
// removeAllListeners(type: string): this;
|
|
66
|
-
// /**
|
|
67
|
-
// * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`.
|
|
68
|
-
// * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`.
|
|
69
|
-
// */
|
|
70
|
-
// removeListener(type: string, listener: EventListener | EventListenerObject): this;
|
|
71
|
-
// }
|
|
72
39
|
interface EventEmitterOptions {
|
|
73
40
|
/**
|
|
74
41
|
* Enables automatic capturing of promise rejection.
|
|
@@ -584,6 +551,85 @@ declare module "events" {
|
|
|
584
551
|
*/
|
|
585
552
|
readonly asyncResource: EventEmitterReferencingAsyncResource;
|
|
586
553
|
}
|
|
554
|
+
/**
|
|
555
|
+
* The `NodeEventTarget` is a Node.js-specific extension to `EventTarget`
|
|
556
|
+
* that emulates a subset of the `EventEmitter` API.
|
|
557
|
+
* @since v14.5.0
|
|
558
|
+
*/
|
|
559
|
+
export interface NodeEventTarget extends EventTarget {
|
|
560
|
+
/**
|
|
561
|
+
* Node.js-specific extension to the `EventTarget` class that emulates the
|
|
562
|
+
* equivalent `EventEmitter` API. The only difference between `addListener()` and
|
|
563
|
+
* `addEventListener()` is that `addListener()` will return a reference to the
|
|
564
|
+
* `EventTarget`.
|
|
565
|
+
* @since v14.5.0
|
|
566
|
+
*/
|
|
567
|
+
addListener(type: string, listener: (arg: any) => void): this;
|
|
568
|
+
/**
|
|
569
|
+
* Node.js-specific extension to the `EventTarget` class that dispatches the
|
|
570
|
+
* `arg` to the list of handlers for `type`.
|
|
571
|
+
* @since v15.2.0
|
|
572
|
+
* @returns `true` if event listeners registered for the `type` exist,
|
|
573
|
+
* otherwise `false`.
|
|
574
|
+
*/
|
|
575
|
+
emit(type: string, arg: any): boolean;
|
|
576
|
+
/**
|
|
577
|
+
* Node.js-specific extension to the `EventTarget` class that returns an array
|
|
578
|
+
* of event `type` names for which event listeners are registered.
|
|
579
|
+
* @since 14.5.0
|
|
580
|
+
*/
|
|
581
|
+
eventNames(): string[];
|
|
582
|
+
/**
|
|
583
|
+
* Node.js-specific extension to the `EventTarget` class that returns the number
|
|
584
|
+
* of event listeners registered for the `type`.
|
|
585
|
+
* @since v14.5.0
|
|
586
|
+
*/
|
|
587
|
+
listenerCount(type: string): number;
|
|
588
|
+
/**
|
|
589
|
+
* Node.js-specific extension to the `EventTarget` class that sets the number
|
|
590
|
+
* of max event listeners as `n`.
|
|
591
|
+
* @since v14.5.0
|
|
592
|
+
*/
|
|
593
|
+
setMaxListeners(n: number): void;
|
|
594
|
+
/**
|
|
595
|
+
* Node.js-specific extension to the `EventTarget` class that returns the number
|
|
596
|
+
* of max event listeners.
|
|
597
|
+
* @since v14.5.0
|
|
598
|
+
*/
|
|
599
|
+
getMaxListeners(): number;
|
|
600
|
+
/**
|
|
601
|
+
* Node.js-specific alias for `eventTarget.removeEventListener()`.
|
|
602
|
+
* @since v14.5.0
|
|
603
|
+
*/
|
|
604
|
+
off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
|
605
|
+
/**
|
|
606
|
+
* Node.js-specific alias for `eventTarget.addEventListener()`.
|
|
607
|
+
* @since v14.5.0
|
|
608
|
+
*/
|
|
609
|
+
on(type: string, listener: (arg: any) => void): this;
|
|
610
|
+
/**
|
|
611
|
+
* Node.js-specific extension to the `EventTarget` class that adds a `once`
|
|
612
|
+
* listener for the given event `type`. This is equivalent to calling `on`
|
|
613
|
+
* with the `once` option set to `true`.
|
|
614
|
+
* @since v14.5.0
|
|
615
|
+
*/
|
|
616
|
+
once(type: string, listener: (arg: any) => void): this;
|
|
617
|
+
/**
|
|
618
|
+
* Node.js-specific extension to the `EventTarget` class. If `type` is specified,
|
|
619
|
+
* removes all registered listeners for `type`, otherwise removes all registered
|
|
620
|
+
* listeners.
|
|
621
|
+
* @since v14.5.0
|
|
622
|
+
*/
|
|
623
|
+
removeAllListeners(type?: string): this;
|
|
624
|
+
/**
|
|
625
|
+
* Node.js-specific extension to the `EventTarget` class that removes the
|
|
626
|
+
* `listener` for the given `type`. The only difference between `removeListener()`
|
|
627
|
+
* and `removeEventListener()` is that `removeListener()` will return a reference
|
|
628
|
+
* to the `EventTarget`.
|
|
629
|
+
* @since v14.5.0
|
|
630
|
+
*/
|
|
631
|
+
removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
|
632
|
+
}
|
|
587
633
|
}
|
|
588
634
|
global {
|
|
589
635
|
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.
|
|
417
|
-
*
|
|
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
|
|
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.
|
|
3
|
+
"version": "24.6.1",
|
|
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.
|
|
150
|
+
"undici-types": "~7.13.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "cc6606dfada445f2822eef37a6d8381fff1079463a3445c82c8657b354789aaa",
|
|
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
|
|
116
|
+
class MessagePort implements 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
|
|
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
|
|
236
|
-
|
|
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
|
|
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
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
}
|