@types/node 20.19.22 → 20.19.24

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 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: Fri, 17 Oct 2025 02:09:19 GMT
11
+ * Last updated: Tue, 28 Oct 2025 17:37:26 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -450,7 +450,16 @@ declare module "buffer" {
450
450
  */
451
451
  subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
452
452
  }
453
+ // TODO: remove globals in future version
454
+ /**
455
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
456
+ * TypeScript versions earlier than 5.7.
457
+ */
453
458
  type NonSharedBuffer = Buffer<ArrayBuffer>;
459
+ /**
460
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
461
+ * TypeScript versions earlier than 5.7.
462
+ */
454
463
  type AllowSharedBuffer = Buffer<ArrayBufferLike>;
455
464
  }
456
465
  /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
node v20.19/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: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
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: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
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(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
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()`.
@@ -332,7 +336,7 @@ declare module "buffer" {
332
336
  * @return The number of bytes contained within `string`.
333
337
  */
334
338
  byteLength(
335
- string: string | Buffer | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
339
+ string: string | NodeJS.ArrayBufferView | ArrayBufferLike,
336
340
  encoding?: BufferEncoding,
337
341
  ): number;
338
342
  /**
@@ -66,6 +66,7 @@
66
66
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/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: Buffer, stderr: Buffer) => void,
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?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
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: Buffer;
1031
- stderr: Buffer;
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 | Buffer;
1045
- stderr: string | Buffer;
1049
+ stdout: string | NonSharedBuffer;
1050
+ stderr: string | NonSharedBuffer;
1046
1051
  }>;
1047
1052
  }
1048
1053
  interface ExecFileOptions extends CommonOptions, Abortable {
@@ -1143,13 +1148,13 @@ declare module "child_process" {
1143
1148
  function execFile(
1144
1149
  file: string,
1145
1150
  options: ExecFileOptionsWithBufferEncoding,
1146
- callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1151
+ callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1147
1152
  ): ChildProcess;
1148
1153
  function execFile(
1149
1154
  file: string,
1150
1155
  args: readonly string[] | undefined | null,
1151
1156
  options: ExecFileOptionsWithBufferEncoding,
1152
- callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1157
+ callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1153
1158
  ): ChildProcess;
1154
1159
  // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
1155
1160
  function execFile(
@@ -1168,7 +1173,11 @@ declare module "child_process" {
1168
1173
  file: string,
1169
1174
  options: ExecFileOptions | undefined | null,
1170
1175
  callback:
1171
- | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1176
+ | ((
1177
+ error: ExecFileException | null,
1178
+ stdout: string | NonSharedBuffer,
1179
+ stderr: string | NonSharedBuffer,
1180
+ ) => void)
1172
1181
  | undefined
1173
1182
  | null,
1174
1183
  ): ChildProcess;
@@ -1177,7 +1186,11 @@ declare module "child_process" {
1177
1186
  args: readonly string[] | undefined | null,
1178
1187
  options: ExecFileOptions | undefined | null,
1179
1188
  callback:
1180
- | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1189
+ | ((
1190
+ error: ExecFileException | null,
1191
+ stdout: string | NonSharedBuffer,
1192
+ stderr: string | NonSharedBuffer,
1193
+ ) => void)
1181
1194
  | undefined
1182
1195
  | null,
1183
1196
  ): ChildProcess;
@@ -1197,16 +1210,16 @@ declare module "child_process" {
1197
1210
  file: string,
1198
1211
  options: ExecFileOptionsWithBufferEncoding,
1199
1212
  ): PromiseWithChild<{
1200
- stdout: Buffer;
1201
- stderr: Buffer;
1213
+ stdout: NonSharedBuffer;
1214
+ stderr: NonSharedBuffer;
1202
1215
  }>;
1203
1216
  function __promisify__(
1204
1217
  file: string,
1205
1218
  args: readonly string[] | undefined | null,
1206
1219
  options: ExecFileOptionsWithBufferEncoding,
1207
1220
  ): PromiseWithChild<{
1208
- stdout: Buffer;
1209
- stderr: Buffer;
1221
+ stdout: NonSharedBuffer;
1222
+ stderr: NonSharedBuffer;
1210
1223
  }>;
1211
1224
  function __promisify__(
1212
1225
  file: string,
@@ -1227,16 +1240,16 @@ declare module "child_process" {
1227
1240
  file: string,
1228
1241
  options: ExecFileOptions | undefined | null,
1229
1242
  ): PromiseWithChild<{
1230
- stdout: string | Buffer;
1231
- stderr: string | Buffer;
1243
+ stdout: string | NonSharedBuffer;
1244
+ stderr: string | NonSharedBuffer;
1232
1245
  }>;
1233
1246
  function __promisify__(
1234
1247
  file: string,
1235
1248
  args: readonly string[] | undefined | null,
1236
1249
  options: ExecFileOptions | undefined | null,
1237
1250
  ): PromiseWithChild<{
1238
- stdout: string | Buffer;
1239
- stderr: string | Buffer;
1251
+ stdout: string | NonSharedBuffer;
1252
+ stderr: string | NonSharedBuffer;
1240
1253
  }>;
1241
1254
  }
1242
1255
  interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
@@ -1342,11 +1355,11 @@ declare module "child_process" {
1342
1355
  * @param command The command to run.
1343
1356
  * @param args List of string arguments.
1344
1357
  */
1345
- function spawnSync(command: string): SpawnSyncReturns<Buffer>;
1358
+ function spawnSync(command: string): SpawnSyncReturns<NonSharedBuffer>;
1346
1359
  function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1347
- function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1348
- function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
1349
- function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<Buffer>;
1360
+ function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<NonSharedBuffer>;
1361
+ function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | NonSharedBuffer>;
1362
+ function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<NonSharedBuffer>;
1350
1363
  function spawnSync(
1351
1364
  command: string,
1352
1365
  args: readonly string[],
@@ -1356,12 +1369,12 @@ declare module "child_process" {
1356
1369
  command: string,
1357
1370
  args: readonly string[],
1358
1371
  options: SpawnSyncOptionsWithBufferEncoding,
1359
- ): SpawnSyncReturns<Buffer>;
1372
+ ): SpawnSyncReturns<NonSharedBuffer>;
1360
1373
  function spawnSync(
1361
1374
  command: string,
1362
1375
  args?: readonly string[],
1363
1376
  options?: SpawnSyncOptions,
1364
- ): SpawnSyncReturns<string | Buffer>;
1377
+ ): SpawnSyncReturns<string | NonSharedBuffer>;
1365
1378
  interface CommonExecOptions extends CommonOptions {
1366
1379
  input?: string | NodeJS.ArrayBufferView | undefined;
1367
1380
  /**
@@ -1403,10 +1416,10 @@ declare module "child_process" {
1403
1416
  * @param command The command to run.
1404
1417
  * @return The stdout from the command.
1405
1418
  */
1406
- function execSync(command: string): Buffer;
1419
+ function execSync(command: string): NonSharedBuffer;
1407
1420
  function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
1408
- function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
1409
- function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
1421
+ function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): NonSharedBuffer;
1422
+ function execSync(command: string, options?: ExecSyncOptions): string | NonSharedBuffer;
1410
1423
  interface ExecFileSyncOptions extends CommonExecOptions {
1411
1424
  shell?: boolean | string | undefined;
1412
1425
  }
@@ -1436,11 +1449,11 @@ declare module "child_process" {
1436
1449
  * @param args List of string arguments.
1437
1450
  * @return The stdout from the command.
1438
1451
  */
1439
- function execFileSync(file: string): Buffer;
1452
+ function execFileSync(file: string): NonSharedBuffer;
1440
1453
  function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
1441
- function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1442
- function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
1443
- function execFileSync(file: string, args: readonly string[]): Buffer;
1454
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): NonSharedBuffer;
1455
+ function execFileSync(file: string, options?: ExecFileSyncOptions): string | NonSharedBuffer;
1456
+ function execFileSync(file: string, args: readonly string[]): NonSharedBuffer;
1444
1457
  function execFileSync(
1445
1458
  file: string,
1446
1459
  args: readonly string[],
@@ -1450,8 +1463,12 @@ declare module "child_process" {
1450
1463
  file: string,
1451
1464
  args: readonly string[],
1452
1465
  options: ExecFileSyncOptionsWithBufferEncoding,
1453
- ): Buffer;
1454
- function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer;
1466
+ ): NonSharedBuffer;
1467
+ function execFileSync(
1468
+ file: string,
1469
+ args?: readonly string[],
1470
+ options?: ExecFileSyncOptions,
1471
+ ): string | NonSharedBuffer;
1455
1472
  }
1456
1473
  declare module "node:child_process" {
1457
1474
  export * from "child_process";