@types/node 20.19.20 → 20.19.22
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.
- node v20.19/README.md +1 -1
- node v20.19/child_process.d.ts +15 -9
- node v20.19/cluster.d.ts +4 -5
- node v20.19/crypto.d.ts +35 -35
- node v20.19/dns.d.ts +1 -1
- node v20.19/events.d.ts +1 -1
- node v20.19/fs.d.ts +11 -11
- node v20.19/http.d.ts +3 -4
- node v20.19/http2.d.ts +4 -3
- node v20.19/https.d.ts +7 -10
- node v20.19/net.d.ts +5 -5
- node v20.19/os.d.ts +13 -3
- node v20.19/package.json +2 -2
- node v20.19/perf_hooks.d.ts +6 -8
- node v20.19/process.d.ts +7 -19
- node v20.19/readline/promises.d.ts +1 -1
- node v20.19/stream.d.ts +29 -22
- node v20.19/tls.d.ts +2 -2
- node v20.19/util.d.ts +1 -1
- node v20.19/v8.d.ts +2 -2
- node v20.19/vm.d.ts +18 -48
- node v20.19/wasi.d.ts +1 -1
node v20.19/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Fri, 17 Oct 2025 02:09:19 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node v20.19/child_process.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ declare module "child_process" {
|
|
|
69
69
|
import { Abortable, EventEmitter } from "node:events";
|
|
70
70
|
import * as dgram from "node:dgram";
|
|
71
71
|
import * as net from "node:net";
|
|
72
|
-
import {
|
|
72
|
+
import { Readable, Stream, Writable } from "node:stream";
|
|
73
73
|
import { URL } from "node:url";
|
|
74
74
|
type Serializable = string | object | number | boolean | bigint;
|
|
75
75
|
type SendHandle = net.Socket | net.Server | dgram.Socket | undefined;
|
|
@@ -139,7 +139,7 @@ declare module "child_process" {
|
|
|
139
139
|
* no IPC channel exists, this property is `undefined`.
|
|
140
140
|
* @since v7.1.0
|
|
141
141
|
*/
|
|
142
|
-
readonly channel?:
|
|
142
|
+
readonly channel?: Control | null;
|
|
143
143
|
/**
|
|
144
144
|
* A sparse array of pipes to the child process, corresponding with positions in
|
|
145
145
|
* the `stdio` option passed to {@link spawn} that have been set
|
|
@@ -612,6 +612,10 @@ declare module "child_process" {
|
|
|
612
612
|
Readable | Writable | null | undefined, // extra, no modification
|
|
613
613
|
];
|
|
614
614
|
}
|
|
615
|
+
interface Control extends EventEmitter {
|
|
616
|
+
ref(): void;
|
|
617
|
+
unref(): void;
|
|
618
|
+
}
|
|
615
619
|
interface MessageOptions {
|
|
616
620
|
keepOpen?: boolean | undefined;
|
|
617
621
|
}
|
|
@@ -894,11 +898,12 @@ declare module "child_process" {
|
|
|
894
898
|
interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
|
895
899
|
encoding: "buffer" | null; // specify `null`.
|
|
896
900
|
}
|
|
901
|
+
// TODO: Just Plain Wrong™ (see also nodejs/node#57392)
|
|
897
902
|
interface ExecException extends Error {
|
|
898
|
-
cmd?: string
|
|
899
|
-
killed?: boolean
|
|
900
|
-
code?: number
|
|
901
|
-
signal?: NodeJS.Signals
|
|
903
|
+
cmd?: string;
|
|
904
|
+
killed?: boolean;
|
|
905
|
+
code?: number;
|
|
906
|
+
signal?: NodeJS.Signals;
|
|
902
907
|
stdout?: string;
|
|
903
908
|
stderr?: string;
|
|
904
909
|
}
|
|
@@ -1056,10 +1061,11 @@ declare module "child_process" {
|
|
|
1056
1061
|
}
|
|
1057
1062
|
/** @deprecated Use `ExecFileOptions` instead. */
|
|
1058
1063
|
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
|
|
1064
|
+
// TODO: execFile exceptions can take many forms... this accurately describes none of them
|
|
1059
1065
|
type ExecFileException =
|
|
1060
1066
|
& Omit<ExecException, "code">
|
|
1061
1067
|
& Omit<NodeJS.ErrnoException, "code">
|
|
1062
|
-
& { code?: string | number |
|
|
1068
|
+
& { code?: string | number | null };
|
|
1063
1069
|
/**
|
|
1064
1070
|
* The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
|
|
1065
1071
|
* executable `file` is spawned directly as a new process making it slightly more
|
|
@@ -1319,7 +1325,7 @@ declare module "child_process" {
|
|
|
1319
1325
|
stderr: T;
|
|
1320
1326
|
status: number | null;
|
|
1321
1327
|
signal: NodeJS.Signals | null;
|
|
1322
|
-
error?: Error
|
|
1328
|
+
error?: Error;
|
|
1323
1329
|
}
|
|
1324
1330
|
/**
|
|
1325
1331
|
* The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
|
|
@@ -1408,7 +1414,7 @@ declare module "child_process" {
|
|
|
1408
1414
|
encoding: BufferEncoding;
|
|
1409
1415
|
}
|
|
1410
1416
|
interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
|
1411
|
-
encoding?: "buffer" | null; // specify `null`.
|
|
1417
|
+
encoding?: "buffer" | null | undefined; // specify `null`.
|
|
1412
1418
|
}
|
|
1413
1419
|
/**
|
|
1414
1420
|
* The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
|
node v20.19/cluster.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ declare module "cluster" {
|
|
|
72
72
|
* String arguments passed to worker.
|
|
73
73
|
* @default process.argv.slice(2)
|
|
74
74
|
*/
|
|
75
|
-
args?: string[] | undefined;
|
|
75
|
+
args?: readonly string[] | undefined;
|
|
76
76
|
/**
|
|
77
77
|
* Whether or not to send output to parent's stdio.
|
|
78
78
|
* @default false
|
|
@@ -480,7 +480,7 @@ declare module "cluster" {
|
|
|
480
480
|
* ```
|
|
481
481
|
* @since v0.7.0
|
|
482
482
|
*/
|
|
483
|
-
readonly worker?: Worker
|
|
483
|
+
readonly worker?: Worker;
|
|
484
484
|
/**
|
|
485
485
|
* A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
|
|
486
486
|
*
|
|
@@ -496,7 +496,7 @@ declare module "cluster" {
|
|
|
496
496
|
* ```
|
|
497
497
|
* @since v0.7.0
|
|
498
498
|
*/
|
|
499
|
-
readonly workers?: NodeJS.Dict<Worker
|
|
499
|
+
readonly workers?: NodeJS.Dict<Worker>;
|
|
500
500
|
readonly SCHED_NONE: number;
|
|
501
501
|
readonly SCHED_RR: number;
|
|
502
502
|
/**
|
|
@@ -549,10 +549,9 @@ declare module "cluster" {
|
|
|
549
549
|
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
550
550
|
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
551
551
|
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
552
|
-
// the handle is a net.Socket or net.Server object, or undefined.
|
|
553
552
|
prependListener(
|
|
554
553
|
event: "message",
|
|
555
|
-
listener: (worker: Worker, message: any, handle
|
|
554
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
556
555
|
): this;
|
|
557
556
|
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
|
558
557
|
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
node v20.19/crypto.d.ts
CHANGED
|
@@ -510,50 +510,50 @@ declare module "crypto" {
|
|
|
510
510
|
format: "jwk";
|
|
511
511
|
}
|
|
512
512
|
interface JsonWebKey {
|
|
513
|
-
crv?: string
|
|
514
|
-
d?: string
|
|
515
|
-
dp?: string
|
|
516
|
-
dq?: string
|
|
517
|
-
e?: string
|
|
518
|
-
k?: string
|
|
519
|
-
kty?: string
|
|
520
|
-
n?: string
|
|
521
|
-
p?: string
|
|
522
|
-
q?: string
|
|
523
|
-
qi?: string
|
|
524
|
-
x?: string
|
|
525
|
-
y?: string
|
|
513
|
+
crv?: string;
|
|
514
|
+
d?: string;
|
|
515
|
+
dp?: string;
|
|
516
|
+
dq?: string;
|
|
517
|
+
e?: string;
|
|
518
|
+
k?: string;
|
|
519
|
+
kty?: string;
|
|
520
|
+
n?: string;
|
|
521
|
+
p?: string;
|
|
522
|
+
q?: string;
|
|
523
|
+
qi?: string;
|
|
524
|
+
x?: string;
|
|
525
|
+
y?: string;
|
|
526
526
|
[key: string]: unknown;
|
|
527
527
|
}
|
|
528
528
|
interface AsymmetricKeyDetails {
|
|
529
529
|
/**
|
|
530
530
|
* Key size in bits (RSA, DSA).
|
|
531
531
|
*/
|
|
532
|
-
modulusLength?: number
|
|
532
|
+
modulusLength?: number;
|
|
533
533
|
/**
|
|
534
534
|
* Public exponent (RSA).
|
|
535
535
|
*/
|
|
536
|
-
publicExponent?: bigint
|
|
536
|
+
publicExponent?: bigint;
|
|
537
537
|
/**
|
|
538
538
|
* Name of the message digest (RSA-PSS).
|
|
539
539
|
*/
|
|
540
|
-
hashAlgorithm?: string
|
|
540
|
+
hashAlgorithm?: string;
|
|
541
541
|
/**
|
|
542
542
|
* Name of the message digest used by MGF1 (RSA-PSS).
|
|
543
543
|
*/
|
|
544
|
-
mgf1HashAlgorithm?: string
|
|
544
|
+
mgf1HashAlgorithm?: string;
|
|
545
545
|
/**
|
|
546
546
|
* Minimal salt length in bytes (RSA-PSS).
|
|
547
547
|
*/
|
|
548
|
-
saltLength?: number
|
|
548
|
+
saltLength?: number;
|
|
549
549
|
/**
|
|
550
550
|
* Size of q in bits (DSA).
|
|
551
551
|
*/
|
|
552
|
-
divisorLength?: number
|
|
552
|
+
divisorLength?: number;
|
|
553
553
|
/**
|
|
554
554
|
* Name of the curve (EC).
|
|
555
555
|
*/
|
|
556
|
-
namedCurve?: string
|
|
556
|
+
namedCurve?: string;
|
|
557
557
|
}
|
|
558
558
|
/**
|
|
559
559
|
* Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
|
|
@@ -608,7 +608,7 @@ declare module "crypto" {
|
|
|
608
608
|
* keys.
|
|
609
609
|
* @since v11.6.0
|
|
610
610
|
*/
|
|
611
|
-
asymmetricKeyType?: KeyType
|
|
611
|
+
asymmetricKeyType?: KeyType;
|
|
612
612
|
/**
|
|
613
613
|
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
614
614
|
* this object contains information about the key. None of the information obtained
|
|
@@ -622,7 +622,7 @@ declare module "crypto" {
|
|
|
622
622
|
* Other key details might be exposed via this API using additional attributes.
|
|
623
623
|
* @since v15.7.0
|
|
624
624
|
*/
|
|
625
|
-
asymmetricKeyDetails?: AsymmetricKeyDetails
|
|
625
|
+
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
626
626
|
/**
|
|
627
627
|
* For symmetric keys, the following encoding options can be used:
|
|
628
628
|
*
|
|
@@ -661,7 +661,7 @@ declare module "crypto" {
|
|
|
661
661
|
* property is `undefined` for asymmetric keys.
|
|
662
662
|
* @since v11.6.0
|
|
663
663
|
*/
|
|
664
|
-
symmetricKeySize?: number
|
|
664
|
+
symmetricKeySize?: number;
|
|
665
665
|
/**
|
|
666
666
|
* Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys
|
|
667
667
|
* or `'private'` for private (asymmetric) keys.
|
|
@@ -2575,15 +2575,15 @@ declare module "crypto" {
|
|
|
2575
2575
|
/**
|
|
2576
2576
|
* Name of the message digest
|
|
2577
2577
|
*/
|
|
2578
|
-
hashAlgorithm?: string;
|
|
2578
|
+
hashAlgorithm?: string | undefined;
|
|
2579
2579
|
/**
|
|
2580
2580
|
* Name of the message digest used by MGF1
|
|
2581
2581
|
*/
|
|
2582
|
-
mgf1HashAlgorithm?: string;
|
|
2582
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2583
2583
|
/**
|
|
2584
2584
|
* Minimal salt length in bytes
|
|
2585
2585
|
*/
|
|
2586
|
-
saltLength?: string;
|
|
2586
|
+
saltLength?: string | undefined;
|
|
2587
2587
|
}
|
|
2588
2588
|
interface DSAKeyPairKeyObjectOptions {
|
|
2589
2589
|
/**
|
|
@@ -2626,15 +2626,15 @@ declare module "crypto" {
|
|
|
2626
2626
|
/**
|
|
2627
2627
|
* Name of the message digest
|
|
2628
2628
|
*/
|
|
2629
|
-
hashAlgorithm?: string;
|
|
2629
|
+
hashAlgorithm?: string | undefined;
|
|
2630
2630
|
/**
|
|
2631
2631
|
* Name of the message digest used by MGF1
|
|
2632
2632
|
*/
|
|
2633
|
-
mgf1HashAlgorithm?: string;
|
|
2633
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2634
2634
|
/**
|
|
2635
2635
|
* Minimal salt length in bytes
|
|
2636
2636
|
*/
|
|
2637
|
-
saltLength?: string;
|
|
2637
|
+
saltLength?: string | undefined;
|
|
2638
2638
|
publicKeyEncoding: {
|
|
2639
2639
|
type: "spki";
|
|
2640
2640
|
format: PubF;
|
|
@@ -3624,23 +3624,23 @@ declare module "crypto" {
|
|
|
3624
3624
|
/**
|
|
3625
3625
|
* @default 'always'
|
|
3626
3626
|
*/
|
|
3627
|
-
subject?: "always" | "default" | "never";
|
|
3627
|
+
subject?: "always" | "default" | "never" | undefined;
|
|
3628
3628
|
/**
|
|
3629
3629
|
* @default true
|
|
3630
3630
|
*/
|
|
3631
|
-
wildcards?: boolean;
|
|
3631
|
+
wildcards?: boolean | undefined;
|
|
3632
3632
|
/**
|
|
3633
3633
|
* @default true
|
|
3634
3634
|
*/
|
|
3635
|
-
partialWildcards?: boolean;
|
|
3635
|
+
partialWildcards?: boolean | undefined;
|
|
3636
3636
|
/**
|
|
3637
3637
|
* @default false
|
|
3638
3638
|
*/
|
|
3639
|
-
multiLabelWildcards?: boolean;
|
|
3639
|
+
multiLabelWildcards?: boolean | undefined;
|
|
3640
3640
|
/**
|
|
3641
3641
|
* @default false
|
|
3642
3642
|
*/
|
|
3643
|
-
singleLabelSubdomains?: boolean;
|
|
3643
|
+
singleLabelSubdomains?: boolean | undefined;
|
|
3644
3644
|
}
|
|
3645
3645
|
/**
|
|
3646
3646
|
* Encapsulates an X509 certificate and provides read-only access to
|
|
@@ -3742,7 +3742,7 @@ declare module "crypto" {
|
|
|
3742
3742
|
* available.
|
|
3743
3743
|
* @since v15.9.0
|
|
3744
3744
|
*/
|
|
3745
|
-
readonly issuerCertificate
|
|
3745
|
+
readonly issuerCertificate: X509Certificate | undefined;
|
|
3746
3746
|
/**
|
|
3747
3747
|
* The public key `KeyObject` for this certificate.
|
|
3748
3748
|
* @since v15.6.0
|
node v20.19/dns.d.ts
CHANGED
|
@@ -783,7 +783,7 @@ declare module "dns" {
|
|
|
783
783
|
* The number of tries the resolver will try contacting each name server before giving up.
|
|
784
784
|
* @default 4
|
|
785
785
|
*/
|
|
786
|
-
tries?: number;
|
|
786
|
+
tries?: number | undefined;
|
|
787
787
|
}
|
|
788
788
|
/**
|
|
789
789
|
* An independent resolver for DNS requests.
|
node v20.19/events.d.ts
CHANGED
node v20.19/fs.d.ts
CHANGED
|
@@ -2369,7 +2369,7 @@ declare module "fs" {
|
|
|
2369
2369
|
/**
|
|
2370
2370
|
* @default null
|
|
2371
2371
|
*/
|
|
2372
|
-
position?: number |
|
|
2372
|
+
position?: number | null | undefined;
|
|
2373
2373
|
}
|
|
2374
2374
|
/**
|
|
2375
2375
|
* Write `buffer` to the file specified by `fd`.
|
|
@@ -4220,7 +4220,7 @@ declare module "fs" {
|
|
|
4220
4220
|
/**
|
|
4221
4221
|
* @default false
|
|
4222
4222
|
*/
|
|
4223
|
-
recursive?: boolean;
|
|
4223
|
+
recursive?: boolean | undefined;
|
|
4224
4224
|
}
|
|
4225
4225
|
/**
|
|
4226
4226
|
* Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html).
|
|
@@ -4273,54 +4273,54 @@ declare module "fs" {
|
|
|
4273
4273
|
* Dereference symlinks
|
|
4274
4274
|
* @default false
|
|
4275
4275
|
*/
|
|
4276
|
-
dereference?: boolean;
|
|
4276
|
+
dereference?: boolean | undefined;
|
|
4277
4277
|
/**
|
|
4278
4278
|
* When `force` is `false`, and the destination
|
|
4279
4279
|
* exists, throw an error.
|
|
4280
4280
|
* @default false
|
|
4281
4281
|
*/
|
|
4282
|
-
errorOnExist?: boolean;
|
|
4282
|
+
errorOnExist?: boolean | undefined;
|
|
4283
4283
|
/**
|
|
4284
4284
|
* Overwrite existing file or directory. _The copy
|
|
4285
4285
|
* operation will ignore errors if you set this to false and the destination
|
|
4286
4286
|
* exists. Use the `errorOnExist` option to change this behavior.
|
|
4287
4287
|
* @default true
|
|
4288
4288
|
*/
|
|
4289
|
-
force?: boolean;
|
|
4289
|
+
force?: boolean | undefined;
|
|
4290
4290
|
/**
|
|
4291
4291
|
* Modifiers for copy operation. See `mode` flag of {@link copyFileSync()}
|
|
4292
4292
|
*/
|
|
4293
|
-
mode?: number;
|
|
4293
|
+
mode?: number | undefined;
|
|
4294
4294
|
/**
|
|
4295
4295
|
* When `true` timestamps from `src` will
|
|
4296
4296
|
* be preserved.
|
|
4297
4297
|
* @default false
|
|
4298
4298
|
*/
|
|
4299
|
-
preserveTimestamps?: boolean;
|
|
4299
|
+
preserveTimestamps?: boolean | undefined;
|
|
4300
4300
|
/**
|
|
4301
4301
|
* Copy directories recursively.
|
|
4302
4302
|
* @default false
|
|
4303
4303
|
*/
|
|
4304
|
-
recursive?: boolean;
|
|
4304
|
+
recursive?: boolean | undefined;
|
|
4305
4305
|
/**
|
|
4306
4306
|
* When true, path resolution for symlinks will be skipped
|
|
4307
4307
|
* @default false
|
|
4308
4308
|
*/
|
|
4309
|
-
verbatimSymlinks?: boolean;
|
|
4309
|
+
verbatimSymlinks?: boolean | undefined;
|
|
4310
4310
|
}
|
|
4311
4311
|
export interface CopyOptions extends CopyOptionsBase {
|
|
4312
4312
|
/**
|
|
4313
4313
|
* Function to filter copied files/directories. Return
|
|
4314
4314
|
* `true` to copy the item, `false` to ignore it.
|
|
4315
4315
|
*/
|
|
4316
|
-
filter
|
|
4316
|
+
filter?: ((source: string, destination: string) => boolean | Promise<boolean>) | undefined;
|
|
4317
4317
|
}
|
|
4318
4318
|
export interface CopySyncOptions extends CopyOptionsBase {
|
|
4319
4319
|
/**
|
|
4320
4320
|
* Function to filter copied files/directories. Return
|
|
4321
4321
|
* `true` to copy the item, `false` to ignore it.
|
|
4322
4322
|
*/
|
|
4323
|
-
filter
|
|
4323
|
+
filter?: ((source: string, destination: string) => boolean) | undefined;
|
|
4324
4324
|
}
|
|
4325
4325
|
/**
|
|
4326
4326
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
node v20.19/http.d.ts
CHANGED
|
@@ -199,7 +199,7 @@ declare module "http" {
|
|
|
199
199
|
"x-frame-options"?: string | undefined;
|
|
200
200
|
"x-xss-protection"?: string | undefined;
|
|
201
201
|
}
|
|
202
|
-
interface ClientRequestArgs {
|
|
202
|
+
interface ClientRequestArgs extends Pick<LookupOptions, "hints"> {
|
|
203
203
|
_defaultAgent?: Agent | undefined;
|
|
204
204
|
agent?: Agent | boolean | undefined;
|
|
205
205
|
auth?: string | null | undefined;
|
|
@@ -212,7 +212,6 @@ declare module "http" {
|
|
|
212
212
|
defaultPort?: number | string | undefined;
|
|
213
213
|
family?: number | undefined;
|
|
214
214
|
headers?: OutgoingHttpHeaders | readonly string[] | undefined;
|
|
215
|
-
hints?: LookupOptions["hints"];
|
|
216
215
|
host?: string | null | undefined;
|
|
217
216
|
hostname?: string | null | undefined;
|
|
218
217
|
insecureHTTPParser?: boolean | undefined;
|
|
@@ -232,7 +231,7 @@ declare module "http" {
|
|
|
232
231
|
socketPath?: string | undefined;
|
|
233
232
|
timeout?: number | undefined;
|
|
234
233
|
uniqueHeaders?: Array<string | string[]> | undefined;
|
|
235
|
-
joinDuplicateHeaders?: boolean;
|
|
234
|
+
joinDuplicateHeaders?: boolean | undefined;
|
|
236
235
|
}
|
|
237
236
|
interface ServerOptions<
|
|
238
237
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
@@ -258,7 +257,7 @@ declare module "http" {
|
|
|
258
257
|
* @default false
|
|
259
258
|
* @since v18.14.0
|
|
260
259
|
*/
|
|
261
|
-
joinDuplicateHeaders?: boolean;
|
|
260
|
+
joinDuplicateHeaders?: boolean | undefined;
|
|
262
261
|
/**
|
|
263
262
|
* The number of milliseconds of inactivity a server needs to wait for additional incoming data,
|
|
264
263
|
* after it has finished writing the last response, before a socket will be destroyed.
|
node v20.19/http2.d.ts
CHANGED
|
@@ -55,14 +55,15 @@ declare module "http2" {
|
|
|
55
55
|
length: number;
|
|
56
56
|
}
|
|
57
57
|
export interface ServerStreamFileResponseOptions {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
statCheck?:
|
|
59
|
+
| ((stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void)
|
|
60
|
+
| undefined;
|
|
60
61
|
waitForTrailers?: boolean | undefined;
|
|
61
62
|
offset?: number | undefined;
|
|
62
63
|
length?: number | undefined;
|
|
63
64
|
}
|
|
64
65
|
export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
|
|
65
|
-
onError
|
|
66
|
+
onError?: ((err: NodeJS.ErrnoException) => void) | undefined;
|
|
66
67
|
}
|
|
67
68
|
export interface Http2Stream extends stream.Duplex {
|
|
68
69
|
/**
|
node v20.19/https.d.ts
CHANGED
|
@@ -8,18 +8,15 @@ declare module "https" {
|
|
|
8
8
|
import * as tls from "node:tls";
|
|
9
9
|
import * as http from "node:http";
|
|
10
10
|
import { URL } from "node:url";
|
|
11
|
-
|
|
11
|
+
interface ServerOptions<
|
|
12
12
|
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
13
13
|
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
|
14
|
-
>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
21
|
-
servername?: string | undefined; // SNI TLS Extension
|
|
22
|
-
};
|
|
14
|
+
> extends http.ServerOptions<Request, Response>, tls.TlsOptions {}
|
|
15
|
+
interface RequestOptions extends http.RequestOptions, tls.SecureContextOptions {
|
|
16
|
+
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
|
|
17
|
+
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
18
|
+
servername?: string | undefined; // SNI TLS Extension
|
|
19
|
+
}
|
|
23
20
|
interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
|
24
21
|
rejectUnauthorized?: boolean | undefined;
|
|
25
22
|
maxCachedSessions?: number | undefined;
|
node v20.19/net.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare module "net" {
|
|
|
31
31
|
allowHalfOpen?: boolean | undefined;
|
|
32
32
|
readable?: boolean | undefined;
|
|
33
33
|
writable?: boolean | undefined;
|
|
34
|
-
signal?: AbortSignal;
|
|
34
|
+
signal?: AbortSignal | undefined;
|
|
35
35
|
}
|
|
36
36
|
interface OnReadOpts {
|
|
37
37
|
buffer: Uint8Array | (() => Uint8Array);
|
|
@@ -327,25 +327,25 @@ declare module "net" {
|
|
|
327
327
|
* the socket is destroyed (for example, if the client disconnected).
|
|
328
328
|
* @since v0.5.10
|
|
329
329
|
*/
|
|
330
|
-
readonly remoteAddress
|
|
330
|
+
readonly remoteAddress: string | undefined;
|
|
331
331
|
/**
|
|
332
332
|
* The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
|
|
333
333
|
* the socket is destroyed (for example, if the client disconnected).
|
|
334
334
|
* @since v0.11.14
|
|
335
335
|
*/
|
|
336
|
-
readonly remoteFamily
|
|
336
|
+
readonly remoteFamily: string | undefined;
|
|
337
337
|
/**
|
|
338
338
|
* The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
|
|
339
339
|
* the socket is destroyed (for example, if the client disconnected).
|
|
340
340
|
* @since v0.5.10
|
|
341
341
|
*/
|
|
342
|
-
readonly remotePort
|
|
342
|
+
readonly remotePort: number | undefined;
|
|
343
343
|
/**
|
|
344
344
|
* The socket timeout in milliseconds as set by `socket.setTimeout()`.
|
|
345
345
|
* It is `undefined` if a timeout has not been set.
|
|
346
346
|
* @since v10.7.0
|
|
347
347
|
*/
|
|
348
|
-
readonly timeout?: number
|
|
348
|
+
readonly timeout?: number;
|
|
349
349
|
/**
|
|
350
350
|
* Half-closes the socket. i.e., it sends a FIN packet. It is possible the
|
|
351
351
|
* server will still send some data.
|
node v20.19/os.d.ts
CHANGED
|
@@ -30,10 +30,10 @@ declare module "os" {
|
|
|
30
30
|
mac: string;
|
|
31
31
|
internal: boolean;
|
|
32
32
|
cidr: string | null;
|
|
33
|
+
scopeid?: number;
|
|
33
34
|
}
|
|
34
35
|
interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
|
|
35
36
|
family: "IPv4";
|
|
36
|
-
scopeid?: undefined;
|
|
37
37
|
}
|
|
38
38
|
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
|
|
39
39
|
family: "IPv6";
|
|
@@ -231,6 +231,15 @@ declare module "os" {
|
|
|
231
231
|
* @since v2.3.0
|
|
232
232
|
*/
|
|
233
233
|
function homedir(): string;
|
|
234
|
+
interface UserInfoOptions {
|
|
235
|
+
encoding?: BufferEncoding | "buffer" | undefined;
|
|
236
|
+
}
|
|
237
|
+
interface UserInfoOptionsWithBufferEncoding extends UserInfoOptions {
|
|
238
|
+
encoding: "buffer";
|
|
239
|
+
}
|
|
240
|
+
interface UserInfoOptionsWithStringEncoding extends UserInfoOptions {
|
|
241
|
+
encoding?: BufferEncoding | undefined;
|
|
242
|
+
}
|
|
234
243
|
/**
|
|
235
244
|
* Returns information about the currently effective user. On POSIX platforms,
|
|
236
245
|
* this is typically a subset of the password file. The returned object includes
|
|
@@ -244,8 +253,9 @@ declare module "os" {
|
|
|
244
253
|
* Throws a [`SystemError`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`.
|
|
245
254
|
* @since v6.0.0
|
|
246
255
|
*/
|
|
247
|
-
function userInfo(options:
|
|
248
|
-
function userInfo(options?:
|
|
256
|
+
function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo<Buffer>;
|
|
257
|
+
function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo<string>;
|
|
258
|
+
function userInfo(options: UserInfoOptions): UserInfo<string | Buffer>;
|
|
249
259
|
type SignalConstants = {
|
|
250
260
|
[key in NodeJS.Signals]: number;
|
|
251
261
|
};
|
node v20.19/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "20.19.
|
|
3
|
+
"version": "20.19.22",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -135,6 +135,6 @@
|
|
|
135
135
|
"undici-types": "~6.21.0"
|
|
136
136
|
},
|
|
137
137
|
"peerDependencies": {},
|
|
138
|
-
"typesPublisherContentHash": "
|
|
138
|
+
"typesPublisherContentHash": "1715152e7acac301f51bba902a32521d6bfdfbfe285f096ada9586f7756ab4a7",
|
|
139
139
|
"typeScriptVersion": "5.2"
|
|
140
140
|
}
|
node v20.19/perf_hooks.d.ts
CHANGED
|
@@ -48,13 +48,13 @@ declare module "perf_hooks" {
|
|
|
48
48
|
* the type of garbage collection operation that occurred.
|
|
49
49
|
* See perf_hooks.constants for valid values.
|
|
50
50
|
*/
|
|
51
|
-
readonly kind
|
|
51
|
+
readonly kind: number;
|
|
52
52
|
/**
|
|
53
53
|
* When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
|
|
54
54
|
* property contains additional information about garbage collection operation.
|
|
55
55
|
* See perf_hooks.constants for valid values.
|
|
56
56
|
*/
|
|
57
|
-
readonly flags
|
|
57
|
+
readonly flags: number;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* The constructor of this class is not exposed to users directly.
|
|
@@ -92,11 +92,6 @@ declare module "perf_hooks" {
|
|
|
92
92
|
* @since v8.5.0
|
|
93
93
|
*/
|
|
94
94
|
readonly entryType: EntryType;
|
|
95
|
-
/**
|
|
96
|
-
* Additional detail specific to the `entryType`.
|
|
97
|
-
* @since v16.0.0
|
|
98
|
-
*/
|
|
99
|
-
readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
|
|
100
95
|
toJSON(): any;
|
|
101
96
|
}
|
|
102
97
|
/**
|
|
@@ -104,6 +99,7 @@ declare module "perf_hooks" {
|
|
|
104
99
|
* @since v18.2.0, v16.17.0
|
|
105
100
|
*/
|
|
106
101
|
class PerformanceMark extends PerformanceEntry {
|
|
102
|
+
readonly detail: any;
|
|
107
103
|
readonly duration: 0;
|
|
108
104
|
readonly entryType: "mark";
|
|
109
105
|
}
|
|
@@ -114,6 +110,7 @@ declare module "perf_hooks" {
|
|
|
114
110
|
* @since v18.2.0, v16.17.0
|
|
115
111
|
*/
|
|
116
112
|
class PerformanceMeasure extends PerformanceEntry {
|
|
113
|
+
readonly detail: any;
|
|
117
114
|
readonly entryType: "measure";
|
|
118
115
|
}
|
|
119
116
|
interface UVMetrics {
|
|
@@ -130,6 +127,7 @@ declare module "perf_hooks" {
|
|
|
130
127
|
*/
|
|
131
128
|
readonly eventsWaiting: number;
|
|
132
129
|
}
|
|
130
|
+
// TODO: PerformanceNodeEntry is missing
|
|
133
131
|
/**
|
|
134
132
|
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
135
133
|
*
|
|
@@ -224,7 +222,7 @@ declare module "perf_hooks" {
|
|
|
224
222
|
/**
|
|
225
223
|
* Additional optional detail to include with the mark.
|
|
226
224
|
*/
|
|
227
|
-
detail?: unknown
|
|
225
|
+
detail?: unknown;
|
|
228
226
|
/**
|
|
229
227
|
* Duration between start and end times.
|
|
230
228
|
*/
|
node v20.19/process.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare module "process" {
|
|
2
|
+
import { Control, MessageOptions } from "node:child_process";
|
|
2
3
|
import * as tty from "node:tty";
|
|
3
4
|
import { Worker } from "node:worker_threads";
|
|
4
5
|
|
|
@@ -323,7 +324,7 @@ declare module "process" {
|
|
|
323
324
|
/**
|
|
324
325
|
* Can be used to change the default timezone at runtime
|
|
325
326
|
*/
|
|
326
|
-
TZ?: string;
|
|
327
|
+
TZ?: string | undefined;
|
|
327
328
|
}
|
|
328
329
|
interface HRTime {
|
|
329
330
|
/**
|
|
@@ -967,7 +968,7 @@ declare module "process" {
|
|
|
967
968
|
* @since v0.1.13
|
|
968
969
|
* @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed.
|
|
969
970
|
*/
|
|
970
|
-
exit(code?: number | string | null
|
|
971
|
+
exit(code?: number | string | null): never;
|
|
971
972
|
/**
|
|
972
973
|
* A number which will be the process exit code, when the process either
|
|
973
974
|
* exits gracefully, or is exited via {@link exit} without specifying
|
|
@@ -978,7 +979,7 @@ declare module "process" {
|
|
|
978
979
|
* @default undefined
|
|
979
980
|
* @since v0.11.8
|
|
980
981
|
*/
|
|
981
|
-
exitCode
|
|
982
|
+
exitCode: number | string | number | undefined;
|
|
982
983
|
/**
|
|
983
984
|
* The `process.getActiveResourcesInfo()` method returns an array of strings containing
|
|
984
985
|
* the types of the active resources that are currently keeping the event loop alive.
|
|
@@ -1499,7 +1500,7 @@ declare module "process" {
|
|
|
1499
1500
|
* @since v0.1.17
|
|
1500
1501
|
* @deprecated Since v14.0.0 - Use `main` instead.
|
|
1501
1502
|
*/
|
|
1502
|
-
mainModule?: Module
|
|
1503
|
+
mainModule?: Module;
|
|
1503
1504
|
memoryUsage: MemoryUsageFn;
|
|
1504
1505
|
/**
|
|
1505
1506
|
* Gets the amount of memory available to the process (in bytes) based on
|
|
@@ -1693,18 +1694,7 @@ declare module "process" {
|
|
|
1693
1694
|
* If no IPC channel exists, this property is undefined.
|
|
1694
1695
|
* @since v7.1.0
|
|
1695
1696
|
*/
|
|
1696
|
-
channel?:
|
|
1697
|
-
/**
|
|
1698
|
-
* This method makes the IPC channel keep the event loop of the process running if .unref() has been called before.
|
|
1699
|
-
* @since v7.1.0
|
|
1700
|
-
*/
|
|
1701
|
-
ref(): void;
|
|
1702
|
-
/**
|
|
1703
|
-
* This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open.
|
|
1704
|
-
* @since v7.1.0
|
|
1705
|
-
*/
|
|
1706
|
-
unref(): void;
|
|
1707
|
-
};
|
|
1697
|
+
channel?: Control;
|
|
1708
1698
|
/**
|
|
1709
1699
|
* If Node.js is spawned with an IPC channel, the `process.send()` method can be
|
|
1710
1700
|
* used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object.
|
|
@@ -1719,9 +1709,7 @@ declare module "process" {
|
|
|
1719
1709
|
send?(
|
|
1720
1710
|
message: any,
|
|
1721
1711
|
sendHandle?: any,
|
|
1722
|
-
options?:
|
|
1723
|
-
keepOpen?: boolean | undefined;
|
|
1724
|
-
},
|
|
1712
|
+
options?: MessageOptions,
|
|
1725
1713
|
callback?: (error: Error | null) => void,
|
|
1726
1714
|
): boolean;
|
|
1727
1715
|
/**
|
node v20.19/stream.d.ts
CHANGED
|
@@ -45,22 +45,22 @@ declare module "stream" {
|
|
|
45
45
|
emitClose?: boolean | undefined;
|
|
46
46
|
highWaterMark?: number | undefined;
|
|
47
47
|
objectMode?: boolean | undefined;
|
|
48
|
-
construct
|
|
49
|
-
destroy
|
|
48
|
+
construct?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined;
|
|
49
|
+
destroy?: ((this: T, error: Error | null, callback: (error?: Error | null) => void) => void) | undefined;
|
|
50
50
|
autoDestroy?: boolean | undefined;
|
|
51
51
|
}
|
|
52
52
|
interface ReadableOptions<T extends Readable = Readable> extends StreamOptions<T> {
|
|
53
53
|
encoding?: BufferEncoding | undefined;
|
|
54
|
-
read
|
|
54
|
+
read?: ((this: T, size: number) => void) | undefined;
|
|
55
55
|
}
|
|
56
56
|
interface ArrayOptions {
|
|
57
57
|
/**
|
|
58
58
|
* The maximum concurrent invocations of `fn` to call on the stream at once.
|
|
59
59
|
* @default 1
|
|
60
60
|
*/
|
|
61
|
-
concurrency?: number;
|
|
61
|
+
concurrency?: number | undefined;
|
|
62
62
|
/** Allows destroying the stream if the signal is aborted. */
|
|
63
|
-
signal?: AbortSignal;
|
|
63
|
+
signal?: AbortSignal | undefined;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* @since v0.9.4
|
|
@@ -696,21 +696,25 @@ declare module "stream" {
|
|
|
696
696
|
interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
|
|
697
697
|
decodeStrings?: boolean | undefined;
|
|
698
698
|
defaultEncoding?: BufferEncoding | undefined;
|
|
699
|
-
write
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
699
|
+
write?:
|
|
700
|
+
| ((
|
|
701
|
+
this: T,
|
|
702
|
+
chunk: any,
|
|
703
|
+
encoding: BufferEncoding,
|
|
704
|
+
callback: (error?: Error | null) => void,
|
|
705
|
+
) => void)
|
|
706
|
+
| undefined;
|
|
707
|
+
writev?:
|
|
708
|
+
| ((
|
|
709
|
+
this: T,
|
|
710
|
+
chunks: Array<{
|
|
711
|
+
chunk: any;
|
|
712
|
+
encoding: BufferEncoding;
|
|
713
|
+
}>,
|
|
714
|
+
callback: (error?: Error | null) => void,
|
|
715
|
+
) => void)
|
|
716
|
+
| undefined;
|
|
717
|
+
final?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined;
|
|
714
718
|
}
|
|
715
719
|
/**
|
|
716
720
|
* @since v0.9.4
|
|
@@ -1233,8 +1237,10 @@ declare module "stream" {
|
|
|
1233
1237
|
function duplexPair(options?: DuplexOptions): [Duplex, Duplex];
|
|
1234
1238
|
type TransformCallback = (error?: Error | null, data?: any) => void;
|
|
1235
1239
|
interface TransformOptions<T extends Transform = Transform> extends DuplexOptions<T> {
|
|
1236
|
-
transform
|
|
1237
|
-
|
|
1240
|
+
transform?:
|
|
1241
|
+
| ((this: T, chunk: any, encoding: BufferEncoding, callback: TransformCallback) => void)
|
|
1242
|
+
| undefined;
|
|
1243
|
+
flush?: ((this: T, callback: TransformCallback) => void) | undefined;
|
|
1238
1244
|
}
|
|
1239
1245
|
/**
|
|
1240
1246
|
* Transform streams are `Duplex` streams where the output is in some way
|
|
@@ -1641,6 +1647,7 @@ declare module "stream" {
|
|
|
1641
1647
|
...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
|
|
1642
1648
|
): Promise<void>;
|
|
1643
1649
|
}
|
|
1650
|
+
// TODO: this interface never existed; remove in next major
|
|
1644
1651
|
interface Pipe {
|
|
1645
1652
|
close(): void;
|
|
1646
1653
|
hasRef(): boolean;
|
node v20.19/tls.d.ts
CHANGED
|
@@ -586,7 +586,7 @@ declare module "tls" {
|
|
|
586
586
|
* requires explicitly specifying a cipher suite with the `ciphers` option.
|
|
587
587
|
* More information can be found in the RFC 4279.
|
|
588
588
|
*/
|
|
589
|
-
pskCallback
|
|
589
|
+
pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
|
|
590
590
|
/**
|
|
591
591
|
* hint to send to a client to help
|
|
592
592
|
* with selecting the identity during TLS-PSK negotiation. Will be ignored
|
|
@@ -627,7 +627,7 @@ declare module "tls" {
|
|
|
627
627
|
* compatible with the selected cipher's digest.
|
|
628
628
|
* `identity` must use UTF-8 encoding.
|
|
629
629
|
*/
|
|
630
|
-
pskCallback
|
|
630
|
+
pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
|
|
631
631
|
}
|
|
632
632
|
/**
|
|
633
633
|
* Accepts encrypted connections using TLS or SSL.
|
node v20.19/util.d.ts
CHANGED
node v20.19/v8.d.ts
CHANGED
|
@@ -43,12 +43,12 @@ declare module "v8" {
|
|
|
43
43
|
* If true, expose internals in the heap snapshot.
|
|
44
44
|
* @default false
|
|
45
45
|
*/
|
|
46
|
-
exposeInternals?: boolean;
|
|
46
|
+
exposeInternals?: boolean | undefined;
|
|
47
47
|
/**
|
|
48
48
|
* If true, expose numeric values in artificial fields.
|
|
49
49
|
* @default false
|
|
50
50
|
*/
|
|
51
|
-
exposeNumericValues?: boolean;
|
|
51
|
+
exposeNumericValues?: boolean | undefined;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Returns an integer representing a version tag derived from the V8 version,
|
node v20.19/vm.d.ts
CHANGED
|
@@ -97,28 +97,22 @@ declare module "vm" {
|
|
|
97
97
|
*/
|
|
98
98
|
breakOnSigint?: boolean | undefined;
|
|
99
99
|
}
|
|
100
|
-
interface RunningScriptInNewContextOptions
|
|
100
|
+
interface RunningScriptInNewContextOptions
|
|
101
|
+
extends RunningScriptOptions, Pick<CreateContextOptions, "microtaskMode">
|
|
102
|
+
{
|
|
101
103
|
/**
|
|
102
104
|
* Human-readable name of the newly created context.
|
|
103
105
|
*/
|
|
104
|
-
contextName?: CreateContextOptions["name"];
|
|
106
|
+
contextName?: CreateContextOptions["name"] | undefined;
|
|
105
107
|
/**
|
|
106
108
|
* Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
|
|
107
109
|
* but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
|
|
108
110
|
* Most notably, this string should omit the trailing slash, as that denotes a path.
|
|
109
111
|
*/
|
|
110
|
-
contextOrigin?: CreateContextOptions["origin"];
|
|
111
|
-
contextCodeGeneration?: CreateContextOptions["codeGeneration"];
|
|
112
|
-
/**
|
|
113
|
-
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
|
114
|
-
*/
|
|
115
|
-
microtaskMode?: CreateContextOptions["microtaskMode"];
|
|
112
|
+
contextOrigin?: CreateContextOptions["origin"] | undefined;
|
|
113
|
+
contextCodeGeneration?: CreateContextOptions["codeGeneration"] | undefined;
|
|
116
114
|
}
|
|
117
|
-
interface RunningCodeOptions extends RunningScriptOptions {
|
|
118
|
-
/**
|
|
119
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
120
|
-
*/
|
|
121
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
115
|
+
interface RunningCodeOptions extends RunningScriptOptions, Pick<ScriptOptions, "cachedData"> {
|
|
122
116
|
/**
|
|
123
117
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
124
118
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
@@ -129,11 +123,9 @@ declare module "vm" {
|
|
|
129
123
|
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
|
130
124
|
| undefined;
|
|
131
125
|
}
|
|
132
|
-
interface RunningCodeInNewContextOptions
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*/
|
|
136
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
126
|
+
interface RunningCodeInNewContextOptions
|
|
127
|
+
extends RunningScriptInNewContextOptions, Pick<ScriptOptions, "cachedData">
|
|
128
|
+
{
|
|
137
129
|
/**
|
|
138
130
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
139
131
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
@@ -144,16 +136,7 @@ declare module "vm" {
|
|
|
144
136
|
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
|
145
137
|
| undefined;
|
|
146
138
|
}
|
|
147
|
-
interface CompileFunctionOptions extends BaseOptions {
|
|
148
|
-
/**
|
|
149
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
150
|
-
*/
|
|
151
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
152
|
-
/**
|
|
153
|
-
* Specifies whether to produce new cache data.
|
|
154
|
-
* @default false
|
|
155
|
-
*/
|
|
156
|
-
produceCachedData?: boolean | undefined;
|
|
139
|
+
interface CompileFunctionOptions extends BaseOptions, Pick<ScriptOptions, "cachedData" | "produceCachedData"> {
|
|
157
140
|
/**
|
|
158
141
|
* The sandbox/context in which the said function should be compiled in.
|
|
159
142
|
*/
|
|
@@ -380,15 +363,15 @@ declare module "vm" {
|
|
|
380
363
|
*/
|
|
381
364
|
createCachedData(): Buffer;
|
|
382
365
|
/** @deprecated in favor of `script.createCachedData()` */
|
|
383
|
-
cachedDataProduced?: boolean
|
|
366
|
+
cachedDataProduced?: boolean;
|
|
384
367
|
/**
|
|
385
368
|
* When `cachedData` is supplied to create the `vm.Script`, this value will be set
|
|
386
369
|
* to either `true` or `false` depending on acceptance of the data by V8.
|
|
387
370
|
* Otherwise the value is `undefined`.
|
|
388
371
|
* @since v5.7.0
|
|
389
372
|
*/
|
|
390
|
-
cachedDataRejected?: boolean
|
|
391
|
-
cachedData?: Buffer
|
|
373
|
+
cachedDataRejected?: boolean;
|
|
374
|
+
cachedData?: Buffer;
|
|
392
375
|
/**
|
|
393
376
|
* When the script is compiled from a source that contains a source map magic
|
|
394
377
|
* comment, this property will be set to the URL of the source map.
|
|
@@ -406,7 +389,7 @@ declare module "vm" {
|
|
|
406
389
|
* ```
|
|
407
390
|
* @since v19.1.0, v18.13.0
|
|
408
391
|
*/
|
|
409
|
-
sourceMapURL
|
|
392
|
+
sourceMapURL: string | undefined;
|
|
410
393
|
}
|
|
411
394
|
/**
|
|
412
395
|
* If the given `contextObject` is an object, the `vm.createContext()` method will
|
|
@@ -615,11 +598,7 @@ declare module "vm" {
|
|
|
615
598
|
code: string,
|
|
616
599
|
params?: readonly string[],
|
|
617
600
|
options?: CompileFunctionOptions,
|
|
618
|
-
): Function &
|
|
619
|
-
cachedData?: Script["cachedData"] | undefined;
|
|
620
|
-
cachedDataProduced?: Script["cachedDataProduced"] | undefined;
|
|
621
|
-
cachedDataRejected?: Script["cachedDataRejected"] | undefined;
|
|
622
|
-
};
|
|
601
|
+
): Function & Pick<Script, "cachedData" | "cachedDataProduced" | "cachedDataRejected">;
|
|
623
602
|
/**
|
|
624
603
|
* Measure the memory known to V8 and used by all contexts known to the
|
|
625
604
|
* current V8 isolate, or the main context.
|
|
@@ -676,10 +655,7 @@ declare module "vm" {
|
|
|
676
655
|
* @experimental
|
|
677
656
|
*/
|
|
678
657
|
function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
|
|
679
|
-
interface ModuleEvaluateOptions {
|
|
680
|
-
timeout?: RunningScriptOptions["timeout"] | undefined;
|
|
681
|
-
breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
|
|
682
|
-
}
|
|
658
|
+
interface ModuleEvaluateOptions extends Pick<RunningScriptOptions, "breakOnSigint" | "timeout"> {}
|
|
683
659
|
type ModuleLinker = (
|
|
684
660
|
specifier: string,
|
|
685
661
|
referencingModule: Module,
|
|
@@ -888,19 +864,13 @@ declare module "vm" {
|
|
|
888
864
|
*/
|
|
889
865
|
link(linker: ModuleLinker): Promise<void>;
|
|
890
866
|
}
|
|
891
|
-
interface SourceTextModuleOptions {
|
|
867
|
+
interface SourceTextModuleOptions extends Pick<ScriptOptions, "cachedData" | "columnOffset" | "lineOffset"> {
|
|
892
868
|
/**
|
|
893
869
|
* String used in stack traces.
|
|
894
870
|
* @default 'vm:module(i)' where i is a context-specific ascending index.
|
|
895
871
|
*/
|
|
896
872
|
identifier?: string | undefined;
|
|
897
|
-
/**
|
|
898
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
899
|
-
*/
|
|
900
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
901
873
|
context?: Context | undefined;
|
|
902
|
-
lineOffset?: BaseOptions["lineOffset"] | undefined;
|
|
903
|
-
columnOffset?: BaseOptions["columnOffset"] | undefined;
|
|
904
874
|
/**
|
|
905
875
|
* Called during evaluation of this module to initialize the `import.meta`.
|
|
906
876
|
*/
|
node v20.19/wasi.d.ts
CHANGED