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
6 changes: 3 additions & 3 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17222,7 +17222,7 @@ interface GlobalEventHandlersEventMap {
"change": Event;
"click": PointerEvent;
"close": Event;
"command": Event;
"command": CommandEvent;
"compositionend": CompositionEvent;
"compositionstart": CompositionEvent;
"compositionupdate": CompositionEvent;
Expand Down Expand Up @@ -17348,7 +17348,7 @@ interface GlobalEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/command_event) */
oncommand: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncommand: ((this: GlobalEventHandlers, ev: CommandEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) */
Expand Down Expand Up @@ -44734,7 +44734,7 @@ declare var onclick: ((this: Window, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
declare var onclose: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/command_event) */
declare var oncommand: ((this: Window, ev: Event) => any) | null;
declare var oncommand: ((this: Window, ev: CommandEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
declare var oncontextlost: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) */
Expand Down
6 changes: 3 additions & 3 deletions baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17208,7 +17208,7 @@ interface GlobalEventHandlersEventMap {
"change": Event;
"click": PointerEvent;
"close": Event;
"command": Event;
"command": CommandEvent;
"compositionend": CompositionEvent;
"compositionstart": CompositionEvent;
"compositionupdate": CompositionEvent;
Expand Down Expand Up @@ -17334,7 +17334,7 @@ interface GlobalEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/command_event) */
oncommand: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncommand: ((this: GlobalEventHandlers, ev: CommandEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) */
Expand Down Expand Up @@ -44708,7 +44708,7 @@ declare var onclick: ((this: Window, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
declare var onclose: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/command_event) */
declare var oncommand: ((this: Window, ev: Event) => any) | null;
declare var oncommand: ((this: Window, ev: CommandEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
declare var oncontextlost: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) */
Expand Down
6 changes: 3 additions & 3 deletions baselines/ts5.6/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17219,7 +17219,7 @@ interface GlobalEventHandlersEventMap {
"change": Event;
"click": PointerEvent;
"close": Event;
"command": Event;
"command": CommandEvent;
"compositionend": CompositionEvent;
"compositionstart": CompositionEvent;
"compositionupdate": CompositionEvent;
Expand Down Expand Up @@ -17345,7 +17345,7 @@ interface GlobalEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/command_event) */
oncommand: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncommand: ((this: GlobalEventHandlers, ev: CommandEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) */
Expand Down Expand Up @@ -44731,7 +44731,7 @@ declare var onclick: ((this: Window, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
declare var onclose: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/command_event) */
declare var oncommand: ((this: Window, ev: Event) => any) | null;
declare var oncommand: ((this: Window, ev: CommandEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
declare var oncontextlost: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) */
Expand Down
6 changes: 3 additions & 3 deletions baselines/ts5.9/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17219,7 +17219,7 @@ interface GlobalEventHandlersEventMap {
"change": Event;
"click": PointerEvent;
"close": Event;
"command": Event;
"command": CommandEvent;
"compositionend": CompositionEvent;
"compositionstart": CompositionEvent;
"compositionupdate": CompositionEvent;
Expand Down Expand Up @@ -17345,7 +17345,7 @@ interface GlobalEventHandlers {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/command_event) */
oncommand: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncommand: ((this: GlobalEventHandlers, ev: CommandEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) */
Expand Down Expand Up @@ -44731,7 +44731,7 @@ declare var onclick: ((this: Window, ev: PointerEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */
declare var onclose: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/command_event) */
declare var oncommand: ((this: Window, ev: Event) => any) | null;
declare var oncommand: ((this: Window, ev: CommandEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/contextlost_event) */
declare var oncontextlost: ((this: Window, ev: Event) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) */
Expand Down
1 change: 1 addition & 0 deletions inputfiles/patches/events.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface-mixin GlobalEventHandlers {
event beforetoggle type=ToggleEvent
event blur type=FocusEvent
event click type=PointerEvent
event command type=CommandEvent
event compositionend type=CompositionEvent
event compositionstart type=CompositionEvent
event compositionupdate type=CompositionEvent
Expand Down
35 changes: 35 additions & 0 deletions unittests/files/command-event.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
document.body.addEventListener("command", (event) => {
const commandEvent: CommandEvent = event;
const command: string = event.command;
const source: Element | null = event.source;
});

document.body.oncommand = (event) => {
const commandEvent: CommandEvent = event;
const command: string = event.command;
};

document.addEventListener("command", (event) => {
const commandEvent: CommandEvent = event;
const command: string = event.command;
});

window.oncommand = (event) => {
const commandEvent: CommandEvent = event;
const command: string = event.command;
};

oncommand = (event) => {
const commandEvent: CommandEvent = event;
const command: string = event.command;
};

window.addEventListener("command", (event) => {
const commandEvent: CommandEvent = event;
const source: Element | null = event.source;
});

addEventListener("command", (event) => {
const commandEvent: CommandEvent = event;
const command: string = event.command;
});
Loading