@types/node 26.4.0 → 26.5.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 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: Thu, 27 Aug 2026 00:14:49 GMT
11
+ * Last updated: Mon, 07 Sep 2026 14:04:38 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/buffer.d.ts CHANGED
@@ -1776,6 +1776,7 @@ declare module "node:buffer" {
1776
1776
  slice(start?: number, end?: number, contentType?: string): Blob;
1777
1777
  stream(): ReadableStream<NodeJS.NonSharedUint8Array>;
1778
1778
  text(): Promise<string>;
1779
+ textStream(): ReadableStream<string>;
1779
1780
  }
1780
1781
  export var Blob: {
1781
1782
  prototype: Blob;
@@ -529,10 +529,10 @@ declare module "node:diagnostics_channel" {
529
529
  * @param context Shared object to correlate trace events through
530
530
  * @param thisArg The receiver to be used for the function call
531
531
  * @param args Optional arguments to pass to the function
532
- * @returns The return value of the given function, or the result of
533
- * calling `.then(...)` on the return value if the tracing channel has active
534
- * subscribers. If the return value is not a Promise or thenable, then
535
- * it is returned as-is and a warning is emitted.
532
+ * @returns The return value of the given function. If the return value
533
+ * is a Promise or thenable, tracing events will be published when it settles.
534
+ * If the return value is not a Promise or thenable, it is returned as-is and
535
+ * a warning is emitted.
536
536
  */
537
537
  tracePromise<ThisArg = any, Args extends any[] = any[], Result extends PromiseLike<unknown> = any>(
538
538
  fn: (this: ThisArg, ...args: Args) => Result,
node/ffi.d.ts CHANGED
@@ -459,7 +459,7 @@ declare module "node:ffi" {
459
459
  "void": void;
460
460
  "number": number;
461
461
  "bigint": bigint;
462
- "pointer": bigint | null;
462
+ "pointer": bigint;
463
463
  }
464
464
  enum types {
465
465
  VOID = "void",
node/http.d.ts CHANGED
@@ -225,7 +225,7 @@ declare module "node:http" {
225
225
  * The number of milliseconds of inactivity a server needs to wait for additional incoming data,
226
226
  * after it has finished writing the last response, before a socket will be destroyed.
227
227
  * @see Server.keepAliveTimeout for more information.
228
- * @default 5000
228
+ * @default 65000
229
229
  * @since v18.0.0
230
230
  */
231
231
  keepAliveTimeout?: number | undefined;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "26.4.0",
3
+ "version": "26.5.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": "~8.3.0"
150
+ "undici-types": "~8.9.0"
151
151
  },
152
152
  "peerDependencies": {},
153
- "typesPublisherContentHash": "0793b8d36264e159c56982e4bc1d7024a8a703b13431ee414c7feacfe570e674",
153
+ "typesPublisherContentHash": "3bacbc5199574a21e6d696b9d0acb8666162bfc95a630bb59b22c48fd1373573",
154
154
  "typeScriptVersion": "5.6"
155
155
  }
node/perf_hooks.d.ts CHANGED
@@ -301,6 +301,7 @@ declare module "node:perf_hooks" {
301
301
  namespace constants {
302
302
  const NODE_PERFORMANCE_GC_MAJOR: number;
303
303
  const NODE_PERFORMANCE_GC_MINOR: number;
304
+ const NODE_PERFORMANCE_GC_MINOR_MARK_SWEEP: number;
304
305
  const NODE_PERFORMANCE_GC_INCREMENTAL: number;
305
306
  const NODE_PERFORMANCE_GC_WEAKCB: number;
306
307
  const NODE_PERFORMANCE_GC_FLAGS_NO: number;
@@ -313,9 +314,14 @@ declare module "node:perf_hooks" {
313
314
  }
314
315
  interface EventLoopMonitorOptions {
315
316
  /**
316
- * The sampling rate in milliseconds.
317
- * Must be greater than zero.
318
- * @default 10
317
+ * When `true`, samples are taken once per
318
+ * event loop iteration. **Default:** `false`.
319
+ */
320
+ samplePerIteration?: boolean | undefined;
321
+ /**
322
+ * The sampling rate in milliseconds for interval-based
323
+ * sampling. Must be greater than zero. This option is ignored when
324
+ * `samplePerIteration` is `true`. **Default:** `10`.
319
325
  */
320
326
  resolution?: number | undefined;
321
327
  }
@@ -399,21 +405,25 @@ declare module "node:perf_hooks" {
399
405
  */
400
406
  readonly stddev: number;
401
407
  }
402
- interface IntervalHistogram extends Histogram {
408
+ /**
409
+ * A `Histogram` that records event loop delay, returned by
410
+ * `perf_hooks.monitorEventLoopDelay()`.
411
+ */
412
+ interface ELDHistogram extends Histogram {
403
413
  /**
404
- * Enables the update interval timer. Returns `true` if the timer was
405
- * started, `false` if it was already started.
414
+ * Disables event loop delay sampling. Returns `true` if sampling was
415
+ * stopped, `false` if it was already stopped.
406
416
  * @since v11.10.0
407
417
  */
408
- enable(): boolean;
418
+ disable(): boolean;
409
419
  /**
410
- * Disables the update interval timer. Returns `true` if the timer was
411
- * stopped, `false` if it was already stopped.
420
+ * Enables event loop delay sampling. Returns `true` if sampling was
421
+ * started, `false` if it was already started.
412
422
  * @since v11.10.0
413
423
  */
414
- disable(): boolean;
424
+ enable(): boolean;
415
425
  /**
416
- * Disables the update interval timer when the histogram is disposed.
426
+ * Disables event loop delay sampling when the histogram is disposed.
417
427
  *
418
428
  * ```js
419
429
  * const { monitorEventLoopDelay } = require('node:perf_hooks');
@@ -508,14 +518,16 @@ declare module "node:perf_hooks" {
508
518
  /**
509
519
  * _This property is an extension by Node.js. It is not available in Web browsers._
510
520
  *
511
- * Creates an `IntervalHistogram` object that samples and reports the event loop
512
- * delay over time. The delays will be reported in nanoseconds.
521
+ * Creates a histogram object that samples and reports the event loop delay over
522
+ * time. The delays will be reported in nanoseconds.
513
523
  *
514
- * Using a timer to detect approximate event loop delay works because the
515
- * execution of timers is tied specifically to the lifecycle of the libuv
516
- * event loop. That is, a delay in the loop will cause a delay in the execution
517
- * of the timer, and those delays are specifically what this API is intended to
518
- * detect.
524
+ * By default, the histogram is updated by a timer using the configured
525
+ * `resolution`. When `samplePerIteration` is `true`, samples are taken once per
526
+ * event loop iteration using `uv_prepare_t` and `uv_check_t` hooks. In that mode,
527
+ * the histogram does not keep the loop alive or force additional iterations when
528
+ * the application is idle.
529
+ * The two sampling modes produce significantly different results and should not
530
+ * be compared directly.
519
531
  *
520
532
  * ```js
521
533
  * import { monitorEventLoopDelay } from 'node:perf_hooks';
@@ -533,7 +545,7 @@ declare module "node:perf_hooks" {
533
545
  * ```
534
546
  * @since v11.10.0
535
547
  */
536
- function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
548
+ function monitorEventLoopDelay(options?: EventLoopMonitorOptions): ELDHistogram;
537
549
  interface TimerifyOptions {
538
550
  /**
539
551
  * A histogram object created using
node/quic.d.ts CHANGED
@@ -1059,8 +1059,8 @@ declare module "node:quic" {
1059
1059
  interface CreateStreamOptions {
1060
1060
  /**
1061
1061
  * The outbound body source. See `stream.setBody()` for details on
1062
- * supported types. When omitted, the stream starts half-closed (writable
1063
- * side open, no body queued).
1062
+ * supported types. When omitted, the stream's outgoing side remains
1063
+ * writable with no body queued; no FIN is sent immediately.
1064
1064
  */
1065
1065
  body?: StreamBody | undefined;
1066
1066
  /**
@@ -1375,7 +1375,8 @@ declare module "node:quic" {
1375
1375
  onqlog: OnQlogCallback | undefined;
1376
1376
  /**
1377
1377
  * Open a new bidirectional stream. If the `body` option is not specified,
1378
- * the outgoing stream will be half-closed. The `priority` and `incremental`
1378
+ * the stream's outgoing side remains writable and no FIN is sent
1379
+ * immediately. The `priority` and `incremental`
1379
1380
  * options are only used when the session supports priority (e.g. HTTP/3).
1380
1381
  * The `headers`, `onheaders`, `ontrailers`, `oninfo`, and `onwanttrailers`
1381
1382
  * options are only used when the session supports headers (e.g. HTTP/3).
@@ -1384,7 +1385,8 @@ declare module "node:quic" {
1384
1385
  createBidirectionalStream(options?: CreateStreamOptions): Promise<QuicStream>;
1385
1386
  /**
1386
1387
  * Open a new unidirectional stream. If the `body` option is not specified,
1387
- * the outgoing stream will be closed. The `priority` and `incremental`
1388
+ * the stream's outgoing side remains writable and no FIN is sent
1389
+ * immediately. The `priority` and `incremental`
1388
1390
  * options are only used when the session supports priority (e.g. HTTP/3).
1389
1391
  * @since v23.8.0
1390
1392
  */
node/stream/web.d.ts CHANGED
@@ -294,6 +294,26 @@ declare module "node:stream/web" {
294
294
  prototype: WritableStreamDefaultWriter;
295
295
  new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
296
296
  };
297
+ // Node.js extensions
298
+ /**
299
+ * Runs the WHATWG `ReadableStreamTee` abstract operation on `stream`.
300
+ *
301
+ * This differs from `readableStream.tee()` only when `cloneForBranch2` is
302
+ * `true`. The `tee()` method always passes `false`, while other web platform
303
+ * specifications, such as Fetch body cloning, pass `true` so that the second
304
+ * branch receives cloned chunks and consumption of one branch cannot mutate chunks
305
+ * seen by the other.
306
+ * @since v26.5.0
307
+ * @experimental
308
+ * @param cloneForBranch2 When `true`, chunks enqueued into the second
309
+ * branch are cloned from chunks enqueued into the first branch. **Default:**
310
+ * `false`.
311
+ * @returns Two `ReadableStream` branches.
312
+ */
313
+ function ReadableStreamTee<R>(
314
+ stream: ReadableStream<R>,
315
+ cloneForBranch2?: boolean,
316
+ ): [ReadableStream<R>, ReadableStream<R>];
297
317
  }
298
318
  declare module "stream/web" {
299
319
  export * from "node:stream/web";
node/tls.d.ts CHANGED
@@ -270,11 +270,19 @@ declare module "node:tls" {
270
270
  */
271
271
  getCipher(): CipherNameAndProtocol;
272
272
  /**
273
- * Returns an object representing the type, name, and size of parameter of
274
- * an ephemeral key exchange in `perfect forward secrecy` on a client
275
- * connection. It returns an empty object when the key exchange is not
276
- * ephemeral. As this is only supported on a client socket; `null` is returned
277
- * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The `name` property is available only when type is `'ECDH'`.
273
+ * Returns an object describing ephemeral key agreement in [perfect forward
274
+ * secrecy](https://nodejs.org/docs/latest-v26.x/api/tls.html#perfect-forward-secrecy) on a client connection. It returns an empty object when the key
275
+ * agreement is not ephemeral. As this is only supported on a client socket;
276
+ * `null` is returned if called on a server socket. The supported types are `'DH'`,
277
+ * `'ECDH'`, and `'TLSGroup'`. For `'DH'` and `'ECDH'`, the object describes peer
278
+ * temporary key parameters. For `'TLSGroup'`, the object identifies the negotiated
279
+ * TLS Supported Group used for key agreement when a peer temporary key object is
280
+ * not available.
281
+ *
282
+ * The `name` property is available only when type is `'ECDH'` or `'TLSGroup'`. The
283
+ * `size` property is not available when type is `'TLSGroup'`. For `'TLSGroup'`,
284
+ * `name` is the negotiated TLS Supported Group name. Standardized TLS group names
285
+ * and code points are listed in the [IANA TLS Supported Groups registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8).
278
286
  *
279
287
  * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`.
280
288
  * @since v5.0.0
@@ -822,13 +830,16 @@ declare module "node:tls" {
822
830
  */
823
831
  dhparam?: string | Buffer | undefined;
824
832
  /**
825
- * A string describing a named curve or a colon separated list of curve
826
- * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
827
- * agreement. Set to auto to select the curve automatically. Use
828
- * crypto.getCurves() to obtain a list of available curve names. On
829
- * recent releases, openssl ecparam -list_curves will also display the
830
- * name and description of each available elliptic curve. Default:
831
- * tls.DEFAULT_ECDH_CURVE.
833
+ * A string describing a named curve, TLS group, or
834
+ * colon-separated list of named curves or TLS groups to use for key agreement,
835
+ * for example `P-521:P-384:P-256`, `X25519`, or `X25519MLKEM768`. The
836
+ * historical name of this option refers to ECDH key agreement in TLSv1.2 and
837
+ * below. In TLSv1.3, this option configures the TLS Supported Groups and
838
+ * key share groups offered or accepted by the TLS stack. Set to `auto` to
839
+ * select the group automatically. Use `crypto.getCurves()` to obtain a
840
+ * list of available elliptic curve names. For TLS group names, use
841
+ * `openssl list -tls-groups` or consult the [IANA TLS Supported Groups
842
+ * registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8).
832
843
  */
833
844
  ecdhCurve?: string | undefined;
834
845
  /**
@@ -1167,9 +1178,9 @@ declare module "node:tls" {
1167
1178
  */
1168
1179
  function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
1169
1180
  /**
1170
- * The default curve name to use for ECDH key agreement in a tls server.
1171
- * The default value is `'auto'`. See `{@link createSecureContext()}` for further
1172
- * information.
1181
+ * The default named curve or TLS group list to use for key agreement in a TLS
1182
+ * server. The default value is `'auto'`. See `tls.createSecureContext()` for
1183
+ * further information.
1173
1184
  * @since v0.11.13
1174
1185
  */
1175
1186
  let DEFAULT_ECDH_CURVE: string;
node/vfs.d.ts CHANGED
@@ -182,10 +182,11 @@ declare module "node:vfs" {
182
182
  setReadOnly(): void;
183
183
  }
184
184
  /**
185
- * A provider that wraps a directory (i.e. one on the actual file system) and exposes its
186
- * contents through the VFS API. All VFS paths are resolved relative to
187
- * the root and verified to stay inside it; symbolic links resolving
188
- * outside the root are rejected.
185
+ * A provider that wraps a directory (i.e. one on the actual file system) and
186
+ * exposes its contents through the VFS API. All VFS paths are resolved relative to
187
+ * the root and verified to stay inside it; symbolic links resolving outside the
188
+ * root are rejected. This path mapping is not a sandbox or access-control
189
+ * mechanism.
189
190
  * @since v26.4.0
190
191
  */
191
192
  class RealFSProvider extends VirtualProvider {
@@ -193,8 +194,8 @@ declare module "node:vfs" {
193
194
  * ```js
194
195
  * const vfs = require('node:vfs');
195
196
  *
196
- * const realVfs = vfs.create(new vfs.RealFSProvider('/tmp/sandbox'));
197
- * realVfs.writeFileSync('/file.txt', 'hello'); // writes /tmp/sandbox/file.txt
197
+ * const realVfs = vfs.create(new vfs.RealFSProvider('/tmp/vfs-root'));
198
+ * realVfs.writeFileSync('/file.txt', 'hello'); // writes /tmp/vfs-root/file.txt
198
199
  * ```
199
200
  * @since v26.4.0
200
201
  * @param rootPath The absolute file-system path to use as the root.
node/zlib.d.ts CHANGED
@@ -32,6 +32,13 @@ declare module "node:zlib" {
32
32
  * @default buffer.kMaxLength
33
33
  */
34
34
  maxOutputLength?: number | undefined;
35
+ /**
36
+ * If `true`, decompression fails when
37
+ * trailing input is detected after the end of the compressed stream. This
38
+ * includes unreadable bytes and, when decompressing gzip, additional gzip
39
+ * members following the first member. **Default:** `false`
40
+ */
41
+ rejectGarbageAfterEnd?: boolean | undefined;
35
42
  }
36
43
  interface BrotliOptions {
37
44
  /**
@@ -63,6 +70,11 @@ declare module "node:zlib" {
63
70
  * If `true`, returns an object with `buffer` and `engine`.
64
71
  */
65
72
  info?: boolean | undefined;
73
+ /**
74
+ * If `true`, decompression fails when
75
+ * input remains after the first complete compressed stream. **Default:** `false`
76
+ */
77
+ rejectGarbageAfterEnd?: boolean | undefined;
66
78
  }
67
79
  interface ZstdOptions {
68
80
  /**
@@ -98,6 +110,11 @@ declare module "node:zlib" {
98
110
  * @since v24.6.0
99
111
  */
100
112
  dictionary?: NodeJS.ArrayBufferView | undefined;
113
+ /**
114
+ * If `true`, decompression fails when
115
+ * input remains after the first complete compressed stream. **Default:** `false`
116
+ */
117
+ rejectGarbageAfterEnd?: boolean | undefined;
101
118
  }
102
119
  interface Zlib {
103
120
  readonly bytesWritten: number;