0

Does echarts provide a type for the echarts instance? I currently have it typed as any:

  /**
   * The echarts instance.
   */
  echartsIntance: any;

Curious if it has an actual type like the options do?

Ole
  • 41,793
  • 59
  • 191
  • 359
  • 1
    Yes, but it's not documented (echarts is actually written in ts). If you install echarts with npm you'll find the source typing for the `EChart` class in `node_modules/echarts/types/src/core/echarts.d.ts`; it appears to (and should) correspond to the [documented js api](https://echarts.apache.org/en/api.html#echartsInstance). – kikon Jun 18 '23 at 00:04
  • There is however a documentation [entry](https://apache.github.io/echarts-handbook/en/basics/import/#creating-an-option-type-in-typescript) on the synthesis (`ComposeOption`) of the typing of the huge option object, where ts might indeed be useful. – kikon Jun 18 '23 at 00:04
  • 1
    Ah Cool - I see `ECharts` defined in `node_modules/echarts/types/src/core/echarts.d.ts` - THANK YOU!! – Ole Jun 18 '23 at 14:21

0 Answers0