From fd4af5605ae38cf9f974f2f7f6204257fe736cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Tue, 15 Sep 2026 17:08:09 +0100 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75524=20node:?= =?UTF-8?q?=20v26.6=20by=20@Renegade334?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/node/crypto.d.ts | 28 +++++++---- types/node/ffi.d.ts | 14 ++++++ types/node/http2.d.ts | 5 +- types/node/net.d.ts | 20 ++++++-- types/node/node-tests/net.ts | 13 ++++- types/node/node-tests/stream-iter.ts | 2 +- types/node/node-tests/test.ts | 14 ++++++ types/node/package.json | 2 +- types/node/process.d.ts | 1 + types/node/quic.d.ts | 40 +++++++++++++++- types/node/stream/iter.d.ts | 21 ++++---- types/node/test.d.ts | 72 ++++++++++++++++++++++++++++ types/node/test/reporters.d.ts | 1 + types/node/tls.d.ts | 24 ++++++---- types/node/vm.d.ts | 3 +- types/node/worker_threads.d.ts | 5 +- 16 files changed, 223 insertions(+), 42 deletions(-) diff --git a/types/node/crypto.d.ts b/types/node/crypto.d.ts index 89cc1cb89e14cf..b15ba39ff072b3 100644 --- a/types/node/crypto.d.ts +++ b/types/node/crypto.d.ts @@ -88,6 +88,8 @@ declare module "node:crypto" { * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option * can be used to specify the desired output length in bytes. * + * When the data is small (< 5MB) and readily available, `crypto.hash()` is usually faster. + * * The `algorithm` is dependent on the available algorithms supported by the * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. * On recent releases of OpenSSL, `openssl list -digest-algorithms` will @@ -1304,8 +1306,11 @@ declare module "node:crypto" { /** * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: + * If `privateKey` is not a `KeyObject`, this function behaves as if + * `privateKey` had been passed to `crypto.createPrivateKey()`. When + * `privateKey` is a string, `ArrayBuffer`, `Buffer`, `TypedArray`, or + * `DataView`, it must contain PEM-encoded key material. If it is an object, the + * following additional properties can be passed: * * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. * @@ -1375,8 +1380,11 @@ declare module "node:crypto" { /** * Verifies the provided data using the given `key` and `signature`. * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: + * If `key` is not a `KeyObject`, this function behaves as if + * `key` had been passed to `crypto.createPublicKey()`. When `key` is a string, + * `ArrayBuffer`, `Buffer`, `TypedArray`, or `DataView`, it must contain + * PEM-encoded key material. If it is an object, the following additional + * properties can be passed: * * The `signature` argument is the previously calculated signature for the data, in * the `signatureEncoding`. @@ -2690,8 +2698,10 @@ declare module "node:crypto" { * ML-DSA. * * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: + * passed to `crypto.createPrivateKey()`. When `key` is a string, `ArrayBuffer`, + * `Buffer`, `TypedArray`, or `DataView`, it must contain PEM-encoded key + * material. If it is an object, the following additional properties can be + * passed: * * If the `callback` function is provided this function uses libuv's threadpool. * @since v12.0.0 @@ -2716,8 +2726,10 @@ declare module "node:crypto" { * ML-DSA. * * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: + * passed to `crypto.createPublicKey()`. When `key` is a string, `ArrayBuffer`, + * `Buffer`, `TypedArray`, or `DataView`, it must contain PEM-encoded key + * material. If it is an object, the following additional properties can be + * passed: * * The `signature` argument is the previously calculated signature for the `data`. * diff --git a/types/node/ffi.d.ts b/types/node/ffi.d.ts index 8e760e545e7c9c..6b9932023882c6 100644 --- a/types/node/ffi.d.ts +++ b/types/node/ffi.d.ts @@ -415,6 +415,20 @@ declare module "node:ffi" { * @since v26.1.0 */ function getRawPointer(source: ArrayBuffer | NodeJS.ArrayBufferView): bigint; + /** + * Returns the address of the current thread's `uv_loop_t` as a `bigint`. + * + * The returned address is for the current Node.js environment. In the main thread, + * this is the main thread event loop. In a worker thread, this is that worker's + * event loop. + * + * This is unsafe and dangerous. The returned pointer is only valid for the lifetime + * of the current environment. Using it after the environment exits, or from native + * code that assumes a different thread or lifetime, can crash the process or + * corrupt memory. + * @since v26.6.0 + */ + function getCurrentEventLoop(): bigint; type ReturnType = { [K in keyof DataTypeMap]: K }[keyof DataTypeMap]; type ArgumentType = Exclude; interface DataTypeMap { diff --git a/types/node/http2.d.ts b/types/node/http2.d.ts index f772753c1283be..1899b0ef6e9f6a 100644 --- a/types/node/http2.d.ts +++ b/types/node/http2.d.ts @@ -685,10 +685,11 @@ declare module "node:http2" { * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but * limits available methods to ones safe to use with HTTP/2. * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw + * `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. * - * `setTimeout` method will be called on this `Http2Session`. + * `destroy`, `setTimeout`, `ref`, and `unref` methods will be called on this + * `Http2Session`. * * All other interactions will be routed directly to the socket. * @since v8.4.0 diff --git a/types/node/net.d.ts b/types/node/net.d.ts index ad8164682858d4..3f104c5835eca1 100644 --- a/types/node/net.d.ts +++ b/types/node/net.d.ts @@ -353,10 +353,11 @@ declare module "node:net" { /** * This property represents the state of the connection as a string. * - * * If the stream is connecting `socket.readyState` is `opening`. - * * If the stream is readable and writable, it is `open`. - * * If the stream is readable and not writable, it is `readOnly`. - * * If the stream is not readable and writable, it is `writeOnly`. + * * If the socket is connecting, `socket.readyState` is `opening`. + * * If the socket is readable and writable, it is `open`. + * * If the socket is readable and not writable, it is `readOnly`. + * * If the socket is not readable and writable, it is `writeOnly`. + * * Otherwise, it is `closed`. * @since v0.5.0 */ readonly readyState: SocketReadyState; @@ -378,6 +379,12 @@ declare module "node:net" { * @since v0.5.10 */ readonly remotePort: number | undefined; + /** + * Reference to the server that accepted the socket. This is `null` for sockets + * that were not accepted by a server. + * @since v0.3.4 + */ + readonly server: Server | null; /** * The socket timeout in milliseconds as set by `socket.setTimeout()`. * It is `undefined` if a timeout has not been set. @@ -486,6 +493,11 @@ declare module "node:net" { * throw `ERR_SOCKET_HANDLE_ADOPTED`. A handle that is never adopted must be * closed to avoid leaking the socket. * + * When an adopted `BoundSocket` connects to a numeric IP literal, `connect(2)` is + * issued synchronously, so `socket.localAddress` is resolved once + * `socket.connect()` returns. Connection failures are still reported via a + * deferred `'error'` event. + * * ```js * import net from 'node:net'; * diff --git a/types/node/node-tests/net.ts b/types/node/node-tests/net.ts index c2d839d455097b..53e69e8ffbb8f9 100644 --- a/types/node/node-tests/net.ts +++ b/types/node/node-tests/net.ts @@ -1,6 +1,6 @@ -import { Socket } from "node:dgram"; import { LookupAddress, LookupOptions } from "node:dns"; import * as net from "node:net"; +import { Worker } from "node:worker_threads"; { const abort = new AbortController(); @@ -503,3 +503,14 @@ import * as net from "node:net"; new net.Socket({ handle: new net.BoundSocket() }); } + +{ + // worker.js receives `{ socket }` messages and handles each connection. + const worker = new Worker("./worker.js"); + + const server = net.createServer((socket) => { + // Hand the freshly accepted connection off to the worker thread. + worker.postMessage({ socket }, [socket]); + }); + server.listen(8000); +} diff --git a/types/node/node-tests/stream-iter.ts b/types/node/node-tests/stream-iter.ts index 8b4c9ecd406684..7198b38690790f 100644 --- a/types/node/node-tests/stream-iter.ts +++ b/types/node/node-tests/stream-iter.ts @@ -75,7 +75,7 @@ void async function() { }, }); - await pipeTo(from("hello world"), fromWritable(writable, { backpressure: "block" })); + await pipeTo(from("hello world"), fromWritable(writable, { backpressure: "unbounded" })); }; { diff --git a/types/node/node-tests/test.ts b/types/node/node-tests/test.ts index 6445c1ffb9fe5b..c68bc97cd300a1 100644 --- a/types/node/node-tests/test.ts +++ b/types/node/node-tests/test.ts @@ -133,6 +133,10 @@ test(undefined, undefined, t => { // $ExpectType void t.diagnostic("tap diagnostic"); // $ExpectType void + t.log("message"); + // $ExpectType void + t.log("data", [1, 2, 3]); + // $ExpectType void t.runOnly(true); // $ExpectType void t.skip("skip reason"); @@ -530,6 +534,8 @@ suite("foo", (context) => { context.attempt; context.diagnostic("diagnostic"); + context.log("message"); + context.log("data", [1, 2, 3]); }); suite("test tags", () => { @@ -1016,6 +1022,14 @@ class TestReporter extends Transform { ); break; } + case "test:log": { + const { file, column, line, name, message, data } = event.data; + callback( + null, + `${name}/${file}/${column}/${line}/${message}/${data}`, + ); + break; + } case "test:pass": { const { file, column, line, details, name, nesting, testNumber, skip, todo } = event.data; callback( diff --git a/types/node/package.json b/types/node/package.json index 2efdee9dea794f..b76355caaf1799 100644 --- a/types/node/package.json +++ b/types/node/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/node", - "version": "26.5.9999", + "version": "26.6.9999", "nonNpm": "conflict", "nonNpmDescription": "Node.js", "projects": [ diff --git a/types/node/process.d.ts b/types/node/process.d.ts index 4bbb9d4f647741..51a3d6172b0ec7 100644 --- a/types/node/process.d.ts +++ b/types/node/process.d.ts @@ -110,6 +110,7 @@ declare module "node:process" { "node:util/types": typeof import("node:util/types"); "v8": typeof import("v8"); "node:v8": typeof import("node:v8"); + "node:vfs": typeof import("node:vfs"); "vm": typeof import("vm"); "node:vm": typeof import("node:vm"); "wasi": typeof import("wasi"); diff --git a/types/node/quic.d.ts b/types/node/quic.d.ts index 505c9fdea14ba0..e48ea2757d0050 100644 --- a/types/node/quic.d.ts +++ b/types/node/quic.d.ts @@ -4,7 +4,7 @@ declare module "node:quic" { import { FileHandle } from "node:fs/promises"; import { BlockList, SocketAddress } from "node:net"; import { Writer } from "node:stream/iter"; - import { EphemeralKeyInfo } from "node:tls"; + import { CertificateCompressionAlgorithm, EphemeralKeyInfo } from "node:tls"; /** * @since v23.8.0 */ @@ -277,6 +277,28 @@ declare module "node:quic" { * @since v23.8.0 */ ca?: ArrayBuffer | NodeJS.ArrayBufferView | ReadonlyArray | undefined; + /** + * Enables TLS certificate compression ([RFC 8879](https://www.rfc-editor.org/rfc/rfc8879)) for this session. When + * omitted, certificate compression is disabled. + * + * On the server side, the certificate chain is compressed using the first + * listed algorithm that the client advertises support for. On the client side, + * the listed algorithms are advertised to the server so that the server may + * compress its certificate. When client authentication is in use, the option + * also controls compression of the client's certificate. + * + * Compressing the certificate chain is especially useful for QUIC because it + * reduces the size of the server's first flight, which is bounded by the + * anti-amplification limit (see [Certificate size and handshake + * 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 + * uses. + * + * At most three algorithms may be specified. The option is silently ignored if + * Node.js was built against a shared OpenSSL that lacks certificate compression + * support. + * @since v26.6.0 + */ + certificateCompression?: readonly CertificateCompressionAlgorithm[] | undefined; /** * Specifies the congestion control algorithm that will be used. * Must be set to one of either `'reno'`, `'cubic'`, or `'bbr'`. @@ -1438,6 +1460,22 @@ declare module "node:quic" { datagram: string | NodeJS.ArrayBufferView | Promise, encoding?: BufferEncoding, ): Promise; + /** + * The SNI (Server Name Indication) host name associated with the session. This is + * `null` before the client hello is processed. Once the hello has been + * processed, this is either the host name string or `false` if the handshake + * had no SNI. + * @since v26.6.0 + */ + readonly servername: string | false | null; + /** + * The negotiated ALPN protocol. This is `null` before the client hello is + * processed. Once ALPN has been negotiated, this is the protocol string. ALPN + * is mandatory in QUIC so this is never `false` on successful connections, + * unlike `node:tls` where this is optional. + * @since v26.6.0 + */ + readonly alpnProtocol: string | null; /** * The local certificate as a `crypto.X509Certificate` instance. Server * sessions return the certificate configured for the negotiated SNI host. diff --git a/types/node/stream/iter.d.ts b/types/node/stream/iter.d.ts index 0d9f6358103746..f42fb5276b0003 100644 --- a/types/node/stream/iter.d.ts +++ b/types/node/stream/iter.d.ts @@ -45,14 +45,14 @@ declare module "node:stream/iter" { [shareSyncProtocol](options: ShareSyncOptions): SyncShare; } // IDL dictionaries, enums, typedefs - type BackpressurePolicy = "strict" | "block" | "drop-oldest" | "drop-newest"; + type BackpressurePolicy = "strict" | "unbounded" | "drop-oldest" | "drop-newest"; type ByteReadableStream = AsyncIterable; type SyncByteReadableStream = Iterable; interface WriteOptions { signal?: AbortSignal; } interface PushStreamOptions { - highWaterMark?: number; + budget?: number; backpressure?: BackpressurePolicy; signal?: AbortSignal; } @@ -85,21 +85,21 @@ declare module "node:stream/iter" { signal?: AbortSignal; } interface BroadcastOptions { - highWaterMark?: number; + budget?: number; backpressure?: BackpressurePolicy; signal?: AbortSignal; } interface ShareOptions { - highWaterMark?: number; + budget?: number; backpressure?: BackpressurePolicy; signal?: AbortSignal; } interface ShareSyncOptions { - highWaterMark?: number; + budget?: number; backpressure?: BackpressurePolicy; } interface DuplexDirectionOptions { - highWaterMark?: number; + budget?: number; backpressure?: BackpressurePolicy; } interface DuplexOptions { @@ -142,7 +142,7 @@ declare module "node:stream/iter" { broadcast: Broadcast; } interface Writer extends Disposable, AsyncDisposable { - readonly desiredSize: number | null; + readonly canWrite: boolean | null; write(chunk: Uint8Array | string, options?: WriteOptions): Promise; writev(chunks: Array, options?: WriteOptions): Promise; writeSync(chunk: Uint8Array | string): boolean; @@ -155,7 +155,7 @@ declare module "node:stream/iter" { write(chunk: Uint8Array | string, options?: WriteOptions): Promise; } interface SyncWriter extends Disposable { - readonly desiredSize: number | null; + readonly canWrite: boolean | null; writeSync(chunk: Uint8Array | string): number; writevSync(chunks: Array): number; endSync(): number; @@ -166,19 +166,16 @@ declare module "node:stream/iter" { } interface Broadcast extends Disposable { readonly consumerCount: number; - readonly bufferSize: number; push(...args: any[]): ByteReadableStream; cancel(reason?: any): void; } interface Share extends Disposable { readonly consumerCount: number; - readonly bufferSize: number; pull(...args: any[]): ByteReadableStream; cancel(reason?: any): void; } interface SyncShare extends Disposable { readonly consumerCount: number; - readonly bufferSize: number; pull(...args: any): SyncByteReadableStream; cancel(reason?: any): void; } @@ -329,7 +326,7 @@ declare module "node:stream/iter" { * }); * * await pipeTo(from('hello world'), - * fromWritable(writable, { backpressure: 'block' })); + * fromWritable(writable, { backpressure: 'unbounded' })); * ``` * @since v26.1.0 * @experimental diff --git a/types/node/test.d.ts b/types/node/test.d.ts index 585cca25780aa5..22acc430b6a6c7 100644 --- a/types/node/test.d.ts +++ b/types/node/test.d.ts @@ -375,6 +375,7 @@ declare module "node:test" { "test:enqueue": [data: EventData.TestEnqueue]; "test:fail": [data: EventData.TestFail]; "test:interrupted": [data: EventData.TestInterrupted]; + "test:log": [data: EventData.TestLog]; "test:pass": [data: EventData.TestPass]; "test:plan": [data: EventData.TestPlan]; "test:start": [data: EventData.TestStart]; @@ -455,6 +456,13 @@ declare module "node:test" { * `undefined` if the test was run through the REPL. */ column?: number; + /** + * The path of the test file that was + * executed as the entry point of the child process that emitted this event. + * Only present when tests run with process isolation. May differ from + * `file` when the test is defined in a module imported by the entry file. + */ + entryFile?: string; /** * The path of the test file, `undefined` if test was run through the REPL. */ @@ -845,6 +853,36 @@ declare module "node:test" { */ tests: TestStart[]; } + interface TestLog extends LocationInfo { + /** + * The structured payload passed to `context.log`, or + * `undefined` if none was provided. The test runner does not interpret this + * value. + */ + data: unknown; + /** + * The log message. + */ + message: string; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The `testId` of the enclosing test, or + * `undefined` for top-level tests. + */ + parentId: number | undefined; + /** + * A numeric identifier for the test instance that emitted + * the log message. + */ + testId: number; + } interface TestPass extends LocationInfo { /** * Additional execution metadata. @@ -1130,6 +1168,25 @@ declare module "node:test" { * @param message Message to be reported. */ diagnostic(message: string): void; + /** + * This function is used to write a log message to the output. Unlike + * `context.diagnostic`, the resulting `'test:log'` event is emitted + * immediately, in the order that the tests execute, rather than being buffered + * until the test reports its results. This function does not return a value. + * + * ```js + * test('top level test', (t) => { + * t.log('fetched user', { userId: 42 }); + * t.log('retrying flaky endpoint', { attempt: 3 }); + * }); + * ``` + * @since v26.6.0 + * @param message Message to be reported. + * @param data Optional structured payload attached to the message. The test + * runner passes it through untouched. When tests run with process isolation, + * 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). + */ + log(message: string, data?: unknown): void; /** * The absolute path of the test file that created the current test. If a test file imports * 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" { * @param message A diagnostic message to output. */ diagnostic(message: string): void; + /** + * Write a log message to the output. The resulting `'test:log'` event is + * emitted immediately, in the order that the tests execute. + * + * ```js + * test.describe('my suite', (suite) => { + * suite.log('Suite log message'); + * }); + * ``` + * @since v26.6.0 + * @param message Message to be reported. + * @param data Optional structured payload attached to the message. The test + * runner passes it through untouched. + */ + log(message: string, data?: unknown): void; } interface TestOptions { /** diff --git a/types/node/test/reporters.d.ts b/types/node/test/reporters.d.ts index c93f4c0076ef61..36ca28fc8dc1da 100644 --- a/types/node/test/reporters.d.ts +++ b/types/node/test/reporters.d.ts @@ -9,6 +9,7 @@ declare module "node:test/reporters" { | { type: "test:enqueue"; data: EventData.TestEnqueue } | { type: "test:fail"; data: EventData.TestFail } | { type: "test:interrupted"; data: EventData.TestInterrupted } + | { type: "test:log"; data: EventData.TestLog } | { type: "test:pass"; data: EventData.TestPass } | { type: "test:plan"; data: EventData.TestPlan } | { type: "test:start"; data: EventData.TestStart } diff --git a/types/node/tls.d.ts b/types/node/tls.d.ts index 5127ecb81f380e..773a69f0352e1b 100644 --- a/types/node/tls.d.ts +++ b/types/node/tls.d.ts @@ -219,6 +219,13 @@ declare module "node:tls" { * @since v0.11.4 */ authorized: boolean; + /** + * The negotiated ALPN protocol. This is `null` before the handshake completes. + * Once the handshake completes, it settles as either the negotiated protocol + * name, or `false` if the peers did not negotiate an ALPN protocol. + * @since v6.0.0 + */ + alpnProtocol: string | false | null; /** * Returns the reason why the peer's certificate was not been verified. This * property is set only when `tlsSocket.authorized === false`. @@ -230,16 +237,6 @@ declare module "node:tls" { * @since v0.11.4 */ encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * String containing the server name requested via SNI (Server Name Indication) TLS extension. - */ - servername: string | false | null; /** * Returns an object representing the local certificate. The returned object has * some properties corresponding to the fields of the certificate. @@ -402,6 +399,13 @@ declare module "node:tls" { }, callback: (err: Error | null) => void, ): undefined | boolean; + /** + * The SNI (Server Name Indication) host name associated with the socket. This is + * `null` before the handshake completes. Once the handshake completes it settles + * as either the host name string, or `false` if SNI was not used. + * @since v0.11.3 + */ + servername: string | false | null; /** * The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket. * This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`. diff --git a/types/node/vm.d.ts b/types/node/vm.d.ts index 893547ac0b5527..526c3116054691 100644 --- a/types/node/vm.d.ts +++ b/types/node/vm.d.ts @@ -886,6 +886,7 @@ declare module "node:vm" { * const module = new vm.SourceTextModule( * 'Object.getPrototypeOf(import.meta.prop).secret = secret;', * { + * context: contextifiedObject, * initializeImportMeta(meta) { * // Note: this object is created in the top context. As such, * // Object.getPrototypeOf(import.meta.prop) points to the @@ -904,7 +905,7 @@ declare module "node:vm" { * // To fix this problem, replace * // meta.prop = {}; * // above with - * // meta.prop = vm.runInContext('{}', contextifiedObject); + * // meta.prop = vm.runInContext('({})', contextifiedObject); * ``` * @param code JavaScript Module code to parse */ diff --git a/types/node/worker_threads.d.ts b/types/node/worker_threads.d.ts index f2804eae3dcc37..f7977aedfae47c 100644 --- a/types/node/worker_threads.d.ts +++ b/types/node/worker_threads.d.ts @@ -6,6 +6,7 @@ declare module "node:worker_threads" { NodeEventTarget, } from "node:events"; import { FileHandle } from "node:fs/promises"; + import { Server, Socket } from "node:net"; import { Performance } from "node:perf_hooks"; import { Readable, Writable } from "node:stream"; import { ReadableStream, TransformStream, WritableStream } from "node:stream/web"; @@ -514,7 +515,9 @@ declare module "node:worker_threads" { | FileHandle | ReadableStream | WritableStream - | TransformStream; + | TransformStream + | Server + | Socket; interface LockGrantedCallback { (lock: Lock | null): T; } From 3be8fe6c7e542c2418b600d94cad07fa8cac0b9b Mon Sep 17 00:00:00 2001 From: googlemaps-bot Date: Tue, 15 Sep 2026 10:21:26 -0700 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75549=20chore:?= =?UTF-8?q?=20sync=20updates=20to=20google.maps=20by=20@googlemaps-bot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: copybara-service[bot] --- types/google.maps/google.maps-tests.ts | 2 +- types/google.maps/index.d.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/google.maps/google.maps-tests.ts b/types/google.maps/google.maps-tests.ts index 339e344f1a3b83..2caafec4362c6f 100644 --- a/types/google.maps/google.maps-tests.ts +++ b/types/google.maps/google.maps-tests.ts @@ -1,3 +1,3 @@ // No tests required for generated types -// Synced from: https://github.com/googlemaps/js-types/commit/8ee4ab4f60c853ce1f5d6201e810d16713a3f272 +// Synced from: https://github.com/googlemaps/js-types/commit/9a25dc1828a7b5b07410242445a8bd8332f48a99 google.maps.Map; diff --git a/types/google.maps/index.d.ts b/types/google.maps/index.d.ts index 410607fbba0dcd..898807757368f2 100644 --- a/types/google.maps/index.d.ts +++ b/types/google.maps/index.d.ts @@ -10864,6 +10864,7 @@ declare namespace google.maps.marker { content?: Node | null; /** * Adds the given listener function to the given event name in the Maps Eventing system. + * @deprecated Use the standard DOM addEventListener() method instead. */ addListener(eventName: string, handler: Function): google.maps.MapsEventListener; addEventListener(type: K, listener: (this: AdvancedMarkerElement, ev: AdvancedMarkerElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -10873,6 +10874,9 @@ declare namespace google.maps.marker { } export interface AdvancedMarkerElementEventMap extends HTMLElementEventMap { "gmp-click": google.maps.marker.AdvancedMarkerClickEvent; + "gmp-drag": Event; + "gmp-dragend": Event; + "gmp-dragstart": Event; } /** * Options for constructing an {@link google.maps.marker.AdvancedMarkerElement}. From c55ddfb8bdf892a09475e7f27327c942c1cb16e6 Mon Sep 17 00:00:00 2001 From: Pouya Barrach-Yousefi Date: Tue, 15 Sep 2026 16:23:11 -0400 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75500=20[nodem?= =?UTF-8?q?ailer]=20Add=20href=20to=20regular=20attachments=20by=20@pyouse?= =?UTF-8?q?fi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pouya Barrach-Yousefi <1360670+pyousefi@users.noreply.github.com> --- types/nodemailer/lib/mailer/index.d.ts | 6 ++---- types/nodemailer/nodemailer-tests.ts | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/types/nodemailer/lib/mailer/index.d.ts b/types/nodemailer/lib/mailer/index.d.ts index 0023b47f0c753f..1ba47e52a596b0 100644 --- a/types/nodemailer/lib/mailer/index.d.ts +++ b/types/nodemailer/lib/mailer/index.d.ts @@ -40,6 +40,8 @@ declare namespace Mail { content?: string | Buffer | Readable | undefined; /** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */ path?: string | Url | undefined; + /** URL to stream the attachment from instead of including it */ + href?: string | undefined; } interface Attachment extends AttachmentLike { @@ -62,8 +64,6 @@ declare namespace Mail { } interface AmpAttachment extends AttachmentLike { - /** is an alternative for content to load the AMP4EMAIL data from an URL */ - href?: string | undefined; /** defines optional content encoding, eg. ‘base64’ or ‘hex’. This only applies if the content is a string. By default an unicode string is assumed. */ encoding?: string | undefined; /** optional content type for the attachment, if not set will be derived from the filename property */ @@ -77,8 +77,6 @@ declare namespace Mail { method?: string | undefined; /** optional filename, defaults to ‘invite.ics’ */ filename?: string | false | undefined; - /** is an alternative for content to load the calendar data from an URL */ - href?: string | undefined; /** defines optional content encoding, eg. ‘base64’ or ‘hex’. This only applies if the content is a string. By default an unicode string is assumed. */ encoding?: string | undefined; } diff --git a/types/nodemailer/nodemailer-tests.ts b/types/nodemailer/nodemailer-tests.ts index 5c706297c791de..af0940bc418b01 100644 --- a/types/nodemailer/nodemailer-tests.ts +++ b/types/nodemailer/nodemailer-tests.ts @@ -213,6 +213,11 @@ function message_attachments_test() { filename: "license.txt", path: "https://raw.github.com/nodemailer/nodemailer/master/LICENSE", }, + { + // use href as an attachment URL + filename: "license.txt", + href: "https://raw.github.com/nodemailer/nodemailer/master/LICENSE", + }, { // encoded string as an attachment filename: "text1.txt", From e839b8f8a9c481a77c4b1df5d02c39853d1f62bf Mon Sep 17 00:00:00 2001 From: Christopher Buss Date: Tue, 15 Sep 2026 13:28:33 -0700 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75525=20[node]?= =?UTF-8?q?=20Inherit=20CommonOptions=20in=20ForkOptions=20to=20support=20?= =?UTF-8?q?windowsHide=20by=20@christopher-buss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Codex --- types/node/child_process.d.ts | 2 +- types/node/node-tests/child_process.ts | 3 +++ types/node/v22/child_process.d.ts | 2 +- types/node/v22/test/child_process.ts | 3 +++ types/node/v24/child_process.d.ts | 2 +- types/node/v24/test/child_process.ts | 3 +++ types/node/v25/child_process.d.ts | 2 +- types/node/v25/node-tests/child_process.ts | 3 +++ 8 files changed, 16 insertions(+), 4 deletions(-) diff --git a/types/node/child_process.d.ts b/types/node/child_process.d.ts index 11d4783dc1cd60..f89e415241dc5d 100644 --- a/types/node/child_process.d.ts +++ b/types/node/child_process.d.ts @@ -1136,7 +1136,7 @@ declare module "node:child_process" { stderr: string | NonSharedBuffer; }>; } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + interface ForkOptions extends CommonOptions, MessagingOptions, Abortable { execPath?: string | undefined; execArgv?: string[] | undefined; silent?: boolean | undefined; diff --git a/types/node/node-tests/child_process.ts b/types/node/node-tests/child_process.ts index 9e9fede65b9610..58f929b61e1670 100644 --- a/types/node/node-tests/child_process.ts +++ b/types/node/node-tests/child_process.ts @@ -494,6 +494,7 @@ import { promisify } from "node:util"; { const forked = childProcess.fork("./", ["asd"] as readonly string[], { + windowsHide: true, windowsVerbatimArguments: true, silent: false, stdio: "inherit", @@ -526,6 +527,8 @@ import { promisify } from "node:util"; { const forked = childProcess.fork("./", { + windowsHide: true, + timeout: 123, windowsVerbatimArguments: true, silent: false, stdio: ["inherit"], diff --git a/types/node/v22/child_process.d.ts b/types/node/v22/child_process.d.ts index 313c33c4ecd402..e4701134aa50ca 100644 --- a/types/node/v22/child_process.d.ts +++ b/types/node/v22/child_process.d.ts @@ -1253,7 +1253,7 @@ declare module "child_process" { stderr: string | NonSharedBuffer; }>; } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + interface ForkOptions extends CommonOptions, MessagingOptions, Abortable { execPath?: string | undefined; execArgv?: string[] | undefined; silent?: boolean | undefined; diff --git a/types/node/v22/test/child_process.ts b/types/node/v22/test/child_process.ts index 1f83f8b31e402f..3bf26102748d46 100644 --- a/types/node/v22/test/child_process.ts +++ b/types/node/v22/test/child_process.ts @@ -494,6 +494,7 @@ import { promisify } from "node:util"; { const forked = childProcess.fork("./", ["asd"] as readonly string[], { + windowsHide: true, windowsVerbatimArguments: true, silent: false, stdio: "inherit", @@ -526,6 +527,8 @@ import { promisify } from "node:util"; { const forked = childProcess.fork("./", { + windowsHide: true, + timeout: 123, windowsVerbatimArguments: true, silent: false, stdio: ["inherit"], diff --git a/types/node/v24/child_process.d.ts b/types/node/v24/child_process.d.ts index e680bf29dd33de..51cb12e8dfeb9b 100644 --- a/types/node/v24/child_process.d.ts +++ b/types/node/v24/child_process.d.ts @@ -1253,7 +1253,7 @@ declare module "child_process" { stderr: string | NonSharedBuffer; }>; } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + interface ForkOptions extends CommonOptions, MessagingOptions, Abortable { execPath?: string | undefined; execArgv?: string[] | undefined; silent?: boolean | undefined; diff --git a/types/node/v24/test/child_process.ts b/types/node/v24/test/child_process.ts index 1f83f8b31e402f..3bf26102748d46 100644 --- a/types/node/v24/test/child_process.ts +++ b/types/node/v24/test/child_process.ts @@ -494,6 +494,7 @@ import { promisify } from "node:util"; { const forked = childProcess.fork("./", ["asd"] as readonly string[], { + windowsHide: true, windowsVerbatimArguments: true, silent: false, stdio: "inherit", @@ -526,6 +527,8 @@ import { promisify } from "node:util"; { const forked = childProcess.fork("./", { + windowsHide: true, + timeout: 123, windowsVerbatimArguments: true, silent: false, stdio: ["inherit"], diff --git a/types/node/v25/child_process.d.ts b/types/node/v25/child_process.d.ts index e3964ab96fba03..016b5608dab7e6 100644 --- a/types/node/v25/child_process.d.ts +++ b/types/node/v25/child_process.d.ts @@ -1143,7 +1143,7 @@ declare module "node:child_process" { stderr: string | NonSharedBuffer; }>; } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + interface ForkOptions extends CommonOptions, MessagingOptions, Abortable { execPath?: string | undefined; execArgv?: string[] | undefined; silent?: boolean | undefined; diff --git a/types/node/v25/node-tests/child_process.ts b/types/node/v25/node-tests/child_process.ts index 3808b217342e11..93e634531f7bc6 100644 --- a/types/node/v25/node-tests/child_process.ts +++ b/types/node/v25/node-tests/child_process.ts @@ -494,6 +494,7 @@ import { promisify } from "node:util"; { const forked = childProcess.fork("./", ["asd"] as readonly string[], { + windowsHide: true, windowsVerbatimArguments: true, silent: false, stdio: "inherit", @@ -526,6 +527,8 @@ import { promisify } from "node:util"; { const forked = childProcess.fork("./", { + windowsHide: true, + timeout: 123, windowsVerbatimArguments: true, silent: false, stdio: ["inherit"], From 5c19f1140f857b38e8bb29d344f983749677994c Mon Sep 17 00:00:00 2001 From: Erwan Jugand <47392755+erwanjugand@users.noreply.github.com> Date: Tue, 15 Sep 2026 22:29:18 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75514=20[chrom?= =?UTF-8?q?e]=20fix=20chrome.audio=20namespace=20by=20@erwanjugand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 22 ++++++++++++++-------- types/chrome/test/index.ts | 29 ++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index c25643a039a93e..9dc887014a66c0 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -525,7 +525,7 @@ declare namespace chrome { /** Device name */ deviceName: string; /** Type of the device */ - deviceType: DeviceType; + deviceType: `${DeviceType}`; /** The user-friendly name (e.g. "USB Microphone"). */ displayName: string; /** The unique identifier of the audio device. */ @@ -537,14 +537,14 @@ declare namespace chrome { /** The stable/persisted device id string when available. */ stableDeviceId?: string; /** Stream type associated with this device. */ - streamType: StreamType; + streamType: `${StreamType}`; } interface DeviceFilter { /** If set, only audio devices whose active state matches this value will satisfy the filter. */ isActive?: boolean; /** If set, only audio devices whose stream type is included in this list will satisfy the filter. */ - streamTypes?: StreamType[]; + streamTypes?: `${StreamType}`[]; } interface DeviceIdLists { @@ -600,7 +600,7 @@ declare namespace chrome { /** Whether or not the stream is now muted. */ isMuted: boolean; /** The type of the stream for which the mute value changed. The updated mute value applies to all devices with this stream type. */ - streamType: StreamType; + streamType: `${StreamType}`; } /** Type of stream an audio device provides. */ @@ -611,14 +611,17 @@ declare namespace chrome { /** * Gets a list of audio devices filtered based on filter. + * @param filter Device properties by which to filter the list of returned audio devices. If the filter is not set or set to `{}`, returned device list will contain all available audio devices. + * * Can return its result via Promise in Manifest V3 or later since Chrome 116. */ function getDevices(filter?: DeviceFilter): Promise; - function getDevices(filter: DeviceFilter, callback: (devices: AudioDeviceInfo[]) => void): void; function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void; + function getDevices(filter: DeviceFilter | undefined, callback: (devices: AudioDeviceInfo[]) => void): void; /** * Gets the system-wide mute state for the specified stream type. + * * Can return its result via Promise in Manifest V3 or later since Chrome 116. */ function getMute(streamType: `${StreamType}`): Promise; @@ -626,6 +629,7 @@ declare namespace chrome { /** * Sets lists of active input and/or output devices. + * * Can return its result via Promise in Manifest V3 or later since Chrome 116. */ function setActiveDevices(ids: DeviceIdLists): Promise; @@ -633,6 +637,7 @@ declare namespace chrome { /** * Sets mute state for a stream type. The mute state will apply to all audio devices with the specified audio stream type. + * * Can return its result via Promise in Manifest V3 or later since Chrome 116. */ function setMute(streamType: `${StreamType}`, isMuted: boolean): Promise; @@ -640,6 +645,7 @@ declare namespace chrome { /** * Sets the properties for the input or output device. + * * Can return its result via Promise in Manifest V3 or later since Chrome 116. */ function setProperties(id: string, properties: DeviceProperties): Promise; @@ -648,18 +654,18 @@ declare namespace chrome { /** * Fired when audio devices change, either new devices being added, or existing devices being removed. */ - const onDeviceListChanged: chrome.events.Event<(devices: AudioDeviceInfo[]) => void>; + const onDeviceListChanged: events.Event<(devices: AudioDeviceInfo[]) => void>; /** * Fired when sound level changes for an active audio device. */ - const onLevelChanged: chrome.events.Event<(event: LevelChangedEvent) => void>; + const onLevelChanged: events.Event<(event: LevelChangedEvent) => void>; /** * Fired when the mute state of the audio input or output changes. * Note that mute state is system-wide and the new value applies to every audio device with specified stream type. */ - const onMuteChanged: chrome.events.Event<(event: MuteChangedEvent) => void>; + const onMuteChanged: events.Event<(event: MuteChangedEvent) => void>; } //////////////////// diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index c4110c6f8783b5..c1c44c6600ccab 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -2849,30 +2849,45 @@ function testAudio() { chrome.audio.StreamType.INPUT === "INPUT"; chrome.audio.StreamType.OUTPUT === "OUTPUT"; + const filter: chrome.audio.DeviceFilter = { + isActive: true, + streamTypes: ["INPUT", "OUTPUT"], + }; + chrome.audio.getDevices(); // $ExpectType Promise - chrome.audio.getDevices({}); // $ExpectType Promise - chrome.audio.getDevices(devices => {}); // $ExpectType void - chrome.audio.getDevices({}, devices => {}); // $ExpectType void + chrome.audio.getDevices(undefined); // $ExpectType Promise + chrome.audio.getDevices(filter); // $ExpectType Promise + chrome.audio.getDevices(devices => { // $ExpectType void + devices; // $ExpectType AudioDeviceInfo[] + }); + chrome.audio.getDevices(undefined, devices => { // $ExpectType void + devices; // $ExpectType AudioDeviceInfo[] + }); + chrome.audio.getDevices(filter, devices => { // $ExpectType void + devices; // $ExpectType AudioDeviceInfo[] + }); // @ts-expect-error chrome.audio.getDevices(() => {}).then(devices => {}); chrome.audio.getMute("INPUT"); // $ExpectType Promise - chrome.audio.getMute("INPUT", value => {}); // $ExpectType void + chrome.audio.getMute("INPUT", value => { // $ExpectType void + value; // $ExpectType boolean + }); // @ts-expect-error chrome.audio.getMute("INPUT", value => {}).then(value => {}); chrome.audio.setActiveDevices({}); // $ExpectType Promise - chrome.audio.setActiveDevices({}, () => {}); // $ExpectType void + chrome.audio.setActiveDevices({}, () => void 0); // $ExpectType void // @ts-expect-error chrome.audio.setActiveDevices(() => {}).then(() => {}); chrome.audio.setMute("INPUT", true); // $ExpectType Promise - chrome.audio.setMute("INPUT", true, () => {}); // $ExpectType void + chrome.audio.setMute("INPUT", true, () => void 0); // $ExpectType void // @ts-expect-error chrome.audio.setMute("INPUT", true, () => {}).then(() => {}); chrome.audio.setProperties("INPUT", {}); // $ExpectType Promise - chrome.audio.setProperties("INPUT", {}, () => {}); // $ExpectType void + chrome.audio.setProperties("INPUT", {}, () => void 0); // $ExpectType void // @ts-expect-error chrome.audio.setProperties("INPUT", {}, () => {}).then(() => {}); From 092f2b096fbbff055da5d5d25b6cfc35da132c8e Mon Sep 17 00:00:00 2001 From: Douglas Parker Date: Tue, 15 Sep 2026 13:31:52 -0700 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75475=20chrome?= =?UTF-8?q?:=20Add=20global=20`browser`=20alias=20by=20@dgp1130?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 12 ++++++++++++ types/chrome/package.json | 2 +- types/chrome/test/index.ts | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 9dc887014a66c0..45df28374bd964 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -11,8 +11,20 @@ type SetPartial = Omit & Partial>; //////////////////// interface Window { chrome: typeof chrome; + + /** + * Cross-browser alias of {@link chrome}. + * @since Chrome 148 (Chrome 152 for extensions declaring a `devtools_page` in manifest) + */ + browser: typeof chrome; } +/** + * Cross-browser alias of {@link chrome}. + * @since Chrome 148 (Chrome 152 for extensions declaring a `devtools_page` in manifest) + */ +declare var browser: typeof chrome; + declare namespace chrome { //////////////////// // Accessibility Features diff --git a/types/chrome/package.json b/types/chrome/package.json index 2c05ee5201a263..a9e5a5109b9a2e 100644 --- a/types/chrome/package.json +++ b/types/chrome/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/chrome", - "version": "0.2.9999", + "version": "0.3.9999", "nonNpm": "conflict", "nonNpmDescription": "The complete reference to all APIs made available to Chrome Extensions", "projects": [ diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index c1c44c6600ccab..3b1ca2fb7a9556 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -8493,3 +8493,12 @@ function testWallpaper() { // @ts-expect-error chrome.wallpaper.setWallpaper(details, () => {}).then(() => {}); } + +async function testBrowser() { + const _b: typeof browser = chrome; + const _c: typeof chrome = browser; + + browser.tabs.create({ url: "https://example.test" }); // $ExpectType Promise + window.browser.tabs.create({ url: "https://example.test" }); // $ExpectType Promise + globalThis.browser.tabs.create({ url: "https://example.test" }); // $ExpectType Promise +}