eavidy commented on issue #19992:
URL: https://github.com/apache/echarts/issues/19992#issuecomment-2516054620
> Any news ? We are blocked with that and it's already here in
5.5.1有什么消息吗?我们被它挡住了,它已经在5.5.1了
The Echarts package actually comes with ES Module types. They are located in
the `echarts/types/src/export/` directory, but they are not exported.
My current approach is to create a new file in the project to re-export
them.
echarts-reexport.mjs
```ts
/// <reference path="./echarts-reexport.d.mts"/>
export * from "echarts";
```
echarts-reexport.d.mts
```ts
export * from "echarts/types/src/export/core.d.ts";
export * from "echarts/types/src/export/charts.d.ts";
export * from "echarts/types/src/export/components.d.ts";
export * from "echarts/types/src/export/features.d.ts";
export * from "echarts/types/src/export/option.d.ts";
export * from "echarts/types/src/export/renderers.d.ts";
export * from "echarts/types/src/export/api.d.ts";
```
Now, simply import echarts from this file to get the correct type hints.
main.mts
```ts
import { init } from "./echarts-reexport.mjs";
```
Then you can configure the tsconfig.json file and the path alias for the
bundler, which can replace Echarts.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]