@types/node 22.17.1 → 22.18.0
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 v22.17 → node v22.18}/README.md +1 -1
- {node v22.17 → node v22.18}/buffer.d.ts +1 -1
- {node v22.17 → node v22.18}/child_process.d.ts +26 -122
- {node v22.17 → node v22.18}/fs/promises.d.ts +19 -26
- {node v22.17 → node v22.18}/fs.d.ts +17 -34
- {node v22.17 → node v22.18}/http.d.ts +1 -1
- {node v22.17 → node v22.18}/inspector.d.ts +68 -12
- {node v22.17 → node v22.18}/module.d.ts +24 -0
- {node v22.17 → node v22.18}/package.json +2 -2
- {node v22.17 → node v22.18}/process.d.ts +3 -2
- {node v22.17 → node v22.18}/sqlite.d.ts +35 -0
- {node v22.17 → node v22.18}/url.d.ts +11 -0
- {node v22.17 → node v22.18}/worker_threads.d.ts +12 -0
- {node v22.17 → node v22.18}/LICENSE +0 -0
- {node v22.17 → node v22.18}/assert/strict.d.ts +0 -0
- {node v22.17 → node v22.18}/assert.d.ts +0 -0
- {node v22.17 → node v22.18}/async_hooks.d.ts +0 -0
- {node v22.17 → node v22.18}/buffer.buffer.d.ts +0 -0
- {node v22.17 → node v22.18}/cluster.d.ts +0 -0
- {node v22.17 → node v22.18}/compatibility/disposable.d.ts +0 -0
- {node v22.17 → node v22.18}/compatibility/index.d.ts +0 -0
- {node v22.17 → node v22.18}/compatibility/indexable.d.ts +0 -0
- {node v22.17 → node v22.18}/compatibility/iterators.d.ts +0 -0
- {node v22.17 → node v22.18}/console.d.ts +0 -0
- {node v22.17 → node v22.18}/constants.d.ts +0 -0
- {node v22.17 → node v22.18}/crypto.d.ts +0 -0
- {node v22.17 → node v22.18}/dgram.d.ts +0 -0
- {node v22.17 → node v22.18}/diagnostics_channel.d.ts +0 -0
- {node v22.17 → node v22.18}/dns/promises.d.ts +0 -0
- {node v22.17 → node v22.18}/dns.d.ts +0 -0
- {node v22.17 → node v22.18}/dom-events.d.ts +0 -0
- {node v22.17 → node v22.18}/domain.d.ts +0 -0
- {node v22.17 → node v22.18}/events.d.ts +0 -0
- {node v22.17 → node v22.18}/globals.d.ts +0 -0
- {node v22.17 → node v22.18}/globals.typedarray.d.ts +0 -0
- {node v22.17 → node v22.18}/http2.d.ts +0 -0
- {node v22.17 → node v22.18}/https.d.ts +0 -0
- {node v22.17 → node v22.18}/index.d.ts +0 -0
- {node v22.17 → node v22.18}/net.d.ts +0 -0
- {node v22.17 → node v22.18}/os.d.ts +0 -0
- {node v22.17 → node v22.18}/path.d.ts +0 -0
- {node v22.17 → node v22.18}/perf_hooks.d.ts +0 -0
- {node v22.17 → node v22.18}/punycode.d.ts +0 -0
- {node v22.17 → node v22.18}/querystring.d.ts +0 -0
- {node v22.17 → node v22.18}/readline/promises.d.ts +0 -0
- {node v22.17 → node v22.18}/readline.d.ts +0 -0
- {node v22.17 → node v22.18}/repl.d.ts +0 -0
- {node v22.17 → node v22.18}/sea.d.ts +0 -0
- {node v22.17 → node v22.18}/stream/consumers.d.ts +0 -0
- {node v22.17 → node v22.18}/stream/promises.d.ts +0 -0
- {node v22.17 → node v22.18}/stream/web.d.ts +0 -0
- {node v22.17 → node v22.18}/stream.d.ts +0 -0
- {node v22.17 → node v22.18}/string_decoder.d.ts +0 -0
- {node v22.17 → node v22.18}/test.d.ts +0 -0
- {node v22.17 → node v22.18}/timers/promises.d.ts +0 -0
- {node v22.17 → node v22.18}/timers.d.ts +0 -0
- {node v22.17 → node v22.18}/tls.d.ts +0 -0
- {node v22.17 → node v22.18}/trace_events.d.ts +0 -0
- {node v22.17 → node v22.18}/ts5.6/buffer.buffer.d.ts +0 -0
- {node v22.17 → node v22.18}/ts5.6/globals.typedarray.d.ts +0 -0
- {node v22.17 → node v22.18}/ts5.6/index.d.ts +0 -0
- {node v22.17 → node v22.18}/tty.d.ts +0 -0
- {node v22.17 → node v22.18}/util.d.ts +0 -0
- {node v22.17 → node v22.18}/v8.d.ts +0 -0
- {node v22.17 → node v22.18}/vm.d.ts +0 -0
- {node v22.17 → node v22.18}/wasi.d.ts +0 -0
- {node v22.17 → node v22.18}/zlib.d.ts +0 -0
@@ -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/v22.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Mon, 25 Aug 2025 10:02:25 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
@@ -139,7 +139,7 @@ declare module "buffer" {
|
|
139
139
|
type?: string | undefined;
|
140
140
|
}
|
141
141
|
/**
|
142
|
-
* A
|
142
|
+
* A `Blob` encapsulates immutable, raw data that can be safely shared across
|
143
143
|
* multiple worker threads.
|
144
144
|
* @since v15.7.0, v14.18.0
|
145
145
|
*/
|
@@ -24,7 +24,7 @@
|
|
24
24
|
* the parent Node.js process and the spawned subprocess. These pipes have
|
25
25
|
* limited (and platform-specific) capacity. If the subprocess writes to
|
26
26
|
* stdout in excess of that limit without the output being captured, the
|
27
|
-
* subprocess blocks waiting for the pipe buffer to accept more data. This is
|
27
|
+
* subprocess blocks, waiting for the pipe buffer to accept more data. This is
|
28
28
|
* identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
|
29
29
|
*
|
30
30
|
* The command lookup is performed using the `options.env.PATH` environment
|
@@ -66,7 +66,6 @@
|
|
66
66
|
* @see [source](https://github.com/nodejs/node/blob/v22.x/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
|
892
|
+
encoding?: BufferEncoding | undefined;
|
893
893
|
}
|
894
894
|
interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
895
|
-
encoding:
|
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
|
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:
|
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:
|
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
|
1052
|
+
encoding?: BufferEncoding | undefined;
|
1082
1053
|
}
|
1083
1054
|
interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
1084
1055
|
encoding: "buffer" | null;
|
1085
1056
|
}
|
1086
|
-
|
1087
|
-
|
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">
|
@@ -1154,80 +1124,44 @@ declare module "child_process" {
|
|
1154
1124
|
* @param args List of string arguments.
|
1155
1125
|
* @param callback Called with the output when process terminates.
|
1156
1126
|
*/
|
1157
|
-
function execFile(file: string): ChildProcess;
|
1158
|
-
function execFile(
|
1159
|
-
file: string,
|
1160
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
1161
|
-
): ChildProcess;
|
1162
|
-
function execFile(file: string, args?: readonly string[] | null): ChildProcess;
|
1163
|
-
function execFile(
|
1164
|
-
file: string,
|
1165
|
-
args: readonly string[] | undefined | null,
|
1166
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
1167
|
-
): ChildProcess;
|
1168
1127
|
// no `options` definitely means stdout/stderr are `string`.
|
1169
1128
|
function execFile(
|
1170
1129
|
file: string,
|
1171
|
-
callback
|
1130
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
1172
1131
|
): ChildProcess;
|
1173
1132
|
function execFile(
|
1174
1133
|
file: string,
|
1175
1134
|
args: readonly string[] | undefined | null,
|
1176
|
-
callback
|
1135
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
1177
1136
|
): ChildProcess;
|
1178
1137
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
1179
1138
|
function execFile(
|
1180
1139
|
file: string,
|
1181
1140
|
options: ExecFileOptionsWithBufferEncoding,
|
1182
|
-
callback
|
1141
|
+
callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
1183
1142
|
): ChildProcess;
|
1184
1143
|
function execFile(
|
1185
1144
|
file: string,
|
1186
1145
|
args: readonly string[] | undefined | null,
|
1187
1146
|
options: ExecFileOptionsWithBufferEncoding,
|
1188
|
-
callback
|
1147
|
+
callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
1189
1148
|
): ChildProcess;
|
1190
|
-
// `options` with well
|
1149
|
+
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
1191
1150
|
function execFile(
|
1192
1151
|
file: string,
|
1193
1152
|
options: ExecFileOptionsWithStringEncoding,
|
1194
|
-
callback
|
1153
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
1195
1154
|
): ChildProcess;
|
1196
1155
|
function execFile(
|
1197
1156
|
file: string,
|
1198
1157
|
args: readonly string[] | undefined | null,
|
1199
1158
|
options: ExecFileOptionsWithStringEncoding,
|
1200
|
-
callback
|
1201
|
-
): ChildProcess;
|
1202
|
-
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
1203
|
-
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
1204
|
-
function execFile(
|
1205
|
-
file: string,
|
1206
|
-
options: ExecFileOptionsWithOtherEncoding,
|
1207
|
-
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
1208
|
-
): ChildProcess;
|
1209
|
-
function execFile(
|
1210
|
-
file: string,
|
1211
|
-
args: readonly string[] | undefined | null,
|
1212
|
-
options: ExecFileOptionsWithOtherEncoding,
|
1213
|
-
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
1214
|
-
): ChildProcess;
|
1215
|
-
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
1216
|
-
function execFile(
|
1217
|
-
file: string,
|
1218
|
-
options: ExecFileOptions,
|
1219
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
1220
|
-
): ChildProcess;
|
1221
|
-
function execFile(
|
1222
|
-
file: string,
|
1223
|
-
args: readonly string[] | undefined | null,
|
1224
|
-
options: ExecFileOptions,
|
1225
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
1159
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
1226
1160
|
): ChildProcess;
|
1227
1161
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
1228
1162
|
function execFile(
|
1229
1163
|
file: string,
|
1230
|
-
options:
|
1164
|
+
options: ExecFileOptions | undefined | null,
|
1231
1165
|
callback:
|
1232
1166
|
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
1233
1167
|
| undefined
|
@@ -1236,7 +1170,7 @@ declare module "child_process" {
|
|
1236
1170
|
function execFile(
|
1237
1171
|
file: string,
|
1238
1172
|
args: readonly string[] | undefined | null,
|
1239
|
-
options:
|
1173
|
+
options: ExecFileOptions | undefined | null,
|
1240
1174
|
callback:
|
1241
1175
|
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
1242
1176
|
| undefined
|
@@ -1286,37 +1220,7 @@ declare module "child_process" {
|
|
1286
1220
|
}>;
|
1287
1221
|
function __promisify__(
|
1288
1222
|
file: string,
|
1289
|
-
options:
|
1290
|
-
): PromiseWithChild<{
|
1291
|
-
stdout: string | Buffer;
|
1292
|
-
stderr: string | Buffer;
|
1293
|
-
}>;
|
1294
|
-
function __promisify__(
|
1295
|
-
file: string,
|
1296
|
-
args: readonly string[] | undefined | null,
|
1297
|
-
options: ExecFileOptionsWithOtherEncoding,
|
1298
|
-
): PromiseWithChild<{
|
1299
|
-
stdout: string | Buffer;
|
1300
|
-
stderr: string | Buffer;
|
1301
|
-
}>;
|
1302
|
-
function __promisify__(
|
1303
|
-
file: string,
|
1304
|
-
options: ExecFileOptions,
|
1305
|
-
): PromiseWithChild<{
|
1306
|
-
stdout: string;
|
1307
|
-
stderr: string;
|
1308
|
-
}>;
|
1309
|
-
function __promisify__(
|
1310
|
-
file: string,
|
1311
|
-
args: readonly string[] | undefined | null,
|
1312
|
-
options: ExecFileOptions,
|
1313
|
-
): PromiseWithChild<{
|
1314
|
-
stdout: string;
|
1315
|
-
stderr: string;
|
1316
|
-
}>;
|
1317
|
-
function __promisify__(
|
1318
|
-
file: string,
|
1319
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
1223
|
+
options: ExecFileOptions | undefined | null,
|
1320
1224
|
): PromiseWithChild<{
|
1321
1225
|
stdout: string | Buffer;
|
1322
1226
|
stderr: string | Buffer;
|
@@ -1324,7 +1228,7 @@ declare module "child_process" {
|
|
1324
1228
|
function __promisify__(
|
1325
1229
|
file: string,
|
1326
1230
|
args: readonly string[] | undefined | null,
|
1327
|
-
options:
|
1231
|
+
options: ExecFileOptions | undefined | null,
|
1328
1232
|
): PromiseWithChild<{
|
1329
1233
|
stdout: string | Buffer;
|
1330
1234
|
stderr: string | Buffer;
|
@@ -40,7 +40,7 @@ declare module "fs/promises" {
|
|
40
40
|
StatsFs,
|
41
41
|
TimeLike,
|
42
42
|
WatchEventType,
|
43
|
-
WatchOptions,
|
43
|
+
WatchOptions as _WatchOptions,
|
44
44
|
WriteStream,
|
45
45
|
WriteVResult,
|
46
46
|
} from "node:fs";
|
@@ -1182,6 +1182,16 @@ declare module "fs/promises" {
|
|
1182
1182
|
* @return Fulfills with an {fs.Dir}.
|
1183
1183
|
*/
|
1184
1184
|
function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
|
1185
|
+
interface WatchOptions extends _WatchOptions {
|
1186
|
+
maxQueue?: number | undefined;
|
1187
|
+
overflow?: "ignore" | "throw" | undefined;
|
1188
|
+
}
|
1189
|
+
interface WatchOptionsWithBufferEncoding extends WatchOptions {
|
1190
|
+
encoding: "buffer";
|
1191
|
+
}
|
1192
|
+
interface WatchOptionsWithStringEncoding extends WatchOptions {
|
1193
|
+
encoding?: BufferEncoding | undefined;
|
1194
|
+
}
|
1185
1195
|
/**
|
1186
1196
|
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
1187
1197
|
*
|
@@ -1214,33 +1224,16 @@ declare module "fs/promises" {
|
|
1214
1224
|
*/
|
1215
1225
|
function watch(
|
1216
1226
|
filename: PathLike,
|
1217
|
-
options
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
):
|
1223
|
-
/**
|
1224
|
-
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
1225
|
-
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
1226
|
-
* @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
|
1227
|
-
* If `encoding` is not supplied, the default of `'utf8'` is used.
|
1228
|
-
* If `persistent` is not supplied, the default of `true` is used.
|
1229
|
-
* If `recursive` is not supplied, the default of `false` is used.
|
1230
|
-
*/
|
1231
|
-
function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
|
1232
|
-
/**
|
1233
|
-
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
1234
|
-
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
1235
|
-
* @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
|
1236
|
-
* If `encoding` is not supplied, the default of `'utf8'` is used.
|
1237
|
-
* If `persistent` is not supplied, the default of `true` is used.
|
1238
|
-
* If `recursive` is not supplied, the default of `false` is used.
|
1239
|
-
*/
|
1227
|
+
options?: WatchOptionsWithStringEncoding | BufferEncoding,
|
1228
|
+
): NodeJS.AsyncIterator<FileChangeInfo<string>>;
|
1229
|
+
function watch(
|
1230
|
+
filename: PathLike,
|
1231
|
+
options: WatchOptionsWithBufferEncoding | "buffer",
|
1232
|
+
): NodeJS.AsyncIterator<FileChangeInfo<Buffer>>;
|
1240
1233
|
function watch(
|
1241
1234
|
filename: PathLike,
|
1242
|
-
options: WatchOptions |
|
1243
|
-
):
|
1235
|
+
options: WatchOptions | BufferEncoding | "buffer",
|
1236
|
+
): NodeJS.AsyncIterator<FileChangeInfo<string | Buffer>>;
|
1244
1237
|
/**
|
1245
1238
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
1246
1239
|
* including subdirectories and files.
|
@@ -329,14 +329,15 @@ declare module "fs" {
|
|
329
329
|
*/
|
330
330
|
readSync(): Dirent | null;
|
331
331
|
/**
|
332
|
-
* Calls `dir.close()` and returns a promise that
|
333
|
-
*
|
332
|
+
* Calls `dir.close()` if the directory handle is open, and returns a promise that
|
333
|
+
* fulfills when disposal is complete.
|
334
334
|
* @since v22.17.0
|
335
335
|
* @experimental
|
336
336
|
*/
|
337
337
|
[Symbol.asyncDispose](): Promise<void>;
|
338
338
|
/**
|
339
|
-
* Calls `dir.closeSync()` and returns
|
339
|
+
* Calls `dir.closeSync()` if the directory handle is open, and returns
|
340
|
+
* `undefined`.
|
340
341
|
* @since v22.17.0
|
341
342
|
* @experimental
|
342
343
|
*/
|
@@ -3340,6 +3341,12 @@ declare module "fs" {
|
|
3340
3341
|
persistent?: boolean | undefined;
|
3341
3342
|
recursive?: boolean | undefined;
|
3342
3343
|
}
|
3344
|
+
export interface WatchOptionsWithBufferEncoding extends WatchOptions {
|
3345
|
+
encoding: "buffer";
|
3346
|
+
}
|
3347
|
+
export interface WatchOptionsWithStringEncoding extends WatchOptions {
|
3348
|
+
encoding?: BufferEncoding | undefined;
|
3349
|
+
}
|
3343
3350
|
export type WatchEventType = "rename" | "change";
|
3344
3351
|
export type WatchListener<T> = (event: WatchEventType, filename: T | null) => void;
|
3345
3352
|
export type StatsListener = (curr: Stats, prev: Stats) => void;
|
@@ -3366,44 +3373,20 @@ declare module "fs" {
|
|
3366
3373
|
*/
|
3367
3374
|
export function watch(
|
3368
3375
|
filename: PathLike,
|
3369
|
-
options
|
3370
|
-
|
3371
|
-
encoding: "buffer";
|
3372
|
-
})
|
3373
|
-
| "buffer",
|
3374
|
-
listener?: WatchListener<Buffer>,
|
3376
|
+
options?: WatchOptionsWithStringEncoding | BufferEncoding | null,
|
3377
|
+
listener?: WatchListener<string>,
|
3375
3378
|
): FSWatcher;
|
3376
|
-
/**
|
3377
|
-
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
3378
|
-
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
3379
|
-
* @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
|
3380
|
-
* If `encoding` is not supplied, the default of `'utf8'` is used.
|
3381
|
-
* If `persistent` is not supplied, the default of `true` is used.
|
3382
|
-
* If `recursive` is not supplied, the default of `false` is used.
|
3383
|
-
*/
|
3384
3379
|
export function watch(
|
3385
3380
|
filename: PathLike,
|
3386
|
-
options
|
3387
|
-
listener
|
3381
|
+
options: WatchOptionsWithBufferEncoding | "buffer",
|
3382
|
+
listener: WatchListener<Buffer>,
|
3388
3383
|
): FSWatcher;
|
3389
|
-
/**
|
3390
|
-
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
3391
|
-
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
3392
|
-
* @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
|
3393
|
-
* If `encoding` is not supplied, the default of `'utf8'` is used.
|
3394
|
-
* If `persistent` is not supplied, the default of `true` is used.
|
3395
|
-
* If `recursive` is not supplied, the default of `false` is used.
|
3396
|
-
*/
|
3397
3384
|
export function watch(
|
3398
3385
|
filename: PathLike,
|
3399
|
-
options: WatchOptions |
|
3400
|
-
listener
|
3386
|
+
options: WatchOptions | BufferEncoding | "buffer" | null,
|
3387
|
+
listener: WatchListener<string | Buffer>,
|
3401
3388
|
): FSWatcher;
|
3402
|
-
|
3403
|
-
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
3404
|
-
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
3405
|
-
*/
|
3406
|
-
export function watch(filename: PathLike, listener?: WatchListener<string>): FSWatcher;
|
3389
|
+
export function watch(filename: PathLike, listener: WatchListener<string>): FSWatcher;
|
3407
3390
|
/**
|
3408
3391
|
* Test whether or not the given path exists by checking with the file system.
|
3409
3392
|
* Then call the `callback` argument with either true or false:
|
@@ -2028,7 +2028,7 @@ declare module "http" {
|
|
2028
2028
|
*/
|
2029
2029
|
const maxHeaderSize: number;
|
2030
2030
|
/**
|
2031
|
-
* A browser-compatible implementation of
|
2031
|
+
* A browser-compatible implementation of `WebSocket`.
|
2032
2032
|
* @since v22.5.0
|
2033
2033
|
*/
|
2034
2034
|
const WebSocket: import("undici-types").WebSocket;
|
@@ -268,7 +268,7 @@ declare module 'inspector' {
|
|
268
268
|
/**
|
269
269
|
* Embedder-specific auxiliary data.
|
270
270
|
*/
|
271
|
-
auxData?:
|
271
|
+
auxData?: object | undefined;
|
272
272
|
}
|
273
273
|
/**
|
274
274
|
* Detailed information about exception (or error) that was thrown during script compilation or execution.
|
@@ -701,7 +701,7 @@ declare module 'inspector' {
|
|
701
701
|
}
|
702
702
|
interface InspectRequestedEventDataType {
|
703
703
|
object: RemoteObject;
|
704
|
-
hints:
|
704
|
+
hints: object;
|
705
705
|
}
|
706
706
|
}
|
707
707
|
namespace Debugger {
|
@@ -1173,7 +1173,7 @@ declare module 'inspector' {
|
|
1173
1173
|
/**
|
1174
1174
|
* Embedder-specific auxiliary data.
|
1175
1175
|
*/
|
1176
|
-
executionContextAuxData?:
|
1176
|
+
executionContextAuxData?: object | undefined;
|
1177
1177
|
/**
|
1178
1178
|
* True, if this script is generated as a result of the live edit operation.
|
1179
1179
|
* @experimental
|
@@ -1237,7 +1237,7 @@ declare module 'inspector' {
|
|
1237
1237
|
/**
|
1238
1238
|
* Embedder-specific auxiliary data.
|
1239
1239
|
*/
|
1240
|
-
executionContextAuxData?:
|
1240
|
+
executionContextAuxData?: object | undefined;
|
1241
1241
|
/**
|
1242
1242
|
* URL of source map associated with script (if any).
|
1243
1243
|
*/
|
@@ -1282,7 +1282,7 @@ declare module 'inspector' {
|
|
1282
1282
|
/**
|
1283
1283
|
* Object containing break-specific auxiliary properties.
|
1284
1284
|
*/
|
1285
|
-
data?:
|
1285
|
+
data?: object | undefined;
|
1286
1286
|
/**
|
1287
1287
|
* Hit breakpoints IDs
|
1288
1288
|
*/
|
@@ -1649,7 +1649,7 @@ declare module 'inspector' {
|
|
1649
1649
|
categories: string[];
|
1650
1650
|
}
|
1651
1651
|
interface DataCollectedEventDataType {
|
1652
|
-
value:
|
1652
|
+
value: object[];
|
1653
1653
|
}
|
1654
1654
|
}
|
1655
1655
|
namespace NodeWorker {
|
@@ -1759,6 +1759,7 @@ declare module 'inspector' {
|
|
1759
1759
|
url: string;
|
1760
1760
|
method: string;
|
1761
1761
|
headers: Headers;
|
1762
|
+
hasPostData: boolean;
|
1762
1763
|
}
|
1763
1764
|
/**
|
1764
1765
|
* HTTP response data.
|
@@ -1776,17 +1777,45 @@ declare module 'inspector' {
|
|
1776
1777
|
*/
|
1777
1778
|
interface Headers {
|
1778
1779
|
}
|
1780
|
+
interface GetRequestPostDataParameterType {
|
1781
|
+
/**
|
1782
|
+
* Identifier of the network request to get content for.
|
1783
|
+
*/
|
1784
|
+
requestId: RequestId;
|
1785
|
+
}
|
1786
|
+
interface GetResponseBodyParameterType {
|
1787
|
+
/**
|
1788
|
+
* Identifier of the network request to get content for.
|
1789
|
+
*/
|
1790
|
+
requestId: RequestId;
|
1791
|
+
}
|
1779
1792
|
interface StreamResourceContentParameterType {
|
1780
1793
|
/**
|
1781
1794
|
* Identifier of the request to stream.
|
1782
1795
|
*/
|
1783
1796
|
requestId: RequestId;
|
1784
1797
|
}
|
1798
|
+
interface GetRequestPostDataReturnType {
|
1799
|
+
/**
|
1800
|
+
* Request body string, omitting files from multipart requests
|
1801
|
+
*/
|
1802
|
+
postData: string;
|
1803
|
+
}
|
1804
|
+
interface GetResponseBodyReturnType {
|
1805
|
+
/**
|
1806
|
+
* Response body.
|
1807
|
+
*/
|
1808
|
+
body: string;
|
1809
|
+
/**
|
1810
|
+
* True, if content was sent as base64.
|
1811
|
+
*/
|
1812
|
+
base64Encoded: boolean;
|
1813
|
+
}
|
1785
1814
|
interface StreamResourceContentReturnType {
|
1786
1815
|
/**
|
1787
1816
|
* Data that has been buffered until streaming is enabled.
|
1788
1817
|
*/
|
1789
|
-
bufferedData:
|
1818
|
+
bufferedData: string;
|
1790
1819
|
}
|
1791
1820
|
interface RequestWillBeSentEventDataType {
|
1792
1821
|
/**
|
@@ -1877,7 +1906,7 @@ declare module 'inspector' {
|
|
1877
1906
|
* Data that was received.
|
1878
1907
|
* @experimental
|
1879
1908
|
*/
|
1880
|
-
data?:
|
1909
|
+
data?: string | undefined;
|
1881
1910
|
}
|
1882
1911
|
}
|
1883
1912
|
namespace NodeRuntime {
|
@@ -2285,6 +2314,16 @@ declare module 'inspector' {
|
|
2285
2314
|
* Enables network tracking, network events will now be delivered to the client.
|
2286
2315
|
*/
|
2287
2316
|
post(method: 'Network.enable', callback?: (err: Error | null) => void): void;
|
2317
|
+
/**
|
2318
|
+
* Returns post data sent with the request. Returns an error when no data was sent with the request.
|
2319
|
+
*/
|
2320
|
+
post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType, callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void;
|
2321
|
+
post(method: 'Network.getRequestPostData', callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void;
|
2322
|
+
/**
|
2323
|
+
* Returns content served for the given request.
|
2324
|
+
*/
|
2325
|
+
post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType, callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void;
|
2326
|
+
post(method: 'Network.getResponseBody', callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void;
|
2288
2327
|
/**
|
2289
2328
|
* Enables streaming of the response for the given requestId.
|
2290
2329
|
* If enabled, the dataReceived event contains the data that was received during streaming.
|
@@ -3049,22 +3088,31 @@ declare module 'inspector' {
|
|
3049
3088
|
|
3050
3089
|
// DevTools protocol event broadcast methods
|
3051
3090
|
namespace Network {
|
3091
|
+
/**
|
3092
|
+
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3093
|
+
*
|
3094
|
+
* Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
|
3095
|
+
* the application is about to send an HTTP request.
|
3096
|
+
* @since v22.6.0
|
3097
|
+
*/
|
3098
|
+
function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
|
3052
3099
|
/**
|
3053
3100
|
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3054
3101
|
*
|
3055
3102
|
* Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if
|
3056
3103
|
* `Network.streamResourceContent` command was not invoked for the given request yet.
|
3104
|
+
*
|
3105
|
+
* Also enables `Network.getResponseBody` command to retrieve the response data.
|
3057
3106
|
* @since v22.17.0
|
3058
3107
|
*/
|
3059
3108
|
function dataReceived(params: DataReceivedEventDataType): void;
|
3060
3109
|
/**
|
3061
3110
|
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3062
3111
|
*
|
3063
|
-
*
|
3064
|
-
*
|
3065
|
-
* @since v22.6.0
|
3112
|
+
* Enables `Network.getRequestPostData` command to retrieve the request data.
|
3113
|
+
* @since v22.18.0
|
3066
3114
|
*/
|
3067
|
-
function
|
3115
|
+
function dataSent(params: unknown): void;
|
3068
3116
|
/**
|
3069
3117
|
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3070
3118
|
*
|
@@ -3450,6 +3498,14 @@ declare module 'inspector/promises' {
|
|
3450
3498
|
* Enables network tracking, network events will now be delivered to the client.
|
3451
3499
|
*/
|
3452
3500
|
post(method: 'Network.enable'): Promise<void>;
|
3501
|
+
/**
|
3502
|
+
* Returns post data sent with the request. Returns an error when no data was sent with the request.
|
3503
|
+
*/
|
3504
|
+
post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType): Promise<Network.GetRequestPostDataReturnType>;
|
3505
|
+
/**
|
3506
|
+
* Returns content served for the given request.
|
3507
|
+
*/
|
3508
|
+
post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType): Promise<Network.GetResponseBodyReturnType>;
|
3453
3509
|
/**
|
3454
3510
|
* Enables streaming of the response for the given requestId.
|
3455
3511
|
* If enabled, the dataReceived event contains the data that was received during streaming.
|
@@ -684,6 +684,30 @@ declare module "module" {
|
|
684
684
|
* @returns The absolute URL string that the specifier would resolve to.
|
685
685
|
*/
|
686
686
|
resolve(specifier: string, parent?: string | URL): string;
|
687
|
+
/**
|
688
|
+
* `true` when the current module is the entry point of the current process; `false` otherwise.
|
689
|
+
*
|
690
|
+
* Equivalent to `require.main === module` in CommonJS.
|
691
|
+
*
|
692
|
+
* Analogous to Python's `__name__ == "__main__"`.
|
693
|
+
*
|
694
|
+
* ```js
|
695
|
+
* export function foo() {
|
696
|
+
* return 'Hello, world';
|
697
|
+
* }
|
698
|
+
*
|
699
|
+
* function main() {
|
700
|
+
* const message = foo();
|
701
|
+
* console.log(message);
|
702
|
+
* }
|
703
|
+
*
|
704
|
+
* if (import.meta.main) main();
|
705
|
+
* // `foo` can be imported from another module without possible side-effects from `main`
|
706
|
+
* ```
|
707
|
+
* @since v22.18.0
|
708
|
+
* @experimental
|
709
|
+
*/
|
710
|
+
main: boolean;
|
687
711
|
}
|
688
712
|
namespace NodeJS {
|
689
713
|
interface Module {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.
|
3
|
+
"version": "22.18.0",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -140,6 +140,6 @@
|
|
140
140
|
"undici-types": "~6.21.0"
|
141
141
|
},
|
142
142
|
"peerDependencies": {},
|
143
|
-
"typesPublisherContentHash": "
|
143
|
+
"typesPublisherContentHash": "ae8e73c3b32ff5a96d071f2d267aa1e4e07236949e16a41489a853461b8cca89",
|
144
144
|
"typeScriptVersion": "5.2"
|
145
145
|
}
|
@@ -231,8 +231,9 @@ declare module "process" {
|
|
231
231
|
*/
|
232
232
|
readonly tls_sni: boolean;
|
233
233
|
/**
|
234
|
-
* A value that is `"strip"`
|
235
|
-
* `"transform"` if Node.js is run with `--experimental-transform-types`, and `false`
|
234
|
+
* A value that is `"strip"` by default,
|
235
|
+
* `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if
|
236
|
+
* Node.js is run with `--no-experimental-strip-types`.
|
236
237
|
* @since v22.10.0
|
237
238
|
*/
|
238
239
|
readonly typescript: "strip" | "transform" | false;
|
@@ -89,6 +89,41 @@ declare module "node:sqlite" {
|
|
89
89
|
* @default false
|
90
90
|
*/
|
91
91
|
allowExtension?: boolean | undefined;
|
92
|
+
/**
|
93
|
+
* The [busy timeout](https://sqlite.org/c3ref/busy_timeout.html) in milliseconds. This is the maximum amount of
|
94
|
+
* time that SQLite will wait for a database lock to be released before
|
95
|
+
* returning an error.
|
96
|
+
* @since v22.16.0
|
97
|
+
* @default 0
|
98
|
+
*/
|
99
|
+
timeout?: number | undefined;
|
100
|
+
/**
|
101
|
+
* If `true`, integer fields are read as JavaScript `BigInt` values. If `false`,
|
102
|
+
* integer fields are read as JavaScript numbers.
|
103
|
+
* @since v22.18.0
|
104
|
+
* @default false
|
105
|
+
*/
|
106
|
+
readBigInts?: boolean | undefined;
|
107
|
+
/**
|
108
|
+
* If `true`, query results are returned as arrays instead of objects.
|
109
|
+
* @since v22.18.0
|
110
|
+
* @default false
|
111
|
+
*/
|
112
|
+
returnArrays?: boolean | undefined;
|
113
|
+
/**
|
114
|
+
* If `true`, allows binding named parameters without the prefix
|
115
|
+
* character (e.g., `foo` instead of `:foo`).
|
116
|
+
* @since v22.18.0
|
117
|
+
* @default true
|
118
|
+
*/
|
119
|
+
allowBareNamedParameters?: boolean | undefined;
|
120
|
+
/**
|
121
|
+
* If `true`, unknown named parameters are ignored when binding.
|
122
|
+
* If `false`, an exception is thrown for unknown named parameters.
|
123
|
+
* @since v22.18.0
|
124
|
+
* @default false
|
125
|
+
*/
|
126
|
+
allowUnknownNamedParameters?: boolean | undefined;
|
92
127
|
}
|
93
128
|
interface CreateSessionOptions {
|
94
129
|
/**
|
@@ -315,6 +315,17 @@ declare module "url" {
|
|
315
315
|
* @return The fully-resolved platform-specific Node.js file path.
|
316
316
|
*/
|
317
317
|
function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string;
|
318
|
+
/**
|
319
|
+
* Like `url.fileURLToPath(...)` except that instead of returning a string
|
320
|
+
* representation of the path, a `Buffer` is returned. This conversion is
|
321
|
+
* helpful when the input URL contains percent-encoded segments that are
|
322
|
+
* not valid UTF-8 / Unicode sequences.
|
323
|
+
* @since v22.18.0
|
324
|
+
* @param url The file URL string or URL object to convert to a path.
|
325
|
+
* @returns The fully-resolved platform-specific Node.js file path
|
326
|
+
* as a `Buffer`.
|
327
|
+
*/
|
328
|
+
function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): Buffer;
|
318
329
|
/**
|
319
330
|
* This function ensures that `path` is resolved absolutely, and that the URL
|
320
331
|
* control characters are correctly encoded when converting into a File URL.
|
@@ -481,6 +481,18 @@ declare module "worker_threads" {
|
|
481
481
|
* @since v22.16.0
|
482
482
|
*/
|
483
483
|
getHeapStatistics(): Promise<HeapInfo>;
|
484
|
+
/**
|
485
|
+
* Calls `worker.terminate()` when the dispose scope is exited.
|
486
|
+
*
|
487
|
+
* ```js
|
488
|
+
* async function example() {
|
489
|
+
* await using worker = new Worker('for (;;) {}', { eval: true });
|
490
|
+
* // Worker is automatically terminate when the scope is exited.
|
491
|
+
* }
|
492
|
+
* ```
|
493
|
+
* @since v22.18.0
|
494
|
+
*/
|
495
|
+
[Symbol.asyncDispose](): Promise<void>;
|
484
496
|
addListener(event: "error", listener: (err: Error) => void): this;
|
485
497
|
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
486
498
|
addListener(event: "message", listener: (value: any) => void): this;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|