Skip to content

Commit

Permalink
More specific types for cut/copy/paste events (microsoft#1479)
Browse files Browse the repository at this point in the history
PR microsoft#1468 changed them to Event at the same time that it moved them. This PR
changes their type back to ClipboardEvent.
  • Loading branch information
sandersn committed Jan 20, 2023
1 parent 4a18fe5 commit 5ea2fe8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
18 changes: 9 additions & 9 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5747,9 +5747,9 @@ interface GlobalEventHandlersEventMap {
"compositionstart": CompositionEvent;
"compositionupdate": CompositionEvent;
"contextmenu": MouseEvent;
"copy": Event;
"copy": ClipboardEvent;
"cuechange": Event;
"cut": Event;
"cut": ClipboardEvent;
"dblclick": MouseEvent;
"drag": DragEvent;
"dragend": DragEvent;
Expand Down Expand Up @@ -5784,7 +5784,7 @@ interface GlobalEventHandlersEventMap {
"mouseout": MouseEvent;
"mouseover": MouseEvent;
"mouseup": MouseEvent;
"paste": Event;
"paste": ClipboardEvent;
"pause": Event;
"play": Event;
"playing": Event;
Expand Down Expand Up @@ -5870,9 +5870,9 @@ interface GlobalEventHandlers {
* @param ev The mouse event.
*/
oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
oncopy: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncut: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
/**
* Fires when the user double-clicks the object.
* @param ev The mouse event.
Expand Down Expand Up @@ -6002,7 +6002,7 @@ interface GlobalEventHandlers {
* @param ev The mouse event.
*/
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onpaste: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
/**
* Occurs when playback is paused.
* @param ev The event.
Expand Down Expand Up @@ -18204,9 +18204,9 @@ declare var onclose: ((this: Window, ev: Event) => any) | null;
* @param ev The mouse event.
*/
declare var oncontextmenu: ((this: Window, ev: MouseEvent) => any) | null;
declare var oncopy: ((this: Window, ev: Event) => any) | null;
declare var oncopy: ((this: Window, ev: ClipboardEvent) => any) | null;
declare var oncuechange: ((this: Window, ev: Event) => any) | null;
declare var oncut: ((this: Window, ev: Event) => any) | null;
declare var oncut: ((this: Window, ev: ClipboardEvent) => any) | null;
/**
* Fires when the user double-clicks the object.
* @param ev The mouse event.
Expand Down Expand Up @@ -18336,7 +18336,7 @@ declare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null;
* @param ev The mouse event.
*/
declare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null;
declare var onpaste: ((this: Window, ev: Event) => any) | null;
declare var onpaste: ((this: Window, ev: ClipboardEvent) => any) | null;
/**
* Occurs when playback is paused.
* @param ev The event.
Expand Down
12 changes: 12 additions & 0 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@
"name": "animationstart",
"type": "AnimationEvent"
},
{
"name": "cut",
"type": "ClipboardEvent"
},
{
"name": "copy",
"type": "ClipboardEvent"
},
{
"name": "paste",
"type": "ClipboardEvent"
},
{
"name": "gotpointercapture",
"type": "PointerEvent"
Expand Down

0 comments on commit 5ea2fe8

Please sign in to comment.