iuliust opened a new issue #15284:
URL: https://github.com/apache/echarts/issues/15284
### 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 :
```typescript
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();
}
}
```
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]