You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/06/23 08:11:30 UTC
[GitHub] [echarts] DavidMarquezF opened a new issue, #17272: [Feature] Reference types of option properties easily
DavidMarquezF opened a new issue, #17272:
URL: https://github.com/apache/echarts/issues/17272
### 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<FormatterParams>;
```
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
--
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: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org