@types/node 24.7.1 → 24.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node/README.md +1 -1
- node/assert.d.ts +1 -1
- node/child_process.d.ts +15 -9
- node/cluster.d.ts +3 -4
- node/crypto.d.ts +35 -35
- node/dns.d.ts +1 -1
- node/events.d.ts +1 -1
- node/fs.d.ts +11 -11
- node/http.d.ts +3 -4
- node/http2.d.ts +4 -3
- node/https.d.ts +9 -12
- node/net.d.ts +5 -5
- node/os.d.ts +13 -3
- node/package.json +2 -2
- node/perf_hooks.d.ts +6 -8
- node/process.d.ts +7 -19
- node/readline/promises.d.ts +1 -1
- node/stream.d.ts +29 -22
- node/tls.d.ts +2 -2
- node/v8.d.ts +2 -2
- node/vm.d.ts +18 -48
node/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.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Sat, 11 Oct 2025 14:02:18 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node/assert.d.ts
CHANGED
node/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
|
|
@@ -1320,7 +1326,7 @@ declare module "child_process" {
|
|
|
1320
1326
|
stderr: T;
|
|
1321
1327
|
status: number | null;
|
|
1322
1328
|
signal: NodeJS.Signals | null;
|
|
1323
|
-
error?: Error
|
|
1329
|
+
error?: Error;
|
|
1324
1330
|
}
|
|
1325
1331
|
/**
|
|
1326
1332
|
* The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
|
|
@@ -1409,7 +1415,7 @@ declare module "child_process" {
|
|
|
1409
1415
|
encoding: BufferEncoding;
|
|
1410
1416
|
}
|
|
1411
1417
|
interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
|
1412
|
-
encoding?: "buffer" | null; // specify `null`.
|
|
1418
|
+
encoding?: "buffer" | null | undefined; // specify `null`.
|
|
1413
1419
|
}
|
|
1414
1420
|
/**
|
|
1415
1421
|
* The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
|
node/cluster.d.ts
CHANGED
|
@@ -481,7 +481,7 @@ declare module "cluster" {
|
|
|
481
481
|
* ```
|
|
482
482
|
* @since v0.7.0
|
|
483
483
|
*/
|
|
484
|
-
readonly worker?: Worker
|
|
484
|
+
readonly worker?: Worker;
|
|
485
485
|
/**
|
|
486
486
|
* 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.
|
|
487
487
|
*
|
|
@@ -497,7 +497,7 @@ declare module "cluster" {
|
|
|
497
497
|
* ```
|
|
498
498
|
* @since v0.7.0
|
|
499
499
|
*/
|
|
500
|
-
readonly workers?: NodeJS.Dict<Worker
|
|
500
|
+
readonly workers?: NodeJS.Dict<Worker>;
|
|
501
501
|
readonly SCHED_NONE: number;
|
|
502
502
|
readonly SCHED_RR: number;
|
|
503
503
|
/**
|
|
@@ -550,10 +550,9 @@ declare module "cluster" {
|
|
|
550
550
|
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
551
551
|
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
552
552
|
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
553
|
-
// the handle is a net.Socket or net.Server object, or undefined.
|
|
554
553
|
prependListener(
|
|
555
554
|
event: "message",
|
|
556
|
-
listener: (worker: Worker, message: any, handle
|
|
555
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
557
556
|
): this;
|
|
558
557
|
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
|
559
558
|
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
node/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,
|
|
@@ -598,7 +598,7 @@ declare module "crypto" {
|
|
|
598
598
|
* keys.
|
|
599
599
|
* @since v11.6.0
|
|
600
600
|
*/
|
|
601
|
-
asymmetricKeyType?: KeyType
|
|
601
|
+
asymmetricKeyType?: KeyType;
|
|
602
602
|
/**
|
|
603
603
|
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
604
604
|
* this object contains information about the key. None of the information obtained
|
|
@@ -612,7 +612,7 @@ declare module "crypto" {
|
|
|
612
612
|
* Other key details might be exposed via this API using additional attributes.
|
|
613
613
|
* @since v15.7.0
|
|
614
614
|
*/
|
|
615
|
-
asymmetricKeyDetails?: AsymmetricKeyDetails
|
|
615
|
+
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
616
616
|
/**
|
|
617
617
|
* For symmetric keys, the following encoding options can be used:
|
|
618
618
|
*
|
|
@@ -651,7 +651,7 @@ declare module "crypto" {
|
|
|
651
651
|
* property is `undefined` for asymmetric keys.
|
|
652
652
|
* @since v11.6.0
|
|
653
653
|
*/
|
|
654
|
-
symmetricKeySize?: number
|
|
654
|
+
symmetricKeySize?: number;
|
|
655
655
|
/**
|
|
656
656
|
* Converts a `KeyObject` instance to a `CryptoKey`.
|
|
657
657
|
* @since 22.10.0
|
|
@@ -2512,15 +2512,15 @@ declare module "crypto" {
|
|
|
2512
2512
|
/**
|
|
2513
2513
|
* Name of the message digest
|
|
2514
2514
|
*/
|
|
2515
|
-
hashAlgorithm?: string;
|
|
2515
|
+
hashAlgorithm?: string | undefined;
|
|
2516
2516
|
/**
|
|
2517
2517
|
* Name of the message digest used by MGF1
|
|
2518
2518
|
*/
|
|
2519
|
-
mgf1HashAlgorithm?: string;
|
|
2519
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2520
2520
|
/**
|
|
2521
2521
|
* Minimal salt length in bytes
|
|
2522
2522
|
*/
|
|
2523
|
-
saltLength?: string;
|
|
2523
|
+
saltLength?: string | undefined;
|
|
2524
2524
|
}
|
|
2525
2525
|
interface DSAKeyPairKeyObjectOptions {
|
|
2526
2526
|
/**
|
|
@@ -2563,15 +2563,15 @@ declare module "crypto" {
|
|
|
2563
2563
|
/**
|
|
2564
2564
|
* Name of the message digest
|
|
2565
2565
|
*/
|
|
2566
|
-
hashAlgorithm?: string;
|
|
2566
|
+
hashAlgorithm?: string | undefined;
|
|
2567
2567
|
/**
|
|
2568
2568
|
* Name of the message digest used by MGF1
|
|
2569
2569
|
*/
|
|
2570
|
-
mgf1HashAlgorithm?: string;
|
|
2570
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2571
2571
|
/**
|
|
2572
2572
|
* Minimal salt length in bytes
|
|
2573
2573
|
*/
|
|
2574
|
-
saltLength?: string;
|
|
2574
|
+
saltLength?: string | undefined;
|
|
2575
2575
|
publicKeyEncoding: {
|
|
2576
2576
|
type: "spki";
|
|
2577
2577
|
format: PubF;
|
|
@@ -3835,23 +3835,23 @@ declare module "crypto" {
|
|
|
3835
3835
|
/**
|
|
3836
3836
|
* @default 'always'
|
|
3837
3837
|
*/
|
|
3838
|
-
subject?: "always" | "default" | "never";
|
|
3838
|
+
subject?: "always" | "default" | "never" | undefined;
|
|
3839
3839
|
/**
|
|
3840
3840
|
* @default true
|
|
3841
3841
|
*/
|
|
3842
|
-
wildcards?: boolean;
|
|
3842
|
+
wildcards?: boolean | undefined;
|
|
3843
3843
|
/**
|
|
3844
3844
|
* @default true
|
|
3845
3845
|
*/
|
|
3846
|
-
partialWildcards?: boolean;
|
|
3846
|
+
partialWildcards?: boolean | undefined;
|
|
3847
3847
|
/**
|
|
3848
3848
|
* @default false
|
|
3849
3849
|
*/
|
|
3850
|
-
multiLabelWildcards?: boolean;
|
|
3850
|
+
multiLabelWildcards?: boolean | undefined;
|
|
3851
3851
|
/**
|
|
3852
3852
|
* @default false
|
|
3853
3853
|
*/
|
|
3854
|
-
singleLabelSubdomains?: boolean;
|
|
3854
|
+
singleLabelSubdomains?: boolean | undefined;
|
|
3855
3855
|
}
|
|
3856
3856
|
/**
|
|
3857
3857
|
* Encapsulates an X509 certificate and provides read-only access to
|
|
@@ -3953,7 +3953,7 @@ declare module "crypto" {
|
|
|
3953
3953
|
* available.
|
|
3954
3954
|
* @since v15.9.0
|
|
3955
3955
|
*/
|
|
3956
|
-
readonly issuerCertificate
|
|
3956
|
+
readonly issuerCertificate: X509Certificate | undefined;
|
|
3957
3957
|
/**
|
|
3958
3958
|
* The public key `KeyObject` for this certificate.
|
|
3959
3959
|
* @since v15.6.0
|
node/dns.d.ts
CHANGED
|
@@ -829,7 +829,7 @@ declare module "dns" {
|
|
|
829
829
|
* The number of tries the resolver will try contacting each name server before giving up.
|
|
830
830
|
* @default 4
|
|
831
831
|
*/
|
|
832
|
-
tries?: number;
|
|
832
|
+
tries?: number | undefined;
|
|
833
833
|
/**
|
|
834
834
|
* The max retry timeout, in milliseconds.
|
|
835
835
|
* @default 0
|
node/events.d.ts
CHANGED
node/fs.d.ts
CHANGED
|
@@ -2634,7 +2634,7 @@ declare module "fs" {
|
|
|
2634
2634
|
/**
|
|
2635
2635
|
* @default null
|
|
2636
2636
|
*/
|
|
2637
|
-
position?: number |
|
|
2637
|
+
position?: number | null | undefined;
|
|
2638
2638
|
}
|
|
2639
2639
|
/**
|
|
2640
2640
|
* Write `buffer` to the file specified by `fd`.
|
|
@@ -4463,7 +4463,7 @@ declare module "fs" {
|
|
|
4463
4463
|
/**
|
|
4464
4464
|
* @default false
|
|
4465
4465
|
*/
|
|
4466
|
-
recursive?: boolean;
|
|
4466
|
+
recursive?: boolean | undefined;
|
|
4467
4467
|
}
|
|
4468
4468
|
/**
|
|
4469
4469
|
* Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html).
|
|
@@ -4516,54 +4516,54 @@ declare module "fs" {
|
|
|
4516
4516
|
* Dereference symlinks
|
|
4517
4517
|
* @default false
|
|
4518
4518
|
*/
|
|
4519
|
-
dereference?: boolean;
|
|
4519
|
+
dereference?: boolean | undefined;
|
|
4520
4520
|
/**
|
|
4521
4521
|
* When `force` is `false`, and the destination
|
|
4522
4522
|
* exists, throw an error.
|
|
4523
4523
|
* @default false
|
|
4524
4524
|
*/
|
|
4525
|
-
errorOnExist?: boolean;
|
|
4525
|
+
errorOnExist?: boolean | undefined;
|
|
4526
4526
|
/**
|
|
4527
4527
|
* Overwrite existing file or directory. _The copy
|
|
4528
4528
|
* operation will ignore errors if you set this to false and the destination
|
|
4529
4529
|
* exists. Use the `errorOnExist` option to change this behavior.
|
|
4530
4530
|
* @default true
|
|
4531
4531
|
*/
|
|
4532
|
-
force?: boolean;
|
|
4532
|
+
force?: boolean | undefined;
|
|
4533
4533
|
/**
|
|
4534
4534
|
* Modifiers for copy operation. See `mode` flag of {@link copyFileSync()}
|
|
4535
4535
|
*/
|
|
4536
|
-
mode?: number;
|
|
4536
|
+
mode?: number | undefined;
|
|
4537
4537
|
/**
|
|
4538
4538
|
* When `true` timestamps from `src` will
|
|
4539
4539
|
* be preserved.
|
|
4540
4540
|
* @default false
|
|
4541
4541
|
*/
|
|
4542
|
-
preserveTimestamps?: boolean;
|
|
4542
|
+
preserveTimestamps?: boolean | undefined;
|
|
4543
4543
|
/**
|
|
4544
4544
|
* Copy directories recursively.
|
|
4545
4545
|
* @default false
|
|
4546
4546
|
*/
|
|
4547
|
-
recursive?: boolean;
|
|
4547
|
+
recursive?: boolean | undefined;
|
|
4548
4548
|
/**
|
|
4549
4549
|
* When true, path resolution for symlinks will be skipped
|
|
4550
4550
|
* @default false
|
|
4551
4551
|
*/
|
|
4552
|
-
verbatimSymlinks?: boolean;
|
|
4552
|
+
verbatimSymlinks?: boolean | undefined;
|
|
4553
4553
|
}
|
|
4554
4554
|
export interface CopyOptions extends CopyOptionsBase {
|
|
4555
4555
|
/**
|
|
4556
4556
|
* Function to filter copied files/directories. Return
|
|
4557
4557
|
* `true` to copy the item, `false` to ignore it.
|
|
4558
4558
|
*/
|
|
4559
|
-
filter
|
|
4559
|
+
filter?: ((source: string, destination: string) => boolean | Promise<boolean>) | undefined;
|
|
4560
4560
|
}
|
|
4561
4561
|
export interface CopySyncOptions extends CopyOptionsBase {
|
|
4562
4562
|
/**
|
|
4563
4563
|
* Function to filter copied files/directories. Return
|
|
4564
4564
|
* `true` to copy the item, `false` to ignore it.
|
|
4565
4565
|
*/
|
|
4566
|
-
filter
|
|
4566
|
+
filter?: ((source: string, destination: string) => boolean) | undefined;
|
|
4567
4567
|
}
|
|
4568
4568
|
/**
|
|
4569
4569
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
node/http.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ declare module "http" {
|
|
|
200
200
|
"x-frame-options"?: string | undefined;
|
|
201
201
|
"x-xss-protection"?: string | undefined;
|
|
202
202
|
}
|
|
203
|
-
interface ClientRequestArgs {
|
|
203
|
+
interface ClientRequestArgs extends Pick<LookupOptions, "hints"> {
|
|
204
204
|
_defaultAgent?: Agent | undefined;
|
|
205
205
|
agent?: Agent | boolean | undefined;
|
|
206
206
|
auth?: string | null | undefined;
|
|
@@ -213,7 +213,6 @@ declare module "http" {
|
|
|
213
213
|
defaultPort?: number | string | undefined;
|
|
214
214
|
family?: number | undefined;
|
|
215
215
|
headers?: OutgoingHttpHeaders | readonly string[] | undefined;
|
|
216
|
-
hints?: LookupOptions["hints"];
|
|
217
216
|
host?: string | null | undefined;
|
|
218
217
|
hostname?: string | null | undefined;
|
|
219
218
|
insecureHTTPParser?: boolean | undefined;
|
|
@@ -234,7 +233,7 @@ declare module "http" {
|
|
|
234
233
|
socketPath?: string | undefined;
|
|
235
234
|
timeout?: number | undefined;
|
|
236
235
|
uniqueHeaders?: Array<string | string[]> | undefined;
|
|
237
|
-
joinDuplicateHeaders?: boolean;
|
|
236
|
+
joinDuplicateHeaders?: boolean | undefined;
|
|
238
237
|
}
|
|
239
238
|
interface ServerOptions<
|
|
240
239
|
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
@@ -260,7 +259,7 @@ declare module "http" {
|
|
|
260
259
|
* @default false
|
|
261
260
|
* @since v18.14.0
|
|
262
261
|
*/
|
|
263
|
-
joinDuplicateHeaders?: boolean;
|
|
262
|
+
joinDuplicateHeaders?: boolean | undefined;
|
|
264
263
|
/**
|
|
265
264
|
* The number of milliseconds of inactivity a server needs to wait for additional incoming data,
|
|
266
265
|
* after it has finished writing the last response, before a socket will be destroyed.
|
node/http2.d.ts
CHANGED
|
@@ -51,14 +51,15 @@ declare module "http2" {
|
|
|
51
51
|
length: number;
|
|
52
52
|
}
|
|
53
53
|
export interface ServerStreamFileResponseOptions {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
statCheck?:
|
|
55
|
+
| ((stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void)
|
|
56
|
+
| undefined;
|
|
56
57
|
waitForTrailers?: boolean | undefined;
|
|
57
58
|
offset?: number | undefined;
|
|
58
59
|
length?: number | undefined;
|
|
59
60
|
}
|
|
60
61
|
export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
|
|
61
|
-
onError
|
|
62
|
+
onError?: ((err: NodeJS.ErrnoException) => void) | undefined;
|
|
62
63
|
}
|
|
63
64
|
export interface Http2Stream extends stream.Duplex {
|
|
64
65
|
/**
|
node/https.d.ts
CHANGED
|
@@ -8,20 +8,17 @@ 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
|
-
|
|
21
|
-
|
|
22
|
-
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
23
|
-
servername?: string | undefined; // SNI TLS Extension
|
|
24
|
-
};
|
|
14
|
+
> extends http.ServerOptions<Request, Response>, tls.TlsOptions {}
|
|
15
|
+
interface RequestOptions extends http.RequestOptions, tls.SecureContextOptions {
|
|
16
|
+
checkServerIdentity?:
|
|
17
|
+
| ((hostname: string, cert: tls.DetailedPeerCertificate) => Error | undefined)
|
|
18
|
+
| undefined;
|
|
19
|
+
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
20
|
+
servername?: string | undefined; // SNI TLS Extension
|
|
21
|
+
}
|
|
25
22
|
interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
|
26
23
|
maxCachedSessions?: number | undefined;
|
|
27
24
|
}
|
node/net.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare module "net" {
|
|
|
32
32
|
onread?: OnReadOpts | undefined;
|
|
33
33
|
readable?: boolean | undefined;
|
|
34
34
|
writable?: boolean | undefined;
|
|
35
|
-
signal?: AbortSignal;
|
|
35
|
+
signal?: AbortSignal | undefined;
|
|
36
36
|
}
|
|
37
37
|
interface OnReadOpts {
|
|
38
38
|
buffer: Uint8Array | (() => Uint8Array);
|
|
@@ -321,25 +321,25 @@ declare module "net" {
|
|
|
321
321
|
* the socket is destroyed (for example, if the client disconnected).
|
|
322
322
|
* @since v0.5.10
|
|
323
323
|
*/
|
|
324
|
-
readonly remoteAddress
|
|
324
|
+
readonly remoteAddress: string | undefined;
|
|
325
325
|
/**
|
|
326
326
|
* The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
|
|
327
327
|
* the socket is destroyed (for example, if the client disconnected).
|
|
328
328
|
* @since v0.11.14
|
|
329
329
|
*/
|
|
330
|
-
readonly remoteFamily
|
|
330
|
+
readonly remoteFamily: string | undefined;
|
|
331
331
|
/**
|
|
332
332
|
* The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
|
|
333
333
|
* the socket is destroyed (for example, if the client disconnected).
|
|
334
334
|
* @since v0.5.10
|
|
335
335
|
*/
|
|
336
|
-
readonly remotePort
|
|
336
|
+
readonly remotePort: number | undefined;
|
|
337
337
|
/**
|
|
338
338
|
* The socket timeout in milliseconds as set by `socket.setTimeout()`.
|
|
339
339
|
* It is `undefined` if a timeout has not been set.
|
|
340
340
|
* @since v10.7.0
|
|
341
341
|
*/
|
|
342
|
-
readonly timeout?: number
|
|
342
|
+
readonly timeout?: number;
|
|
343
343
|
/**
|
|
344
344
|
* Half-closes the socket. i.e., it sends a FIN packet. It is possible the
|
|
345
345
|
* server will still send some data.
|
node/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-v24.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "24.7.
|
|
3
|
+
"version": "24.7.2",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~7.14.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "4bf36d2d52de2aa8898ee24d026198a784567fa5a42adcae5e37b826951ff66d",
|
|
154
154
|
"typeScriptVersion": "5.2"
|
|
155
155
|
}
|
node/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
|
*
|
|
@@ -225,7 +223,7 @@ declare module "perf_hooks" {
|
|
|
225
223
|
/**
|
|
226
224
|
* Additional optional detail to include with the mark.
|
|
227
225
|
*/
|
|
228
|
-
detail?: unknown
|
|
226
|
+
detail?: unknown;
|
|
229
227
|
/**
|
|
230
228
|
* Duration between start and end times.
|
|
231
229
|
*/
|
node/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
|
|
|
@@ -346,7 +347,7 @@ declare module "process" {
|
|
|
346
347
|
/**
|
|
347
348
|
* Can be used to change the default timezone at runtime
|
|
348
349
|
*/
|
|
349
|
-
TZ?: string;
|
|
350
|
+
TZ?: string | undefined;
|
|
350
351
|
}
|
|
351
352
|
interface HRTime {
|
|
352
353
|
/**
|
|
@@ -990,7 +991,7 @@ declare module "process" {
|
|
|
990
991
|
* @since v0.1.13
|
|
991
992
|
* @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed.
|
|
992
993
|
*/
|
|
993
|
-
exit(code?: number | string | null
|
|
994
|
+
exit(code?: number | string | null): never;
|
|
994
995
|
/**
|
|
995
996
|
* A number which will be the process exit code, when the process either
|
|
996
997
|
* exits gracefully, or is exited via {@link exit} without specifying
|
|
@@ -1001,7 +1002,7 @@ declare module "process" {
|
|
|
1001
1002
|
* @default undefined
|
|
1002
1003
|
* @since v0.11.8
|
|
1003
1004
|
*/
|
|
1004
|
-
exitCode
|
|
1005
|
+
exitCode: number | string | null | undefined;
|
|
1005
1006
|
finalization: {
|
|
1006
1007
|
/**
|
|
1007
1008
|
* This function registers a callback to be called when the process emits the `exit` event if the `ref` object was not garbage collected.
|
|
@@ -1568,7 +1569,7 @@ declare module "process" {
|
|
|
1568
1569
|
* @since v0.1.17
|
|
1569
1570
|
* @deprecated Since v14.0.0 - Use `main` instead.
|
|
1570
1571
|
*/
|
|
1571
|
-
mainModule?: Module
|
|
1572
|
+
mainModule?: Module;
|
|
1572
1573
|
memoryUsage: MemoryUsageFn;
|
|
1573
1574
|
/**
|
|
1574
1575
|
* Gets the amount of memory available to the process (in bytes) based on
|
|
@@ -1760,18 +1761,7 @@ declare module "process" {
|
|
|
1760
1761
|
* If no IPC channel exists, this property is undefined.
|
|
1761
1762
|
* @since v7.1.0
|
|
1762
1763
|
*/
|
|
1763
|
-
channel?:
|
|
1764
|
-
/**
|
|
1765
|
-
* This method makes the IPC channel keep the event loop of the process running if .unref() has been called before.
|
|
1766
|
-
* @since v7.1.0
|
|
1767
|
-
*/
|
|
1768
|
-
ref(): void;
|
|
1769
|
-
/**
|
|
1770
|
-
* 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.
|
|
1771
|
-
* @since v7.1.0
|
|
1772
|
-
*/
|
|
1773
|
-
unref(): void;
|
|
1774
|
-
};
|
|
1764
|
+
channel?: Control;
|
|
1775
1765
|
/**
|
|
1776
1766
|
* If Node.js is spawned with an IPC channel, the `process.send()` method can be
|
|
1777
1767
|
* used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object.
|
|
@@ -1786,9 +1776,7 @@ declare module "process" {
|
|
|
1786
1776
|
send?(
|
|
1787
1777
|
message: any,
|
|
1788
1778
|
sendHandle?: any,
|
|
1789
|
-
options?:
|
|
1790
|
-
keepOpen?: boolean | undefined;
|
|
1791
|
-
},
|
|
1779
|
+
options?: MessageOptions,
|
|
1792
1780
|
callback?: (error: Error | null) => void,
|
|
1793
1781
|
): boolean;
|
|
1794
1782
|
/**
|
node/readline/promises.d.ts
CHANGED
node/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
|
|
@@ -697,21 +697,25 @@ declare module "stream" {
|
|
|
697
697
|
interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
|
|
698
698
|
decodeStrings?: boolean | undefined;
|
|
699
699
|
defaultEncoding?: BufferEncoding | undefined;
|
|
700
|
-
write
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
700
|
+
write?:
|
|
701
|
+
| ((
|
|
702
|
+
this: T,
|
|
703
|
+
chunk: any,
|
|
704
|
+
encoding: BufferEncoding,
|
|
705
|
+
callback: (error?: Error | null) => void,
|
|
706
|
+
) => void)
|
|
707
|
+
| undefined;
|
|
708
|
+
writev?:
|
|
709
|
+
| ((
|
|
710
|
+
this: T,
|
|
711
|
+
chunks: Array<{
|
|
712
|
+
chunk: any;
|
|
713
|
+
encoding: BufferEncoding;
|
|
714
|
+
}>,
|
|
715
|
+
callback: (error?: Error | null) => void,
|
|
716
|
+
) => void)
|
|
717
|
+
| undefined;
|
|
718
|
+
final?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined;
|
|
715
719
|
}
|
|
716
720
|
/**
|
|
717
721
|
* @since v0.9.4
|
|
@@ -1235,8 +1239,10 @@ declare module "stream" {
|
|
|
1235
1239
|
function duplexPair(options?: DuplexOptions): [Duplex, Duplex];
|
|
1236
1240
|
type TransformCallback = (error?: Error | null, data?: any) => void;
|
|
1237
1241
|
interface TransformOptions<T extends Transform = Transform> extends DuplexOptions<T> {
|
|
1238
|
-
transform
|
|
1239
|
-
|
|
1242
|
+
transform?:
|
|
1243
|
+
| ((this: T, chunk: any, encoding: BufferEncoding, callback: TransformCallback) => void)
|
|
1244
|
+
| undefined;
|
|
1245
|
+
flush?: ((this: T, callback: TransformCallback) => void) | undefined;
|
|
1240
1246
|
}
|
|
1241
1247
|
/**
|
|
1242
1248
|
* Transform streams are `Duplex` streams where the output is in some way
|
|
@@ -1643,6 +1649,7 @@ declare module "stream" {
|
|
|
1643
1649
|
...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
|
|
1644
1650
|
): Promise<void>;
|
|
1645
1651
|
}
|
|
1652
|
+
// TODO: this interface never existed; remove in next major
|
|
1646
1653
|
interface Pipe {
|
|
1647
1654
|
close(): void;
|
|
1648
1655
|
hasRef(): boolean;
|
node/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/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/vm.d.ts
CHANGED
|
@@ -99,28 +99,22 @@ declare module "vm" {
|
|
|
99
99
|
*/
|
|
100
100
|
breakOnSigint?: boolean | undefined;
|
|
101
101
|
}
|
|
102
|
-
interface RunningScriptInNewContextOptions
|
|
102
|
+
interface RunningScriptInNewContextOptions
|
|
103
|
+
extends RunningScriptOptions, Pick<CreateContextOptions, "microtaskMode">
|
|
104
|
+
{
|
|
103
105
|
/**
|
|
104
106
|
* Human-readable name of the newly created context.
|
|
105
107
|
*/
|
|
106
|
-
contextName?: CreateContextOptions["name"];
|
|
108
|
+
contextName?: CreateContextOptions["name"] | undefined;
|
|
107
109
|
/**
|
|
108
110
|
* Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
|
|
109
111
|
* but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
|
|
110
112
|
* Most notably, this string should omit the trailing slash, as that denotes a path.
|
|
111
113
|
*/
|
|
112
|
-
contextOrigin?: CreateContextOptions["origin"];
|
|
113
|
-
contextCodeGeneration?: CreateContextOptions["codeGeneration"];
|
|
114
|
-
/**
|
|
115
|
-
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
|
116
|
-
*/
|
|
117
|
-
microtaskMode?: CreateContextOptions["microtaskMode"];
|
|
114
|
+
contextOrigin?: CreateContextOptions["origin"] | undefined;
|
|
115
|
+
contextCodeGeneration?: CreateContextOptions["codeGeneration"] | undefined;
|
|
118
116
|
}
|
|
119
|
-
interface RunningCodeOptions extends RunningScriptOptions {
|
|
120
|
-
/**
|
|
121
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
122
|
-
*/
|
|
123
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
117
|
+
interface RunningCodeOptions extends RunningScriptOptions, Pick<ScriptOptions, "cachedData"> {
|
|
124
118
|
/**
|
|
125
119
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
126
120
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
@@ -132,11 +126,9 @@ declare module "vm" {
|
|
|
132
126
|
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
|
133
127
|
| undefined;
|
|
134
128
|
}
|
|
135
|
-
interface RunningCodeInNewContextOptions
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
*/
|
|
139
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
129
|
+
interface RunningCodeInNewContextOptions
|
|
130
|
+
extends RunningScriptInNewContextOptions, Pick<ScriptOptions, "cachedData">
|
|
131
|
+
{
|
|
140
132
|
/**
|
|
141
133
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
142
134
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
@@ -148,16 +140,7 @@ declare module "vm" {
|
|
|
148
140
|
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
|
149
141
|
| undefined;
|
|
150
142
|
}
|
|
151
|
-
interface CompileFunctionOptions extends BaseOptions {
|
|
152
|
-
/**
|
|
153
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
154
|
-
*/
|
|
155
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
156
|
-
/**
|
|
157
|
-
* Specifies whether to produce new cache data.
|
|
158
|
-
* @default false
|
|
159
|
-
*/
|
|
160
|
-
produceCachedData?: boolean | undefined;
|
|
143
|
+
interface CompileFunctionOptions extends BaseOptions, Pick<ScriptOptions, "cachedData" | "produceCachedData"> {
|
|
161
144
|
/**
|
|
162
145
|
* The sandbox/context in which the said function should be compiled in.
|
|
163
146
|
*/
|
|
@@ -386,15 +369,15 @@ declare module "vm" {
|
|
|
386
369
|
*/
|
|
387
370
|
createCachedData(): Buffer;
|
|
388
371
|
/** @deprecated in favor of `script.createCachedData()` */
|
|
389
|
-
cachedDataProduced?: boolean
|
|
372
|
+
cachedDataProduced?: boolean;
|
|
390
373
|
/**
|
|
391
374
|
* When `cachedData` is supplied to create the `vm.Script`, this value will be set
|
|
392
375
|
* to either `true` or `false` depending on acceptance of the data by V8.
|
|
393
376
|
* Otherwise the value is `undefined`.
|
|
394
377
|
* @since v5.7.0
|
|
395
378
|
*/
|
|
396
|
-
cachedDataRejected?: boolean
|
|
397
|
-
cachedData?: Buffer
|
|
379
|
+
cachedDataRejected?: boolean;
|
|
380
|
+
cachedData?: Buffer;
|
|
398
381
|
/**
|
|
399
382
|
* When the script is compiled from a source that contains a source map magic
|
|
400
383
|
* comment, this property will be set to the URL of the source map.
|
|
@@ -412,7 +395,7 @@ declare module "vm" {
|
|
|
412
395
|
* ```
|
|
413
396
|
* @since v19.1.0, v18.13.0
|
|
414
397
|
*/
|
|
415
|
-
sourceMapURL
|
|
398
|
+
sourceMapURL: string | undefined;
|
|
416
399
|
}
|
|
417
400
|
/**
|
|
418
401
|
* If the given `contextObject` is an object, the `vm.createContext()` method will
|
|
@@ -622,11 +605,7 @@ declare module "vm" {
|
|
|
622
605
|
code: string,
|
|
623
606
|
params?: readonly string[],
|
|
624
607
|
options?: CompileFunctionOptions,
|
|
625
|
-
): Function &
|
|
626
|
-
cachedData?: Script["cachedData"] | undefined;
|
|
627
|
-
cachedDataProduced?: Script["cachedDataProduced"] | undefined;
|
|
628
|
-
cachedDataRejected?: Script["cachedDataRejected"] | undefined;
|
|
629
|
-
};
|
|
608
|
+
): Function & Pick<Script, "cachedData" | "cachedDataProduced" | "cachedDataRejected">;
|
|
630
609
|
/**
|
|
631
610
|
* Measure the memory known to V8 and used by all contexts known to the
|
|
632
611
|
* current V8 isolate, or the main context.
|
|
@@ -683,10 +662,7 @@ declare module "vm" {
|
|
|
683
662
|
* @experimental
|
|
684
663
|
*/
|
|
685
664
|
function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
|
|
686
|
-
interface ModuleEvaluateOptions {
|
|
687
|
-
timeout?: RunningScriptOptions["timeout"] | undefined;
|
|
688
|
-
breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
|
|
689
|
-
}
|
|
665
|
+
interface ModuleEvaluateOptions extends Pick<RunningScriptOptions, "breakOnSigint" | "timeout"> {}
|
|
690
666
|
type ModuleLinker = (
|
|
691
667
|
specifier: string,
|
|
692
668
|
referencingModule: Module,
|
|
@@ -885,19 +861,13 @@ declare module "vm" {
|
|
|
885
861
|
*/
|
|
886
862
|
link(linker: ModuleLinker): Promise<void>;
|
|
887
863
|
}
|
|
888
|
-
interface SourceTextModuleOptions {
|
|
864
|
+
interface SourceTextModuleOptions extends Pick<ScriptOptions, "cachedData" | "columnOffset" | "lineOffset"> {
|
|
889
865
|
/**
|
|
890
866
|
* String used in stack traces.
|
|
891
867
|
* @default 'vm:module(i)' where i is a context-specific ascending index.
|
|
892
868
|
*/
|
|
893
869
|
identifier?: string | undefined;
|
|
894
|
-
/**
|
|
895
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
896
|
-
*/
|
|
897
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
898
870
|
context?: Context | undefined;
|
|
899
|
-
lineOffset?: BaseOptions["lineOffset"] | undefined;
|
|
900
|
-
columnOffset?: BaseOptions["columnOffset"] | undefined;
|
|
901
871
|
/**
|
|
902
872
|
* Called during evaluation of this module to initialize the `import.meta`.
|
|
903
873
|
*/
|