@types/node 24.6.2 → 24.7.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/fs.d.ts CHANGED
@@ -4600,6 +4600,7 @@ declare module "fs" {
4600
4600
  */
4601
4601
  export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
4602
4602
 
4603
+ // TODO: collapse
4603
4604
  interface _GlobOptions<T extends Dirent | string> {
4604
4605
  /**
4605
4606
  * Current working directory.
@@ -4616,6 +4617,9 @@ declare module "fs" {
4616
4617
  * Function to filter out files/directories or a
4617
4618
  * list of glob patterns to be excluded. If a function is provided, return
4618
4619
  * `true` to exclude the item, `false` to include it.
4620
+ * If a string array is provided, each string should be a glob pattern that
4621
+ * specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are
4622
+ * not supported.
4619
4623
  * @default undefined
4620
4624
  */
4621
4625
  exclude?: ((fileName: T) => boolean) | readonly string[] | undefined;
node/http.d.ts CHANGED
@@ -1462,6 +1462,16 @@ declare module "http" {
1462
1462
  * Only relevant if keepAlive is set to true.
1463
1463
  */
1464
1464
  keepAliveMsecs?: number | undefined;
1465
+ /**
1466
+ * Milliseconds to subtract from
1467
+ * the server-provided `keep-alive: timeout=...` hint when determining socket
1468
+ * expiration time. This buffer helps ensure the agent closes the socket
1469
+ * slightly before the server does, reducing the chance of sending a request
1470
+ * on a socket that’s about to be closed by the server.
1471
+ * @since v24.7.0
1472
+ * @default 1000
1473
+ */
1474
+ agentKeepAliveTimeoutBuffer?: number | undefined;
1465
1475
  /**
1466
1476
  * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
1467
1477
  */
node/http2.d.ts CHANGED
@@ -423,7 +423,7 @@ declare module "http2" {
423
423
  * ```
424
424
  * @since v8.4.0
425
425
  */
426
- respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
426
+ respond(headers?: OutgoingHttpHeaders | readonly string[], options?: ServerStreamResponseOptions): void;
427
427
  /**
428
428
  * Initiates a response whose data is read from the given file descriptor. No
429
429
  * validation is performed on the given file descriptor. If an error occurs while
node/index.d.ts CHANGED
@@ -39,11 +39,13 @@
39
39
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
40
40
  /// <reference path="globals.d.ts" />
41
41
  /// <reference path="web-globals/abortcontroller.d.ts" />
42
+ /// <reference path="web-globals/crypto.d.ts" />
42
43
  /// <reference path="web-globals/domexception.d.ts" />
43
44
  /// <reference path="web-globals/events.d.ts" />
44
45
  /// <reference path="web-globals/fetch.d.ts" />
45
46
  /// <reference path="web-globals/navigator.d.ts" />
46
47
  /// <reference path="web-globals/storage.d.ts" />
48
+ /// <reference path="web-globals/streams.d.ts" />
47
49
  /// <reference path="assert.d.ts" />
48
50
  /// <reference path="assert/strict.d.ts" />
49
51
  /// <reference path="async_hooks.d.ts" />
node/inspector.d.ts CHANGED
@@ -159,6 +159,30 @@ declare module "inspector" {
159
159
  * @since v22.7.0
160
160
  */
161
161
  function loadingFailed(params: LoadingFailedEventDataType): void;
162
+ /**
163
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
164
+ *
165
+ * Broadcasts the `Network.webSocketCreated` event to connected frontends. This event indicates that
166
+ * a WebSocket connection has been initiated.
167
+ * @since v24.7.0
168
+ */
169
+ function webSocketCreated(params: WebSocketCreatedEventDataType): void;
170
+ /**
171
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
172
+ *
173
+ * Broadcasts the `Network.webSocketHandshakeResponseReceived` event to connected frontends.
174
+ * This event indicates that the WebSocket handshake response has been received.
175
+ * @since v24.7.0
176
+ */
177
+ function webSocketHandshakeResponseReceived(params: WebSocketHandshakeResponseReceivedEventDataType): void;
178
+ /**
179
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
180
+ *
181
+ * Broadcasts the `Network.webSocketClosed` event to connected frontends.
182
+ * This event indicates that a WebSocket connection has been closed.
183
+ * @since v24.7.0
184
+ */
185
+ function webSocketClosed(params: WebSocketClosedEventDataType): void;
162
186
  }
163
187
  namespace NetworkResources {
164
188
  /**
@@ -1774,6 +1774,23 @@ declare module "inspector" {
1774
1774
  success: boolean;
1775
1775
  stream?: IO.StreamHandle | undefined;
1776
1776
  }
1777
+ /**
1778
+ * WebSocket response data.
1779
+ */
1780
+ interface WebSocketResponse {
1781
+ /**
1782
+ * HTTP response status code.
1783
+ */
1784
+ status: number;
1785
+ /**
1786
+ * HTTP response status text.
1787
+ */
1788
+ statusText: string;
1789
+ /**
1790
+ * HTTP response headers.
1791
+ */
1792
+ headers: Headers;
1793
+ }
1777
1794
  interface GetRequestPostDataParameterType {
1778
1795
  /**
1779
1796
  * Identifier of the network request to get content for.
@@ -1914,6 +1931,44 @@ declare module "inspector" {
1914
1931
  */
1915
1932
  data?: string | undefined;
1916
1933
  }
1934
+ interface WebSocketCreatedEventDataType {
1935
+ /**
1936
+ * Request identifier.
1937
+ */
1938
+ requestId: RequestId;
1939
+ /**
1940
+ * WebSocket request URL.
1941
+ */
1942
+ url: string;
1943
+ /**
1944
+ * Request initiator.
1945
+ */
1946
+ initiator: Initiator;
1947
+ }
1948
+ interface WebSocketClosedEventDataType {
1949
+ /**
1950
+ * Request identifier.
1951
+ */
1952
+ requestId: RequestId;
1953
+ /**
1954
+ * Timestamp.
1955
+ */
1956
+ timestamp: MonotonicTime;
1957
+ }
1958
+ interface WebSocketHandshakeResponseReceivedEventDataType {
1959
+ /**
1960
+ * Request identifier.
1961
+ */
1962
+ requestId: RequestId;
1963
+ /**
1964
+ * Timestamp.
1965
+ */
1966
+ timestamp: MonotonicTime;
1967
+ /**
1968
+ * WebSocket response data.
1969
+ */
1970
+ response: WebSocketResponse;
1971
+ }
1917
1972
  }
1918
1973
  namespace NodeRuntime {
1919
1974
  interface NotifyWhenWaitingForDisconnectParameterType {
@@ -2483,6 +2538,18 @@ declare module "inspector" {
2483
2538
  * Fired when data chunk was received over the network.
2484
2539
  */
2485
2540
  addListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2541
+ /**
2542
+ * Fired upon WebSocket creation.
2543
+ */
2544
+ addListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
2545
+ /**
2546
+ * Fired when WebSocket is closed.
2547
+ */
2548
+ addListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
2549
+ /**
2550
+ * Fired when WebSocket handshake response becomes available.
2551
+ */
2552
+ addListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
2486
2553
  /**
2487
2554
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2488
2555
  * enabled.
@@ -2529,6 +2596,9 @@ declare module "inspector" {
2529
2596
  emit(event: "Network.loadingFailed", message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
2530
2597
  emit(event: "Network.loadingFinished", message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
2531
2598
  emit(event: "Network.dataReceived", message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
2599
+ emit(event: "Network.webSocketCreated", message: InspectorNotification<Network.WebSocketCreatedEventDataType>): boolean;
2600
+ emit(event: "Network.webSocketClosed", message: InspectorNotification<Network.WebSocketClosedEventDataType>): boolean;
2601
+ emit(event: "Network.webSocketHandshakeResponseReceived", message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>): boolean;
2532
2602
  emit(event: "NodeRuntime.waitingForDisconnect"): boolean;
2533
2603
  emit(event: "NodeRuntime.waitingForDebugger"): boolean;
2534
2604
  emit(event: "Target.targetCreated", message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
@@ -2642,6 +2712,18 @@ declare module "inspector" {
2642
2712
  * Fired when data chunk was received over the network.
2643
2713
  */
2644
2714
  on(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2715
+ /**
2716
+ * Fired upon WebSocket creation.
2717
+ */
2718
+ on(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
2719
+ /**
2720
+ * Fired when WebSocket is closed.
2721
+ */
2722
+ on(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
2723
+ /**
2724
+ * Fired when WebSocket handshake response becomes available.
2725
+ */
2726
+ on(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
2645
2727
  /**
2646
2728
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2647
2729
  * enabled.
@@ -2765,6 +2847,18 @@ declare module "inspector" {
2765
2847
  * Fired when data chunk was received over the network.
2766
2848
  */
2767
2849
  once(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2850
+ /**
2851
+ * Fired upon WebSocket creation.
2852
+ */
2853
+ once(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
2854
+ /**
2855
+ * Fired when WebSocket is closed.
2856
+ */
2857
+ once(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
2858
+ /**
2859
+ * Fired when WebSocket handshake response becomes available.
2860
+ */
2861
+ once(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
2768
2862
  /**
2769
2863
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2770
2864
  * enabled.
@@ -2888,6 +2982,18 @@ declare module "inspector" {
2888
2982
  * Fired when data chunk was received over the network.
2889
2983
  */
2890
2984
  prependListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2985
+ /**
2986
+ * Fired upon WebSocket creation.
2987
+ */
2988
+ prependListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
2989
+ /**
2990
+ * Fired when WebSocket is closed.
2991
+ */
2992
+ prependListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
2993
+ /**
2994
+ * Fired when WebSocket handshake response becomes available.
2995
+ */
2996
+ prependListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
2891
2997
  /**
2892
2998
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2893
2999
  * enabled.
@@ -3011,6 +3117,18 @@ declare module "inspector" {
3011
3117
  * Fired when data chunk was received over the network.
3012
3118
  */
3013
3119
  prependOnceListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3120
+ /**
3121
+ * Fired upon WebSocket creation.
3122
+ */
3123
+ prependOnceListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
3124
+ /**
3125
+ * Fired when WebSocket is closed.
3126
+ */
3127
+ prependOnceListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
3128
+ /**
3129
+ * Fired when WebSocket handshake response becomes available.
3130
+ */
3131
+ prependOnceListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
3014
3132
  /**
3015
3133
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3016
3134
  * enabled.
@@ -3506,6 +3624,18 @@ declare module "inspector/promises" {
3506
3624
  * Fired when data chunk was received over the network.
3507
3625
  */
3508
3626
  addListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3627
+ /**
3628
+ * Fired upon WebSocket creation.
3629
+ */
3630
+ addListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
3631
+ /**
3632
+ * Fired when WebSocket is closed.
3633
+ */
3634
+ addListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
3635
+ /**
3636
+ * Fired when WebSocket handshake response becomes available.
3637
+ */
3638
+ addListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
3509
3639
  /**
3510
3640
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3511
3641
  * enabled.
@@ -3552,6 +3682,9 @@ declare module "inspector/promises" {
3552
3682
  emit(event: "Network.loadingFailed", message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
3553
3683
  emit(event: "Network.loadingFinished", message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
3554
3684
  emit(event: "Network.dataReceived", message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
3685
+ emit(event: "Network.webSocketCreated", message: InspectorNotification<Network.WebSocketCreatedEventDataType>): boolean;
3686
+ emit(event: "Network.webSocketClosed", message: InspectorNotification<Network.WebSocketClosedEventDataType>): boolean;
3687
+ emit(event: "Network.webSocketHandshakeResponseReceived", message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>): boolean;
3555
3688
  emit(event: "NodeRuntime.waitingForDisconnect"): boolean;
3556
3689
  emit(event: "NodeRuntime.waitingForDebugger"): boolean;
3557
3690
  emit(event: "Target.targetCreated", message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
@@ -3665,6 +3798,18 @@ declare module "inspector/promises" {
3665
3798
  * Fired when data chunk was received over the network.
3666
3799
  */
3667
3800
  on(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3801
+ /**
3802
+ * Fired upon WebSocket creation.
3803
+ */
3804
+ on(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
3805
+ /**
3806
+ * Fired when WebSocket is closed.
3807
+ */
3808
+ on(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
3809
+ /**
3810
+ * Fired when WebSocket handshake response becomes available.
3811
+ */
3812
+ on(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
3668
3813
  /**
3669
3814
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3670
3815
  * enabled.
@@ -3788,6 +3933,18 @@ declare module "inspector/promises" {
3788
3933
  * Fired when data chunk was received over the network.
3789
3934
  */
3790
3935
  once(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3936
+ /**
3937
+ * Fired upon WebSocket creation.
3938
+ */
3939
+ once(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
3940
+ /**
3941
+ * Fired when WebSocket is closed.
3942
+ */
3943
+ once(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
3944
+ /**
3945
+ * Fired when WebSocket handshake response becomes available.
3946
+ */
3947
+ once(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
3791
3948
  /**
3792
3949
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3793
3950
  * enabled.
@@ -3911,6 +4068,18 @@ declare module "inspector/promises" {
3911
4068
  * Fired when data chunk was received over the network.
3912
4069
  */
3913
4070
  prependListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
4071
+ /**
4072
+ * Fired upon WebSocket creation.
4073
+ */
4074
+ prependListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
4075
+ /**
4076
+ * Fired when WebSocket is closed.
4077
+ */
4078
+ prependListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
4079
+ /**
4080
+ * Fired when WebSocket handshake response becomes available.
4081
+ */
4082
+ prependListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
3914
4083
  /**
3915
4084
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3916
4085
  * enabled.
@@ -4034,6 +4203,18 @@ declare module "inspector/promises" {
4034
4203
  * Fired when data chunk was received over the network.
4035
4204
  */
4036
4205
  prependOnceListener(event: "Network.dataReceived", listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
4206
+ /**
4207
+ * Fired upon WebSocket creation.
4208
+ */
4209
+ prependOnceListener(event: "Network.webSocketCreated", listener: (message: InspectorNotification<Network.WebSocketCreatedEventDataType>) => void): this;
4210
+ /**
4211
+ * Fired when WebSocket is closed.
4212
+ */
4213
+ prependOnceListener(event: "Network.webSocketClosed", listener: (message: InspectorNotification<Network.WebSocketClosedEventDataType>) => void): this;
4214
+ /**
4215
+ * Fired when WebSocket handshake response becomes available.
4216
+ */
4217
+ prependOnceListener(event: "Network.webSocketHandshakeResponseReceived", listener: (message: InspectorNotification<Network.WebSocketHandshakeResponseReceivedEventDataType>) => void): this;
4037
4218
  /**
4038
4219
  * This event is fired instead of `Runtime.executionContextDestroyed` when
4039
4220
  * enabled.
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "24.6.2",
3
+ "version": "24.7.0",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -147,9 +147,9 @@
147
147
  },
148
148
  "scripts": {},
149
149
  "dependencies": {
150
- "undici-types": "~7.13.0"
150
+ "undici-types": "~7.14.0"
151
151
  },
152
152
  "peerDependencies": {},
153
- "typesPublisherContentHash": "e7bb75f8d0111245a28651af05ef0fef9a30a5eeafcb3bbe9f3bd4c13ad7adde",
153
+ "typesPublisherContentHash": "cb817ed05b070456dfb7f285cfc14fb71b6bd7f9a892b8f34821bc93aaeaff95",
154
154
  "typeScriptVersion": "5.2"
155
155
  }
node/sqlite.d.ts CHANGED
@@ -637,8 +637,9 @@ declare module "node:sqlite" {
637
637
  */
638
638
  rate?: number | undefined;
639
639
  /**
640
- * Callback function that will be called with the number of pages copied and the total number of
641
- * pages.
640
+ * An optional callback function that will be called after each backup step. The argument passed
641
+ * to this callback is an `Object` with `remainingPages` and `totalPages` properties, describing the current progress
642
+ * of the backup operation.
642
643
  */
643
644
  progress?: ((progressInfo: BackupProgressInfo) => void) | undefined;
644
645
  }
@@ -675,9 +676,10 @@ declare module "node:sqlite" {
675
676
  * the contents will be overwritten.
676
677
  * @param options Optional configuration for the backup. The
677
678
  * following properties are supported:
678
- * @returns A promise that resolves when the backup is completed and rejects if an error occurs.
679
+ * @returns A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an
680
+ * error occurs.
679
681
  */
680
- function backup(sourceDb: DatabaseSync, path: string | Buffer | URL, options?: BackupOptions): Promise<void>;
682
+ function backup(sourceDb: DatabaseSync, path: string | Buffer | URL, options?: BackupOptions): Promise<number>;
681
683
  /**
682
684
  * @since v22.13.0
683
685
  */
node/stream/web.d.ts CHANGED
@@ -1,11 +1,7 @@
1
1
  type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
2
2
  : import("stream/web").ByteLengthQueuingStrategy;
3
- type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
4
- : import("stream/web").CompressionStream;
5
3
  type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
6
4
  : import("stream/web").CountQueuingStrategy;
7
- type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
8
- : import("stream/web").DecompressionStream;
9
5
  type _QueuingStrategy<T = any> = typeof globalThis extends { onmessage: any } ? {}
10
6
  : import("stream/web").QueuingStrategy<T>;
11
7
  type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
@@ -412,22 +408,17 @@ declare module "stream/web" {
412
408
  prototype: TextDecoderStream;
413
409
  new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream;
414
410
  };
415
- interface CompressionStream {
411
+ type CompressionFormat = "brotli" | "deflate" | "deflate-raw" | "gzip";
412
+ class CompressionStream {
413
+ constructor(format: CompressionFormat);
416
414
  readonly readable: ReadableStream;
417
415
  readonly writable: WritableStream;
418
416
  }
419
- const CompressionStream: {
420
- prototype: CompressionStream;
421
- new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream;
422
- };
423
- interface DecompressionStream {
424
- readonly writable: WritableStream;
417
+ class DecompressionStream {
418
+ constructor(format: CompressionFormat);
425
419
  readonly readable: ReadableStream;
420
+ readonly writable: WritableStream;
426
421
  }
427
- const DecompressionStream: {
428
- prototype: DecompressionStream;
429
- new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream;
430
- };
431
422
 
432
423
  global {
433
424
  interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
@@ -440,26 +431,6 @@ declare module "stream/web" {
440
431
  ? T
441
432
  : typeof import("stream/web").ByteLengthQueuingStrategy;
442
433
 
443
- interface CompressionStream extends _CompressionStream {}
444
- /**
445
- * `CompressionStream` class is a global reference for `import { CompressionStream } from 'node:stream/web'`.
446
- * https://nodejs.org/api/globals.html#class-compressionstream
447
- * @since v18.0.0
448
- */
449
- var CompressionStream: typeof globalThis extends {
450
- onmessage: any;
451
- // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
452
- // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
453
- ReportingObserver: any;
454
- CompressionStream: infer T;
455
- } ? T
456
- // TS 4.8, 4.9, 5.0
457
- : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
458
- prototype: T;
459
- new(format: "deflate" | "deflate-raw" | "gzip"): T;
460
- }
461
- : typeof import("stream/web").CompressionStream;
462
-
463
434
  interface CountQueuingStrategy extends _CountQueuingStrategy {}
464
435
  /**
465
436
  * `CountQueuingStrategy` class is a global reference for `import { CountQueuingStrategy } from 'node:stream/web'`.
@@ -469,26 +440,6 @@ declare module "stream/web" {
469
440
  var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T
470
441
  : typeof import("stream/web").CountQueuingStrategy;
471
442
 
472
- interface DecompressionStream extends _DecompressionStream {}
473
- /**
474
- * `DecompressionStream` class is a global reference for `import { DecompressionStream } from 'node:stream/web'`.
475
- * https://nodejs.org/api/globals.html#class-decompressionstream
476
- * @since v18.0.0
477
- */
478
- var DecompressionStream: typeof globalThis extends {
479
- onmessage: any;
480
- // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
481
- // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
482
- ReportingObserver: any;
483
- DecompressionStream: infer T extends object;
484
- } ? T
485
- // TS 4.8, 4.9, 5.0
486
- : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
487
- prototype: T;
488
- new(format: "deflate" | "deflate-raw" | "gzip"): T;
489
- }
490
- : typeof import("stream/web").DecompressionStream;
491
-
492
443
  interface QueuingStrategy<T = any> extends _QueuingStrategy<T> {}
493
444
 
494
445
  interface ReadableByteStreamController extends _ReadableByteStreamController {}
node/test.d.ts CHANGED
@@ -343,6 +343,13 @@ declare module "node:test" {
343
343
  * @default undefined
344
344
  */
345
345
  shard?: TestShard | undefined;
346
+ /**
347
+ * A file path where the test runner will
348
+ * store the state of the tests to allow rerunning only the failed tests on a next run.
349
+ * @since v24.7.0
350
+ * @default undefined
351
+ */
352
+ rerunFailuresFilePath?: string | undefined;
346
353
  /**
347
354
  * enable [code coverage](https://nodejs.org/docs/latest-v24.x/api/test.html#collecting-code-coverage) collection.
348
355
  * @since v22.10.0
@@ -711,7 +718,7 @@ declare module "node:test" {
711
718
  /**
712
719
  * The type of the test, used to denote whether this is a suite.
713
720
  */
714
- type?: "suite";
721
+ type?: "suite" | "test";
715
722
  };
716
723
  /**
717
724
  * The test name.
@@ -781,7 +788,13 @@ declare module "node:test" {
781
788
  * The type of the test, used to denote whether this is a suite.
782
789
  * @since v20.0.0, v19.9.0, v18.17.0
783
790
  */
784
- type?: "suite";
791
+ type?: "suite" | "test";
792
+ /**
793
+ * The attempt number of the test run,
794
+ * present only when using the `--test-rerun-failures` flag.
795
+ * @since v24.7.0
796
+ */
797
+ attempt?: number;
785
798
  };
786
799
  /**
787
800
  * The test name.
@@ -817,7 +830,19 @@ declare module "node:test" {
817
830
  * The type of the test, used to denote whether this is a suite.
818
831
  * @since 20.0.0, 19.9.0, 18.17.0
819
832
  */
820
- type?: "suite";
833
+ type?: "suite" | "test";
834
+ /**
835
+ * The attempt number of the test run,
836
+ * present only when using the `--test-rerun-failures` flag.
837
+ * @since v24.7.0
838
+ */
839
+ attempt?: number;
840
+ /**
841
+ * The attempt number the test passed on,
842
+ * present only when using the `--test-rerun-failures` flag.
843
+ * @since v24.7.0
844
+ */
845
+ passed_on_attempt?: number;
821
846
  };
822
847
  /**
823
848
  * The test name.
@@ -962,6 +987,7 @@ declare module "node:test" {
962
987
  * @since v22.2.0, v20.15.0
963
988
  */
964
989
  readonly assert: TestContextAssert;
990
+ readonly attempt: number;
965
991
  /**
966
992
  * This function is used to create a hook running before subtest of the current test.
967
993
  * @param fn The hook function. The first argument to this function is a `TestContext` object.
node/ts5.6/index.d.ts CHANGED
@@ -41,11 +41,13 @@
41
41
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
42
42
  /// <reference path="../globals.d.ts" />
43
43
  /// <reference path="../web-globals/abortcontroller.d.ts" />
44
+ /// <reference path="../web-globals/crypto.d.ts" />
44
45
  /// <reference path="../web-globals/domexception.d.ts" />
45
46
  /// <reference path="../web-globals/events.d.ts" />
46
47
  /// <reference path="../web-globals/fetch.d.ts" />
47
48
  /// <reference path="../web-globals/navigator.d.ts" />
48
49
  /// <reference path="../web-globals/storage.d.ts" />
50
+ /// <reference path="../web-globals/streams.d.ts" />
49
51
  /// <reference path="../assert.d.ts" />
50
52
  /// <reference path="../assert/strict.d.ts" />
51
53
  /// <reference path="../async_hooks.d.ts" />
node/ts5.7/index.d.ts CHANGED
@@ -41,11 +41,13 @@
41
41
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
42
42
  /// <reference path="../globals.d.ts" />
43
43
  /// <reference path="../web-globals/abortcontroller.d.ts" />
44
+ /// <reference path="../web-globals/crypto.d.ts" />
44
45
  /// <reference path="../web-globals/domexception.d.ts" />
45
46
  /// <reference path="../web-globals/events.d.ts" />
46
47
  /// <reference path="../web-globals/fetch.d.ts" />
47
48
  /// <reference path="../web-globals/navigator.d.ts" />
48
49
  /// <reference path="../web-globals/storage.d.ts" />
50
+ /// <reference path="../web-globals/streams.d.ts" />
49
51
  /// <reference path="../assert.d.ts" />
50
52
  /// <reference path="../assert/strict.d.ts" />
51
53
  /// <reference path="../async_hooks.d.ts" />
@@ -0,0 +1,32 @@
1
+ export {};
2
+
3
+ import { webcrypto } from "crypto";
4
+
5
+ declare global {
6
+ var Crypto: typeof globalThis extends { onmessage: any; Crypto: infer T } ? T : {
7
+ prototype: webcrypto.Crypto;
8
+ new(): webcrypto.Crypto;
9
+ };
10
+
11
+ var CryptoKey: typeof globalThis extends { onmessage: any; CryptoKey: infer T } ? T : {
12
+ prototype: webcrypto.CryptoKey;
13
+ new(): webcrypto.CryptoKey;
14
+ };
15
+
16
+ var SubtleCrypto: typeof globalThis extends { onmessage: any; SubtleCrypto: infer T } ? T : {
17
+ prototype: webcrypto.SubtleCrypto;
18
+ new(): webcrypto.SubtleCrypto;
19
+ supports(
20
+ operation: string,
21
+ algorithm: webcrypto.AlgorithmIdentifier,
22
+ length?: number,
23
+ ): boolean;
24
+ supports(
25
+ operation: string,
26
+ algorithm: webcrypto.AlgorithmIdentifier,
27
+ additionalAlgorithm: webcrypto.AlgorithmIdentifier,
28
+ ): boolean;
29
+ };
30
+
31
+ var crypto: typeof globalThis extends { onmessage: any; crypto: infer T } ? T : webcrypto.Crypto;
32
+ }