Type for datazoom event
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### Version
5.4.3
### Link to Minimal Reproduction
No response
### Steps to Reproduce
Create datazoom event
Try to type
### Current Behavior
For example, we have the following code:
`myChart.on("dataZoom", event => {
if (event.batch) {
return dataZoom.value = { start: event.batch[0].start, end: event.batch[0].end };
}
dataZoom.value = { start: event.start, end: event.end };
});`
For the event TypeScript gives an error:
` Argument of type (this: EChartsType, e: unknown) => { start: any; end: any; } | undefined
is not assignable to parameter of type WithThisType<(...args: unknown[]) => boolean | void, EChartsType>`
How to type an event?
### Expected Behavior
-
### Environment
```markdown
- OS: macOS Sonoma
- Browser: Chrome 120.0.6099.129
- Framework: Vue@3
```
### Any additional comments?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.