@types/node 24.1.0 → 24.2.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/README.md +1 -1
- node/crypto.d.ts +17 -1
- node/fs/promises.d.ts +7 -3
- node/fs.d.ts +0 -2
- node/http2.d.ts +13 -11
- node/inspector.d.ts +110 -6
- node/module.d.ts +24 -0
- node/package.json +4 -4
- node/perf_hooks.d.ts +14 -0
- node/repl.d.ts +11 -1
- node/sqlite.d.ts +0 -1
- node/stream.d.ts +17 -6
- node/test.d.ts +16 -1
- node/timers.d.ts +0 -2
- node/url.d.ts +1 -1
- node/util.d.ts +6 -2
- node/worker_threads.d.ts +12 -0
- node/zlib.d.ts +8 -2
node/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Mon, 04 Aug 2025 10:03:40 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/crypto.d.ts
CHANGED
@@ -3771,7 +3771,23 @@ declare module "crypto" {
|
|
3771
3771
|
*/
|
3772
3772
|
checkIP(ip: string): string | undefined;
|
3773
3773
|
/**
|
3774
|
-
* Checks whether this certificate was issued by the given `otherCert
|
3774
|
+
* Checks whether this certificate was potentially issued by the given `otherCert`
|
3775
|
+
* by comparing the certificate metadata.
|
3776
|
+
*
|
3777
|
+
* This is useful for pruning a list of possible issuer certificates which have been
|
3778
|
+
* selected using a more rudimentary filtering routine, i.e. just based on subject
|
3779
|
+
* and issuer names.
|
3780
|
+
*
|
3781
|
+
* Finally, to verify that this certificate's signature was produced by a private key
|
3782
|
+
* corresponding to `otherCert`'s public key use `x509.verify(publicKey)`
|
3783
|
+
* with `otherCert`'s public key represented as a `KeyObject`
|
3784
|
+
* like so
|
3785
|
+
*
|
3786
|
+
* ```js
|
3787
|
+
* if (!x509.verify(otherCert.publicKey)) {
|
3788
|
+
* throw new Error('otherCert did not issue x509');
|
3789
|
+
* }
|
3790
|
+
* ```
|
3775
3791
|
* @since v15.6.0
|
3776
3792
|
*/
|
3777
3793
|
checkIssued(otherCert: X509Certificate): boolean;
|
node/fs/promises.d.ts
CHANGED
@@ -88,6 +88,9 @@ declare module "fs/promises" {
|
|
88
88
|
highWaterMark?: number | undefined;
|
89
89
|
flush?: boolean | undefined;
|
90
90
|
}
|
91
|
+
interface ReadableWebStreamOptions {
|
92
|
+
autoClose?: boolean | undefined;
|
93
|
+
}
|
91
94
|
// TODO: Add `EventEmitter` close
|
92
95
|
interface FileHandle {
|
93
96
|
/**
|
@@ -261,7 +264,7 @@ declare module "fs/promises" {
|
|
261
264
|
* close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method.
|
262
265
|
* @since v17.0.0
|
263
266
|
*/
|
264
|
-
readableWebStream(): ReadableStream;
|
267
|
+
readableWebStream(options?: ReadableWebStreamOptions): ReadableStream;
|
265
268
|
/**
|
266
269
|
* Asynchronously reads the entire contents of a file.
|
267
270
|
*
|
@@ -474,8 +477,9 @@ declare module "fs/promises" {
|
|
474
477
|
*/
|
475
478
|
close(): Promise<void>;
|
476
479
|
/**
|
477
|
-
*
|
478
|
-
*
|
480
|
+
* Calls `filehandle.close()` and returns a promise that fulfills when the
|
481
|
+
* filehandle is closed.
|
482
|
+
* @since v20.4.0, v18.8.0
|
479
483
|
*/
|
480
484
|
[Symbol.asyncDispose](): Promise<void>;
|
481
485
|
}
|
node/fs.d.ts
CHANGED
@@ -325,13 +325,11 @@ declare module "fs" {
|
|
325
325
|
/**
|
326
326
|
* An alias for `dir.close()`.
|
327
327
|
* @since v24.1.0
|
328
|
-
* @experimental
|
329
328
|
*/
|
330
329
|
[Symbol.dispose](): void;
|
331
330
|
/**
|
332
331
|
* An alias for `dir.closeSync()`.
|
333
332
|
* @since v24.1.0
|
334
|
-
* @experimental
|
335
333
|
*/
|
336
334
|
[Symbol.asyncDispose](): void;
|
337
335
|
}
|
node/http2.d.ts
CHANGED
@@ -32,18 +32,14 @@ declare module "http2" {
|
|
32
32
|
":scheme"?: string | undefined;
|
33
33
|
}
|
34
34
|
// Http2Stream
|
35
|
-
export interface StreamPriorityOptions {
|
36
|
-
exclusive?: boolean | undefined;
|
37
|
-
parent?: number | undefined;
|
38
|
-
weight?: number | undefined;
|
39
|
-
silent?: boolean | undefined;
|
40
|
-
}
|
41
35
|
export interface StreamState {
|
42
36
|
localWindowSize?: number | undefined;
|
43
37
|
state?: number | undefined;
|
44
38
|
localClose?: number | undefined;
|
45
39
|
remoteClose?: number | undefined;
|
40
|
+
/** @deprecated */
|
46
41
|
sumDependencyWeight?: number | undefined;
|
42
|
+
/** @deprecated */
|
47
43
|
weight?: number | undefined;
|
48
44
|
}
|
49
45
|
export interface ServerStreamResponseOptions {
|
@@ -151,10 +147,9 @@ declare module "http2" {
|
|
151
147
|
*/
|
152
148
|
close(code?: number, callback?: () => void): void;
|
153
149
|
/**
|
154
|
-
*
|
155
|
-
* @since v8.4.0
|
150
|
+
* @deprecated Priority signaling is no longer supported in Node.js.
|
156
151
|
*/
|
157
|
-
priority(options:
|
152
|
+
priority(options: unknown): void;
|
158
153
|
/**
|
159
154
|
* ```js
|
160
155
|
* import http2 from 'node:http2';
|
@@ -395,7 +390,7 @@ declare module "http2" {
|
|
395
390
|
): void;
|
396
391
|
pushStream(
|
397
392
|
headers: OutgoingHttpHeaders,
|
398
|
-
options?:
|
393
|
+
options?: Pick<ClientSessionRequestOptions, "exclusive" | "parent">,
|
399
394
|
callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void,
|
400
395
|
): void;
|
401
396
|
/**
|
@@ -629,7 +624,6 @@ declare module "http2" {
|
|
629
624
|
endStream?: boolean | undefined;
|
630
625
|
exclusive?: boolean | undefined;
|
631
626
|
parent?: number | undefined;
|
632
|
-
weight?: number | undefined;
|
633
627
|
waitForTrailers?: boolean | undefined;
|
634
628
|
signal?: AbortSignal | undefined;
|
635
629
|
}
|
@@ -1294,6 +1288,14 @@ declare module "http2" {
|
|
1294
1288
|
* @default 100000
|
1295
1289
|
*/
|
1296
1290
|
unknownProtocolTimeout?: number | undefined;
|
1291
|
+
/**
|
1292
|
+
* If `true`, it turns on strict leading
|
1293
|
+
* and trailing whitespace validation for HTTP/2 header field names and values
|
1294
|
+
* as per [RFC-9113](https://www.rfc-editor.org/rfc/rfc9113.html#section-8.2.1).
|
1295
|
+
* @since v24.2.0
|
1296
|
+
* @default true
|
1297
|
+
*/
|
1298
|
+
strictFieldWhitespaceValidation?: boolean | undefined;
|
1297
1299
|
}
|
1298
1300
|
export interface ClientSessionOptions extends SessionOptions {
|
1299
1301
|
/**
|
node/inspector.d.ts
CHANGED
@@ -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 {
|
@@ -1768,12 +1768,26 @@ declare module 'inspector' {
|
|
1768
1768
|
status: number;
|
1769
1769
|
statusText: string;
|
1770
1770
|
headers: Headers;
|
1771
|
+
mimeType: string;
|
1772
|
+
charset: string;
|
1771
1773
|
}
|
1772
1774
|
/**
|
1773
1775
|
* Request / response headers as keys / values of JSON object.
|
1774
1776
|
*/
|
1775
1777
|
interface Headers {
|
1776
1778
|
}
|
1779
|
+
interface StreamResourceContentParameterType {
|
1780
|
+
/**
|
1781
|
+
* Identifier of the request to stream.
|
1782
|
+
*/
|
1783
|
+
requestId: RequestId;
|
1784
|
+
}
|
1785
|
+
interface StreamResourceContentReturnType {
|
1786
|
+
/**
|
1787
|
+
* Data that has been buffered until streaming is enabled.
|
1788
|
+
*/
|
1789
|
+
bufferedData: string;
|
1790
|
+
}
|
1777
1791
|
interface RequestWillBeSentEventDataType {
|
1778
1792
|
/**
|
1779
1793
|
* Request identifier.
|
@@ -1842,6 +1856,29 @@ declare module 'inspector' {
|
|
1842
1856
|
*/
|
1843
1857
|
timestamp: MonotonicTime;
|
1844
1858
|
}
|
1859
|
+
interface DataReceivedEventDataType {
|
1860
|
+
/**
|
1861
|
+
* Request identifier.
|
1862
|
+
*/
|
1863
|
+
requestId: RequestId;
|
1864
|
+
/**
|
1865
|
+
* Timestamp.
|
1866
|
+
*/
|
1867
|
+
timestamp: MonotonicTime;
|
1868
|
+
/**
|
1869
|
+
* Data chunk length.
|
1870
|
+
*/
|
1871
|
+
dataLength: number;
|
1872
|
+
/**
|
1873
|
+
* Actual bytes received (might be less than dataLength for compressed encodings).
|
1874
|
+
*/
|
1875
|
+
encodedDataLength: number;
|
1876
|
+
/**
|
1877
|
+
* Data that was received.
|
1878
|
+
* @experimental
|
1879
|
+
*/
|
1880
|
+
data?: string | undefined;
|
1881
|
+
}
|
1845
1882
|
}
|
1846
1883
|
namespace NodeRuntime {
|
1847
1884
|
interface NotifyWhenWaitingForDisconnectParameterType {
|
@@ -2248,6 +2285,17 @@ declare module 'inspector' {
|
|
2248
2285
|
* Enables network tracking, network events will now be delivered to the client.
|
2249
2286
|
*/
|
2250
2287
|
post(method: 'Network.enable', callback?: (err: Error | null) => void): void;
|
2288
|
+
/**
|
2289
|
+
* Enables streaming of the response for the given requestId.
|
2290
|
+
* If enabled, the dataReceived event contains the data that was received during streaming.
|
2291
|
+
* @experimental
|
2292
|
+
*/
|
2293
|
+
post(
|
2294
|
+
method: 'Network.streamResourceContent',
|
2295
|
+
params?: Network.StreamResourceContentParameterType,
|
2296
|
+
callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void
|
2297
|
+
): void;
|
2298
|
+
post(method: 'Network.streamResourceContent', callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void;
|
2251
2299
|
/**
|
2252
2300
|
* Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`.
|
2253
2301
|
*/
|
@@ -2369,6 +2417,10 @@ declare module 'inspector' {
|
|
2369
2417
|
addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
2370
2418
|
addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
2371
2419
|
addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
2420
|
+
/**
|
2421
|
+
* Fired when data chunk was received over the network.
|
2422
|
+
*/
|
2423
|
+
addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
2372
2424
|
/**
|
2373
2425
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
2374
2426
|
* enabled.
|
@@ -2414,6 +2466,7 @@ declare module 'inspector' {
|
|
2414
2466
|
emit(event: 'Network.responseReceived', message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean;
|
2415
2467
|
emit(event: 'Network.loadingFailed', message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
|
2416
2468
|
emit(event: 'Network.loadingFinished', message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
|
2469
|
+
emit(event: 'Network.dataReceived', message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
|
2417
2470
|
emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
|
2418
2471
|
emit(event: 'NodeRuntime.waitingForDebugger'): boolean;
|
2419
2472
|
emit(event: 'Target.targetCreated', message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
|
@@ -2523,6 +2576,10 @@ declare module 'inspector' {
|
|
2523
2576
|
on(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
2524
2577
|
on(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
2525
2578
|
on(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
2579
|
+
/**
|
2580
|
+
* Fired when data chunk was received over the network.
|
2581
|
+
*/
|
2582
|
+
on(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
2526
2583
|
/**
|
2527
2584
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
2528
2585
|
* enabled.
|
@@ -2642,6 +2699,10 @@ declare module 'inspector' {
|
|
2642
2699
|
once(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
2643
2700
|
once(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
2644
2701
|
once(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
2702
|
+
/**
|
2703
|
+
* Fired when data chunk was received over the network.
|
2704
|
+
*/
|
2705
|
+
once(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
2645
2706
|
/**
|
2646
2707
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
2647
2708
|
* enabled.
|
@@ -2761,6 +2822,10 @@ declare module 'inspector' {
|
|
2761
2822
|
prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
2762
2823
|
prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
2763
2824
|
prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
2825
|
+
/**
|
2826
|
+
* Fired when data chunk was received over the network.
|
2827
|
+
*/
|
2828
|
+
prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
2764
2829
|
/**
|
2765
2830
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
2766
2831
|
* enabled.
|
@@ -2880,6 +2945,10 @@ declare module 'inspector' {
|
|
2880
2945
|
prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
2881
2946
|
prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
2882
2947
|
prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
2948
|
+
/**
|
2949
|
+
* Fired when data chunk was received over the network.
|
2950
|
+
*/
|
2951
|
+
prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
2883
2952
|
/**
|
2884
2953
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
2885
2954
|
* enabled.
|
@@ -2988,6 +3057,14 @@ declare module 'inspector' {
|
|
2988
3057
|
* @since v22.6.0
|
2989
3058
|
*/
|
2990
3059
|
function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
|
3060
|
+
/**
|
3061
|
+
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3062
|
+
*
|
3063
|
+
* Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if
|
3064
|
+
* `Network.streamResourceContent` command was not invoked for the given request yet.
|
3065
|
+
* @since v24.2.0
|
3066
|
+
*/
|
3067
|
+
function dataReceived(params: DataReceivedEventDataType): void;
|
2991
3068
|
/**
|
2992
3069
|
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
2993
3070
|
*
|
@@ -3373,6 +3450,12 @@ declare module 'inspector/promises' {
|
|
3373
3450
|
* Enables network tracking, network events will now be delivered to the client.
|
3374
3451
|
*/
|
3375
3452
|
post(method: 'Network.enable'): Promise<void>;
|
3453
|
+
/**
|
3454
|
+
* Enables streaming of the response for the given requestId.
|
3455
|
+
* If enabled, the dataReceived event contains the data that was received during streaming.
|
3456
|
+
* @experimental
|
3457
|
+
*/
|
3458
|
+
post(method: 'Network.streamResourceContent', params?: Network.StreamResourceContentParameterType): Promise<Network.StreamResourceContentReturnType>;
|
3376
3459
|
/**
|
3377
3460
|
* Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`.
|
3378
3461
|
*/
|
@@ -3492,6 +3575,10 @@ declare module 'inspector/promises' {
|
|
3492
3575
|
addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
3493
3576
|
addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
3494
3577
|
addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
3578
|
+
/**
|
3579
|
+
* Fired when data chunk was received over the network.
|
3580
|
+
*/
|
3581
|
+
addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
3495
3582
|
/**
|
3496
3583
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
3497
3584
|
* enabled.
|
@@ -3537,6 +3624,7 @@ declare module 'inspector/promises' {
|
|
3537
3624
|
emit(event: 'Network.responseReceived', message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean;
|
3538
3625
|
emit(event: 'Network.loadingFailed', message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
|
3539
3626
|
emit(event: 'Network.loadingFinished', message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
|
3627
|
+
emit(event: 'Network.dataReceived', message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
|
3540
3628
|
emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
|
3541
3629
|
emit(event: 'NodeRuntime.waitingForDebugger'): boolean;
|
3542
3630
|
emit(event: 'Target.targetCreated', message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
|
@@ -3646,6 +3734,10 @@ declare module 'inspector/promises' {
|
|
3646
3734
|
on(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
3647
3735
|
on(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
3648
3736
|
on(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
3737
|
+
/**
|
3738
|
+
* Fired when data chunk was received over the network.
|
3739
|
+
*/
|
3740
|
+
on(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
3649
3741
|
/**
|
3650
3742
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
3651
3743
|
* enabled.
|
@@ -3765,6 +3857,10 @@ declare module 'inspector/promises' {
|
|
3765
3857
|
once(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
3766
3858
|
once(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
3767
3859
|
once(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
3860
|
+
/**
|
3861
|
+
* Fired when data chunk was received over the network.
|
3862
|
+
*/
|
3863
|
+
once(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
3768
3864
|
/**
|
3769
3865
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
3770
3866
|
* enabled.
|
@@ -3884,6 +3980,10 @@ declare module 'inspector/promises' {
|
|
3884
3980
|
prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
3885
3981
|
prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
3886
3982
|
prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
3983
|
+
/**
|
3984
|
+
* Fired when data chunk was received over the network.
|
3985
|
+
*/
|
3986
|
+
prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
3887
3987
|
/**
|
3888
3988
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
3889
3989
|
* enabled.
|
@@ -4003,6 +4103,10 @@ declare module 'inspector/promises' {
|
|
4003
4103
|
prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
|
4004
4104
|
prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
|
4005
4105
|
prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
|
4106
|
+
/**
|
4107
|
+
* Fired when data chunk was received over the network.
|
4108
|
+
*/
|
4109
|
+
prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
|
4006
4110
|
/**
|
4007
4111
|
* This event is fired instead of `Runtime.executionContextDestroyed` when
|
4008
4112
|
* enabled.
|
node/module.d.ts
CHANGED
@@ -685,6 +685,30 @@ declare module "module" {
|
|
685
685
|
* @returns The absolute URL string that the specifier would resolve to.
|
686
686
|
*/
|
687
687
|
resolve(specifier: string, parent?: string | URL): string;
|
688
|
+
/**
|
689
|
+
* `true` when the current module is the entry point of the current process; `false` otherwise.
|
690
|
+
*
|
691
|
+
* Equivalent to `require.main === module` in CommonJS.
|
692
|
+
*
|
693
|
+
* Analogous to Python's `__name__ == "__main__"`.
|
694
|
+
*
|
695
|
+
* ```js
|
696
|
+
* export function foo() {
|
697
|
+
* return 'Hello, world';
|
698
|
+
* }
|
699
|
+
*
|
700
|
+
* function main() {
|
701
|
+
* const message = foo();
|
702
|
+
* console.log(message);
|
703
|
+
* }
|
704
|
+
*
|
705
|
+
* if (import.meta.main) main();
|
706
|
+
* // `foo` can be imported from another module without possible side-effects from `main`
|
707
|
+
* ```
|
708
|
+
* @since v24.2.0
|
709
|
+
* @experimental
|
710
|
+
*/
|
711
|
+
main: boolean;
|
688
712
|
}
|
689
713
|
namespace NodeJS {
|
690
714
|
interface Module {
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "24.
|
3
|
+
"version": "24.2.0",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -152,9 +152,9 @@
|
|
152
152
|
},
|
153
153
|
"scripts": {},
|
154
154
|
"dependencies": {
|
155
|
-
"undici-types": "~7.
|
155
|
+
"undici-types": "~7.10.0"
|
156
156
|
},
|
157
157
|
"peerDependencies": {},
|
158
|
-
"typesPublisherContentHash": "
|
159
|
-
"typeScriptVersion": "5.
|
158
|
+
"typesPublisherContentHash": "592a3f00c1a1fd43b2d3e4b61e9a9840a9d22deac79f88625b217e5a14958a3d",
|
159
|
+
"typeScriptVersion": "5.2"
|
160
160
|
}
|
node/perf_hooks.d.ts
CHANGED
@@ -813,6 +813,20 @@ declare module "perf_hooks" {
|
|
813
813
|
* @since v11.10.0
|
814
814
|
*/
|
815
815
|
disable(): boolean;
|
816
|
+
/**
|
817
|
+
* Disables the update interval timer when the histogram is disposed.
|
818
|
+
*
|
819
|
+
* ```js
|
820
|
+
* const { monitorEventLoopDelay } = require('node:perf_hooks');
|
821
|
+
* {
|
822
|
+
* using hist = monitorEventLoopDelay({ resolution: 20 });
|
823
|
+
* hist.enable();
|
824
|
+
* // The histogram will be disabled when the block is exited.
|
825
|
+
* }
|
826
|
+
* ```
|
827
|
+
* @since v24.2.0
|
828
|
+
*/
|
829
|
+
[Symbol.dispose](): void;
|
816
830
|
}
|
817
831
|
interface RecordableHistogram extends Histogram {
|
818
832
|
/**
|
node/repl.d.ts
CHANGED
@@ -123,6 +123,12 @@ declare module "repl" {
|
|
123
123
|
*/
|
124
124
|
action: REPLCommandAction;
|
125
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
|
+
}
|
126
132
|
/**
|
127
133
|
* Instances of `repl.REPLServer` are created using the {@link start} method
|
128
134
|
* or directly using the JavaScript `new` keyword.
|
@@ -316,7 +322,11 @@ declare module "repl" {
|
|
316
322
|
* @param historyPath the path to the history file
|
317
323
|
* @param callback called when history writes are ready or upon error
|
318
324
|
*/
|
319
|
-
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;
|
320
330
|
/**
|
321
331
|
* events.EventEmitter
|
322
332
|
* 1. close - inherited from `readline.Interface`
|
node/sqlite.d.ts
CHANGED
node/stream.d.ts
CHANGED
@@ -615,6 +615,17 @@ declare module "stream" {
|
|
615
615
|
* @param error Error which will be passed as payload in `'error'` event
|
616
616
|
*/
|
617
617
|
destroy(error?: Error): this;
|
618
|
+
/**
|
619
|
+
* @returns `AsyncIterator` to fully consume the stream.
|
620
|
+
* @since v10.0.0
|
621
|
+
*/
|
622
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
|
623
|
+
/**
|
624
|
+
* Calls `readable.destroy()` with an `AbortError` and returns
|
625
|
+
* a promise that fulfills when the stream is finished.
|
626
|
+
* @since v20.4.0
|
627
|
+
*/
|
628
|
+
[Symbol.asyncDispose](): Promise<void>;
|
618
629
|
/**
|
619
630
|
* Event emitter
|
620
631
|
* The defined events on documents including:
|
@@ -682,12 +693,6 @@ declare module "stream" {
|
|
682
693
|
removeListener(event: "readable", listener: () => void): this;
|
683
694
|
removeListener(event: "resume", listener: () => void): this;
|
684
695
|
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
685
|
-
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
|
686
|
-
/**
|
687
|
-
* Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
|
688
|
-
* @since v20.4.0
|
689
|
-
*/
|
690
|
-
[Symbol.asyncDispose](): Promise<void>;
|
691
696
|
}
|
692
697
|
interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
|
693
698
|
decodeStrings?: boolean | undefined;
|
@@ -957,6 +962,12 @@ declare module "stream" {
|
|
957
962
|
* @param error Optional, an error to emit with `'error'` event.
|
958
963
|
*/
|
959
964
|
destroy(error?: Error): this;
|
965
|
+
/**
|
966
|
+
* Calls `writable.destroy()` with an `AbortError` and returns
|
967
|
+
* a promise that fulfills when the stream is finished.
|
968
|
+
* @since v22.4.0, v20.16.0
|
969
|
+
*/
|
970
|
+
[Symbol.asyncDispose](): Promise<void>;
|
960
971
|
/**
|
961
972
|
* Event emitter
|
962
973
|
* The defined events on documents including:
|
node/test.d.ts
CHANGED
@@ -410,6 +410,7 @@ declare module "node:test" {
|
|
410
410
|
addListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
411
411
|
addListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
412
412
|
addListener(event: "test:watch:drained", listener: () => void): this;
|
413
|
+
addListener(event: "test:watch:restarted", listener: () => void): this;
|
413
414
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
414
415
|
emit(event: "test:coverage", data: EventData.TestCoverage): boolean;
|
415
416
|
emit(event: "test:complete", data: EventData.TestComplete): boolean;
|
@@ -424,6 +425,7 @@ declare module "node:test" {
|
|
424
425
|
emit(event: "test:stdout", data: EventData.TestStdout): boolean;
|
425
426
|
emit(event: "test:summary", data: EventData.TestSummary): boolean;
|
426
427
|
emit(event: "test:watch:drained"): boolean;
|
428
|
+
emit(event: "test:watch:restarted"): boolean;
|
427
429
|
emit(event: string | symbol, ...args: any[]): boolean;
|
428
430
|
on(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
429
431
|
on(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
@@ -438,6 +440,7 @@ declare module "node:test" {
|
|
438
440
|
on(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
439
441
|
on(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
440
442
|
on(event: "test:watch:drained", listener: () => void): this;
|
443
|
+
on(event: "test:watch:restarted", listener: () => void): this;
|
441
444
|
on(event: string, listener: (...args: any[]) => void): this;
|
442
445
|
once(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
443
446
|
once(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
@@ -452,6 +455,7 @@ declare module "node:test" {
|
|
452
455
|
once(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
453
456
|
once(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
454
457
|
once(event: "test:watch:drained", listener: () => void): this;
|
458
|
+
once(event: "test:watch:restarted", listener: () => void): this;
|
455
459
|
once(event: string, listener: (...args: any[]) => void): this;
|
456
460
|
prependListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
457
461
|
prependListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
@@ -466,6 +470,7 @@ declare module "node:test" {
|
|
466
470
|
prependListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
467
471
|
prependListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
468
472
|
prependListener(event: "test:watch:drained", listener: () => void): this;
|
473
|
+
prependListener(event: "test:watch:restarted", listener: () => void): this;
|
469
474
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
470
475
|
prependOnceListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
471
476
|
prependOnceListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
@@ -480,6 +485,7 @@ declare module "node:test" {
|
|
480
485
|
prependOnceListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
481
486
|
prependOnceListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
482
487
|
prependOnceListener(event: "test:watch:drained", listener: () => void): this;
|
488
|
+
prependOnceListener(event: "test:watch:restarted", listener: () => void): this;
|
483
489
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
484
490
|
}
|
485
491
|
namespace EventData {
|
@@ -510,6 +516,14 @@ declare module "node:test" {
|
|
510
516
|
* The nesting level of the test.
|
511
517
|
*/
|
512
518
|
nesting: number;
|
519
|
+
/**
|
520
|
+
* The severity level of the diagnostic message.
|
521
|
+
* Possible values are:
|
522
|
+
* * `'info'`: Informational messages.
|
523
|
+
* * `'warn'`: Warnings.
|
524
|
+
* * `'error'`: Errors.
|
525
|
+
*/
|
526
|
+
level: "info" | "warn" | "error";
|
513
527
|
}
|
514
528
|
interface TestCoverage {
|
515
529
|
/**
|
@@ -2168,7 +2182,8 @@ declare module "node:test/reporters" {
|
|
2168
2182
|
| { type: "test:stderr"; data: EventData.TestStderr }
|
2169
2183
|
| { type: "test:stdout"; data: EventData.TestStdout }
|
2170
2184
|
| { type: "test:summary"; data: EventData.TestSummary }
|
2171
|
-
| { type: "test:watch:drained"; data: undefined }
|
2185
|
+
| { type: "test:watch:drained"; data: undefined }
|
2186
|
+
| { type: "test:watch:restarted"; data: undefined };
|
2172
2187
|
type TestEventGenerator = AsyncGenerator<TestEvent, void>;
|
2173
2188
|
|
2174
2189
|
interface ReporterConstructorWrapper<T extends new(...args: any[]) => Transform> {
|
node/timers.d.ts
CHANGED
@@ -60,7 +60,6 @@ declare module "timers" {
|
|
60
60
|
/**
|
61
61
|
* Cancels the immediate. This is similar to calling `clearImmediate()`.
|
62
62
|
* @since v20.5.0, v18.18.0
|
63
|
-
* @experimental
|
64
63
|
*/
|
65
64
|
[Symbol.dispose](): void;
|
66
65
|
_onImmediate(...args: any[]): void;
|
@@ -141,7 +140,6 @@ declare module "timers" {
|
|
141
140
|
/**
|
142
141
|
* Cancels the timeout.
|
143
142
|
* @since v20.5.0, v18.18.0
|
144
|
-
* @experimental
|
145
143
|
*/
|
146
144
|
[Symbol.dispose](): void;
|
147
145
|
_onTimeout(...args: any[]): void;
|
node/url.d.ts
CHANGED
@@ -874,7 +874,7 @@ declare module "url" {
|
|
874
874
|
* Returns an ES6 `Iterator` over each of the name-value pairs in the query.
|
875
875
|
* Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`.
|
876
876
|
*
|
877
|
-
* Alias for `urlSearchParams[
|
877
|
+
* Alias for `urlSearchParams[Symbol.iterator]()`.
|
878
878
|
*/
|
879
879
|
entries(): URLSearchParamsIterator<[string, string]>;
|
880
880
|
/**
|
node/util.d.ts
CHANGED
@@ -431,8 +431,8 @@ declare module "util" {
|
|
431
431
|
* intended for debugging. The output of `util.inspect` may change at any time
|
432
432
|
* and should not be depended upon programmatically. Additional `options` may be
|
433
433
|
* passed that alter the result.
|
434
|
-
* `util.inspect()` will use the constructor's name and/or
|
435
|
-
* an identifiable tag for an inspected value.
|
434
|
+
* `util.inspect()` will use the constructor's name and/or `Symbol.toStringTag`
|
435
|
+
* property to make an identifiable tag for an inspected value.
|
436
436
|
*
|
437
437
|
* ```js
|
438
438
|
* class Foo {
|
@@ -1172,6 +1172,7 @@ declare module "util" {
|
|
1172
1172
|
| "hidden"
|
1173
1173
|
| "inverse"
|
1174
1174
|
| "italic"
|
1175
|
+
| "none"
|
1175
1176
|
| "overlined"
|
1176
1177
|
| "reset"
|
1177
1178
|
| "strikethrough"
|
@@ -1228,6 +1229,8 @@ declare module "util" {
|
|
1228
1229
|
* );
|
1229
1230
|
* ```
|
1230
1231
|
*
|
1232
|
+
* The special format value `none` applies no additional styling to the text.
|
1233
|
+
*
|
1231
1234
|
* The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v24.x/api/util.html#modifiers).
|
1232
1235
|
* @param format A text format or an Array of text formats defined in `util.inspect.colors`.
|
1233
1236
|
* @param text The text to to be formatted.
|
@@ -2108,6 +2111,7 @@ declare module "util/types" {
|
|
2108
2111
|
* console.log(myError instanceof Error); // true
|
2109
2112
|
* ```
|
2110
2113
|
* @since v10.0.0
|
2114
|
+
* @deprecated The `util.types.isNativeError` API is deprecated. Please use `Error.isError` instead.
|
2111
2115
|
*/
|
2112
2116
|
function isNativeError(object: unknown): object is Error;
|
2113
2117
|
/**
|
node/worker_threads.d.ts
CHANGED
@@ -482,6 +482,18 @@ declare module "worker_threads" {
|
|
482
482
|
* @since v24.0.0
|
483
483
|
*/
|
484
484
|
getHeapStatistics(): Promise<HeapInfo>;
|
485
|
+
/**
|
486
|
+
* Calls `worker.terminate()` when the dispose scope is exited.
|
487
|
+
*
|
488
|
+
* ```js
|
489
|
+
* async function example() {
|
490
|
+
* await using worker = new Worker('for (;;) {}', { eval: true });
|
491
|
+
* // Worker is automatically terminate when the scope is exited.
|
492
|
+
* }
|
493
|
+
* ```
|
494
|
+
* @since v24.2.0
|
495
|
+
*/
|
496
|
+
[Symbol.asyncDispose](): Promise<void>;
|
485
497
|
addListener(event: "error", listener: (err: Error) => void): this;
|
486
498
|
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
487
499
|
addListener(event: "message", listener: (value: any) => void): this;
|
node/zlib.d.ts
CHANGED
@@ -147,6 +147,10 @@ declare module "zlib" {
|
|
147
147
|
* @default buffer.kMaxLength
|
148
148
|
*/
|
149
149
|
maxOutputLength?: number | undefined;
|
150
|
+
/**
|
151
|
+
* If `true`, returns an object with `buffer` and `engine`.
|
152
|
+
*/
|
153
|
+
info?: boolean | undefined;
|
150
154
|
}
|
151
155
|
interface ZstdOptions {
|
152
156
|
/**
|
@@ -172,6 +176,10 @@ declare module "zlib" {
|
|
172
176
|
* @default buffer.kMaxLength
|
173
177
|
*/
|
174
178
|
maxOutputLength?: number | undefined;
|
179
|
+
/**
|
180
|
+
* If `true`, returns an object with `buffer` and `engine`.
|
181
|
+
*/
|
182
|
+
info?: boolean | undefined;
|
175
183
|
}
|
176
184
|
interface Zlib {
|
177
185
|
readonly bytesWritten: number;
|
@@ -610,8 +618,6 @@ declare module "zlib" {
|
|
610
618
|
const Z_FINISH: number;
|
611
619
|
/** @deprecated Use `constants.Z_BLOCK` */
|
612
620
|
const Z_BLOCK: number;
|
613
|
-
/** @deprecated Use `constants.Z_TREES` */
|
614
|
-
const Z_TREES: number;
|
615
621
|
// Return codes for the compression/decompression functions.
|
616
622
|
// Negative values are errors, positive values are used for special but normal events.
|
617
623
|
/** @deprecated Use `constants.Z_OK` */
|