Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions types/dom-chromium-ai/dom-chromium-ai-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ async function topLevel() {
expectedInputLanguages: ["en"],
expectedContextLanguages: ["en"],
outputLanguage: "en",
preference: "auto",
sharedContext: "foo",
signal: (new AbortController()).signal,
monitor(m: CreateMonitor) {
Expand Down
3 changes: 3 additions & 0 deletions types/dom-chromium-ai/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Summarizer>;
static availability(options?: SummarizerCreateCoreOptions): Promise<Availability>;
Expand Down Expand Up @@ -231,6 +233,7 @@ interface SummarizerCreateCoreOptions {
type?: SummarizerType;
format?: SummarizerFormat;
length?: SummarizerLength;
preference?: PerformancePreference;

expectedInputLanguages?: ReadonlyArray<string>;
expectedContextLanguages?: ReadonlyArray<string>;
Expand Down
16 changes: 12 additions & 4 deletions types/w3c-web-hid/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -156,14 +156,22 @@ declare class HIDDevice extends EventTarget {

receiveFeatureReport(reportId: number): Promise<DataView>;

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,
Expand Down
2 changes: 1 addition & 1 deletion types/w3c-web-hid/w3c-web-hid-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down