mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-14 19:23:28 +08:00
fix: fix types for mouse events
This commit is contained in:
17
src/types.ts
17
src/types.ts
@ -25,24 +25,27 @@ export type EventTarget = EChartsType | ZRenderType;
|
|||||||
type SetOptionType = EChartsType["setOption"];
|
type SetOptionType = EChartsType["setOption"];
|
||||||
export type Option = Parameters<SetOptionType>[0];
|
export type Option = Parameters<SetOptionType>[0];
|
||||||
|
|
||||||
type ElementEventName =
|
type MouseEventName =
|
||||||
| "click"
|
| "click"
|
||||||
| "dblclick"
|
| "dblclick"
|
||||||
| "mousewheel"
|
|
||||||
| "mouseout"
|
| "mouseout"
|
||||||
| "mouseover"
|
| "mouseover"
|
||||||
| "mouseup"
|
| "mouseup"
|
||||||
| "mousedown"
|
| "mousedown"
|
||||||
| "mousemove"
|
| "mousemove"
|
||||||
| "contextmenu"
|
| "contextmenu"
|
||||||
|
| "globalout";
|
||||||
|
|
||||||
|
type ElementEventName =
|
||||||
|
| MouseEventName
|
||||||
|
| "mousewheel"
|
||||||
| "drag"
|
| "drag"
|
||||||
| "dragstart"
|
| "dragstart"
|
||||||
| "dragend"
|
| "dragend"
|
||||||
| "dragenter"
|
| "dragenter"
|
||||||
| "dragleave"
|
| "dragleave"
|
||||||
| "dragover"
|
| "dragover"
|
||||||
| "drop"
|
| "drop";
|
||||||
| "globalout";
|
|
||||||
|
|
||||||
type ZRenderEventName = `zr:${ElementEventName}`;
|
type ZRenderEventName = `zr:${ElementEventName}`;
|
||||||
|
|
||||||
@ -75,8 +78,8 @@ type OtherEventName =
|
|||||||
| "brushselected"
|
| "brushselected"
|
||||||
| "globalcursortaken";
|
| "globalcursortaken";
|
||||||
|
|
||||||
type ElementEmits = {
|
type MouseEmits = {
|
||||||
[key in ElementEventName]: (params: ECElementEvent) => boolean;
|
[key in MouseEventName]: (params: ECElementEvent) => boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ZRenderEmits = {
|
type ZRenderEmits = {
|
||||||
@ -87,7 +90,7 @@ type OtherEmits = {
|
|||||||
[key in OtherEventName]: null;
|
[key in OtherEventName]: null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Emits = ElementEmits &
|
export type Emits = MouseEmits &
|
||||||
OtherEmits & {
|
OtherEmits & {
|
||||||
rendered: (params: { elapsedTime: number }) => boolean;
|
rendered: (params: { elapsedTime: number }) => boolean;
|
||||||
finished: () => boolean;
|
finished: () => boolean;
|
||||||
|
Reference in New Issue
Block a user