@types/node 26.5.0 → 26.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node/README.md +1 -1
- node/crypto.d.ts +20 -8
- node/ffi.d.ts +14 -0
- node/http2.d.ts +3 -2
- node/net.d.ts +16 -4
- node/package.json +2 -2
- node/process.d.ts +1 -0
- node/quic.d.ts +39 -1
- node/stream/iter.d.ts +9 -12
- node/test/reporters.d.ts +1 -0
- node/test.d.ts +72 -0
- node/tls.d.ts +14 -10
- node/vm.d.ts +2 -1
- node/web-globals/streams.d.ts +4 -0
- node/worker_threads.d.ts +4 -1
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Tue, 15 Sep 2026 16:36:26 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node/crypto.d.ts
CHANGED
|
@@ -88,6 +88,8 @@ declare module "node:crypto" {
|
|
|
88
88
|
* behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option
|
|
89
89
|
* can be used to specify the desired output length in bytes.
|
|
90
90
|
*
|
|
91
|
+
* When the data is small (< 5MB) and readily available, `crypto.hash()` is usually faster.
|
|
92
|
+
*
|
|
91
93
|
* The `algorithm` is dependent on the available algorithms supported by the
|
|
92
94
|
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
|
93
95
|
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
|
@@ -1304,8 +1306,11 @@ declare module "node:crypto" {
|
|
|
1304
1306
|
/**
|
|
1305
1307
|
* Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`.
|
|
1306
1308
|
*
|
|
1307
|
-
* If `privateKey` is not a `KeyObject`, this function behaves as if
|
|
1308
|
-
*
|
|
1309
|
+
* If `privateKey` is not a `KeyObject`, this function behaves as if
|
|
1310
|
+
* `privateKey` had been passed to `crypto.createPrivateKey()`. When
|
|
1311
|
+
* `privateKey` is a string, `ArrayBuffer`, `Buffer`, `TypedArray`, or
|
|
1312
|
+
* `DataView`, it must contain PEM-encoded key material. If it is an object, the
|
|
1313
|
+
* following additional properties can be passed:
|
|
1309
1314
|
*
|
|
1310
1315
|
* If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned.
|
|
1311
1316
|
*
|
|
@@ -1375,8 +1380,11 @@ declare module "node:crypto" {
|
|
|
1375
1380
|
/**
|
|
1376
1381
|
* Verifies the provided data using the given `key` and `signature`.
|
|
1377
1382
|
*
|
|
1378
|
-
* If `key` is not a `KeyObject`, this function behaves as if
|
|
1379
|
-
*
|
|
1383
|
+
* If `key` is not a `KeyObject`, this function behaves as if
|
|
1384
|
+
* `key` had been passed to `crypto.createPublicKey()`. When `key` is a string,
|
|
1385
|
+
* `ArrayBuffer`, `Buffer`, `TypedArray`, or `DataView`, it must contain
|
|
1386
|
+
* PEM-encoded key material. If it is an object, the following additional
|
|
1387
|
+
* properties can be passed:
|
|
1380
1388
|
*
|
|
1381
1389
|
* The `signature` argument is the previously calculated signature for the data, in
|
|
1382
1390
|
* the `signatureEncoding`.
|
|
@@ -2690,8 +2698,10 @@ declare module "node:crypto" {
|
|
|
2690
2698
|
* ML-DSA.
|
|
2691
2699
|
*
|
|
2692
2700
|
* If `key` is not a `KeyObject`, this function behaves as if `key` had been
|
|
2693
|
-
* passed to
|
|
2694
|
-
*
|
|
2701
|
+
* passed to `crypto.createPrivateKey()`. When `key` is a string, `ArrayBuffer`,
|
|
2702
|
+
* `Buffer`, `TypedArray`, or `DataView`, it must contain PEM-encoded key
|
|
2703
|
+
* material. If it is an object, the following additional properties can be
|
|
2704
|
+
* passed:
|
|
2695
2705
|
*
|
|
2696
2706
|
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
2697
2707
|
* @since v12.0.0
|
|
@@ -2716,8 +2726,10 @@ declare module "node:crypto" {
|
|
|
2716
2726
|
* ML-DSA.
|
|
2717
2727
|
*
|
|
2718
2728
|
* If `key` is not a `KeyObject`, this function behaves as if `key` had been
|
|
2719
|
-
* passed to
|
|
2720
|
-
*
|
|
2729
|
+
* passed to `crypto.createPublicKey()`. When `key` is a string, `ArrayBuffer`,
|
|
2730
|
+
* `Buffer`, `TypedArray`, or `DataView`, it must contain PEM-encoded key
|
|
2731
|
+
* material. If it is an object, the following additional properties can be
|
|
2732
|
+
* passed:
|
|
2721
2733
|
*
|
|
2722
2734
|
* The `signature` argument is the previously calculated signature for the `data`.
|
|
2723
2735
|
*
|
node/ffi.d.ts
CHANGED
|
@@ -415,6 +415,20 @@ declare module "node:ffi" {
|
|
|
415
415
|
* @since v26.1.0
|
|
416
416
|
*/
|
|
417
417
|
function getRawPointer(source: ArrayBuffer | NodeJS.ArrayBufferView): bigint;
|
|
418
|
+
/**
|
|
419
|
+
* Returns the address of the current thread's `uv_loop_t` as a `bigint`.
|
|
420
|
+
*
|
|
421
|
+
* The returned address is for the current Node.js environment. In the main thread,
|
|
422
|
+
* this is the main thread event loop. In a worker thread, this is that worker's
|
|
423
|
+
* event loop.
|
|
424
|
+
*
|
|
425
|
+
* This is unsafe and dangerous. The returned pointer is only valid for the lifetime
|
|
426
|
+
* of the current environment. Using it after the environment exits, or from native
|
|
427
|
+
* code that assumes a different thread or lifetime, can crash the process or
|
|
428
|
+
* corrupt memory.
|
|
429
|
+
* @since v26.6.0
|
|
430
|
+
*/
|
|
431
|
+
function getCurrentEventLoop(): bigint;
|
|
418
432
|
type ReturnType = { [K in keyof DataTypeMap]: K }[keyof DataTypeMap];
|
|
419
433
|
type ArgumentType = Exclude<ReturnType, "void">;
|
|
420
434
|
interface DataTypeMap {
|
node/http2.d.ts
CHANGED
|
@@ -685,10 +685,11 @@ declare module "node:http2" {
|
|
|
685
685
|
* Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
|
|
686
686
|
* limits available methods to ones safe to use with HTTP/2.
|
|
687
687
|
*
|
|
688
|
-
* `
|
|
688
|
+
* `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw
|
|
689
689
|
* an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information.
|
|
690
690
|
*
|
|
691
|
-
* `setTimeout`
|
|
691
|
+
* `destroy`, `setTimeout`, `ref`, and `unref` methods will be called on this
|
|
692
|
+
* `Http2Session`.
|
|
692
693
|
*
|
|
693
694
|
* All other interactions will be routed directly to the socket.
|
|
694
695
|
* @since v8.4.0
|
node/net.d.ts
CHANGED
|
@@ -353,10 +353,11 @@ declare module "node:net" {
|
|
|
353
353
|
/**
|
|
354
354
|
* This property represents the state of the connection as a string.
|
|
355
355
|
*
|
|
356
|
-
* * If the
|
|
357
|
-
* * If the
|
|
358
|
-
* * If the
|
|
359
|
-
* * If the
|
|
356
|
+
* * If the socket is connecting, `socket.readyState` is `opening`.
|
|
357
|
+
* * If the socket is readable and writable, it is `open`.
|
|
358
|
+
* * If the socket is readable and not writable, it is `readOnly`.
|
|
359
|
+
* * If the socket is not readable and writable, it is `writeOnly`.
|
|
360
|
+
* * Otherwise, it is `closed`.
|
|
360
361
|
* @since v0.5.0
|
|
361
362
|
*/
|
|
362
363
|
readonly readyState: SocketReadyState;
|
|
@@ -378,6 +379,12 @@ declare module "node:net" {
|
|
|
378
379
|
* @since v0.5.10
|
|
379
380
|
*/
|
|
380
381
|
readonly remotePort: number | undefined;
|
|
382
|
+
/**
|
|
383
|
+
* Reference to the server that accepted the socket. This is `null` for sockets
|
|
384
|
+
* that were not accepted by a server.
|
|
385
|
+
* @since v0.3.4
|
|
386
|
+
*/
|
|
387
|
+
readonly server: Server | null;
|
|
381
388
|
/**
|
|
382
389
|
* The socket timeout in milliseconds as set by `socket.setTimeout()`.
|
|
383
390
|
* It is `undefined` if a timeout has not been set.
|
|
@@ -486,6 +493,11 @@ declare module "node:net" {
|
|
|
486
493
|
* throw `ERR_SOCKET_HANDLE_ADOPTED`. A handle that is never adopted must be
|
|
487
494
|
* closed to avoid leaking the socket.
|
|
488
495
|
*
|
|
496
|
+
* When an adopted `BoundSocket` connects to a numeric IP literal, `connect(2)` is
|
|
497
|
+
* issued synchronously, so `socket.localAddress` is resolved once
|
|
498
|
+
* `socket.connect()` returns. Connection failures are still reported via a
|
|
499
|
+
* deferred `'error'` event.
|
|
500
|
+
*
|
|
489
501
|
* ```js
|
|
490
502
|
* import net from 'node:net';
|
|
491
503
|
*
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.6.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.9.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "c3ddfc83c34abd0878ab763a394a46f266d63e76f7c37c6dc366dd6288d17e83",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
node/process.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ declare module "node:process" {
|
|
|
110
110
|
"node:util/types": typeof import("node:util/types");
|
|
111
111
|
"v8": typeof import("v8");
|
|
112
112
|
"node:v8": typeof import("node:v8");
|
|
113
|
+
"node:vfs": typeof import("node:vfs");
|
|
113
114
|
"vm": typeof import("vm");
|
|
114
115
|
"node:vm": typeof import("node:vm");
|
|
115
116
|
"wasi": typeof import("wasi");
|
node/quic.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare module "node:quic" {
|
|
|
4
4
|
import { FileHandle } from "node:fs/promises";
|
|
5
5
|
import { BlockList, SocketAddress } from "node:net";
|
|
6
6
|
import { Writer } from "node:stream/iter";
|
|
7
|
-
import { EphemeralKeyInfo } from "node:tls";
|
|
7
|
+
import { CertificateCompressionAlgorithm, EphemeralKeyInfo } from "node:tls";
|
|
8
8
|
/**
|
|
9
9
|
* @since v23.8.0
|
|
10
10
|
*/
|
|
@@ -277,6 +277,28 @@ declare module "node:quic" {
|
|
|
277
277
|
* @since v23.8.0
|
|
278
278
|
*/
|
|
279
279
|
ca?: ArrayBuffer | NodeJS.ArrayBufferView | ReadonlyArray<ArrayBuffer | NodeJS.ArrayBufferView> | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* Enables TLS certificate compression ([RFC 8879](https://www.rfc-editor.org/rfc/rfc8879)) for this session. When
|
|
282
|
+
* omitted, certificate compression is disabled.
|
|
283
|
+
*
|
|
284
|
+
* On the server side, the certificate chain is compressed using the first
|
|
285
|
+
* listed algorithm that the client advertises support for. On the client side,
|
|
286
|
+
* the listed algorithms are advertised to the server so that the server may
|
|
287
|
+
* compress its certificate. When client authentication is in use, the option
|
|
288
|
+
* also controls compression of the client's certificate.
|
|
289
|
+
*
|
|
290
|
+
* Compressing the certificate chain is especially useful for QUIC because it
|
|
291
|
+
* reduces the size of the server's first flight, which is bounded by the
|
|
292
|
+
* anti-amplification limit (see [Certificate size and handshake
|
|
293
|
+
* performance](https://nodejs.org/docs/latest-v26.x/api/quic.html#certificate-size-and-handshake-performance)). Certificate compression requires TLS 1.3, which QUIC always
|
|
294
|
+
* uses.
|
|
295
|
+
*
|
|
296
|
+
* At most three algorithms may be specified. The option is silently ignored if
|
|
297
|
+
* Node.js was built against a shared OpenSSL that lacks certificate compression
|
|
298
|
+
* support.
|
|
299
|
+
* @since v26.6.0
|
|
300
|
+
*/
|
|
301
|
+
certificateCompression?: readonly CertificateCompressionAlgorithm[] | undefined;
|
|
280
302
|
/**
|
|
281
303
|
* Specifies the congestion control algorithm that will be used.
|
|
282
304
|
* Must be set to one of either `'reno'`, `'cubic'`, or `'bbr'`.
|
|
@@ -1438,6 +1460,22 @@ declare module "node:quic" {
|
|
|
1438
1460
|
datagram: string | NodeJS.ArrayBufferView | Promise<string | NodeJS.ArrayBufferView>,
|
|
1439
1461
|
encoding?: BufferEncoding,
|
|
1440
1462
|
): Promise<bigint>;
|
|
1463
|
+
/**
|
|
1464
|
+
* The SNI (Server Name Indication) host name associated with the session. This is
|
|
1465
|
+
* `null` before the client hello is processed. Once the hello has been
|
|
1466
|
+
* processed, this is either the host name string or `false` if the handshake
|
|
1467
|
+
* had no SNI.
|
|
1468
|
+
* @since v26.6.0
|
|
1469
|
+
*/
|
|
1470
|
+
readonly servername: string | false | null;
|
|
1471
|
+
/**
|
|
1472
|
+
* The negotiated ALPN protocol. This is `null` before the client hello is
|
|
1473
|
+
* processed. Once ALPN has been negotiated, this is the protocol string. ALPN
|
|
1474
|
+
* is mandatory in QUIC so this is never `false` on successful connections,
|
|
1475
|
+
* unlike `node:tls` where this is optional.
|
|
1476
|
+
* @since v26.6.0
|
|
1477
|
+
*/
|
|
1478
|
+
readonly alpnProtocol: string | null;
|
|
1441
1479
|
/**
|
|
1442
1480
|
* The local certificate as a `crypto.X509Certificate` instance. Server
|
|
1443
1481
|
* sessions return the certificate configured for the negotiated SNI host.
|
node/stream/iter.d.ts
CHANGED
|
@@ -45,14 +45,14 @@ declare module "node:stream/iter" {
|
|
|
45
45
|
[shareSyncProtocol](options: ShareSyncOptions): SyncShare;
|
|
46
46
|
}
|
|
47
47
|
// IDL dictionaries, enums, typedefs
|
|
48
|
-
type BackpressurePolicy = "strict" | "
|
|
48
|
+
type BackpressurePolicy = "strict" | "unbounded" | "drop-oldest" | "drop-newest";
|
|
49
49
|
type ByteReadableStream = AsyncIterable<Uint8Array[]>;
|
|
50
50
|
type SyncByteReadableStream = Iterable<Uint8Array[]>;
|
|
51
51
|
interface WriteOptions {
|
|
52
52
|
signal?: AbortSignal;
|
|
53
53
|
}
|
|
54
54
|
interface PushStreamOptions {
|
|
55
|
-
|
|
55
|
+
budget?: number;
|
|
56
56
|
backpressure?: BackpressurePolicy;
|
|
57
57
|
signal?: AbortSignal;
|
|
58
58
|
}
|
|
@@ -85,21 +85,21 @@ declare module "node:stream/iter" {
|
|
|
85
85
|
signal?: AbortSignal;
|
|
86
86
|
}
|
|
87
87
|
interface BroadcastOptions {
|
|
88
|
-
|
|
88
|
+
budget?: number;
|
|
89
89
|
backpressure?: BackpressurePolicy;
|
|
90
90
|
signal?: AbortSignal;
|
|
91
91
|
}
|
|
92
92
|
interface ShareOptions {
|
|
93
|
-
|
|
93
|
+
budget?: number;
|
|
94
94
|
backpressure?: BackpressurePolicy;
|
|
95
95
|
signal?: AbortSignal;
|
|
96
96
|
}
|
|
97
97
|
interface ShareSyncOptions {
|
|
98
|
-
|
|
98
|
+
budget?: number;
|
|
99
99
|
backpressure?: BackpressurePolicy;
|
|
100
100
|
}
|
|
101
101
|
interface DuplexDirectionOptions {
|
|
102
|
-
|
|
102
|
+
budget?: number;
|
|
103
103
|
backpressure?: BackpressurePolicy;
|
|
104
104
|
}
|
|
105
105
|
interface DuplexOptions {
|
|
@@ -142,7 +142,7 @@ declare module "node:stream/iter" {
|
|
|
142
142
|
broadcast: Broadcast;
|
|
143
143
|
}
|
|
144
144
|
interface Writer extends Disposable, AsyncDisposable {
|
|
145
|
-
readonly
|
|
145
|
+
readonly canWrite: boolean | null;
|
|
146
146
|
write(chunk: Uint8Array | string, options?: WriteOptions): Promise<void>;
|
|
147
147
|
writev(chunks: Array<Uint8Array | string>, options?: WriteOptions): Promise<void>;
|
|
148
148
|
writeSync(chunk: Uint8Array | string): boolean;
|
|
@@ -155,7 +155,7 @@ declare module "node:stream/iter" {
|
|
|
155
155
|
write(chunk: Uint8Array | string, options?: WriteOptions): Promise<void>;
|
|
156
156
|
}
|
|
157
157
|
interface SyncWriter extends Disposable {
|
|
158
|
-
readonly
|
|
158
|
+
readonly canWrite: boolean | null;
|
|
159
159
|
writeSync(chunk: Uint8Array | string): number;
|
|
160
160
|
writevSync(chunks: Array<Uint8Array | string>): number;
|
|
161
161
|
endSync(): number;
|
|
@@ -166,19 +166,16 @@ declare module "node:stream/iter" {
|
|
|
166
166
|
}
|
|
167
167
|
interface Broadcast extends Disposable {
|
|
168
168
|
readonly consumerCount: number;
|
|
169
|
-
readonly bufferSize: number;
|
|
170
169
|
push(...args: any[]): ByteReadableStream;
|
|
171
170
|
cancel(reason?: any): void;
|
|
172
171
|
}
|
|
173
172
|
interface Share extends Disposable {
|
|
174
173
|
readonly consumerCount: number;
|
|
175
|
-
readonly bufferSize: number;
|
|
176
174
|
pull(...args: any[]): ByteReadableStream;
|
|
177
175
|
cancel(reason?: any): void;
|
|
178
176
|
}
|
|
179
177
|
interface SyncShare extends Disposable {
|
|
180
178
|
readonly consumerCount: number;
|
|
181
|
-
readonly bufferSize: number;
|
|
182
179
|
pull(...args: any): SyncByteReadableStream;
|
|
183
180
|
cancel(reason?: any): void;
|
|
184
181
|
}
|
|
@@ -329,7 +326,7 @@ declare module "node:stream/iter" {
|
|
|
329
326
|
* });
|
|
330
327
|
*
|
|
331
328
|
* await pipeTo(from('hello world'),
|
|
332
|
-
* fromWritable(writable, { backpressure: '
|
|
329
|
+
* fromWritable(writable, { backpressure: 'unbounded' }));
|
|
333
330
|
* ```
|
|
334
331
|
* @since v26.1.0
|
|
335
332
|
* @experimental
|
node/test/reporters.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare module "node:test/reporters" {
|
|
|
9
9
|
| { type: "test:enqueue"; data: EventData.TestEnqueue }
|
|
10
10
|
| { type: "test:fail"; data: EventData.TestFail }
|
|
11
11
|
| { type: "test:interrupted"; data: EventData.TestInterrupted }
|
|
12
|
+
| { type: "test:log"; data: EventData.TestLog }
|
|
12
13
|
| { type: "test:pass"; data: EventData.TestPass }
|
|
13
14
|
| { type: "test:plan"; data: EventData.TestPlan }
|
|
14
15
|
| { type: "test:start"; data: EventData.TestStart }
|
node/test.d.ts
CHANGED
|
@@ -375,6 +375,7 @@ declare module "node:test" {
|
|
|
375
375
|
"test:enqueue": [data: EventData.TestEnqueue];
|
|
376
376
|
"test:fail": [data: EventData.TestFail];
|
|
377
377
|
"test:interrupted": [data: EventData.TestInterrupted];
|
|
378
|
+
"test:log": [data: EventData.TestLog];
|
|
378
379
|
"test:pass": [data: EventData.TestPass];
|
|
379
380
|
"test:plan": [data: EventData.TestPlan];
|
|
380
381
|
"test:start": [data: EventData.TestStart];
|
|
@@ -455,6 +456,13 @@ declare module "node:test" {
|
|
|
455
456
|
* `undefined` if the test was run through the REPL.
|
|
456
457
|
*/
|
|
457
458
|
column?: number;
|
|
459
|
+
/**
|
|
460
|
+
* The path of the test file that was
|
|
461
|
+
* executed as the entry point of the child process that emitted this event.
|
|
462
|
+
* Only present when tests run with process isolation. May differ from
|
|
463
|
+
* `file` when the test is defined in a module imported by the entry file.
|
|
464
|
+
*/
|
|
465
|
+
entryFile?: string;
|
|
458
466
|
/**
|
|
459
467
|
* The path of the test file, `undefined` if test was run through the REPL.
|
|
460
468
|
*/
|
|
@@ -845,6 +853,36 @@ declare module "node:test" {
|
|
|
845
853
|
*/
|
|
846
854
|
tests: TestStart[];
|
|
847
855
|
}
|
|
856
|
+
interface TestLog extends LocationInfo {
|
|
857
|
+
/**
|
|
858
|
+
* The structured payload passed to `context.log`, or
|
|
859
|
+
* `undefined` if none was provided. The test runner does not interpret this
|
|
860
|
+
* value.
|
|
861
|
+
*/
|
|
862
|
+
data: unknown;
|
|
863
|
+
/**
|
|
864
|
+
* The log message.
|
|
865
|
+
*/
|
|
866
|
+
message: string;
|
|
867
|
+
/**
|
|
868
|
+
* The test name.
|
|
869
|
+
*/
|
|
870
|
+
name: string;
|
|
871
|
+
/**
|
|
872
|
+
* The nesting level of the test.
|
|
873
|
+
*/
|
|
874
|
+
nesting: number;
|
|
875
|
+
/**
|
|
876
|
+
* The `testId` of the enclosing test, or
|
|
877
|
+
* `undefined` for top-level tests.
|
|
878
|
+
*/
|
|
879
|
+
parentId: number | undefined;
|
|
880
|
+
/**
|
|
881
|
+
* A numeric identifier for the test instance that emitted
|
|
882
|
+
* the log message.
|
|
883
|
+
*/
|
|
884
|
+
testId: number;
|
|
885
|
+
}
|
|
848
886
|
interface TestPass extends LocationInfo {
|
|
849
887
|
/**
|
|
850
888
|
* Additional execution metadata.
|
|
@@ -1130,6 +1168,25 @@ declare module "node:test" {
|
|
|
1130
1168
|
* @param message Message to be reported.
|
|
1131
1169
|
*/
|
|
1132
1170
|
diagnostic(message: string): void;
|
|
1171
|
+
/**
|
|
1172
|
+
* This function is used to write a log message to the output. Unlike
|
|
1173
|
+
* `context.diagnostic`, the resulting `'test:log'` event is emitted
|
|
1174
|
+
* immediately, in the order that the tests execute, rather than being buffered
|
|
1175
|
+
* until the test reports its results. This function does not return a value.
|
|
1176
|
+
*
|
|
1177
|
+
* ```js
|
|
1178
|
+
* test('top level test', (t) => {
|
|
1179
|
+
* t.log('fetched user', { userId: 42 });
|
|
1180
|
+
* t.log('retrying flaky endpoint', { attempt: 3 });
|
|
1181
|
+
* });
|
|
1182
|
+
* ```
|
|
1183
|
+
* @since v26.6.0
|
|
1184
|
+
* @param message Message to be reported.
|
|
1185
|
+
* @param data Optional structured payload attached to the message. The test
|
|
1186
|
+
* runner passes it through untouched. When tests run with process isolation,
|
|
1187
|
+
* this value must be compatible with the [HTML structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm).
|
|
1188
|
+
*/
|
|
1189
|
+
log(message: string, data?: unknown): void;
|
|
1133
1190
|
/**
|
|
1134
1191
|
* The absolute path of the test file that created the current test. If a test file imports
|
|
1135
1192
|
* additional modules that generate tests, the imported tests will return the path of the root test file.
|
|
@@ -1492,6 +1549,21 @@ declare module "node:test" {
|
|
|
1492
1549
|
* @param message A diagnostic message to output.
|
|
1493
1550
|
*/
|
|
1494
1551
|
diagnostic(message: string): void;
|
|
1552
|
+
/**
|
|
1553
|
+
* Write a log message to the output. The resulting `'test:log'` event is
|
|
1554
|
+
* emitted immediately, in the order that the tests execute.
|
|
1555
|
+
*
|
|
1556
|
+
* ```js
|
|
1557
|
+
* test.describe('my suite', (suite) => {
|
|
1558
|
+
* suite.log('Suite log message');
|
|
1559
|
+
* });
|
|
1560
|
+
* ```
|
|
1561
|
+
* @since v26.6.0
|
|
1562
|
+
* @param message Message to be reported.
|
|
1563
|
+
* @param data Optional structured payload attached to the message. The test
|
|
1564
|
+
* runner passes it through untouched.
|
|
1565
|
+
*/
|
|
1566
|
+
log(message: string, data?: unknown): void;
|
|
1495
1567
|
}
|
|
1496
1568
|
interface TestOptions {
|
|
1497
1569
|
/**
|
node/tls.d.ts
CHANGED
|
@@ -219,6 +219,13 @@ declare module "node:tls" {
|
|
|
219
219
|
* @since v0.11.4
|
|
220
220
|
*/
|
|
221
221
|
authorized: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* The negotiated ALPN protocol. This is `null` before the handshake completes.
|
|
224
|
+
* Once the handshake completes, it settles as either the negotiated protocol
|
|
225
|
+
* name, or `false` if the peers did not negotiate an ALPN protocol.
|
|
226
|
+
* @since v6.0.0
|
|
227
|
+
*/
|
|
228
|
+
alpnProtocol: string | false | null;
|
|
222
229
|
/**
|
|
223
230
|
* Returns the reason why the peer's certificate was not been verified. This
|
|
224
231
|
* property is set only when `tlsSocket.authorized === false`.
|
|
@@ -230,16 +237,6 @@ declare module "node:tls" {
|
|
|
230
237
|
* @since v0.11.4
|
|
231
238
|
*/
|
|
232
239
|
encrypted: true;
|
|
233
|
-
/**
|
|
234
|
-
* String containing the selected ALPN protocol.
|
|
235
|
-
* Before a handshake has completed, this value is always null.
|
|
236
|
-
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
|
|
237
|
-
*/
|
|
238
|
-
alpnProtocol: string | false | null;
|
|
239
|
-
/**
|
|
240
|
-
* String containing the server name requested via SNI (Server Name Indication) TLS extension.
|
|
241
|
-
*/
|
|
242
|
-
servername: string | false | null;
|
|
243
240
|
/**
|
|
244
241
|
* Returns an object representing the local certificate. The returned object has
|
|
245
242
|
* some properties corresponding to the fields of the certificate.
|
|
@@ -402,6 +399,13 @@ declare module "node:tls" {
|
|
|
402
399
|
},
|
|
403
400
|
callback: (err: Error | null) => void,
|
|
404
401
|
): undefined | boolean;
|
|
402
|
+
/**
|
|
403
|
+
* The SNI (Server Name Indication) host name associated with the socket. This is
|
|
404
|
+
* `null` before the handshake completes. Once the handshake completes it settles
|
|
405
|
+
* as either the host name string, or `false` if SNI was not used.
|
|
406
|
+
* @since v0.11.3
|
|
407
|
+
*/
|
|
408
|
+
servername: string | false | null;
|
|
405
409
|
/**
|
|
406
410
|
* The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket.
|
|
407
411
|
* This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`.
|
node/vm.d.ts
CHANGED
|
@@ -886,6 +886,7 @@ declare module "node:vm" {
|
|
|
886
886
|
* const module = new vm.SourceTextModule(
|
|
887
887
|
* 'Object.getPrototypeOf(import.meta.prop).secret = secret;',
|
|
888
888
|
* {
|
|
889
|
+
* context: contextifiedObject,
|
|
889
890
|
* initializeImportMeta(meta) {
|
|
890
891
|
* // Note: this object is created in the top context. As such,
|
|
891
892
|
* // Object.getPrototypeOf(import.meta.prop) points to the
|
|
@@ -904,7 +905,7 @@ declare module "node:vm" {
|
|
|
904
905
|
* // To fix this problem, replace
|
|
905
906
|
* // meta.prop = {};
|
|
906
907
|
* // above with
|
|
907
|
-
* // meta.prop = vm.runInContext('{}', contextifiedObject);
|
|
908
|
+
* // meta.prop = vm.runInContext('({})', contextifiedObject);
|
|
908
909
|
* ```
|
|
909
910
|
* @param code JavaScript Module code to parse
|
|
910
911
|
*/
|
node/web-globals/streams.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ type _ReadableStreamDefaultController<R = any> = typeof globalThis extends { onm
|
|
|
19
19
|
: webstreams.ReadableStreamDefaultController<R>;
|
|
20
20
|
type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends { onmessage: any } ? {}
|
|
21
21
|
: webstreams.ReadableStreamDefaultReader<R>;
|
|
22
|
+
type _ReadableWritablePair<R = any, W = any> = typeof globalThis extends { onmessage: any } ? {}
|
|
23
|
+
: webstreams.ReadableWritablePair<R, W>;
|
|
22
24
|
type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextDecoderStream;
|
|
23
25
|
type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextEncoderStream;
|
|
24
26
|
type _TransformStream<I = any, O = any> = typeof globalThis extends { onmessage: any } ? {}
|
|
@@ -82,6 +84,8 @@ declare global {
|
|
|
82
84
|
? T
|
|
83
85
|
: typeof webstreams.ReadableStreamDefaultReader;
|
|
84
86
|
|
|
87
|
+
interface ReadableWritablePair<R = any, W = any> extends _ReadableWritablePair<R, W> {}
|
|
88
|
+
|
|
85
89
|
interface TextDecoderStream extends _TextDecoderStream {}
|
|
86
90
|
var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T
|
|
87
91
|
: typeof webstreams.TextDecoderStream;
|
node/worker_threads.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare module "node:worker_threads" {
|
|
|
6
6
|
NodeEventTarget,
|
|
7
7
|
} from "node:events";
|
|
8
8
|
import { FileHandle } from "node:fs/promises";
|
|
9
|
+
import { Server, Socket } from "node:net";
|
|
9
10
|
import { Performance } from "node:perf_hooks";
|
|
10
11
|
import { Readable, Writable } from "node:stream";
|
|
11
12
|
import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
|
|
@@ -514,7 +515,9 @@ declare module "node:worker_threads" {
|
|
|
514
515
|
| FileHandle
|
|
515
516
|
| ReadableStream
|
|
516
517
|
| WritableStream
|
|
517
|
-
| TransformStream
|
|
518
|
+
| TransformStream
|
|
519
|
+
| Server
|
|
520
|
+
| Socket;
|
|
518
521
|
interface LockGrantedCallback<T> {
|
|
519
522
|
(lock: Lock | null): T;
|
|
520
523
|
}
|