Skip to content

Commit 5ea2fe8

Browse files
authored
More specific types for cut/copy/paste events (#1479)
PR #1468 changed them to Event at the same time that it moved them. This PR changes their type back to ClipboardEvent.
1 parent 4a18fe5 commit 5ea2fe8

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

baselines/dom.generated.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5747,9 +5747,9 @@ interface GlobalEventHandlersEventMap {
57475747
"compositionstart": CompositionEvent;
57485748
"compositionupdate": CompositionEvent;
57495749
"contextmenu": MouseEvent;
5750-
"copy": Event;
5750+
"copy": ClipboardEvent;
57515751
"cuechange": Event;
5752-
"cut": Event;
5752+
"cut": ClipboardEvent;
57535753
"dblclick": MouseEvent;
57545754
"drag": DragEvent;
57555755
"dragend": DragEvent;
@@ -5784,7 +5784,7 @@ interface GlobalEventHandlersEventMap {
57845784
"mouseout": MouseEvent;
57855785
"mouseover": MouseEvent;
57865786
"mouseup": MouseEvent;
5787-
"paste": Event;
5787+
"paste": ClipboardEvent;
57885788
"pause": Event;
57895789
"play": Event;
57905790
"playing": Event;
@@ -5870,9 +5870,9 @@ interface GlobalEventHandlers {
58705870
* @param ev The mouse event.
58715871
*/
58725872
oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
5873-
oncopy: ((this: GlobalEventHandlers, ev: Event) => any) | null;
5873+
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
58745874
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
5875-
oncut: ((this: GlobalEventHandlers, ev: Event) => any) | null;
5875+
oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
58765876
/**
58775877
* Fires when the user double-clicks the object.
58785878
* @param ev The mouse event.
@@ -6002,7 +6002,7 @@ interface GlobalEventHandlers {
60026002
* @param ev The mouse event.
60036003
*/
60046004
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
6005-
onpaste: ((this: GlobalEventHandlers, ev: Event) => any) | null;
6005+
onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
60066006
/**
60076007
* Occurs when playback is paused.
60086008
* @param ev The event.
@@ -18204,9 +18204,9 @@ declare var onclose: ((this: Window, ev: Event) => any) | null;
1820418204
* @param ev The mouse event.
1820518205
*/
1820618206
declare var oncontextmenu: ((this: Window, ev: MouseEvent) => any) | null;
18207-
declare var oncopy: ((this: Window, ev: Event) => any) | null;
18207+
declare var oncopy: ((this: Window, ev: ClipboardEvent) => any) | null;
1820818208
declare var oncuechange: ((this: Window, ev: Event) => any) | null;
18209-
declare var oncut: ((this: Window, ev: Event) => any) | null;
18209+
declare var oncut: ((this: Window, ev: ClipboardEvent) => any) | null;
1821018210
/**
1821118211
* Fires when the user double-clicks the object.
1821218212
* @param ev The mouse event.
@@ -18336,7 +18336,7 @@ declare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null;
1833618336
* @param ev The mouse event.
1833718337
*/
1833818338
declare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null;
18339-
declare var onpaste: ((this: Window, ev: Event) => any) | null;
18339+
declare var onpaste: ((this: Window, ev: ClipboardEvent) => any) | null;
1834018340
/**
1834118341
* Occurs when playback is paused.
1834218342
* @param ev The event.

inputfiles/overridingTypes.jsonc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@
4545
"name": "animationstart",
4646
"type": "AnimationEvent"
4747
},
48+
{
49+
"name": "cut",
50+
"type": "ClipboardEvent"
51+
},
52+
{
53+
"name": "copy",
54+
"type": "ClipboardEvent"
55+
},
56+
{
57+
"name": "paste",
58+
"type": "ClipboardEvent"
59+
},
4860
{
4961
"name": "gotpointercapture",
5062
"type": "PointerEvent"

0 commit comments

Comments
 (0)