ilueckel opened a new issue #13755:
URL: https://github.com/apache/incubator-echarts/issues/13755


   ### What problem does this feature solve?
   The `init` function returns a class of type `ECharts`. This works fine as 
long as you use the chart variable right after initalization.
   ```ts
   import {init, EChartsOption} from "echarts";
   ...
   export class BaseChart {
     initChart() {
       const chart = init(nativeElement);
       // do something else with the chart.
     }
   }
   ```
   
   But all typings get lost, when you want to pass the chart around (e.g. for 
updating data later on)
   ```ts
   import {init, EChartsOption} from "echarts";
   ...
   export class BaseChart {
     const chart: ECharts; // <--- This does not work. You can it make `any`, 
but then all typings are lost;
     initChart() {
       this.chart = init(nativeElement);
       // do something else with the chart.
     }
   }
   ```
   
   The TypeScript definitions do not export the `ECharts` class
   ```ts
   import {ECharts} from "echarts" // <---- This is not possible
   ```
   
   ### What does the proposed API look like?
   Extend the exports in TypeScript. Something like this:
   
   ```
   export { ECharts, EChartsFullOption as EChartsOption, connect, disConnect, 
dispose, getInstanceByDom, getInstanceById, getMap, init, registerLocale, 
registerMap, registerTheme };
   ```
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to