@types/node 20.19.10 → 20.19.11

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, 08 Aug 2025 16:38:49 GMT
11
+ * Last updated: Fri, 15 Aug 2025 08:39:32 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -66,7 +66,6 @@
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 { ObjectEncodingOptions } from "node:fs";
70
69
  import { Abortable, EventEmitter } from "node:events";
71
70
  import * as dgram from "node:dgram";
72
71
  import * as net from "node:net";
@@ -887,12 +886,13 @@ declare module "child_process" {
887
886
  signal?: AbortSignal | undefined;
888
887
  maxBuffer?: number | undefined;
889
888
  killSignal?: NodeJS.Signals | number | undefined;
889
+ encoding?: string | null | undefined;
890
890
  }
891
891
  interface ExecOptionsWithStringEncoding extends ExecOptions {
892
- encoding: BufferEncoding;
892
+ encoding?: BufferEncoding | undefined;
893
893
  }
894
894
  interface ExecOptionsWithBufferEncoding extends ExecOptions {
895
- encoding: BufferEncoding | null; // specify `null`.
895
+ encoding: "buffer" | null; // specify `null`.
896
896
  }
897
897
  interface ExecException extends Error {
898
898
  cmd?: string | undefined;
@@ -995,38 +995,19 @@ declare module "child_process" {
995
995
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
996
996
  function exec(
997
997
  command: string,
998
- options: {
999
- encoding: "buffer" | null;
1000
- } & ExecOptions,
998
+ options: ExecOptionsWithBufferEncoding,
1001
999
  callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
1002
1000
  ): ChildProcess;
1003
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
1004
- function exec(
1005
- command: string,
1006
- options: {
1007
- encoding: BufferEncoding;
1008
- } & ExecOptions,
1009
- callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1010
- ): ChildProcess;
1011
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1012
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1013
- function exec(
1014
- command: string,
1015
- options: {
1016
- encoding: BufferEncoding;
1017
- } & ExecOptions,
1018
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1019
- ): ChildProcess;
1020
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
1001
+ // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
1021
1002
  function exec(
1022
1003
  command: string,
1023
- options: ExecOptions,
1004
+ options: ExecOptionsWithStringEncoding,
1024
1005
  callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1025
1006
  ): ChildProcess;
1026
1007
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1027
1008
  function exec(
1028
1009
  command: string,
1029
- options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
1010
+ options: ExecOptions | undefined | null,
1030
1011
  callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1031
1012
  ): ChildProcess;
1032
1013
  interface PromiseWithChild<T> extends Promise<T> {
@@ -1039,32 +1020,21 @@ declare module "child_process" {
1039
1020
  }>;
1040
1021
  function __promisify__(
1041
1022
  command: string,
1042
- options: {
1043
- encoding: "buffer" | null;
1044
- } & ExecOptions,
1023
+ options: ExecOptionsWithBufferEncoding,
1045
1024
  ): PromiseWithChild<{
1046
1025
  stdout: Buffer;
1047
1026
  stderr: Buffer;
1048
1027
  }>;
1049
1028
  function __promisify__(
1050
1029
  command: string,
1051
- options: {
1052
- encoding: BufferEncoding;
1053
- } & ExecOptions,
1030
+ options: ExecOptionsWithStringEncoding,
1054
1031
  ): PromiseWithChild<{
1055
1032
  stdout: string;
1056
1033
  stderr: string;
1057
1034
  }>;
1058
1035
  function __promisify__(
1059
1036
  command: string,
1060
- options: ExecOptions,
1061
- ): PromiseWithChild<{
1062
- stdout: string;
1063
- stderr: string;
1064
- }>;
1065
- function __promisify__(
1066
- command: string,
1067
- options?: (ObjectEncodingOptions & ExecOptions) | null,
1037
+ options: ExecOptions | undefined | null,
1068
1038
  ): PromiseWithChild<{
1069
1039
  stdout: string | Buffer;
1070
1040
  stderr: string | Buffer;
@@ -1076,16 +1046,16 @@ declare module "child_process" {
1076
1046
  windowsVerbatimArguments?: boolean | undefined;
1077
1047
  shell?: boolean | string | undefined;
1078
1048
  signal?: AbortSignal | undefined;
1049
+ encoding?: string | null | undefined;
1079
1050
  }
1080
1051
  interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
1081
- encoding: BufferEncoding;
1052
+ encoding?: BufferEncoding | undefined;
1082
1053
  }
1083
1054
  interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
1084
1055
  encoding: "buffer" | null;
1085
1056
  }
1086
- interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
1087
- encoding: BufferEncoding;
1088
- }
1057
+ /** @deprecated Use `ExecFileOptions` instead. */
1058
+ interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
1089
1059
  type ExecFileException =
1090
1060
  & Omit<ExecException, "code">
1091
1061
  & Omit<NodeJS.ErrnoException, "code">
@@ -1153,80 +1123,44 @@ declare module "child_process" {
1153
1123
  * @param args List of string arguments.
1154
1124
  * @param callback Called with the output when process terminates.
1155
1125
  */
1156
- function execFile(file: string): ChildProcess;
1157
- function execFile(
1158
- file: string,
1159
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1160
- ): ChildProcess;
1161
- function execFile(file: string, args?: readonly string[] | null): ChildProcess;
1162
- function execFile(
1163
- file: string,
1164
- args: readonly string[] | undefined | null,
1165
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1166
- ): ChildProcess;
1167
1126
  // no `options` definitely means stdout/stderr are `string`.
1168
1127
  function execFile(
1169
1128
  file: string,
1170
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1129
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1171
1130
  ): ChildProcess;
1172
1131
  function execFile(
1173
1132
  file: string,
1174
1133
  args: readonly string[] | undefined | null,
1175
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1134
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1176
1135
  ): ChildProcess;
1177
1136
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
1178
1137
  function execFile(
1179
1138
  file: string,
1180
1139
  options: ExecFileOptionsWithBufferEncoding,
1181
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1140
+ callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1182
1141
  ): ChildProcess;
1183
1142
  function execFile(
1184
1143
  file: string,
1185
1144
  args: readonly string[] | undefined | null,
1186
1145
  options: ExecFileOptionsWithBufferEncoding,
1187
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1146
+ callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1188
1147
  ): ChildProcess;
1189
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
1148
+ // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
1190
1149
  function execFile(
1191
1150
  file: string,
1192
1151
  options: ExecFileOptionsWithStringEncoding,
1193
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1152
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1194
1153
  ): ChildProcess;
1195
1154
  function execFile(
1196
1155
  file: string,
1197
1156
  args: readonly string[] | undefined | null,
1198
1157
  options: ExecFileOptionsWithStringEncoding,
1199
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1200
- ): ChildProcess;
1201
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1202
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1203
- function execFile(
1204
- file: string,
1205
- options: ExecFileOptionsWithOtherEncoding,
1206
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1207
- ): ChildProcess;
1208
- function execFile(
1209
- file: string,
1210
- args: readonly string[] | undefined | null,
1211
- options: ExecFileOptionsWithOtherEncoding,
1212
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1213
- ): ChildProcess;
1214
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
1215
- function execFile(
1216
- file: string,
1217
- options: ExecFileOptions,
1218
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1219
- ): ChildProcess;
1220
- function execFile(
1221
- file: string,
1222
- args: readonly string[] | undefined | null,
1223
- options: ExecFileOptions,
1224
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1158
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1225
1159
  ): ChildProcess;
1226
1160
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1227
1161
  function execFile(
1228
1162
  file: string,
1229
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1163
+ options: ExecFileOptions | undefined | null,
1230
1164
  callback:
1231
1165
  | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1232
1166
  | undefined
@@ -1235,7 +1169,7 @@ declare module "child_process" {
1235
1169
  function execFile(
1236
1170
  file: string,
1237
1171
  args: readonly string[] | undefined | null,
1238
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1172
+ options: ExecFileOptions | undefined | null,
1239
1173
  callback:
1240
1174
  | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1241
1175
  | undefined
@@ -1285,37 +1219,7 @@ declare module "child_process" {
1285
1219
  }>;
1286
1220
  function __promisify__(
1287
1221
  file: string,
1288
- options: ExecFileOptionsWithOtherEncoding,
1289
- ): PromiseWithChild<{
1290
- stdout: string | Buffer;
1291
- stderr: string | Buffer;
1292
- }>;
1293
- function __promisify__(
1294
- file: string,
1295
- args: readonly string[] | undefined | null,
1296
- options: ExecFileOptionsWithOtherEncoding,
1297
- ): PromiseWithChild<{
1298
- stdout: string | Buffer;
1299
- stderr: string | Buffer;
1300
- }>;
1301
- function __promisify__(
1302
- file: string,
1303
- options: ExecFileOptions,
1304
- ): PromiseWithChild<{
1305
- stdout: string;
1306
- stderr: string;
1307
- }>;
1308
- function __promisify__(
1309
- file: string,
1310
- args: readonly string[] | undefined | null,
1311
- options: ExecFileOptions,
1312
- ): PromiseWithChild<{
1313
- stdout: string;
1314
- stderr: string;
1315
- }>;
1316
- function __promisify__(
1317
- file: string,
1318
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1222
+ options: ExecFileOptions | undefined | null,
1319
1223
  ): PromiseWithChild<{
1320
1224
  stdout: string | Buffer;
1321
1225
  stderr: string | Buffer;
@@ -1323,7 +1227,7 @@ declare module "child_process" {
1323
1227
  function __promisify__(
1324
1228
  file: string,
1325
1229
  args: readonly string[] | undefined | null,
1326
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1230
+ options: ExecFileOptions | undefined | null,
1327
1231
  ): PromiseWithChild<{
1328
1232
  stdout: string | Buffer;
1329
1233
  stderr: string | Buffer;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.19.10",
3
+ "version": "20.19.11",
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": "da2c8dc92e2f4476e8d56904cea688f98e4bf8dee450ca0de0990829662d89bd",
138
+ "typesPublisherContentHash": "d9417d14fd1bdb3eca9a2b40a6b355fade6f1c645286da30bca0f4a0f8ddcab1",
139
139
  "typeScriptVersion": "5.2"
140
140
  }