[Feature] Reference types of option properties easily
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### What problem does this feature solve?
I've found that it is quite hard to use types with ECharts. For instance, I wanted to create a function that was my default tooltip formatter (to reuse the code).
The type it should have is:
```ts
formatter?: string | TooltipFormatterCallback;
```
However, these types are not exported. I tried to pick the type using typescript-->
```
ECOption["tooltip"]["formatter"]
```
But the formatter can either be an array or a single object so typescript doesn't allow me to do this.
Similar things happen with xAxis and others (all the types that are `Arrayable`). I just don't know how to get the types or infer them in some way.
Maybe I'm missing something. If I am maybe, adding a small explanation in the docs could prove helpful.
### What does the proposed API look like?
Export the typings of individual options so that they can be used easily
Contributor guide
Assessment
This issue has not been assessed yet.