From d92d5ae31c0a421e700c76e1fa0a8ecff2e391db Mon Sep 17 00:00:00 2001 From: Yukihiro Hasegawa <49516827+y-hsgw@users.noreply.github.com> Date: Thu, 18 Sep 2025 08:46:10 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73662=20node/w?= =?UTF-8?q?orker=5Fthreads:=20update=20argument=20types=20for=20BroadcastC?= =?UTF-8?q?hannel=20onmessage=20and=20onmessageerror=20by=20@y-hsgw?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/node/test/worker_threads.ts | 8 ++++++-- types/node/v18/test/worker_threads.ts | 8 ++++++-- types/node/v18/worker_threads.d.ts | 7 ++++--- types/node/v20/test/worker_threads.ts | 8 ++++++-- types/node/v20/worker_threads.d.ts | 7 ++++--- types/node/v22/test/worker_threads.ts | 8 ++++++-- types/node/v22/worker_threads.d.ts | 7 ++++--- types/node/worker_threads.d.ts | 7 ++++--- 8 files changed, 40 insertions(+), 20 deletions(-) diff --git a/types/node/test/worker_threads.ts b/types/node/test/worker_threads.ts index 94cf1df5202094e..60982438f7b5260 100644 --- a/types/node/test/worker_threads.ts +++ b/types/node/test/worker_threads.ts @@ -144,8 +144,12 @@ import { createContext } from "node:vm"; bc.close(); bc.ref(); bc.unref(); - bc.onmessage = (msg: unknown) => {}; - bc.onmessageerror = (msg: unknown) => {}; + bc.onmessage = (msg) => { + msg; // $ExpectType MessageEvent + }; + bc.onmessageerror = (msg) => { + msg; // $ExpectType MessageEvent + }; // Test global alias const bc2 = new BroadcastChannel("test"); diff --git a/types/node/v18/test/worker_threads.ts b/types/node/v18/test/worker_threads.ts index 31d2b08702443b8..11a3c35e81d5242 100644 --- a/types/node/v18/test/worker_threads.ts +++ b/types/node/v18/test/worker_threads.ts @@ -128,8 +128,12 @@ import { createContext } from "node:vm"; bc.close(); bc.ref(); bc.unref(); - bc.onmessage = (msg: unknown) => {}; - bc.onmessageerror = (msg: unknown) => {}; + bc.onmessage = (msg) => { + msg; // $ExpectType MessageEvent + }; + bc.onmessageerror = (msg) => { + msg; // $ExpectType MessageEvent + }; // Test global alias const bc2 = new BroadcastChannel("test"); diff --git a/types/node/v18/worker_threads.d.ts b/types/node/v18/worker_threads.d.ts index 484f457fb6fc723..de5244216cacb21 100644 --- a/types/node/v18/worker_threads.d.ts +++ b/types/node/v18/worker_threads.d.ts @@ -59,6 +59,7 @@ declare module "worker_threads" { import { Readable, Writable } from "node:stream"; import { ReadableStream, TransformStream, WritableStream } from "node:stream/web"; import { URL } from "node:url"; + import { MessageEvent } from "undici-types"; const isMainThread: boolean; const parentPort: null | MessagePort; const resourceLimits: ResourceLimits; @@ -525,18 +526,18 @@ declare module "worker_threads" { * ``` * @since v15.4.0 */ - class BroadcastChannel { + class BroadcastChannel extends EventTarget { readonly name: string; /** * Invoked with a single \`MessageEvent\` argument when a message is received. * @since v15.4.0 */ - onmessage: (message: unknown) => void; + onmessage: (message: MessageEvent) => void; /** * Invoked with a received message cannot be deserialized. * @since v15.4.0 */ - onmessageerror: (message: unknown) => void; + onmessageerror: (message: MessageEvent) => void; constructor(name: string); /** * Closes the `BroadcastChannel` connection. diff --git a/types/node/v20/test/worker_threads.ts b/types/node/v20/test/worker_threads.ts index aeaac9f9e56293a..9e67d8baf97cbd1 100644 --- a/types/node/v20/test/worker_threads.ts +++ b/types/node/v20/test/worker_threads.ts @@ -128,8 +128,12 @@ import { createContext } from "node:vm"; bc.close(); bc.ref(); bc.unref(); - bc.onmessage = (msg: unknown) => {}; - bc.onmessageerror = (msg: unknown) => {}; + bc.onmessage = (msg) => { + msg; // $ExpectType MessageEvent + }; + bc.onmessageerror = (msg) => { + msg; // $ExpectType MessageEvent + }; // Test global alias const bc2 = new BroadcastChannel("test"); diff --git a/types/node/v20/worker_threads.d.ts b/types/node/v20/worker_threads.d.ts index 89603a84c9166b9..a580d08243a90f2 100644 --- a/types/node/v20/worker_threads.d.ts +++ b/types/node/v20/worker_threads.d.ts @@ -59,6 +59,7 @@ declare module "worker_threads" { import { Readable, Writable } from "node:stream"; import { ReadableStream, TransformStream, WritableStream } from "node:stream/web"; import { URL } from "node:url"; + import { MessageEvent } from "undici-types"; const isMainThread: boolean; const parentPort: null | MessagePort; const resourceLimits: ResourceLimits; @@ -544,18 +545,18 @@ declare module "worker_threads" { * ``` * @since v15.4.0 */ - class BroadcastChannel { + class BroadcastChannel extends EventTarget { readonly name: string; /** * Invoked with a single \`MessageEvent\` argument when a message is received. * @since v15.4.0 */ - onmessage: (message: unknown) => void; + onmessage: (message: MessageEvent) => void; /** * Invoked with a received message cannot be deserialized. * @since v15.4.0 */ - onmessageerror: (message: unknown) => void; + onmessageerror: (message: MessageEvent) => void; constructor(name: string); /** * Closes the `BroadcastChannel` connection. diff --git a/types/node/v22/test/worker_threads.ts b/types/node/v22/test/worker_threads.ts index 38c7648f246e01f..b666a7465ab4f40 100644 --- a/types/node/v22/test/worker_threads.ts +++ b/types/node/v22/test/worker_threads.ts @@ -144,8 +144,12 @@ import { createContext } from "node:vm"; bc.close(); bc.ref(); bc.unref(); - bc.onmessage = (msg: unknown) => {}; - bc.onmessageerror = (msg: unknown) => {}; + bc.onmessage = (msg) => { + msg; // $ExpectType MessageEvent + }; + bc.onmessageerror = (msg) => { + msg; // $ExpectType MessageEvent + }; // Test global alias const bc2 = new BroadcastChannel("test"); diff --git a/types/node/v22/worker_threads.d.ts b/types/node/v22/worker_threads.d.ts index d48fbabf4d3c53e..75f64ce2a9cd26a 100644 --- a/types/node/v22/worker_threads.d.ts +++ b/types/node/v22/worker_threads.d.ts @@ -63,6 +63,7 @@ declare module "worker_threads" { import { ReadableStream, TransformStream, WritableStream } from "node:stream/web"; import { URL } from "node:url"; import { HeapInfo } from "node:v8"; + import { MessageEvent } from "undici-types"; const isInternalThread: boolean; const isMainThread: boolean; const parentPort: null | MessagePort; @@ -573,18 +574,18 @@ declare module "worker_threads" { * ``` * @since v15.4.0 */ - class BroadcastChannel { + class BroadcastChannel extends EventTarget { readonly name: string; /** * Invoked with a single \`MessageEvent\` argument when a message is received. * @since v15.4.0 */ - onmessage: (message: unknown) => void; + onmessage: (message: MessageEvent) => void; /** * Invoked with a received message cannot be deserialized. * @since v15.4.0 */ - onmessageerror: (message: unknown) => void; + onmessageerror: (message: MessageEvent) => void; constructor(name: string); /** * Closes the `BroadcastChannel` connection. diff --git a/types/node/worker_threads.d.ts b/types/node/worker_threads.d.ts index c0acdefb81da433..73446b174cb23c9 100644 --- a/types/node/worker_threads.d.ts +++ b/types/node/worker_threads.d.ts @@ -63,6 +63,7 @@ declare module "worker_threads" { import { ReadableStream, TransformStream, WritableStream } from "node:stream/web"; import { URL } from "node:url"; import { HeapInfo } from "node:v8"; + import { MessageEvent } from "undici-types"; const isInternalThread: boolean; const isMainThread: boolean; const parentPort: null | MessagePort; @@ -574,18 +575,18 @@ declare module "worker_threads" { * ``` * @since v15.4.0 */ - class BroadcastChannel { + class BroadcastChannel extends EventTarget { readonly name: string; /** * Invoked with a single \`MessageEvent\` argument when a message is received. * @since v15.4.0 */ - onmessage: (message: unknown) => void; + onmessage: (message: MessageEvent) => void; /** * Invoked with a received message cannot be deserialized. * @since v15.4.0 */ - onmessageerror: (message: unknown) => void; + onmessageerror: (message: MessageEvent) => void; constructor(name: string); /** * Closes the `BroadcastChannel` connection. From b6689380c5719ec5ad1ea15108fea661d7f300ca Mon Sep 17 00:00:00 2001 From: Alison McKay Date: Wed, 17 Sep 2025 17:14:29 -0700 Subject: [PATCH 2/2] [office-js] [office-js-preview] (Excel) Remove unnecessary API set tags (#73692) --- types/office-js-preview/index.d.ts | 18 ------------------ types/office-js/index.d.ts | 3 --- 2 files changed, 21 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 540e3c45a6cbbdb..9a009605579bfa5 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -55823,9 +55823,6 @@ declare namespace Excel { * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. - * - * @remarks - * [Api set: ExcelApi 1.20] */ load(propertyNamesAndPaths?: { select?: string; @@ -55935,9 +55932,6 @@ declare namespace Excel { * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. - * - * @remarks - * [Api set: ExcelApi 1.20] */ load(propertyNamesAndPaths?: { select?: string; @@ -56024,9 +56018,6 @@ declare namespace Excel { * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. - * - * @remarks - * [Api set: ExcelApi 1.20] */ load(propertyNamesAndPaths?: { select?: string; @@ -56085,9 +56076,6 @@ declare namespace Excel { * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. - * - * @remarks - * [Api set: ExcelApi 1.20] */ load(propertyNamesAndPaths?: { select?: string; @@ -56153,9 +56141,6 @@ declare namespace Excel { * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. - * - * @remarks - * [Api set: ExcelApi 1.20] */ load(propertyNamesAndPaths?: { select?: string; @@ -56292,9 +56277,6 @@ declare namespace Excel { * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. - * - * @remarks - * [Api set: ExcelApi 1.20] */ load(propertyNamesAndPaths?: { select?: string; diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 6aeb8217d81162e..98d8f3fbd8c6ee5 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -51834,9 +51834,6 @@ declare namespace Excel { * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load. - * - * @remarks - * [Api set: ExcelApi 1.20] */ load(propertyNamesAndPaths?: { select?: string;