@types/node 26.1.2 → 26.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 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: Mon, 27 Jul 2026 17:32:10 GMT
11
+ * Last updated: Fri, 07 Aug 2026 17:46:44 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/child_process.d.ts CHANGED
@@ -227,7 +227,6 @@ declare module "node:child_process" {
227
227
  * new process in a shell or with the use of the `shell` option of `ChildProcess`:
228
228
  *
229
229
  * ```js
230
- * 'use strict';
231
230
  * import { spawn } from 'node:child_process';
232
231
  *
233
232
  * const subprocess = spawn(
node/crypto.d.ts CHANGED
@@ -2698,12 +2698,12 @@ declare module "node:crypto" {
2698
2698
  */
2699
2699
  function sign(
2700
2700
  algorithm: string | null | undefined,
2701
- data: ArrayBufferLike | NodeJS.ArrayBufferView,
2701
+ data: BinaryLike,
2702
2702
  key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
2703
2703
  ): NonSharedBuffer;
2704
2704
  function sign(
2705
2705
  algorithm: string | null | undefined,
2706
- data: ArrayBufferLike | NodeJS.ArrayBufferView,
2706
+ data: BinaryLike,
2707
2707
  key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
2708
2708
  callback: (error: Error | null, data: NonSharedBuffer) => void,
2709
2709
  ): void;
@@ -2729,15 +2729,15 @@ declare module "node:crypto" {
2729
2729
  */
2730
2730
  function verify(
2731
2731
  algorithm: string | null | undefined,
2732
- data: ArrayBufferLike | NodeJS.ArrayBufferView,
2732
+ data: BinaryLike,
2733
2733
  key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
2734
- signature: ArrayBufferLike | NodeJS.ArrayBufferView,
2734
+ signature: BinaryLike,
2735
2735
  ): boolean;
2736
2736
  function verify(
2737
2737
  algorithm: string | null | undefined,
2738
- data: ArrayBufferLike | NodeJS.ArrayBufferView,
2738
+ data: BinaryLike,
2739
2739
  key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
2740
- signature: ArrayBufferLike | NodeJS.ArrayBufferView,
2740
+ signature: BinaryLike,
2741
2741
  callback: (error: Error | null, result: boolean) => void,
2742
2742
  ): void;
2743
2743
  /**
node/dns/promises.d.ts CHANGED
@@ -183,7 +183,7 @@ declare module "node:dns/promises" {
183
183
  * refresh: 900,
184
184
  * retry: 900,
185
185
  * expire: 1800,
186
- * minttl: 60 } ]
186
+ * minttl: 60 } ];
187
187
  * ```
188
188
  * @since v10.6.0
189
189
  */
@@ -226,7 +226,7 @@ declare module "node:dns/promises" {
226
226
  * regexp: '',
227
227
  * replacement: '_sip._udp.example.com',
228
228
  * order: 30,
229
- * preference: 100
229
+ * preference: 100,
230
230
  * }
231
231
  * ```
232
232
  * @since v10.6.0
@@ -265,7 +265,7 @@ declare module "node:dns/promises" {
265
265
  * refresh: 10000,
266
266
  * retry: 2400,
267
267
  * expire: 604800,
268
- * minttl: 3600
268
+ * minttl: 3600,
269
269
  * }
270
270
  * ```
271
271
  * @since v10.6.0
@@ -285,7 +285,7 @@ declare module "node:dns/promises" {
285
285
  * priority: 10,
286
286
  * weight: 5,
287
287
  * port: 21223,
288
- * name: 'service.example.com'
288
+ * name: 'service.example.com',
289
289
  * }
290
290
  * ```
291
291
  * @since v10.6.0
@@ -306,7 +306,7 @@ declare module "node:dns/promises" {
306
306
  * certUsage: 3,
307
307
  * selector: 1,
308
308
  * match: 1,
309
- * data: [ArrayBuffer]
309
+ * data: [ArrayBuffer],
310
310
  * }
311
311
  * ```
312
312
  * @since v23.9.0, v22.15.0
node/dns.d.ts CHANGED
@@ -490,7 +490,7 @@ declare module "node:dns" {
490
490
  * regexp: '',
491
491
  * replacement: '_sip._udp.example.com',
492
492
  * order: 30,
493
- * preference: 100
493
+ * preference: 100,
494
494
  * }
495
495
  * ```
496
496
  * @since v0.9.12
@@ -547,7 +547,7 @@ declare module "node:dns" {
547
547
  * refresh: 10000,
548
548
  * retry: 2400,
549
549
  * expire: 604800,
550
- * minttl: 3600
550
+ * minttl: 3600,
551
551
  * }
552
552
  * ```
553
553
  * @since v0.11.10
@@ -573,7 +573,7 @@ declare module "node:dns" {
573
573
  * priority: 10,
574
574
  * weight: 5,
575
575
  * port: 21223,
576
- * name: 'service.example.com'
576
+ * name: 'service.example.com',
577
577
  * }
578
578
  * ```
579
579
  * @since v0.1.27
@@ -600,7 +600,7 @@ declare module "node:dns" {
600
600
  * certUsage: 3,
601
601
  * selector: 1,
602
602
  * match: 1,
603
- * data: [ArrayBuffer]
603
+ * data: [ArrayBuffer],
604
604
  * }
605
605
  * ```
606
606
  * @since v23.9.0, v22.15.0
@@ -650,7 +650,7 @@ declare module "node:dns" {
650
650
  * refresh: 900,
651
651
  * retry: 900,
652
652
  * expire: 1800,
653
- * minttl: 60 } ]
653
+ * minttl: 60 } ];
654
654
  * ```
655
655
  *
656
656
  * DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see
node/fs.d.ts CHANGED
@@ -48,6 +48,13 @@ declare module "node:fs" {
48
48
  mtime: Date;
49
49
  ctime: Date;
50
50
  birthtime: Date;
51
+ // Deliberately not defining a type alias here... it'd be exported, and something in the ecosystem would inevitably start using it.
52
+ // TODO: replace with Temporal builtins once @types/node no longer supports TS <6.0.
53
+ atimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
54
+ mtimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
55
+ ctimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
56
+ birthtimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T
57
+ : unknown;
51
58
  }
52
59
  interface Stats extends StatsBase<number> {}
53
60
  /**
node/http.d.ts CHANGED
@@ -922,6 +922,36 @@ declare module "node:http" {
922
922
  headers?: OutgoingHttpHeaders | OutgoingHttpHeader[],
923
923
  ): this;
924
924
  writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
925
+ /**
926
+ * Sends an arbitrary HTTP/1.1 1xx informational response to the client. This
927
+ * is a generic equivalent of `response.writeContinue()`,
928
+ * `response.writeProcessing()` and `response.writeEarlyHints()`, and
929
+ * can be called multiple times before the final response. After the final
930
+ * response headers have been sent (via `response.writeHead()` or an
931
+ * implicit header), calling this method throws `ERR_HTTP_HEADERS_SENT`.
932
+ *
933
+ * Clients receive these responses via the [`'information'`](https://nodejs.org/docs/latest-v26.x/api/http.html#event-information)
934
+ * event on `http.ClientRequest`.
935
+ *
936
+ * ```js
937
+ * response.writeInformation(110, { 'X-Progress': '50%' });
938
+ * ```
939
+ * @since v26.2.0
940
+ * @param statusCode An HTTP 1xx informational status code, between `100`
941
+ * and `199` inclusive, excluding `101` (Switching Protocols) which is only
942
+ * available through the [`'upgrade'`](https://nodejs.org/docs/latest-v26.x/api/http.html#event-upgrade) event.
943
+ * @param headers An optional set of headers to send with the
944
+ * informational response. Accepts the same shapes as
945
+ * `response.writeHead()`.
946
+ * @param callback Optional, called once the message has been written
947
+ * to the socket.
948
+ */
949
+ writeInformation(
950
+ statusCode: number,
951
+ headers?: OutgoingHttpHeaders | readonly string[],
952
+ callback?: () => void,
953
+ ): void;
954
+ writeInformation(statusCode: number, callback: () => void): void;
925
955
  /**
926
956
  * Sends a HTTP/1.1 102 Processing message to the client, indicating that
927
957
  * the request body should be sent.
node/http2.d.ts CHANGED
@@ -59,7 +59,7 @@ declare module "node:http2" {
59
59
  "ready": [];
60
60
  "streamClosed": [code: number];
61
61
  "timeout": [];
62
- "trailers": [trailers: IncomingHttpHeaders, flags: number];
62
+ "trailers": [headers: IncomingHttpHeaders, flags: number, rawHeaders: string[]];
63
63
  "wantTrailers": [];
64
64
  }
65
65
  interface Http2Stream extends stream.Duplex {
@@ -245,7 +245,7 @@ declare module "node:http2" {
245
245
  interface ClientHttp2StreamEventMap extends Http2StreamEventMap {
246
246
  "continue": [];
247
247
  "headers": [headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number, rawHeaders: string[]];
248
- "push": [headers: IncomingHttpHeaders, flags: number];
248
+ "push": [headers: IncomingHttpHeaders, flags: number, rawHeaders: string[]];
249
249
  "response": [headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number, rawHeaders: string[]];
250
250
  }
251
251
  interface ClientHttp2Stream extends Http2Stream {
@@ -1644,8 +1644,8 @@ declare module "node:http2" {
1644
1644
  *
1645
1645
  * Then `request.url` will be:
1646
1646
  *
1647
- * ```js
1648
- * '/status?name=ryan'
1647
+ * ```json
1648
+ * "/status?name=ryan"
1649
1649
  * ```
1650
1650
  *
1651
1651
  * To parse the url into its parts, `new URL()` can be used:
node/os.d.ts CHANGED
@@ -122,7 +122,7 @@ declare module "node:os" {
122
122
  * irq: 20,
123
123
  * },
124
124
  * },
125
- * ]
125
+ * ];
126
126
  * ```
127
127
  *
128
128
  * `nice` values are POSIX-only. On Windows, the `nice` values of all processors
@@ -167,44 +167,44 @@ declare module "node:os" {
167
167
  *
168
168
  * The properties available on the assigned network address object include:
169
169
  *
170
- * ```js
170
+ * ```json
171
171
  * {
172
- * lo: [
172
+ * "lo": [
173
173
  * {
174
- * address: '127.0.0.1',
175
- * netmask: '255.0.0.0',
176
- * family: 'IPv4',
177
- * mac: '00:00:00:00:00:00',
178
- * internal: true,
179
- * cidr: '127.0.0.1/8'
174
+ * "address:": "127.0.0.1",
175
+ * "netmask:": "255.0.0.0",
176
+ * "family:": "IPv4",
177
+ * "mac:": "00:00:00:00:00:00",
178
+ * "internal:": true,
179
+ * "cidr:": "127.0.0.1/8"
180
180
  * },
181
181
  * {
182
- * address: '::1',
183
- * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
184
- * family: 'IPv6',
185
- * mac: '00:00:00:00:00:00',
186
- * scopeid: 0,
187
- * internal: true,
188
- * cidr: '::1/128'
182
+ * "address:": "::1",
183
+ * "netmask:": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
184
+ * "family:": "IPv6",
185
+ * "mac:": "00:00:00:00:00:00",
186
+ * "scopeid:": 0,
187
+ * "internal:": true,
188
+ * "cidr:": "::1/128"
189
189
  * }
190
190
  * ],
191
- * eth0: [
191
+ * "eth0": [
192
192
  * {
193
- * address: '192.168.1.108',
194
- * netmask: '255.255.255.0',
195
- * family: 'IPv4',
196
- * mac: '01:02:03:0a:0b:0c',
197
- * internal: false,
198
- * cidr: '192.168.1.108/24'
193
+ * "address:": "192.168.1.108",
194
+ * "netmask:": "255.255.255.0",
195
+ * "family:": "IPv4",
196
+ * "mac:": "01:02:03:0a:0b:0c",
197
+ * "internal:": false,
198
+ * "cidr:": "192.168.1.108/24"
199
199
  * },
200
200
  * {
201
- * address: 'fe80::a00:27ff:fe4e:66a1',
202
- * netmask: 'ffff:ffff:ffff:ffff::',
203
- * family: 'IPv6',
204
- * mac: '01:02:03:0a:0b:0c',
205
- * scopeid: 1,
206
- * internal: false,
207
- * cidr: 'fe80::a00:27ff:fe4e:66a1/64'
201
+ * "address:": "fe80::a00:27ff:fe4e:66a1",
202
+ * "netmask:": "ffff:ffff:ffff:ffff::",
203
+ * "family:": "IPv6",
204
+ * "mac:": "01:02:03:0a:0b:0c",
205
+ * "scopeid:": 1,
206
+ * "internal:": false,
207
+ * "cidr:": "fe80::a00:27ff:fe4e:66a1/64"
208
208
  * }
209
209
  * ]
210
210
  * }
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "26.1.2",
3
+ "version": "26.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",
@@ -150,6 +150,6 @@
150
150
  "undici-types": "~8.3.0"
151
151
  },
152
152
  "peerDependencies": {},
153
- "typesPublisherContentHash": "359a01a58cecf5a30fb7b7a7b10c4f5c332339421ef5cbc9932fc492f472a5b4",
153
+ "typesPublisherContentHash": "e8c7e12bafdd8ff8648e4d416be7af2d4373bffe17a7498d815e251898739e7c",
154
154
  "typeScriptVersion": "5.6"
155
155
  }
node/perf_hooks.d.ts CHANGED
@@ -11,6 +11,7 @@ declare module "node:perf_hooks" {
11
11
  | "measure" // available on the Web
12
12
  | "net" // Node.js only
13
13
  | "node" // Node.js only
14
+ | "quic" // Node.js only
14
15
  | "resource"; // available on the Web
15
16
  interface ConnectionTimingInfo {
16
17
  domainLookupStartTime: number;
@@ -214,7 +215,7 @@ declare module "node:perf_hooks" {
214
215
  * @since v16.0.0
215
216
  */
216
217
  readonly detail: any;
217
- readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node";
218
+ readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node" | "quic";
218
219
  }
219
220
  interface UVMetrics {
220
221
  /**
node/process.d.ts CHANGED
@@ -791,14 +791,14 @@ declare module "node:process" {
791
791
  *
792
792
  * Results in `process.execArgv`:
793
793
  *
794
- * ```js
794
+ * ```json
795
795
  * ["--icu-data-dir=./foo", "--require", "./bar.js"]
796
796
  * ```
797
797
  *
798
798
  * And `process.argv`:
799
799
  *
800
- * ```js
801
- * ['/usr/local/bin/node', 'script.js', '--version']
800
+ * ```json
801
+ * ["/usr/local/bin/node", "script.js", "--version"]
802
802
  * ```
803
803
  *
804
804
  * Refer to `Worker constructor` for the detailed behavior of worker
@@ -810,8 +810,8 @@ declare module "node:process" {
810
810
  * The `process.execPath` property returns the absolute pathname of the executable
811
811
  * that started the Node.js process. Symbolic links, if any, are resolved.
812
812
  *
813
- * ```js
814
- * '/usr/local/bin/node'
813
+ * ```json
814
+ * "/usr/local/bin/node"
815
815
  * ```
816
816
  * @since v0.1.100
817
817
  */
@@ -994,18 +994,18 @@ declare module "node:process" {
994
994
  *
995
995
  * An example of this object looks like:
996
996
  *
997
- * ```js
997
+ * ```json
998
998
  * {
999
- * TERM: 'xterm-256color',
1000
- * SHELL: '/usr/local/bin/bash',
1001
- * USER: 'maciej',
1002
- * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
1003
- * PWD: '/Users/maciej',
1004
- * EDITOR: 'vim',
1005
- * SHLVL: '1',
1006
- * HOME: '/Users/maciej',
1007
- * LOGNAME: 'maciej',
1008
- * _: '/usr/local/bin/node'
999
+ * "TERM": "xterm-256color",
1000
+ * "SHELL": "/usr/local/bin/bash",
1001
+ * "USER": "maciej",
1002
+ * "PATH": "~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin",
1003
+ * "PWD": "/Users/maciej",
1004
+ * "EDITOR": "vim",
1005
+ * "SHLVL": "1",
1006
+ * "HOME": "/Users/maciej",
1007
+ * "LOGNAME": "maciej",
1008
+ * "_": "/usr/local/bin/node"
1009
1009
  * }
1010
1010
  * ```
1011
1011
  *
@@ -1540,29 +1540,28 @@ declare module "node:process" {
1540
1540
  *
1541
1541
  * An example of the possible output looks like:
1542
1542
  *
1543
- * ```js
1543
+ * ```json
1544
1544
  * {
1545
- * target_defaults:
1546
- * { cflags: [],
1547
- * default_configuration: 'Release',
1548
- * defines: [],
1549
- * include_dirs: [],
1550
- * libraries: [] },
1551
- * variables:
1545
+ * "target_defaults":
1546
+ * { "cflags": [],
1547
+ * "default_configuration": "Release",
1548
+ * "defines": [],
1549
+ * "include_dirs": [],
1550
+ * "libraries": [] },
1551
+ * "variables":
1552
1552
  * {
1553
- * host_arch: 'x64',
1554
- * napi_build_version: 5,
1555
- * node_install_npm: 'true',
1556
- * node_prefix: '',
1557
- * node_shared_cares: 'false',
1558
- * node_shared_http_parser: 'false',
1559
- * node_shared_libuv: 'false',
1560
- * node_shared_zlib: 'false',
1561
- * node_use_openssl: 'true',
1562
- * node_shared_openssl: 'false',
1563
- * strict_aliasing: 'true',
1564
- * target_arch: 'x64',
1565
- * v8_use_snapshot: 1
1553
+ * "host_arch": "x64",
1554
+ * "napi_build_version": 5,
1555
+ * "node_install_npm": "true",
1556
+ * "node_prefix": "",
1557
+ * "node_shared_cares": "false",
1558
+ * "node_shared_http_parser": "false",
1559
+ * "node_shared_libuv": "false",
1560
+ * "node_shared_zlib": "false",
1561
+ * "node_use_openssl": "true",
1562
+ * "node_shared_openssl": "false",
1563
+ * "target_arch": "x64",
1564
+ * "v8_use_snapshot": 1
1566
1565
  * }
1567
1566
  * }
1568
1567
  * ```
@@ -1876,13 +1875,13 @@ declare module "node:process" {
1876
1875
  *
1877
1876
  * `process.release` contains the following properties:
1878
1877
  *
1879
- * ```js
1878
+ * ```json
1880
1879
  * {
1881
- * name: 'node',
1882
- * lts: 'Hydrogen',
1883
- * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz',
1884
- * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz',
1885
- * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib'
1880
+ * "name": "node",
1881
+ * "lts": "Hydrogen",
1882
+ * "sourceUrl": "https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz",
1883
+ * "headersUrl": "https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz",
1884
+ * "libUrl": "https://nodejs.org/download/release/v18.12.0/win-x64/node.lib"
1886
1885
  * }
1887
1886
  * ```
1888
1887
  *