-
Notifications
You must be signed in to change notification settings - Fork 19.8k
Closed
Labels
difficulty: easyIssues that can be fixed more easily than the average.Issues that can be fixed more easily than the average.enThis issue is in EnglishThis issue is in Englishtypescript
Description
Version
5.1.2
Steps to reproduce
Try to get a reference to the ElementEvent type of echartsInstance.on(eventName, (event) => {...})
What is expected?
In a typescript project, we should be able to get the reference to the ElementEvent type, among other types.
What is actually happening?
There's no way to get a clean reference to the type
In general, a very, very limited part of Echarts' internal types are exported. This is a big problem, because when I want to declare an observable of ElementEvent, it is just impossible.
I want to be able to have the following code :
import { ElementEvent } from 'echarts';
// ...
export class ChartComponent {
chartClickEvents = new Subject<ElementEvent>(); // Unfortunately, it's impossible because Echart's types are almost never exported...
constructor() {
// ...
this.echartsInstance.on('click', event => {
this.chartClickEvents.next(event);
});
this.chartClickEvents.pipe(
tap(e => {
// do stuff...
}),
).subscribe();
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
difficulty: easyIssues that can be fixed more easily than the average.Issues that can be fixed more easily than the average.enThis issue is in EnglishThis issue is in Englishtypescript