diff --git a/types/dom-chromium-ai/dom-chromium-ai-tests.ts b/types/dom-chromium-ai/dom-chromium-ai-tests.ts index 7f37fa7943265a..de971628a92741 100644 --- a/types/dom-chromium-ai/dom-chromium-ai-tests.ts +++ b/types/dom-chromium-ai/dom-chromium-ai-tests.ts @@ -186,6 +186,7 @@ async function topLevel() { expectedInputLanguages: ["en"], expectedContextLanguages: ["en"], outputLanguage: "en", + preference: "auto", sharedContext: "foo", signal: (new AbortController()).signal, monitor(m: CreateMonitor) { diff --git a/types/dom-chromium-ai/index.d.ts b/types/dom-chromium-ai/index.d.ts index 076843f6142dc6..511cfe22f4318c 100644 --- a/types/dom-chromium-ai/index.d.ts +++ b/types/dom-chromium-ai/index.d.ts @@ -204,6 +204,8 @@ type LanguageModelMessageValue = ImageBitmapSource | AudioBuffer | BufferSource // Writing Assistance APIs // https://webmachinelearning.github.io/writing-assistance-apis/#idl-index +type PerformancePreference = "auto" | "speed" | "capability"; + declare abstract class Summarizer implements DestroyableModel { static create(options?: SummarizerCreateOptions): Promise; static availability(options?: SummarizerCreateCoreOptions): Promise; @@ -231,6 +233,7 @@ interface SummarizerCreateCoreOptions { type?: SummarizerType; format?: SummarizerFormat; length?: SummarizerLength; + preference?: PerformancePreference; expectedInputLanguages?: ReadonlyArray; expectedContextLanguages?: ReadonlyArray; diff --git a/types/w3c-web-hid/index.d.ts b/types/w3c-web-hid/index.d.ts index 3ff5cdae34bab5..d127425baf4dee 100644 --- a/types/w3c-web-hid/index.d.ts +++ b/types/w3c-web-hid/index.d.ts @@ -23,7 +23,7 @@ declare class HID extends EventTarget { addEventListener( type: "connect" | "disconnect", listener: (this: this, ev: HIDConnectionEvent) => any, - useCapture?: boolean, + options?: boolean | AddEventListenerOptions, ): void; addEventListener( type: string, @@ -34,7 +34,7 @@ declare class HID extends EventTarget { removeEventListener( type: "connect" | "disconnect", callback: (this: this, ev: HIDConnectionEvent) => any, - useCapture?: boolean, + options?: boolean | AddEventListenerOptions, ): void; removeEventListener( type: string, @@ -156,14 +156,22 @@ declare class HIDDevice extends EventTarget { receiveFeatureReport(reportId: number): Promise; - addEventListener(type: "inputreport", listener: (this: this, ev: HIDInputReportEvent) => any): void; + addEventListener( + type: "inputreport", + listener: (this: this, ev: HIDInputReportEvent) => any, + options?: boolean | AddEventListenerOptions, + ): void; addEventListener( type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions, ): void; - removeEventListener(type: "inputreport", callback: (this: this, ev: HIDInputReportEvent) => any): void; + removeEventListener( + type: "inputreport", + callback: (this: this, ev: HIDInputReportEvent) => any, + options?: boolean | AddEventListenerOptions, + ): void; removeEventListener( type: string, callback: EventListenerOrEventListenerObject | null, diff --git a/types/w3c-web-hid/w3c-web-hid-tests.ts b/types/w3c-web-hid/w3c-web-hid-tests.ts index 7a329793929c9e..e005b45d686dea 100644 --- a/types/w3c-web-hid/w3c-web-hid-tests.ts +++ b/types/w3c-web-hid/w3c-web-hid-tests.ts @@ -14,7 +14,7 @@ async function example_1() { navigator.hid.addEventListener("connect", ({ device }) => { console.log(`HID connected: ${device.productName}`); - }); + }, { signal: AbortSignal.timeout(1000) }); navigator.hid.addEventListener("disconnect", ({ device }) => { console.log(`HID disconnected: ${device.productName}`);