Skip to content

Commit 16b9274

Browse files
committed
fix: fix types for mouse events
1 parent cf963ef commit 16b9274

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/types.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,27 @@ export type EventTarget = EChartsType | ZRenderType;
2525
type SetOptionType = EChartsType["setOption"];
2626
export type Option = Parameters<SetOptionType>[0];
2727

28-
type ElementEventName =
28+
type MouseEventName =
2929
| "click"
3030
| "dblclick"
31-
| "mousewheel"
3231
| "mouseout"
3332
| "mouseover"
3433
| "mouseup"
3534
| "mousedown"
3635
| "mousemove"
3736
| "contextmenu"
37+
| "globalout";
38+
39+
type ElementEventName =
40+
| MouseEventName
41+
| "mousewheel"
3842
| "drag"
3943
| "dragstart"
4044
| "dragend"
4145
| "dragenter"
4246
| "dragleave"
4347
| "dragover"
44-
| "drop"
45-
| "globalout";
48+
| "drop";
4649

4750
type ZRenderEventName = `zr:${ElementEventName}`;
4851

@@ -75,8 +78,8 @@ type OtherEventName =
7578
| "brushselected"
7679
| "globalcursortaken";
7780

78-
type ElementEmits = {
79-
[key in ElementEventName]: (params: ECElementEvent) => boolean;
81+
type MouseEmits = {
82+
[key in MouseEventName]: (params: ECElementEvent) => boolean;
8083
};
8184

8285
type ZRenderEmits = {
@@ -87,7 +90,7 @@ type OtherEmits = {
8790
[key in OtherEventName]: null;
8891
};
8992

90-
export type Emits = ElementEmits &
93+
export type Emits = MouseEmits &
9194
OtherEmits & {
9295
rendered: (params: { elapsedTime: number }) => boolean;
9396
finished: () => boolean;

0 commit comments

Comments
 (0)