File tree Expand file tree Collapse file tree 3 files changed +29
-6
lines changed Expand file tree Collapse file tree 3 files changed +29
-6
lines changed Original file line number Diff line number Diff line change
1
+ ## 6.4.1
2
+
3
+ * Improve typings for mouse event params.
4
+
1
5
## 6.4.0
2
6
3
7
* Delay the disposal of the ECharts instance to the moment the element is disconnected from the DOM if possible (#433 ).
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-echarts" ,
3
- "version" : " 6.4.0 " ,
3
+ "version" : " 6.4.1 " ,
4
4
"description" : " Vue.js component for Apache ECharts." ,
5
5
"author" :
" GU Yiling <[email protected] >" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export type EventTarget = EChartsType | ZRenderType;
20
20
type SetOptionType = EChartsType [ "setOption" ] ;
21
21
export type Option = Parameters < SetOptionType > [ 0 ] ;
22
22
23
- type EChartsEventName =
23
+ type EChartsMouseEventName =
24
24
| "click"
25
25
| "dblclick"
26
26
| "mousedown"
@@ -29,7 +29,8 @@ type EChartsEventName =
29
29
| "mouseover"
30
30
| "mouseout"
31
31
| "globalout"
32
- | "contextmenu"
32
+ | "contextmenu" ;
33
+ type EChartsOtherEventName =
33
34
| "highlight"
34
35
| "downplay"
35
36
| "selectchanged"
@@ -77,7 +78,25 @@ type ZRenderEventName =
77
78
| "dragover"
78
79
| "drop"
79
80
| "globalout" ;
80
- type EventName = EChartsEventName | `zr:${ZRenderEventName } `;
81
- export type Emits = {
82
- [ key in EventName ] : null ;
81
+ type OtherEventName = EChartsOtherEventName | `zr:${ZRenderEventName } `;
82
+
83
+ // See https://echarts.apache.org/en/api.html#events.Mouse%20events
84
+ interface MouseEventParams {
85
+ componentType : string ;
86
+ seriesType : string ;
87
+ seriesIndex : number ;
88
+ seriesName : string ;
89
+ name : string ;
90
+ dataIndex : number ;
91
+ color : string ;
92
+ }
93
+
94
+ type MouseEmits = {
95
+ [ k in EChartsMouseEventName ] : ( params : MouseEventParams ) => boolean ;
83
96
} ;
97
+
98
+ type OtherEmits = {
99
+ [ key in OtherEventName ] : null ;
100
+ } ;
101
+
102
+ export type Emits = MouseEmits & OtherEmits ;
You can’t perform that action at this time.
0 commit comments