@types/node 22.15.29 → 24.0.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/assert.d.ts +5 -5
- node/async_hooks.d.ts +26 -6
- node/buffer.d.ts +1 -2
- node/child_process.d.ts +2 -2
- node/cluster.d.ts +15 -15
- node/console.d.ts +17 -17
- node/crypto.d.ts +35 -28
- node/dgram.d.ts +1 -1
- node/diagnostics_channel.d.ts +1 -1
- node/dns.d.ts +16 -16
- node/domain.d.ts +1 -1
- node/events.d.ts +1 -2
- node/fs/promises.d.ts +16 -9
- node/fs.d.ts +28 -19
- node/globals.d.ts +7 -6
- node/globals.typedarray.d.ts +1 -0
- node/http.d.ts +2 -2
- node/http2.d.ts +75 -4
- node/https.d.ts +1 -1
- node/index.d.ts +7 -5
- node/inspector.d.ts +3 -7
- node/module.d.ts +63 -29
- node/net.d.ts +2 -5
- node/os.d.ts +8 -7
- node/package.json +13 -3
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +8 -8
- node/process.d.ts +21 -11
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline/promises.d.ts +0 -1
- node/readline.d.ts +13 -13
- node/repl.d.ts +14 -16
- node/sea.d.ts +1 -1
- node/sqlite.d.ts +182 -2
- node/stream.d.ts +8 -19
- node/string_decoder.d.ts +1 -1
- node/test.d.ts +53 -15
- node/timers/promises.d.ts +1 -1
- node/timers.d.ts +1 -1
- node/tls.d.ts +2 -48
- node/trace_events.d.ts +6 -6
- node/{compatibility → ts5.1/compatibility}/disposable.d.ts +0 -4
- node/ts5.1/index.d.ts +98 -0
- node/ts5.6/compatibility/float16array.d.ts +71 -0
- node/ts5.6/globals.typedarray.d.ts +1 -0
- node/ts5.6/index.d.ts +9 -5
- node/ts5.7/compatibility/float16array.d.ts +72 -0
- node/ts5.7/index.d.ts +96 -0
- node/tty.d.ts +1 -1
- node/url.d.ts +52 -19
- node/util.d.ts +17 -296
- node/v8.d.ts +29 -32
- node/vm.d.ts +17 -10
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +34 -18
- node/zlib.d.ts +5 -7
- node/compatibility/index.d.ts +0 -9
- node/compatibility/indexable.d.ts +0 -23
node/dgram.d.ts
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
* server.bind(41234);
|
24
24
|
* // Prints: server listening 0.0.0.0:41234
|
25
25
|
* ```
|
26
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
26
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dgram.js)
|
27
27
|
*/
|
28
28
|
declare module "dgram" {
|
29
29
|
import { AddressInfo, BlockList } from "node:net";
|
node/diagnostics_channel.d.ts
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
* should generally include the module name to avoid collisions with data from
|
21
21
|
* other modules.
|
22
22
|
* @since v15.1.0, v14.17.0
|
23
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/diagnostics_channel.js)
|
24
24
|
*/
|
25
25
|
declare module "diagnostics_channel" {
|
26
26
|
import { AsyncLocalStorage } from "node:async_hooks";
|
node/dns.d.ts
CHANGED
@@ -41,8 +41,8 @@
|
|
41
41
|
* });
|
42
42
|
* ```
|
43
43
|
*
|
44
|
-
* See the [Implementation considerations section](https://nodejs.org/docs/latest-
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
44
|
+
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations) for more information.
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dns.js)
|
46
46
|
*/
|
47
47
|
declare module "dns" {
|
48
48
|
import * as dnsPromises from "node:dns/promises";
|
@@ -71,7 +71,7 @@ declare module "dns" {
|
|
71
71
|
*/
|
72
72
|
family?: number | "IPv4" | "IPv6" | undefined;
|
73
73
|
/**
|
74
|
-
* One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-
|
74
|
+
* One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v24.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be
|
75
75
|
* passed by bitwise `OR`ing their values.
|
76
76
|
*/
|
77
77
|
hints?: number | undefined;
|
@@ -84,7 +84,7 @@ declare module "dns" {
|
|
84
84
|
* When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
|
85
85
|
* by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
|
86
86
|
* addresses before IPv4 addresses. Default value is configurable using
|
87
|
-
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-
|
87
|
+
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder).
|
88
88
|
* @default `verbatim` (addresses are not reordered)
|
89
89
|
* @since v22.1.0
|
90
90
|
*/
|
@@ -133,7 +133,7 @@ declare module "dns" {
|
|
133
133
|
* The implementation uses an operating system facility that can associate names
|
134
134
|
* with addresses and vice versa. This implementation can have subtle but
|
135
135
|
* important consequences on the behavior of any Node.js program. Please take some
|
136
|
-
* time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-
|
136
|
+
* time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations)
|
137
137
|
* before using `dns.lookup()`.
|
138
138
|
*
|
139
139
|
* Example usage:
|
@@ -155,7 +155,7 @@ declare module "dns" {
|
|
155
155
|
* // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
|
156
156
|
* ```
|
157
157
|
*
|
158
|
-
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-
|
158
|
+
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed
|
159
159
|
* version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties.
|
160
160
|
* @since v0.1.90
|
161
161
|
*/
|
@@ -195,7 +195,7 @@ declare module "dns" {
|
|
195
195
|
* If `address` is not a valid IP address, a `TypeError` will be thrown.
|
196
196
|
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown.
|
197
197
|
*
|
198
|
-
* On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-
|
198
|
+
* On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
|
199
199
|
* where `err.code` is the error code.
|
200
200
|
*
|
201
201
|
* ```js
|
@@ -206,7 +206,7 @@ declare module "dns" {
|
|
206
206
|
* });
|
207
207
|
* ```
|
208
208
|
*
|
209
|
-
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-
|
209
|
+
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed
|
210
210
|
* version, it returns a `Promise` for an `Object` with `hostname` and `service` properties.
|
211
211
|
* @since v0.11.14
|
212
212
|
*/
|
@@ -323,7 +323,7 @@ declare module "dns" {
|
|
323
323
|
*
|
324
324
|
* <omitted>
|
325
325
|
*
|
326
|
-
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-
|
326
|
+
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
|
327
327
|
* where `err.code` is one of the `DNS error codes`.
|
328
328
|
* @since v0.1.27
|
329
329
|
* @param hostname Host name to resolve.
|
@@ -664,8 +664,8 @@ declare module "dns" {
|
|
664
664
|
* Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
|
665
665
|
* array of host names.
|
666
666
|
*
|
667
|
-
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-
|
668
|
-
* one of the [DNS error codes](https://nodejs.org/docs/latest-
|
667
|
+
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object, where `err.code` is
|
668
|
+
* one of the [DNS error codes](https://nodejs.org/docs/latest-v24.x/api/dns.html#error-codes).
|
669
669
|
* @since v0.1.16
|
670
670
|
*/
|
671
671
|
export function reverse(
|
@@ -673,7 +673,7 @@ declare module "dns" {
|
|
673
673
|
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
|
674
674
|
): void;
|
675
675
|
/**
|
676
|
-
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-
|
676
|
+
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
|
677
677
|
* The value could be:
|
678
678
|
*
|
679
679
|
* * `ipv4first`: for `order` defaulting to `ipv4first`.
|
@@ -728,7 +728,7 @@ declare module "dns" {
|
|
728
728
|
*/
|
729
729
|
export function getServers(): string[];
|
730
730
|
/**
|
731
|
-
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-
|
731
|
+
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
|
732
732
|
* The value could be:
|
733
733
|
*
|
734
734
|
* * `ipv4first`: sets default `order` to `ipv4first`.
|
@@ -736,8 +736,8 @@ declare module "dns" {
|
|
736
736
|
* * `verbatim`: sets default `order` to `verbatim`.
|
737
737
|
*
|
738
738
|
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
|
739
|
-
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-
|
740
|
-
* [worker threads](https://nodejs.org/docs/latest-
|
739
|
+
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder). When using
|
740
|
+
* [worker threads](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
|
741
741
|
* thread won't affect the default dns orders in workers.
|
742
742
|
* @since v16.4.0, v14.18.0
|
743
743
|
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
|
@@ -783,7 +783,7 @@ declare module "dns" {
|
|
783
783
|
* An independent resolver for DNS requests.
|
784
784
|
*
|
785
785
|
* Creating a new resolver uses the default server settings. Setting
|
786
|
-
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-
|
786
|
+
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnssetserversservers) does not affect
|
787
787
|
* other resolvers:
|
788
788
|
*
|
789
789
|
* ```js
|
node/domain.d.ts
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
* will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to
|
13
13
|
* exit immediately with an error code.
|
14
14
|
* @deprecated Since v1.4.2 - Deprecated
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/domain.js)
|
16
16
|
*/
|
17
17
|
declare module "domain" {
|
18
18
|
import EventEmitter = require("node:events");
|
node/events.d.ts
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
* });
|
33
33
|
* myEmitter.emit('event');
|
34
34
|
* ```
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/events.js)
|
36
36
|
*/
|
37
37
|
declare module "events" {
|
38
38
|
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
@@ -431,7 +431,6 @@ declare module "events" {
|
|
431
431
|
* }
|
432
432
|
* ```
|
433
433
|
* @since v20.5.0
|
434
|
-
* @experimental
|
435
434
|
* @return Disposable that removes the `abort` listener.
|
436
435
|
*/
|
437
436
|
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
node/fs/promises.d.ts
CHANGED
@@ -259,7 +259,6 @@ declare module "fs/promises" {
|
|
259
259
|
* While the `ReadableStream` will read the file to completion, it will not
|
260
260
|
* close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method.
|
261
261
|
* @since v17.0.0
|
262
|
-
* @experimental
|
263
262
|
*/
|
264
263
|
readableWebStream(): ReadableStream;
|
265
264
|
/**
|
@@ -1251,20 +1250,28 @@ declare module "fs/promises" {
|
|
1251
1250
|
*/
|
1252
1251
|
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
1253
1252
|
/**
|
1254
|
-
*
|
1253
|
+
* ```js
|
1254
|
+
* import { glob } from 'node:fs/promises';
|
1255
|
+
*
|
1256
|
+
* for await (const entry of glob('*.js'))
|
1257
|
+
* console.log(entry);
|
1258
|
+
* ```
|
1259
|
+
* @since v22.0.0
|
1260
|
+
* @returns An AsyncIterator that yields the paths of files
|
1261
|
+
* that match the pattern.
|
1255
1262
|
*/
|
1256
|
-
function glob(pattern: string | string[]): NodeJS.AsyncIterator<string>;
|
1263
|
+
function glob(pattern: string | readonly string[]): NodeJS.AsyncIterator<string>;
|
1257
1264
|
function glob(
|
1258
|
-
pattern: string | string[],
|
1259
|
-
|
1265
|
+
pattern: string | readonly string[],
|
1266
|
+
options: GlobOptionsWithFileTypes,
|
1260
1267
|
): NodeJS.AsyncIterator<Dirent>;
|
1261
1268
|
function glob(
|
1262
|
-
pattern: string | string[],
|
1263
|
-
|
1269
|
+
pattern: string | readonly string[],
|
1270
|
+
options: GlobOptionsWithoutFileTypes,
|
1264
1271
|
): NodeJS.AsyncIterator<string>;
|
1265
1272
|
function glob(
|
1266
|
-
pattern: string | string[],
|
1267
|
-
|
1273
|
+
pattern: string | readonly string[],
|
1274
|
+
options: GlobOptions,
|
1268
1275
|
): NodeJS.AsyncIterator<Dirent | string>;
|
1269
1276
|
}
|
1270
1277
|
declare module "node:fs/promises" {
|
node/fs.d.ts
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
*
|
17
17
|
* All file system operations have synchronous, callback, and promise-based
|
18
18
|
* forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
|
19
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
19
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/fs.js)
|
20
20
|
*/
|
21
21
|
declare module "fs" {
|
22
22
|
import * as stream from "node:stream";
|
@@ -243,16 +243,10 @@ declare module "fs" {
|
|
243
243
|
*/
|
244
244
|
name: Name;
|
245
245
|
/**
|
246
|
-
* The
|
247
|
-
* @since v20.12.0
|
246
|
+
* The path to the parent directory of the file this `fs.Dirent` object refers to.
|
247
|
+
* @since v20.12.0, v18.20.0
|
248
248
|
*/
|
249
249
|
parentPath: string;
|
250
|
-
/**
|
251
|
-
* Alias for `dirent.parentPath`.
|
252
|
-
* @since v20.1.0
|
253
|
-
* @deprecated Since v20.12.0
|
254
|
-
*/
|
255
|
-
path: string;
|
256
250
|
}
|
257
251
|
/**
|
258
252
|
* A class representing a directory stream.
|
@@ -4200,7 +4194,6 @@ declare module "fs" {
|
|
4200
4194
|
* blob.stream();
|
4201
4195
|
* ```
|
4202
4196
|
* @since v19.8.0
|
4203
|
-
* @experimental
|
4204
4197
|
*/
|
4205
4198
|
export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise<Blob>;
|
4206
4199
|
|
@@ -4386,13 +4379,23 @@ declare module "fs" {
|
|
4386
4379
|
|
4387
4380
|
/**
|
4388
4381
|
* Retrieves the files matching the specified pattern.
|
4382
|
+
*
|
4383
|
+
* ```js
|
4384
|
+
* import { glob } from 'node:fs';
|
4385
|
+
*
|
4386
|
+
* glob('*.js', (err, matches) => {
|
4387
|
+
* if (err) throw err;
|
4388
|
+
* console.log(matches);
|
4389
|
+
* });
|
4390
|
+
* ```
|
4391
|
+
* @since v22.0.0
|
4389
4392
|
*/
|
4390
4393
|
export function glob(
|
4391
|
-
pattern: string | string[],
|
4394
|
+
pattern: string | readonly string[],
|
4392
4395
|
callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
|
4393
4396
|
): void;
|
4394
4397
|
export function glob(
|
4395
|
-
pattern: string | string[],
|
4398
|
+
pattern: string | readonly string[],
|
4396
4399
|
options: GlobOptionsWithFileTypes,
|
4397
4400
|
callback: (
|
4398
4401
|
err: NodeJS.ErrnoException | null,
|
@@ -4400,7 +4403,7 @@ declare module "fs" {
|
|
4400
4403
|
) => void,
|
4401
4404
|
): void;
|
4402
4405
|
export function glob(
|
4403
|
-
pattern: string | string[],
|
4406
|
+
pattern: string | readonly string[],
|
4404
4407
|
options: GlobOptionsWithoutFileTypes,
|
4405
4408
|
callback: (
|
4406
4409
|
err: NodeJS.ErrnoException | null,
|
@@ -4408,7 +4411,7 @@ declare module "fs" {
|
|
4408
4411
|
) => void,
|
4409
4412
|
): void;
|
4410
4413
|
export function glob(
|
4411
|
-
pattern: string | string[],
|
4414
|
+
pattern: string | readonly string[],
|
4412
4415
|
options: GlobOptions,
|
4413
4416
|
callback: (
|
4414
4417
|
err: NodeJS.ErrnoException | null,
|
@@ -4416,19 +4419,25 @@ declare module "fs" {
|
|
4416
4419
|
) => void,
|
4417
4420
|
): void;
|
4418
4421
|
/**
|
4419
|
-
*
|
4422
|
+
* ```js
|
4423
|
+
* import { globSync } from 'node:fs';
|
4424
|
+
*
|
4425
|
+
* console.log(globSync('*.js'));
|
4426
|
+
* ```
|
4427
|
+
* @since v22.0.0
|
4428
|
+
* @returns paths of files that match the pattern.
|
4420
4429
|
*/
|
4421
|
-
export function globSync(pattern: string | string[]): string[];
|
4430
|
+
export function globSync(pattern: string | readonly string[]): string[];
|
4422
4431
|
export function globSync(
|
4423
|
-
pattern: string | string[],
|
4432
|
+
pattern: string | readonly string[],
|
4424
4433
|
options: GlobOptionsWithFileTypes,
|
4425
4434
|
): Dirent[];
|
4426
4435
|
export function globSync(
|
4427
|
-
pattern: string | string[],
|
4436
|
+
pattern: string | readonly string[],
|
4428
4437
|
options: GlobOptionsWithoutFileTypes,
|
4429
4438
|
): string[];
|
4430
4439
|
export function globSync(
|
4431
|
-
pattern: string | string[],
|
4440
|
+
pattern: string | readonly string[],
|
4432
4441
|
options: GlobOptions,
|
4433
4442
|
): Dirent[] | string[];
|
4434
4443
|
}
|
node/globals.d.ts
CHANGED
@@ -14,6 +14,7 @@ type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
|
|
14
14
|
: import("undici-types").ResponseInit;
|
15
15
|
type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").WebSocket;
|
16
16
|
type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").EventSource;
|
17
|
+
type _CloseEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").CloseEvent;
|
17
18
|
// #endregion Fetch and friends
|
18
19
|
|
19
20
|
// Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise.
|
@@ -250,16 +251,12 @@ declare global {
|
|
250
251
|
}
|
251
252
|
|
252
253
|
/** An iterable iterator returned by the Node.js API. */
|
253
|
-
|
254
|
-
// TODO: In next major @types/node version, change default TReturn to undefined.
|
255
|
-
interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
254
|
+
interface Iterator<T, TReturn = undefined, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
256
255
|
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
257
256
|
}
|
258
257
|
|
259
258
|
/** An async iterable iterator returned by the Node.js API. */
|
260
|
-
|
261
|
-
// TODO: In next major @types/node version, change default TReturn to undefined.
|
262
|
-
interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
259
|
+
interface AsyncIterator<T, TReturn = undefined, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
263
260
|
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
|
264
261
|
}
|
265
262
|
}
|
@@ -362,5 +359,9 @@ declare global {
|
|
362
359
|
interface EventSource extends _EventSource {}
|
363
360
|
var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T
|
364
361
|
: typeof import("undici-types").EventSource;
|
362
|
+
|
363
|
+
interface CloseEvent extends _CloseEvent {}
|
364
|
+
var CloseEvent: typeof globalThis extends { onmessage: any; CloseEvent: infer T } ? T
|
365
|
+
: typeof import("undici-types").CloseEvent;
|
365
366
|
// #endregion fetch
|
366
367
|
}
|
node/globals.typedarray.d.ts
CHANGED
@@ -12,6 +12,7 @@ declare global {
|
|
12
12
|
| Int32Array<TArrayBuffer>
|
13
13
|
| BigUint64Array<TArrayBuffer>
|
14
14
|
| BigInt64Array<TArrayBuffer>
|
15
|
+
| Float16Array<TArrayBuffer>
|
15
16
|
| Float32Array<TArrayBuffer>
|
16
17
|
| Float64Array<TArrayBuffer>;
|
17
18
|
type ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
|
node/http.d.ts
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
* 'Host', 'example.com',
|
38
38
|
* 'accepT', '*' ]
|
39
39
|
* ```
|
40
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
40
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/http.js)
|
41
41
|
*/
|
42
42
|
declare module "http" {
|
43
43
|
import * as stream from "node:stream";
|
@@ -1505,7 +1505,7 @@ declare module "http" {
|
|
1505
1505
|
* });
|
1506
1506
|
* ```
|
1507
1507
|
*
|
1508
|
-
* `options` in [`socket.connect()`](https://nodejs.org/docs/latest-
|
1508
|
+
* `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v24.x/api/net.html#socketconnectoptions-connectlistener) are also supported.
|
1509
1509
|
*
|
1510
1510
|
* To configure any of them, a custom {@link Agent} instance must be created.
|
1511
1511
|
*
|
node/http2.d.ts
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* import http2 from 'node:http2';
|
7
7
|
* ```
|
8
8
|
* @since v8.4.0
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/http2.js)
|
10
10
|
*/
|
11
11
|
declare module "http2" {
|
12
12
|
import EventEmitter = require("node:events");
|
@@ -965,7 +965,10 @@ declare module "http2" {
|
|
965
965
|
* * `:path` \= `/`
|
966
966
|
* @since v8.4.0
|
967
967
|
*/
|
968
|
-
request(
|
968
|
+
request(
|
969
|
+
headers?: OutgoingHttpHeaders | readonly string[],
|
970
|
+
options?: ClientSessionRequestOptions,
|
971
|
+
): ClientHttp2Stream;
|
969
972
|
addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
970
973
|
addListener(event: "origin", listener: (origins: string[]) => void): this;
|
971
974
|
addListener(
|
@@ -1223,14 +1226,66 @@ declare module "http2" {
|
|
1223
1226
|
}
|
1224
1227
|
// Http2Server
|
1225
1228
|
export interface SessionOptions {
|
1229
|
+
/**
|
1230
|
+
* Sets the maximum dynamic table size for deflating header fields.
|
1231
|
+
* @default 4Kib
|
1232
|
+
*/
|
1226
1233
|
maxDeflateDynamicTableSize?: number | undefined;
|
1234
|
+
/**
|
1235
|
+
* Sets the maximum number of settings entries per `SETTINGS` frame.
|
1236
|
+
* The minimum value allowed is `1`.
|
1237
|
+
* @default 32
|
1238
|
+
*/
|
1239
|
+
maxSettings?: number | undefined;
|
1240
|
+
/**
|
1241
|
+
* Sets the maximum memory that the `Http2Session` is permitted to use.
|
1242
|
+
* The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte.
|
1243
|
+
* The minimum value allowed is `1`.
|
1244
|
+
* This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded,
|
1245
|
+
* but new `Http2Stream` instances will be rejected while this limit is exceeded.
|
1246
|
+
* The current number of `Http2Stream` sessions, the current memory use of the header compression tables,
|
1247
|
+
* current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit.
|
1248
|
+
* @default 10
|
1249
|
+
*/
|
1227
1250
|
maxSessionMemory?: number | undefined;
|
1251
|
+
/**
|
1252
|
+
* Sets the maximum number of header entries.
|
1253
|
+
* This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module.
|
1254
|
+
* The minimum value is `1`.
|
1255
|
+
* @default 128
|
1256
|
+
*/
|
1228
1257
|
maxHeaderListPairs?: number | undefined;
|
1258
|
+
/**
|
1259
|
+
* Sets the maximum number of outstanding, unacknowledged pings.
|
1260
|
+
* @default 10
|
1261
|
+
*/
|
1229
1262
|
maxOutstandingPings?: number | undefined;
|
1263
|
+
/**
|
1264
|
+
* Sets the maximum allowed size for a serialized, compressed block of headers.
|
1265
|
+
* Attempts to send headers that exceed this limit will result in
|
1266
|
+
* a `'frameError'` event being emitted and the stream being closed and destroyed.
|
1267
|
+
*/
|
1230
1268
|
maxSendHeaderBlockLength?: number | undefined;
|
1269
|
+
/**
|
1270
|
+
* Strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames.
|
1271
|
+
* @default http2.constants.PADDING_STRATEGY_NONE
|
1272
|
+
*/
|
1231
1273
|
paddingStrategy?: number | undefined;
|
1274
|
+
/**
|
1275
|
+
* Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received.
|
1276
|
+
* Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`.
|
1277
|
+
* @default 100
|
1278
|
+
*/
|
1232
1279
|
peerMaxConcurrentStreams?: number | undefined;
|
1280
|
+
/**
|
1281
|
+
* The initial settings to send to the remote peer upon connection.
|
1282
|
+
*/
|
1233
1283
|
settings?: Settings | undefined;
|
1284
|
+
/**
|
1285
|
+
* The array of integer values determines the settings types,
|
1286
|
+
* which are included in the `CustomSettings`-property of the received remoteSettings.
|
1287
|
+
* Please see the `CustomSettings`-property of the `Http2Settings` object for more information, on the allowed setting types.
|
1288
|
+
*/
|
1234
1289
|
remoteCustomSettings?: number[] | undefined;
|
1235
1290
|
/**
|
1236
1291
|
* Specifies a timeout in milliseconds that
|
@@ -1239,11 +1294,27 @@ declare module "http2" {
|
|
1239
1294
|
* @default 100000
|
1240
1295
|
*/
|
1241
1296
|
unknownProtocolTimeout?: number | undefined;
|
1242
|
-
selectPadding?(frameLen: number, maxFrameLen: number): number;
|
1243
1297
|
}
|
1244
1298
|
export interface ClientSessionOptions extends SessionOptions {
|
1299
|
+
/**
|
1300
|
+
* Sets the maximum number of reserved push streams the client will accept at any given time.
|
1301
|
+
* Once the current number of currently reserved push streams exceeds reaches this limit,
|
1302
|
+
* new push streams sent by the server will be automatically rejected.
|
1303
|
+
* The minimum allowed value is 0. The maximum allowed value is 2<sup>32</sup>-1.
|
1304
|
+
* A negative value sets this option to the maximum allowed value.
|
1305
|
+
* @default 200
|
1306
|
+
*/
|
1245
1307
|
maxReservedRemoteStreams?: number | undefined;
|
1308
|
+
/**
|
1309
|
+
* An optional callback that receives the `URL` instance passed to `connect` and the `options` object,
|
1310
|
+
* and returns any `Duplex` stream that is to be used as the connection for this session.
|
1311
|
+
*/
|
1246
1312
|
createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined;
|
1313
|
+
/**
|
1314
|
+
* The protocol to connect with, if not set in the `authority`.
|
1315
|
+
* Value may be either `'http:'` or `'https:'`.
|
1316
|
+
* @default 'https:'
|
1317
|
+
*/
|
1247
1318
|
protocol?: "http:" | "https:" | undefined;
|
1248
1319
|
}
|
1249
1320
|
export interface ServerSessionOptions<
|
@@ -1789,7 +1860,7 @@ declare module "http2" {
|
|
1789
1860
|
* If there were no previous values for the header, this is equivalent to calling {@link setHeader}.
|
1790
1861
|
*
|
1791
1862
|
* Attempting to set a header field name or value that contains invalid characters will result in a
|
1792
|
-
* [TypeError](https://nodejs.org/docs/latest-
|
1863
|
+
* [TypeError](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-typeerror) being thrown.
|
1793
1864
|
*
|
1794
1865
|
* ```js
|
1795
1866
|
* // Returns headers including "set-cookie: a" and "set-cookie: b"
|
node/https.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
3
3
|
* separate module.
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/https.js)
|
5
5
|
*/
|
6
6
|
declare module "https" {
|
7
7
|
import { Duplex } from "node:stream";
|
node/index.d.ts
CHANGED
@@ -22,15 +22,17 @@
|
|
22
22
|
* IN THE SOFTWARE.
|
23
23
|
*/
|
24
24
|
|
25
|
-
// NOTE: These definitions support Node.js and TypeScript 5.
|
25
|
+
// NOTE: These definitions support Node.js and TypeScript 5.8+.
|
26
26
|
|
27
|
-
// Reference required TypeScript
|
27
|
+
// Reference required TypeScript libraries:
|
28
28
|
/// <reference lib="es2020" />
|
29
|
+
/// <reference lib="esnext.disposable" />
|
30
|
+
/// <reference lib="esnext.float16" />
|
29
31
|
|
30
|
-
//
|
31
|
-
/// <reference path="compatibility/
|
32
|
+
// Iterator definitions required for compatibility with TypeScript <5.6:
|
33
|
+
/// <reference path="compatibility/iterators.d.ts" />
|
32
34
|
|
33
|
-
// Definitions specific to TypeScript 5.7+:
|
35
|
+
// Definitions for Node.js modules specific to TypeScript 5.7+:
|
34
36
|
/// <reference path="globals.typedarray.d.ts" />
|
35
37
|
/// <reference path="buffer.buffer.d.ts" />
|
36
38
|
|
node/inspector.d.ts
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
/**
|
7
7
|
* The `node:inspector` module provides an API for interacting with the V8
|
8
8
|
* inspector.
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector.js)
|
10
10
|
*/
|
11
11
|
declare module 'inspector' {
|
12
12
|
import EventEmitter = require('node:events');
|
@@ -2865,7 +2865,7 @@ declare module 'inspector' {
|
|
2865
2865
|
* If wait is `true`, will block until a client has connected to the inspect port
|
2866
2866
|
* and flow control has been passed to the debugger client.
|
2867
2867
|
*
|
2868
|
-
* See the [security warning](https://nodejs.org/docs/latest-
|
2868
|
+
* See the [security warning](https://nodejs.org/docs/latest-v24.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure)
|
2869
2869
|
* regarding the `host` parameter usage.
|
2870
2870
|
* @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI.
|
2871
2871
|
* @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI.
|
@@ -2948,7 +2948,6 @@ declare module 'inspector' {
|
|
2948
2948
|
* Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
|
2949
2949
|
* the application is about to send an HTTP request.
|
2950
2950
|
* @since v22.6.0
|
2951
|
-
* @experimental
|
2952
2951
|
*/
|
2953
2952
|
function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
|
2954
2953
|
/**
|
@@ -2957,7 +2956,6 @@ declare module 'inspector' {
|
|
2957
2956
|
* Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that
|
2958
2957
|
* HTTP response is available.
|
2959
2958
|
* @since v22.6.0
|
2960
|
-
* @experimental
|
2961
2959
|
*/
|
2962
2960
|
function responseReceived(params: ResponseReceivedEventDataType): void;
|
2963
2961
|
/**
|
@@ -2966,7 +2964,6 @@ declare module 'inspector' {
|
|
2966
2964
|
* Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that
|
2967
2965
|
* HTTP request has finished loading.
|
2968
2966
|
* @since v22.6.0
|
2969
|
-
* @experimental
|
2970
2967
|
*/
|
2971
2968
|
function loadingFinished(params: LoadingFinishedEventDataType): void;
|
2972
2969
|
/**
|
@@ -2975,7 +2972,6 @@ declare module 'inspector' {
|
|
2975
2972
|
* Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that
|
2976
2973
|
* HTTP request has failed to load.
|
2977
2974
|
* @since v22.7.0
|
2978
|
-
* @experimental
|
2979
2975
|
*/
|
2980
2976
|
function loadingFailed(params: LoadingFailedEventDataType): void;
|
2981
2977
|
}
|
@@ -2992,7 +2988,7 @@ declare module 'node:inspector' {
|
|
2992
2988
|
/**
|
2993
2989
|
* The `node:inspector/promises` module provides an API for interacting with the V8
|
2994
2990
|
* inspector.
|
2995
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
2991
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/inspector/promises.js)
|
2996
2992
|
* @since v19.0.0
|
2997
2993
|
*/
|
2998
2994
|
declare module 'inspector/promises' {
|