40 lines
926 B
TypeScript
40 lines
926 B
TypeScript
export {}
|
|
|
|
declare global {
|
|
namespace Echarts {
|
|
|
|
import type {
|
|
// 系列类型的定义后缀都为 SeriesOption
|
|
BarSeriesOption,
|
|
LineSeriesOption
|
|
} from 'echarts/charts'
|
|
import type {
|
|
// 组件类型的定义后缀都为 ComponentOption
|
|
TitleComponentOption,
|
|
TooltipComponentOption,
|
|
GridComponentOption,
|
|
DatasetComponentOption,
|
|
LegendComponentOption,
|
|
AriaComponentOption
|
|
} from 'echarts/components'
|
|
import type {
|
|
ComposeOption,
|
|
} from 'echarts/core'
|
|
|
|
|
|
// 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型
|
|
type Option = ComposeOption<
|
|
| BarSeriesOption
|
|
| LineSeriesOption
|
|
| TitleComponentOption
|
|
| TooltipComponentOption
|
|
| GridComponentOption
|
|
| DatasetComponentOption
|
|
| LegendComponentOption
|
|
| AriaComponentOption
|
|
>;
|
|
|
|
}
|
|
}
|
|
|