@types/node 20.19.25 → 24.10.4
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 → node v24.10}/README.md +3 -3
- node v24.10/assert/strict.d.ts +111 -0
- {node v20.19 → node v24.10}/assert.d.ts +150 -97
- {node v20.19 → node v24.10}/async_hooks.d.ts +27 -9
- {node v20.19 → node v24.10}/buffer.buffer.d.ts +2 -1
- {node v20.19 → node v24.10}/buffer.d.ts +6 -8
- {node v20.19 → node v24.10}/child_process.d.ts +11 -10
- {node v20.19 → node v24.10}/cluster.d.ts +16 -15
- {node v20.19 → node v24.10}/console.d.ts +19 -18
- {node v20.19 → node v24.10}/crypto.d.ts +1120 -293
- {node v20.19 → node v24.10}/dgram.d.ts +5 -2
- {node v20.19 → node v24.10}/diagnostics_channel.d.ts +1 -3
- {node v20.19 → node v24.10}/dns/promises.d.ts +30 -6
- {node v20.19 → node v24.10}/dns.d.ts +69 -17
- {node v20.19 → node v24.10}/domain.d.ts +1 -1
- {node v20.19 → node v24.10}/events.d.ts +1 -2
- {node v20.19 → node v24.10}/fs/promises.d.ts +85 -38
- {node v20.19 → node v24.10}/fs.d.ts +387 -48
- {node v20.19 → node v24.10}/globals.d.ts +2 -4
- {node v20.19 → node v24.10}/globals.typedarray.d.ts +3 -0
- {node v20.19 → node v24.10}/http.d.ts +90 -5
- {node v20.19 → node v24.10}/http2.d.ts +166 -41
- {node v20.19 → node v24.10}/https.d.ts +4 -3
- {node v20.19 → node v24.10}/index.d.ts +13 -5
- node v24.10/inspector.d.ts +277 -0
- {node v20.19 → node v24.10}/inspector.generated.d.ts +1096 -829
- {node v20.19 → node v24.10}/module.d.ts +403 -48
- {node v20.19 → node v24.10}/net.d.ts +62 -20
- {node v20.19 → node v24.10}/os.d.ts +8 -7
- {node v20.19 → node v24.10}/package.json +18 -3
- {node v20.19 → node v24.10}/path.d.ts +3 -3
- {node v20.19 → node v24.10}/perf_hooks.d.ts +37 -16
- {node v20.19 → node v24.10}/process.d.ts +138 -16
- {node v20.19 → node v24.10}/punycode.d.ts +1 -1
- {node v20.19 → node v24.10}/querystring.d.ts +1 -1
- {node v20.19 → node v24.10}/readline/promises.d.ts +0 -1
- {node v20.19 → node v24.10}/readline.d.ts +19 -14
- {node v20.19 → node v24.10}/repl.d.ts +25 -17
- {node v20.19 → node v24.10}/sea.d.ts +11 -2
- node v24.10/sqlite.d.ts +937 -0
- {node v20.19 → node v24.10}/stream/web.d.ts +85 -45
- {node v20.19 → node v24.10}/stream.d.ts +36 -28
- {node v20.19 → node v24.10}/string_decoder.d.ts +1 -1
- {node v20.19 → node v24.10}/test.d.ts +587 -35
- {node v20.19 → node v24.10}/timers/promises.d.ts +1 -1
- {node v20.19 → node v24.10}/timers.d.ts +4 -5
- {node v20.19 → node v24.10}/tls.d.ts +62 -48
- {node v20.19 → node v24.10}/trace_events.d.ts +6 -6
- node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
- {node v20.19 → node v24.10}/ts5.6/globals.typedarray.d.ts +2 -0
- {node v20.19 → node v24.10}/ts5.6/index.d.ts +15 -5
- node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
- node v24.10/ts5.7/index.d.ts +103 -0
- {node v20.19 → node v24.10}/tty.d.ts +1 -1
- {node v20.19 → node v24.10}/url.d.ts +128 -35
- {node v20.19 → node v24.10}/util.d.ts +384 -390
- {node v20.19 → node v24.10}/v8.d.ts +175 -32
- {node v20.19 → node v24.10}/vm.d.ts +246 -67
- {node v20.19 → node v24.10}/wasi.d.ts +23 -2
- node v24.10/web-globals/crypto.d.ts +32 -0
- {node v20.19 → node v24.10}/web-globals/fetch.d.ts +4 -0
- node v24.10/web-globals/navigator.d.ts +25 -0
- node v24.10/web-globals/storage.d.ts +24 -0
- node v24.10/web-globals/streams.d.ts +22 -0
- {node v20.19 → node v24.10}/worker_threads.d.ts +205 -24
- {node v20.19 → node v24.10}/zlib.d.ts +185 -44
- node v20.19/assert/strict.d.ts +0 -8
- node v20.19/compatibility/disposable.d.ts +0 -16
- node v20.19/compatibility/index.d.ts +0 -9
- node v20.19/compatibility/indexable.d.ts +0 -20
- {node v20.19 → node v24.10}/LICENSE +0 -0
- {node v20.19 → node v24.10}/compatibility/iterators.d.ts +0 -0
- {node v20.19 → node v24.10}/constants.d.ts +0 -0
- {node v20.19 → node v24.10}/stream/consumers.d.ts +0 -0
- {node v20.19 → node v24.10}/stream/promises.d.ts +0 -0
- {node v20.19 → node v24.10}/ts5.6/buffer.buffer.d.ts +0 -0
- {node v20.19 → node v24.10}/web-globals/abortcontroller.d.ts +0 -0
- {node v20.19 → node v24.10}/web-globals/domexception.d.ts +0 -0
- {node v20.19 → node v24.10}/web-globals/events.d.ts +0 -0
|
@@ -76,6 +76,7 @@ declare module "process" {
|
|
|
76
76
|
"repl": typeof import("repl");
|
|
77
77
|
"node:repl": typeof import("node:repl");
|
|
78
78
|
"node:sea": typeof import("node:sea");
|
|
79
|
+
"node:sqlite": typeof import("node:sqlite");
|
|
79
80
|
"stream": typeof import("stream");
|
|
80
81
|
"node:stream": typeof import("node:stream");
|
|
81
82
|
"stream/consumers": typeof import("stream/consumers");
|
|
@@ -117,7 +118,6 @@ declare module "process" {
|
|
|
117
118
|
"zlib": typeof import("zlib");
|
|
118
119
|
"node:zlib": typeof import("node:zlib");
|
|
119
120
|
}
|
|
120
|
-
|
|
121
121
|
global {
|
|
122
122
|
var process: NodeJS.Process;
|
|
123
123
|
namespace NodeJS {
|
|
@@ -188,13 +188,16 @@ declare module "process" {
|
|
|
188
188
|
readonly inspector: boolean;
|
|
189
189
|
/**
|
|
190
190
|
* A boolean value that is `true` if the current Node.js build includes support for IPv6.
|
|
191
|
+
*
|
|
192
|
+
* Since all Node.js builds have IPv6 support, this value is always `true`.
|
|
191
193
|
* @since v0.5.3
|
|
194
|
+
* @deprecated This property is always true, and any checks based on it are redundant.
|
|
192
195
|
*/
|
|
193
196
|
readonly ipv6: boolean;
|
|
194
197
|
/**
|
|
195
198
|
* A boolean value that is `true` if the current Node.js build supports
|
|
196
|
-
* [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-
|
|
197
|
-
* @since
|
|
199
|
+
* [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v24.x/api/modules.md#loading-ecmascript-modules-using-require).
|
|
200
|
+
* @since v22.10.0
|
|
198
201
|
*/
|
|
199
202
|
readonly require_module: boolean;
|
|
200
203
|
/**
|
|
@@ -204,22 +207,44 @@ declare module "process" {
|
|
|
204
207
|
readonly tls: boolean;
|
|
205
208
|
/**
|
|
206
209
|
* A boolean value that is `true` if the current Node.js build includes support for ALPN in TLS.
|
|
210
|
+
*
|
|
211
|
+
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional ALPN support.
|
|
212
|
+
* This value is therefore identical to that of `process.features.tls`.
|
|
207
213
|
* @since v4.8.0
|
|
214
|
+
* @deprecated Use `process.features.tls` instead.
|
|
208
215
|
*/
|
|
209
216
|
readonly tls_alpn: boolean;
|
|
210
217
|
/**
|
|
211
218
|
* A boolean value that is `true` if the current Node.js build includes support for OCSP in TLS.
|
|
219
|
+
*
|
|
220
|
+
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional OCSP support.
|
|
221
|
+
* This value is therefore identical to that of `process.features.tls`.
|
|
212
222
|
* @since v0.11.13
|
|
223
|
+
* @deprecated Use `process.features.tls` instead.
|
|
213
224
|
*/
|
|
214
225
|
readonly tls_ocsp: boolean;
|
|
215
226
|
/**
|
|
216
227
|
* A boolean value that is `true` if the current Node.js build includes support for SNI in TLS.
|
|
228
|
+
*
|
|
229
|
+
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional SNI support.
|
|
230
|
+
* This value is therefore identical to that of `process.features.tls`.
|
|
217
231
|
* @since v0.5.3
|
|
232
|
+
* @deprecated Use `process.features.tls` instead.
|
|
218
233
|
*/
|
|
219
234
|
readonly tls_sni: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* A value that is `"strip"` by default,
|
|
237
|
+
* `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if
|
|
238
|
+
* Node.js is run with `--no-experimental-strip-types`.
|
|
239
|
+
* @since v22.10.0
|
|
240
|
+
*/
|
|
241
|
+
readonly typescript: "strip" | "transform" | false;
|
|
220
242
|
/**
|
|
221
243
|
* A boolean value that is `true` if the current Node.js build includes support for libuv.
|
|
244
|
+
*
|
|
245
|
+
* Since it's not possible to build Node.js without libuv, this value is always `true`.
|
|
222
246
|
* @since v0.5.3
|
|
247
|
+
* @deprecated This property is always true, and any checks based on it are redundant.
|
|
223
248
|
*/
|
|
224
249
|
readonly uv: boolean;
|
|
225
250
|
}
|
|
@@ -252,10 +277,8 @@ declare module "process" {
|
|
|
252
277
|
| "loong64"
|
|
253
278
|
| "mips"
|
|
254
279
|
| "mipsel"
|
|
255
|
-
| "ppc"
|
|
256
280
|
| "ppc64"
|
|
257
281
|
| "riscv64"
|
|
258
|
-
| "s390"
|
|
259
282
|
| "s390x"
|
|
260
283
|
| "x64";
|
|
261
284
|
type Signals =
|
|
@@ -726,7 +749,7 @@ declare module "process" {
|
|
|
726
749
|
* should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()`
|
|
727
750
|
* unless there are specific reasons such as custom dlopen flags or loading from ES modules.
|
|
728
751
|
*
|
|
729
|
-
* The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-
|
|
752
|
+
* The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v24.x/api/os.html#dlopen-constants)`
|
|
730
753
|
* documentation for details.
|
|
731
754
|
*
|
|
732
755
|
* An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon
|
|
@@ -980,7 +1003,41 @@ declare module "process" {
|
|
|
980
1003
|
* @default undefined
|
|
981
1004
|
* @since v0.11.8
|
|
982
1005
|
*/
|
|
983
|
-
exitCode: number | string |
|
|
1006
|
+
exitCode: number | string | null | undefined;
|
|
1007
|
+
finalization: {
|
|
1008
|
+
/**
|
|
1009
|
+
* This function registers a callback to be called when the process emits the `exit` event if the `ref` object was not garbage collected.
|
|
1010
|
+
* If the object `ref` was garbage collected before the `exit` event is emitted, the callback will be removed from the finalization registry, and it will not be called on process exit.
|
|
1011
|
+
*
|
|
1012
|
+
* Inside the callback you can release the resources allocated by the `ref` object.
|
|
1013
|
+
* Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function,
|
|
1014
|
+
* this means that there is a possibility that the callback will not be called under special circumstances.
|
|
1015
|
+
*
|
|
1016
|
+
* The idea of this function is to help you free up resources when the starts process exiting, but also let the object be garbage collected if it is no longer being used.
|
|
1017
|
+
* @param ref The reference to the resource that is being tracked.
|
|
1018
|
+
* @param callback The callback function to be called when the resource is finalized.
|
|
1019
|
+
* @since v22.5.0
|
|
1020
|
+
* @experimental
|
|
1021
|
+
*/
|
|
1022
|
+
register<T extends object>(ref: T, callback: (ref: T, event: "exit") => void): void;
|
|
1023
|
+
/**
|
|
1024
|
+
* This function behaves exactly like the `register`, except that the callback will be called when the process emits the `beforeExit` event if `ref` object was not garbage collected.
|
|
1025
|
+
*
|
|
1026
|
+
* Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function, this means that there is a possibility that the callback will not be called under special circumstances.
|
|
1027
|
+
* @param ref The reference to the resource that is being tracked.
|
|
1028
|
+
* @param callback The callback function to be called when the resource is finalized.
|
|
1029
|
+
* @since v22.5.0
|
|
1030
|
+
* @experimental
|
|
1031
|
+
*/
|
|
1032
|
+
registerBeforeExit<T extends object>(ref: T, callback: (ref: T, event: "beforeExit") => void): void;
|
|
1033
|
+
/**
|
|
1034
|
+
* This function remove the register of the object from the finalization registry, so the callback will not be called anymore.
|
|
1035
|
+
* @param ref The reference to the resource that was registered previously.
|
|
1036
|
+
* @since v22.5.0
|
|
1037
|
+
* @experimental
|
|
1038
|
+
*/
|
|
1039
|
+
unregister(ref: object): void;
|
|
1040
|
+
};
|
|
984
1041
|
/**
|
|
985
1042
|
* The `process.getActiveResourcesInfo()` method returns an array of strings containing
|
|
986
1043
|
* the types of the active resources that are currently keeping the event loop alive.
|
|
@@ -1002,7 +1059,6 @@ declare module "process" {
|
|
|
1002
1059
|
/**
|
|
1003
1060
|
* Provides a way to load built-in modules in a globally available function.
|
|
1004
1061
|
* @param id ID of the built-in module being requested.
|
|
1005
|
-
* @since v20.16.0
|
|
1006
1062
|
*/
|
|
1007
1063
|
getBuiltinModule<ID extends keyof BuiltInModule>(id: ID): BuiltInModule[ID];
|
|
1008
1064
|
getBuiltinModule(id: string): object | undefined;
|
|
@@ -1435,6 +1491,18 @@ declare module "process" {
|
|
|
1435
1491
|
* @since v9.2.0, v8.10.0, v6.13.0
|
|
1436
1492
|
*/
|
|
1437
1493
|
readonly ppid: number;
|
|
1494
|
+
/**
|
|
1495
|
+
* The `process.threadCpuUsage()` method returns the user and system CPU time usage of
|
|
1496
|
+
* the current worker thread, in an object with properties `user` and `system`, whose
|
|
1497
|
+
* values are microsecond values (millionth of a second).
|
|
1498
|
+
*
|
|
1499
|
+
* The result of a previous call to `process.threadCpuUsage()` can be passed as the
|
|
1500
|
+
* argument to the function, to get a diff reading.
|
|
1501
|
+
* @since v23.9.0
|
|
1502
|
+
* @param previousValue A previous return value from calling
|
|
1503
|
+
* `process.threadCpuUsage()`
|
|
1504
|
+
*/
|
|
1505
|
+
threadCpuUsage(previousValue?: CpuUsage): CpuUsage;
|
|
1438
1506
|
/**
|
|
1439
1507
|
* The `process.title` property returns the current process title (i.e. returns
|
|
1440
1508
|
* the current value of `ps`). Assigning a new value to `process.title` modifies
|
|
@@ -1455,7 +1523,8 @@ declare module "process" {
|
|
|
1455
1523
|
title: string;
|
|
1456
1524
|
/**
|
|
1457
1525
|
* The operating system CPU architecture for which the Node.js binary was compiled.
|
|
1458
|
-
* Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`,
|
|
1526
|
+
* Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`,
|
|
1527
|
+
* `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`.
|
|
1459
1528
|
*
|
|
1460
1529
|
* ```js
|
|
1461
1530
|
* import { arch } from 'node:process';
|
|
@@ -1511,13 +1580,11 @@ declare module "process" {
|
|
|
1511
1580
|
* See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more
|
|
1512
1581
|
* information.
|
|
1513
1582
|
* @since v19.6.0, v18.15.0
|
|
1514
|
-
* @experimental
|
|
1515
1583
|
*/
|
|
1516
1584
|
constrainedMemory(): number;
|
|
1517
1585
|
/**
|
|
1518
1586
|
* Gets the amount of free memory that is still available to the process (in bytes).
|
|
1519
|
-
* See [`uv_get_available_memory`](https://nodejs.org/docs/latest-
|
|
1520
|
-
* @experimental
|
|
1587
|
+
* See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v24.x/api/process.html#processavailablememory) for more information.
|
|
1521
1588
|
* @since v20.13.0
|
|
1522
1589
|
*/
|
|
1523
1590
|
availableMemory(): number;
|
|
@@ -1638,7 +1705,12 @@ declare module "process" {
|
|
|
1638
1705
|
*/
|
|
1639
1706
|
nextTick(callback: Function, ...args: any[]): void;
|
|
1640
1707
|
/**
|
|
1641
|
-
*
|
|
1708
|
+
* The process.noDeprecation property indicates whether the --no-deprecation flag is set on the current Node.js process.
|
|
1709
|
+
* See the documentation for the ['warning' event](https://nodejs.org/docs/latest/api/process.html#event-warning) and the [emitWarning()](https://nodejs.org/docs/latest/api/process.html#processemitwarningwarning-type-code-ctor) method for more information about this flag's behavior.
|
|
1710
|
+
*/
|
|
1711
|
+
noDeprecation?: boolean;
|
|
1712
|
+
/**
|
|
1713
|
+
* This API is available through the [--permission](https://nodejs.org/api/cli.html#--permission) flag.
|
|
1642
1714
|
*
|
|
1643
1715
|
* `process.permission` is an object whose methods are used to manage permissions for the current process.
|
|
1644
1716
|
* Additional documentation is available in the [Permission Model](https://nodejs.org/api/permissions.html#permission-model).
|
|
@@ -1777,7 +1849,7 @@ declare module "process" {
|
|
|
1777
1849
|
allowedNodeEnvironmentFlags: ReadonlySet<string>;
|
|
1778
1850
|
/**
|
|
1779
1851
|
* `process.report` is an object whose methods are used to generate diagnostic reports for the current process.
|
|
1780
|
-
* Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-
|
|
1852
|
+
* Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v24.x/api/report.html).
|
|
1781
1853
|
* @since v11.8.0
|
|
1782
1854
|
*/
|
|
1783
1855
|
report: ProcessReport;
|
|
@@ -1842,6 +1914,56 @@ declare module "process" {
|
|
|
1842
1914
|
* @since v0.8.0
|
|
1843
1915
|
*/
|
|
1844
1916
|
traceDeprecation: boolean;
|
|
1917
|
+
/**
|
|
1918
|
+
* An object is "refable" if it implements the Node.js "Refable protocol".
|
|
1919
|
+
* Specifically, this means that the object implements the `Symbol.for('nodejs.ref')`
|
|
1920
|
+
* and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js
|
|
1921
|
+
* event loop alive, while "unref'd" objects will not. Historically, this was
|
|
1922
|
+
* implemented by using `ref()` and `unref()` methods directly on the objects.
|
|
1923
|
+
* This pattern, however, is being deprecated in favor of the "Refable protocol"
|
|
1924
|
+
* in order to better support Web Platform API types whose APIs cannot be modified
|
|
1925
|
+
* to add `ref()` and `unref()` methods but still need to support that behavior.
|
|
1926
|
+
* @since v22.14.0
|
|
1927
|
+
* @experimental
|
|
1928
|
+
* @param maybeRefable An object that may be "refable".
|
|
1929
|
+
*/
|
|
1930
|
+
ref(maybeRefable: any): void;
|
|
1931
|
+
/**
|
|
1932
|
+
* An object is "unrefable" if it implements the Node.js "Refable protocol".
|
|
1933
|
+
* Specifically, this means that the object implements the `Symbol.for('nodejs.ref')`
|
|
1934
|
+
* and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js
|
|
1935
|
+
* event loop alive, while "unref'd" objects will not. Historically, this was
|
|
1936
|
+
* implemented by using `ref()` and `unref()` methods directly on the objects.
|
|
1937
|
+
* This pattern, however, is being deprecated in favor of the "Refable protocol"
|
|
1938
|
+
* in order to better support Web Platform API types whose APIs cannot be modified
|
|
1939
|
+
* to add `ref()` and `unref()` methods but still need to support that behavior.
|
|
1940
|
+
* @since v22.14.0
|
|
1941
|
+
* @experimental
|
|
1942
|
+
* @param maybeRefable An object that may be "unref'd".
|
|
1943
|
+
*/
|
|
1944
|
+
unref(maybeRefable: any): void;
|
|
1945
|
+
/**
|
|
1946
|
+
* Replaces the current process with a new process.
|
|
1947
|
+
*
|
|
1948
|
+
* This is achieved by using the `execve` POSIX function and therefore no memory or other
|
|
1949
|
+
* resources from the current process are preserved, except for the standard input,
|
|
1950
|
+
* standard output and standard error file descriptor.
|
|
1951
|
+
*
|
|
1952
|
+
* All other resources are discarded by the system when the processes are swapped, without triggering
|
|
1953
|
+
* any exit or close events and without running any cleanup handler.
|
|
1954
|
+
*
|
|
1955
|
+
* This function will never return, unless an error occurred.
|
|
1956
|
+
*
|
|
1957
|
+
* This function is not available on Windows or IBM i.
|
|
1958
|
+
* @since v22.15.0
|
|
1959
|
+
* @experimental
|
|
1960
|
+
* @param file The name or path of the executable file to run.
|
|
1961
|
+
* @param args List of string arguments. No argument can contain a null-byte (`\u0000`).
|
|
1962
|
+
* @param env Environment key-value pairs.
|
|
1963
|
+
* No key or value can contain a null-byte (`\u0000`).
|
|
1964
|
+
* **Default:** `process.env`.
|
|
1965
|
+
*/
|
|
1966
|
+
execve?(file: string, args?: readonly string[], env?: ProcessEnv): never;
|
|
1845
1967
|
/* EventEmitter */
|
|
1846
1968
|
addListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1847
1969
|
addListener(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -1883,10 +2005,10 @@ declare module "process" {
|
|
|
1883
2005
|
on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1884
2006
|
on(event: "warning", listener: WarningListener): this;
|
|
1885
2007
|
on(event: "message", listener: MessageListener): this;
|
|
1886
|
-
on(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1887
2008
|
on(event: Signals, listener: SignalsListener): this;
|
|
1888
2009
|
on(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1889
2010
|
on(event: "worker", listener: WorkerListener): this;
|
|
2011
|
+
on(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1890
2012
|
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1891
2013
|
once(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1892
2014
|
once(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -1897,10 +2019,10 @@ declare module "process" {
|
|
|
1897
2019
|
once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1898
2020
|
once(event: "warning", listener: WarningListener): this;
|
|
1899
2021
|
once(event: "message", listener: MessageListener): this;
|
|
1900
|
-
once(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1901
2022
|
once(event: Signals, listener: SignalsListener): this;
|
|
1902
2023
|
once(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1903
2024
|
once(event: "worker", listener: WorkerListener): this;
|
|
2025
|
+
once(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1904
2026
|
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1905
2027
|
prependListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1906
2028
|
prependListener(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* made available to developers as a convenience. Fixes or other modifications to
|
|
25
25
|
* the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
|
|
26
26
|
* @deprecated Since v7.0.0 - Deprecated
|
|
27
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
27
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/punycode.js)
|
|
28
28
|
*/
|
|
29
29
|
declare module "punycode" {
|
|
30
30
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* `querystring` is more performant than `URLSearchParams` but is not a
|
|
10
10
|
* standardized API. Use `URLSearchParams` when performance is not critical or
|
|
11
11
|
* when compatibility with browser code is desirable.
|
|
12
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
12
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/querystring.js)
|
|
13
13
|
*/
|
|
14
14
|
declare module "querystring" {
|
|
15
15
|
interface StringifyOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/
|
|
3
|
-
* (such as [`process.stdin`](https://nodejs.org/docs/
|
|
2
|
+
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream
|
|
3
|
+
* (such as [`process.stdin`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdin)) one line at a time.
|
|
4
4
|
*
|
|
5
5
|
* To use the promise-based APIs:
|
|
6
6
|
*
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
*
|
|
32
32
|
* Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be
|
|
33
33
|
* received on the `input` stream.
|
|
34
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
34
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/readline.js)
|
|
35
35
|
*/
|
|
36
36
|
declare module "readline" {
|
|
37
37
|
import { Abortable, EventEmitter } from "node:events";
|
|
@@ -46,12 +46,12 @@ declare module "readline" {
|
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a
|
|
49
|
-
* single `input` [Readable](https://nodejs.org/docs/
|
|
49
|
+
* single `input` [Readable](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream.
|
|
50
50
|
* The `output` stream is used to print prompts for user input that arrives on,
|
|
51
51
|
* and is read from, the `input` stream.
|
|
52
52
|
* @since v0.1.104
|
|
53
53
|
*/
|
|
54
|
-
export class Interface extends EventEmitter {
|
|
54
|
+
export class Interface extends EventEmitter implements Disposable {
|
|
55
55
|
readonly terminal: boolean;
|
|
56
56
|
/**
|
|
57
57
|
* The current input data being processed by node.
|
|
@@ -100,7 +100,7 @@ declare module "readline" {
|
|
|
100
100
|
* > Instances of the `readline.Interface` class are constructed using the
|
|
101
101
|
* > `readline.createInterface()` method.
|
|
102
102
|
*
|
|
103
|
-
* @see https://nodejs.org/
|
|
103
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
|
104
104
|
*/
|
|
105
105
|
protected constructor(
|
|
106
106
|
input: NodeJS.ReadableStream,
|
|
@@ -114,7 +114,7 @@ declare module "readline" {
|
|
|
114
114
|
* > Instances of the `readline.Interface` class are constructed using the
|
|
115
115
|
* > `readline.createInterface()` method.
|
|
116
116
|
*
|
|
117
|
-
* @see https://nodejs.org/
|
|
117
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
|
118
118
|
*/
|
|
119
119
|
protected constructor(options: ReadLineOptions);
|
|
120
120
|
/**
|
|
@@ -208,6 +208,11 @@ declare module "readline" {
|
|
|
208
208
|
* @since v0.1.98
|
|
209
209
|
*/
|
|
210
210
|
close(): void;
|
|
211
|
+
/**
|
|
212
|
+
* Alias for `rl.close()`.
|
|
213
|
+
* @since v22.15.0
|
|
214
|
+
*/
|
|
215
|
+
[Symbol.dispose](): void;
|
|
211
216
|
/**
|
|
212
217
|
* The `rl.write()` method will write either `data` or a key sequence identified
|
|
213
218
|
* by `key` to the `output`. The `key` argument is supported only if `output` is
|
|
@@ -315,11 +320,11 @@ declare module "readline" {
|
|
|
315
320
|
export type CompleterResult = [string[], string];
|
|
316
321
|
export interface ReadLineOptions {
|
|
317
322
|
/**
|
|
318
|
-
* The [`Readable`](https://nodejs.org/docs/latest-
|
|
323
|
+
* The [`Readable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream to listen to
|
|
319
324
|
*/
|
|
320
325
|
input: NodeJS.ReadableStream;
|
|
321
326
|
/**
|
|
322
|
-
* The [`Writable`](https://nodejs.org/docs/latest-
|
|
327
|
+
* The [`Writable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream to write readline data to.
|
|
323
328
|
*/
|
|
324
329
|
output?: NodeJS.WritableStream | undefined;
|
|
325
330
|
/**
|
|
@@ -364,7 +369,7 @@ declare module "readline" {
|
|
|
364
369
|
* `crlfDelay` will be coerced to a number no less than `100`.
|
|
365
370
|
* It can be set to `Infinity`, in which case
|
|
366
371
|
* `\r` followed by `\n` will always be considered a single newline
|
|
367
|
-
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-
|
|
372
|
+
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v24.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
|
|
368
373
|
* @default 100
|
|
369
374
|
*/
|
|
370
375
|
crlfDelay?: number | undefined;
|
|
@@ -552,7 +557,7 @@ declare module "readline" {
|
|
|
552
557
|
cols: number;
|
|
553
558
|
}
|
|
554
559
|
/**
|
|
555
|
-
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/
|
|
560
|
+
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream
|
|
556
561
|
* in a specified direction identified by `dir`.
|
|
557
562
|
* @since v0.7.7
|
|
558
563
|
* @param callback Invoked once the operation completes.
|
|
@@ -560,7 +565,7 @@ declare module "readline" {
|
|
|
560
565
|
*/
|
|
561
566
|
export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
|
|
562
567
|
/**
|
|
563
|
-
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/
|
|
568
|
+
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream from
|
|
564
569
|
* the current position of the cursor down.
|
|
565
570
|
* @since v0.7.7
|
|
566
571
|
* @param callback Invoked once the operation completes.
|
|
@@ -569,7 +574,7 @@ declare module "readline" {
|
|
|
569
574
|
export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
|
|
570
575
|
/**
|
|
571
576
|
* The `readline.cursorTo()` method moves cursor to the specified position in a
|
|
572
|
-
* given [TTY](https://nodejs.org/docs/
|
|
577
|
+
* given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`.
|
|
573
578
|
* @since v0.7.7
|
|
574
579
|
* @param callback Invoked once the operation completes.
|
|
575
580
|
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
@@ -577,7 +582,7 @@ declare module "readline" {
|
|
|
577
582
|
export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
|
|
578
583
|
/**
|
|
579
584
|
* The `readline.moveCursor()` method moves the cursor _relative_ to its current
|
|
580
|
-
* position in a given [TTY](https://nodejs.org/docs/
|
|
585
|
+
* position in a given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`.
|
|
581
586
|
* @since v0.7.7
|
|
582
587
|
* @param callback Invoked once the operation completes.
|
|
583
588
|
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* import repl from 'node:repl';
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/repl.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module "repl" {
|
|
12
12
|
import { AsyncCompleter, Completer, Interface } from "node:readline";
|
|
@@ -37,12 +37,10 @@ declare module "repl" {
|
|
|
37
37
|
terminal?: boolean | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* The function to be used when evaluating each given line of input.
|
|
40
|
-
* Default
|
|
40
|
+
* **Default:** an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
|
41
41
|
* error with `repl.Recoverable` to indicate the input was incomplete and prompt for
|
|
42
|
-
* additional lines.
|
|
43
|
-
*
|
|
44
|
-
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_default_evaluation
|
|
45
|
-
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_custom_evaluation_functions
|
|
42
|
+
* additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#custom-evaluation-functions)
|
|
43
|
+
* section for more details.
|
|
46
44
|
*/
|
|
47
45
|
eval?: REPLEval | undefined;
|
|
48
46
|
/**
|
|
@@ -74,13 +72,13 @@ declare module "repl" {
|
|
|
74
72
|
* The function to invoke to format the output of each command before writing to `output`.
|
|
75
73
|
* @default a wrapper for `util.inspect`
|
|
76
74
|
*
|
|
77
|
-
* @see https://nodejs.org/dist/latest-
|
|
75
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_customizing_repl_output
|
|
78
76
|
*/
|
|
79
77
|
writer?: REPLWriter | undefined;
|
|
80
78
|
/**
|
|
81
79
|
* An optional function used for custom Tab auto completion.
|
|
82
80
|
*
|
|
83
|
-
* @see https://nodejs.org/dist/latest-
|
|
81
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#readline_use_of_the_completer_function
|
|
84
82
|
*/
|
|
85
83
|
completer?: Completer | AsyncCompleter | undefined;
|
|
86
84
|
/**
|
|
@@ -125,6 +123,12 @@ declare module "repl" {
|
|
|
125
123
|
*/
|
|
126
124
|
action: REPLCommandAction;
|
|
127
125
|
}
|
|
126
|
+
interface REPLServerSetupHistoryOptions {
|
|
127
|
+
filePath?: string | undefined;
|
|
128
|
+
size?: number | undefined;
|
|
129
|
+
removeHistoryDuplicates?: boolean | undefined;
|
|
130
|
+
onHistoryFileLoaded?: ((err: Error | null, repl: REPLServer) => void) | undefined;
|
|
131
|
+
}
|
|
128
132
|
/**
|
|
129
133
|
* Instances of `repl.REPLServer` are created using the {@link start} method
|
|
130
134
|
* or directly using the JavaScript `new` keyword.
|
|
@@ -168,33 +172,33 @@ declare module "repl" {
|
|
|
168
172
|
/**
|
|
169
173
|
* A value indicating whether the REPL is currently in "editor mode".
|
|
170
174
|
*
|
|
171
|
-
* @see https://nodejs.org/dist/latest-
|
|
175
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_commands_and_special_keys
|
|
172
176
|
*/
|
|
173
177
|
readonly editorMode: boolean;
|
|
174
178
|
/**
|
|
175
179
|
* A value indicating whether the `_` variable has been assigned.
|
|
176
180
|
*
|
|
177
|
-
* @see https://nodejs.org/dist/latest-
|
|
181
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
178
182
|
*/
|
|
179
183
|
readonly underscoreAssigned: boolean;
|
|
180
184
|
/**
|
|
181
185
|
* The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
|
|
182
186
|
*
|
|
183
|
-
* @see https://nodejs.org/dist/latest-
|
|
187
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
184
188
|
*/
|
|
185
189
|
readonly last: any;
|
|
186
190
|
/**
|
|
187
191
|
* A value indicating whether the `_error` variable has been assigned.
|
|
188
192
|
*
|
|
189
193
|
* @since v9.8.0
|
|
190
|
-
* @see https://nodejs.org/dist/latest-
|
|
194
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
191
195
|
*/
|
|
192
196
|
readonly underscoreErrAssigned: boolean;
|
|
193
197
|
/**
|
|
194
198
|
* The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
|
|
195
199
|
*
|
|
196
200
|
* @since v9.8.0
|
|
197
|
-
* @see https://nodejs.org/dist/latest-
|
|
201
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
198
202
|
*/
|
|
199
203
|
readonly lastError: any;
|
|
200
204
|
/**
|
|
@@ -246,7 +250,7 @@ declare module "repl" {
|
|
|
246
250
|
*
|
|
247
251
|
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
|
248
252
|
*
|
|
249
|
-
* @see https://nodejs.org/dist/latest-
|
|
253
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_class_replserver
|
|
250
254
|
*/
|
|
251
255
|
private constructor();
|
|
252
256
|
/**
|
|
@@ -291,7 +295,7 @@ declare module "repl" {
|
|
|
291
295
|
* The `replServer.displayPrompt()` method readies the REPL instance for input
|
|
292
296
|
* from the user, printing the configured `prompt` to a new line in the `output` and resuming the `input` to accept new input.
|
|
293
297
|
*
|
|
294
|
-
* When multi-line input is being entered,
|
|
298
|
+
* When multi-line input is being entered, a pipe `'|'` is printed rather than the
|
|
295
299
|
* 'prompt'.
|
|
296
300
|
*
|
|
297
301
|
* When `preserveCursor` is `true`, the cursor placement will not be reset to `0`.
|
|
@@ -318,7 +322,11 @@ declare module "repl" {
|
|
|
318
322
|
* @param historyPath the path to the history file
|
|
319
323
|
* @param callback called when history writes are ready or upon error
|
|
320
324
|
*/
|
|
321
|
-
setupHistory(
|
|
325
|
+
setupHistory(historyPath: string, callback: (err: Error | null, repl: this) => void): void;
|
|
326
|
+
setupHistory(
|
|
327
|
+
historyConfig?: REPLServerSetupHistoryOptions,
|
|
328
|
+
callback?: (err: Error | null, repl: this) => void,
|
|
329
|
+
): void;
|
|
322
330
|
/**
|
|
323
331
|
* events.EventEmitter
|
|
324
332
|
* 1. close - inherited from `readline.Interface`
|
|
@@ -418,7 +426,7 @@ declare module "repl" {
|
|
|
418
426
|
/**
|
|
419
427
|
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
|
420
428
|
*
|
|
421
|
-
* @see https://nodejs.org/dist/latest-
|
|
429
|
+
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_recoverable_errors
|
|
422
430
|
*/
|
|
423
431
|
class Recoverable extends SyntaxError {
|
|
424
432
|
err: Error;
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
* ```
|
|
112
112
|
* @since v19.7.0, v18.16.0
|
|
113
113
|
* @experimental
|
|
114
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
114
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/src/node_sea.cc)
|
|
115
115
|
*/
|
|
116
116
|
declare module "node:sea" {
|
|
117
117
|
type AssetKey = string;
|
|
@@ -149,5 +149,14 @@ declare module "node:sea" {
|
|
|
149
149
|
* writes to the returned array buffer is likely to result in a crash.
|
|
150
150
|
* @since v20.12.0
|
|
151
151
|
*/
|
|
152
|
-
function getRawAsset(key: AssetKey):
|
|
152
|
+
function getRawAsset(key: AssetKey): ArrayBuffer;
|
|
153
|
+
/**
|
|
154
|
+
* This method can be used to retrieve an array of all the keys of assets
|
|
155
|
+
* embedded into the single-executable application.
|
|
156
|
+
* An error is thrown when not running inside a single-executable application.
|
|
157
|
+
* @since v24.8.0
|
|
158
|
+
* @returns An array containing all the keys of the assets
|
|
159
|
+
* embedded in the executable. If no assets are embedded, returns an empty array.
|
|
160
|
+
*/
|
|
161
|
+
function getAssetKeys(): string[];
|
|
153
162
|
}
|