@types/node 24.8.1 → 24.9.1
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 +36 -1
- node/buffer.buffer.d.ts +9 -0
- node/buffer.d.ts +8 -4
- node/child_process.d.ts +50 -33
- node/crypto.d.ts +198 -164
- node/dgram.d.ts +9 -8
- node/fs/promises.d.ts +39 -21
- node/fs.d.ts +89 -76
- node/globals.typedarray.d.ts +19 -0
- node/http.d.ts +52 -22
- node/http2.d.ts +29 -22
- node/https.d.ts +82 -50
- node/net.d.ts +7 -6
- node/os.d.ts +3 -2
- node/package.json +3 -3
- node/process.d.ts +2 -1
- node/sqlite.d.ts +114 -7
- node/stream/consumers.d.ts +2 -2
- node/string_decoder.d.ts +2 -2
- node/tls.d.ts +88 -64
- node/ts5.6/buffer.buffer.d.ts +10 -2
- node/ts5.6/globals.typedarray.d.ts +16 -0
- node/url.d.ts +2 -2
- node/util.d.ts +11 -2
- node/v8.d.ts +20 -3
- node/vm.d.ts +24 -3
- node/worker_threads.d.ts +40 -3
- node/zlib.d.ts +25 -24
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: Tue, 21 Oct 2025 00:04:31 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node/assert.d.ts
CHANGED
|
@@ -44,6 +44,13 @@ declare module "assert" {
|
|
|
44
44
|
* @default true
|
|
45
45
|
*/
|
|
46
46
|
strict?: boolean | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* If set to `true`, skips prototype and constructor
|
|
49
|
+
* comparison in deep equality checks.
|
|
50
|
+
* @since v24.9.0
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
skipPrototype?: boolean | undefined;
|
|
47
54
|
}
|
|
48
55
|
interface Assert extends Pick<typeof assert, AssertMethodNames> {
|
|
49
56
|
readonly [kOptions]: AssertOptions & { strict: false };
|
|
@@ -67,7 +74,8 @@ declare module "assert" {
|
|
|
67
74
|
* ```
|
|
68
75
|
*
|
|
69
76
|
* **Important**: When destructuring assertion methods from an `Assert` instance,
|
|
70
|
-
* the methods lose their connection to the instance's configuration options (such
|
|
77
|
+
* the methods lose their connection to the instance's configuration options (such
|
|
78
|
+
* as `diff`, `strict`, and `skipPrototype` settings).
|
|
71
79
|
* The destructured methods will fall back to default behavior instead.
|
|
72
80
|
*
|
|
73
81
|
* ```js
|
|
@@ -81,6 +89,33 @@ declare module "assert" {
|
|
|
81
89
|
* strictEqual({ a: 1 }, { b: { c: 1 } });
|
|
82
90
|
* ```
|
|
83
91
|
*
|
|
92
|
+
* The `skipPrototype` option affects all deep equality methods:
|
|
93
|
+
*
|
|
94
|
+
* ```js
|
|
95
|
+
* class Foo {
|
|
96
|
+
* constructor(a) {
|
|
97
|
+
* this.a = a;
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* class Bar {
|
|
102
|
+
* constructor(a) {
|
|
103
|
+
* this.a = a;
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
*
|
|
107
|
+
* const foo = new Foo(1);
|
|
108
|
+
* const bar = new Bar(1);
|
|
109
|
+
*
|
|
110
|
+
* // Default behavior - fails due to different constructors
|
|
111
|
+
* const assert1 = new Assert();
|
|
112
|
+
* assert1.deepStrictEqual(foo, bar); // AssertionError
|
|
113
|
+
*
|
|
114
|
+
* // Skip prototype comparison - passes if properties are equal
|
|
115
|
+
* const assert2 = new Assert({ skipPrototype: true });
|
|
116
|
+
* assert2.deepStrictEqual(foo, bar); // OK
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
84
119
|
* When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior
|
|
85
120
|
* (diff: 'simple', non-strict mode).
|
|
86
121
|
* To maintain custom options when using destructured methods, avoid
|
node/buffer.buffer.d.ts
CHANGED
|
@@ -451,7 +451,16 @@ declare module "buffer" {
|
|
|
451
451
|
*/
|
|
452
452
|
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
|
|
453
453
|
}
|
|
454
|
+
// TODO: remove globals in future version
|
|
455
|
+
/**
|
|
456
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
457
|
+
* TypeScript versions earlier than 5.7.
|
|
458
|
+
*/
|
|
454
459
|
type NonSharedBuffer = Buffer<ArrayBuffer>;
|
|
460
|
+
/**
|
|
461
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
462
|
+
* TypeScript versions earlier than 5.7.
|
|
463
|
+
*/
|
|
455
464
|
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
|
|
456
465
|
}
|
|
457
466
|
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
node/buffer.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ declare module "buffer" {
|
|
|
59
59
|
* @since v19.4.0, v18.14.0
|
|
60
60
|
* @param input The input to validate.
|
|
61
61
|
*/
|
|
62
|
-
export function isUtf8(input:
|
|
62
|
+
export function isUtf8(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
63
63
|
/**
|
|
64
64
|
* This function returns `true` if `input` contains only valid ASCII-encoded data,
|
|
65
65
|
* including the case in which `input` is empty.
|
|
@@ -68,7 +68,7 @@ declare module "buffer" {
|
|
|
68
68
|
* @since v19.6.0, v18.15.0
|
|
69
69
|
* @param input The input to validate.
|
|
70
70
|
*/
|
|
71
|
-
export function isAscii(input:
|
|
71
|
+
export function isAscii(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
72
72
|
export let INSPECT_MAX_BYTES: number;
|
|
73
73
|
export const kMaxLength: number;
|
|
74
74
|
export const kStringMaxLength: number;
|
|
@@ -113,7 +113,11 @@ declare module "buffer" {
|
|
|
113
113
|
* @param fromEnc The current encoding.
|
|
114
114
|
* @param toEnc To target encoding.
|
|
115
115
|
*/
|
|
116
|
-
export function transcode(
|
|
116
|
+
export function transcode(
|
|
117
|
+
source: Uint8Array,
|
|
118
|
+
fromEnc: TranscodeEncoding,
|
|
119
|
+
toEnc: TranscodeEncoding,
|
|
120
|
+
): NonSharedBuffer;
|
|
117
121
|
/**
|
|
118
122
|
* Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
|
|
119
123
|
* a prior call to `URL.createObjectURL()`.
|
|
@@ -330,7 +334,7 @@ declare module "buffer" {
|
|
|
330
334
|
* @return The number of bytes contained within `string`.
|
|
331
335
|
*/
|
|
332
336
|
byteLength(
|
|
333
|
-
string: string |
|
|
337
|
+
string: string | NodeJS.ArrayBufferView | ArrayBufferLike,
|
|
334
338
|
encoding?: BufferEncoding,
|
|
335
339
|
): number;
|
|
336
340
|
/**
|
node/child_process.d.ts
CHANGED
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/child_process.js)
|
|
67
67
|
*/
|
|
68
68
|
declare module "child_process" {
|
|
69
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
69
70
|
import { Abortable, EventEmitter } from "node:events";
|
|
70
71
|
import * as dgram from "node:dgram";
|
|
71
72
|
import * as net from "node:net";
|
|
@@ -1001,7 +1002,7 @@ declare module "child_process" {
|
|
|
1001
1002
|
function exec(
|
|
1002
1003
|
command: string,
|
|
1003
1004
|
options: ExecOptionsWithBufferEncoding,
|
|
1004
|
-
callback?: (error: ExecException | null, stdout:
|
|
1005
|
+
callback?: (error: ExecException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
|
1005
1006
|
): ChildProcess;
|
|
1006
1007
|
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
|
1007
1008
|
function exec(
|
|
@@ -1013,7 +1014,11 @@ declare module "child_process" {
|
|
|
1013
1014
|
function exec(
|
|
1014
1015
|
command: string,
|
|
1015
1016
|
options: ExecOptions | undefined | null,
|
|
1016
|
-
callback?: (
|
|
1017
|
+
callback?: (
|
|
1018
|
+
error: ExecException | null,
|
|
1019
|
+
stdout: string | NonSharedBuffer,
|
|
1020
|
+
stderr: string | NonSharedBuffer,
|
|
1021
|
+
) => void,
|
|
1017
1022
|
): ChildProcess;
|
|
1018
1023
|
interface PromiseWithChild<T> extends Promise<T> {
|
|
1019
1024
|
child: ChildProcess;
|
|
@@ -1027,8 +1032,8 @@ declare module "child_process" {
|
|
|
1027
1032
|
command: string,
|
|
1028
1033
|
options: ExecOptionsWithBufferEncoding,
|
|
1029
1034
|
): PromiseWithChild<{
|
|
1030
|
-
stdout:
|
|
1031
|
-
stderr:
|
|
1035
|
+
stdout: NonSharedBuffer;
|
|
1036
|
+
stderr: NonSharedBuffer;
|
|
1032
1037
|
}>;
|
|
1033
1038
|
function __promisify__(
|
|
1034
1039
|
command: string,
|
|
@@ -1041,8 +1046,8 @@ declare module "child_process" {
|
|
|
1041
1046
|
command: string,
|
|
1042
1047
|
options: ExecOptions | undefined | null,
|
|
1043
1048
|
): PromiseWithChild<{
|
|
1044
|
-
stdout: string |
|
|
1045
|
-
stderr: string |
|
|
1049
|
+
stdout: string | NonSharedBuffer;
|
|
1050
|
+
stderr: string | NonSharedBuffer;
|
|
1046
1051
|
}>;
|
|
1047
1052
|
}
|
|
1048
1053
|
interface ExecFileOptions extends CommonOptions, Abortable {
|
|
@@ -1144,13 +1149,13 @@ declare module "child_process" {
|
|
|
1144
1149
|
function execFile(
|
|
1145
1150
|
file: string,
|
|
1146
1151
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1147
|
-
callback?: (error: ExecFileException | null, stdout:
|
|
1152
|
+
callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
|
1148
1153
|
): ChildProcess;
|
|
1149
1154
|
function execFile(
|
|
1150
1155
|
file: string,
|
|
1151
1156
|
args: readonly string[] | undefined | null,
|
|
1152
1157
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1153
|
-
callback?: (error: ExecFileException | null, stdout:
|
|
1158
|
+
callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
|
1154
1159
|
): ChildProcess;
|
|
1155
1160
|
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
|
1156
1161
|
function execFile(
|
|
@@ -1169,7 +1174,11 @@ declare module "child_process" {
|
|
|
1169
1174
|
file: string,
|
|
1170
1175
|
options: ExecFileOptions | undefined | null,
|
|
1171
1176
|
callback:
|
|
1172
|
-
| ((
|
|
1177
|
+
| ((
|
|
1178
|
+
error: ExecFileException | null,
|
|
1179
|
+
stdout: string | NonSharedBuffer,
|
|
1180
|
+
stderr: string | NonSharedBuffer,
|
|
1181
|
+
) => void)
|
|
1173
1182
|
| undefined
|
|
1174
1183
|
| null,
|
|
1175
1184
|
): ChildProcess;
|
|
@@ -1178,7 +1187,11 @@ declare module "child_process" {
|
|
|
1178
1187
|
args: readonly string[] | undefined | null,
|
|
1179
1188
|
options: ExecFileOptions | undefined | null,
|
|
1180
1189
|
callback:
|
|
1181
|
-
| ((
|
|
1190
|
+
| ((
|
|
1191
|
+
error: ExecFileException | null,
|
|
1192
|
+
stdout: string | NonSharedBuffer,
|
|
1193
|
+
stderr: string | NonSharedBuffer,
|
|
1194
|
+
) => void)
|
|
1182
1195
|
| undefined
|
|
1183
1196
|
| null,
|
|
1184
1197
|
): ChildProcess;
|
|
@@ -1198,16 +1211,16 @@ declare module "child_process" {
|
|
|
1198
1211
|
file: string,
|
|
1199
1212
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1200
1213
|
): PromiseWithChild<{
|
|
1201
|
-
stdout:
|
|
1202
|
-
stderr:
|
|
1214
|
+
stdout: NonSharedBuffer;
|
|
1215
|
+
stderr: NonSharedBuffer;
|
|
1203
1216
|
}>;
|
|
1204
1217
|
function __promisify__(
|
|
1205
1218
|
file: string,
|
|
1206
1219
|
args: readonly string[] | undefined | null,
|
|
1207
1220
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1208
1221
|
): PromiseWithChild<{
|
|
1209
|
-
stdout:
|
|
1210
|
-
stderr:
|
|
1222
|
+
stdout: NonSharedBuffer;
|
|
1223
|
+
stderr: NonSharedBuffer;
|
|
1211
1224
|
}>;
|
|
1212
1225
|
function __promisify__(
|
|
1213
1226
|
file: string,
|
|
@@ -1228,16 +1241,16 @@ declare module "child_process" {
|
|
|
1228
1241
|
file: string,
|
|
1229
1242
|
options: ExecFileOptions | undefined | null,
|
|
1230
1243
|
): PromiseWithChild<{
|
|
1231
|
-
stdout: string |
|
|
1232
|
-
stderr: string |
|
|
1244
|
+
stdout: string | NonSharedBuffer;
|
|
1245
|
+
stderr: string | NonSharedBuffer;
|
|
1233
1246
|
}>;
|
|
1234
1247
|
function __promisify__(
|
|
1235
1248
|
file: string,
|
|
1236
1249
|
args: readonly string[] | undefined | null,
|
|
1237
1250
|
options: ExecFileOptions | undefined | null,
|
|
1238
1251
|
): PromiseWithChild<{
|
|
1239
|
-
stdout: string |
|
|
1240
|
-
stderr: string |
|
|
1252
|
+
stdout: string | NonSharedBuffer;
|
|
1253
|
+
stderr: string | NonSharedBuffer;
|
|
1241
1254
|
}>;
|
|
1242
1255
|
}
|
|
1243
1256
|
interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
|
|
@@ -1343,11 +1356,11 @@ declare module "child_process" {
|
|
|
1343
1356
|
* @param command The command to run.
|
|
1344
1357
|
* @param args List of string arguments.
|
|
1345
1358
|
*/
|
|
1346
|
-
function spawnSync(command: string): SpawnSyncReturns<
|
|
1359
|
+
function spawnSync(command: string): SpawnSyncReturns<NonSharedBuffer>;
|
|
1347
1360
|
function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
|
1348
|
-
function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<
|
|
1349
|
-
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string |
|
|
1350
|
-
function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<
|
|
1361
|
+
function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<NonSharedBuffer>;
|
|
1362
|
+
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | NonSharedBuffer>;
|
|
1363
|
+
function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<NonSharedBuffer>;
|
|
1351
1364
|
function spawnSync(
|
|
1352
1365
|
command: string,
|
|
1353
1366
|
args: readonly string[],
|
|
@@ -1357,12 +1370,12 @@ declare module "child_process" {
|
|
|
1357
1370
|
command: string,
|
|
1358
1371
|
args: readonly string[],
|
|
1359
1372
|
options: SpawnSyncOptionsWithBufferEncoding,
|
|
1360
|
-
): SpawnSyncReturns<
|
|
1373
|
+
): SpawnSyncReturns<NonSharedBuffer>;
|
|
1361
1374
|
function spawnSync(
|
|
1362
1375
|
command: string,
|
|
1363
1376
|
args?: readonly string[],
|
|
1364
1377
|
options?: SpawnSyncOptions,
|
|
1365
|
-
): SpawnSyncReturns<string |
|
|
1378
|
+
): SpawnSyncReturns<string | NonSharedBuffer>;
|
|
1366
1379
|
interface CommonExecOptions extends CommonOptions {
|
|
1367
1380
|
input?: string | NodeJS.ArrayBufferView | undefined;
|
|
1368
1381
|
/**
|
|
@@ -1404,10 +1417,10 @@ declare module "child_process" {
|
|
|
1404
1417
|
* @param command The command to run.
|
|
1405
1418
|
* @return The stdout from the command.
|
|
1406
1419
|
*/
|
|
1407
|
-
function execSync(command: string):
|
|
1420
|
+
function execSync(command: string): NonSharedBuffer;
|
|
1408
1421
|
function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
|
|
1409
|
-
function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding):
|
|
1410
|
-
function execSync(command: string, options?: ExecSyncOptions): string |
|
|
1422
|
+
function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): NonSharedBuffer;
|
|
1423
|
+
function execSync(command: string, options?: ExecSyncOptions): string | NonSharedBuffer;
|
|
1411
1424
|
interface ExecFileSyncOptions extends CommonExecOptions {
|
|
1412
1425
|
shell?: boolean | string | undefined;
|
|
1413
1426
|
}
|
|
@@ -1437,11 +1450,11 @@ declare module "child_process" {
|
|
|
1437
1450
|
* @param args List of string arguments.
|
|
1438
1451
|
* @return The stdout from the command.
|
|
1439
1452
|
*/
|
|
1440
|
-
function execFileSync(file: string):
|
|
1453
|
+
function execFileSync(file: string): NonSharedBuffer;
|
|
1441
1454
|
function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
|
|
1442
|
-
function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding):
|
|
1443
|
-
function execFileSync(file: string, options?: ExecFileSyncOptions): string |
|
|
1444
|
-
function execFileSync(file: string, args: readonly string[]):
|
|
1455
|
+
function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): NonSharedBuffer;
|
|
1456
|
+
function execFileSync(file: string, options?: ExecFileSyncOptions): string | NonSharedBuffer;
|
|
1457
|
+
function execFileSync(file: string, args: readonly string[]): NonSharedBuffer;
|
|
1445
1458
|
function execFileSync(
|
|
1446
1459
|
file: string,
|
|
1447
1460
|
args: readonly string[],
|
|
@@ -1451,8 +1464,12 @@ declare module "child_process" {
|
|
|
1451
1464
|
file: string,
|
|
1452
1465
|
args: readonly string[],
|
|
1453
1466
|
options: ExecFileSyncOptionsWithBufferEncoding,
|
|
1454
|
-
):
|
|
1455
|
-
function execFileSync(
|
|
1467
|
+
): NonSharedBuffer;
|
|
1468
|
+
function execFileSync(
|
|
1469
|
+
file: string,
|
|
1470
|
+
args?: readonly string[],
|
|
1471
|
+
options?: ExecFileSyncOptions,
|
|
1472
|
+
): string | NonSharedBuffer;
|
|
1456
1473
|
}
|
|
1457
1474
|
declare module "node:child_process" {
|
|
1458
1475
|
export * from "child_process";
|