Open akopanskiy opened 7 months ago
this code has no errors:
myChart.on('dataZoom', (event: any) => {
var dz = { start: event.start, end: event.end };
if (event.batch)
dz = { start: event.batch[0].start, end: event.batch[0].end };
console.log(dz);
});
📌 please close issue if problem solved.
Same problem, event has no type defined.
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 }; }
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
Any additional comments?
No response