import { XAXisComponentOption, YAXisComponentOption, RadarComponentOption, RadiusAxisComponentOption, AngleAxisComponentOption, AxisPointerComponentOption, SingleAxisComponentOption, PolarComponentOption, GridComponentOption, TitleComponentOption, LegendComponentOption, TooltipComponentOption, DataZoomComponentOption, VisualMapComponentOption, ToolboxComponentOption, BrushComponentOption, GeoComponentOption, ParallelComponentOption, TimelineComponentOption, CalendarComponentOption, DatasetComponentOption, SeriesOption, ParallelAxisComponentOption, MarkPointComponentOption, MarkLineComponentOption, MarkAreaComponentOption, MatrixComponentOption, ThumbnailComponentOption } from '../components/type'; import { Actions } from './actions'; import { Ref, ShallowReactive, ShallowRef } from 'vue'; import { Methods } from './methods'; import { EventHooks } from './events'; export type UpdateOption = SeriesOption | XAXisComponentOption | YAXisComponentOption | GridComponentOption | TitleComponentOption | LegendComponentOption | TooltipComponentOption | RadarComponentOption | RadiusAxisComponentOption | AngleAxisComponentOption | DataZoomComponentOption | AxisPointerComponentOption | ToolboxComponentOption | BrushComponentOption | GeoComponentOption | ParallelComponentOption | SingleAxisComponentOption | TimelineComponentOption | CalendarComponentOption | PolarComponentOption | ParallelAxisComponentOption | MarkPointComponentOption | MarkLineComponentOption | MarkAreaComponentOption | ThumbnailComponentOption; export interface EchartsState { options: Ref; vueEchartsRef: ShallowRef; } export interface EchartsContext extends EchartsState, Methods, EventHooks { readonly id: string; update: { (type: K, data: MainTypeMap[K] extends (infer T)[] ? T : never): void; (type: K, data: MainTypeMap[K]): void; }; actions: ShallowReactive; } export type ChartOptions = { series?: SeriesOption[]; xAxis?: XAXisComponentOption[]; yAxis?: YAXisComponentOption[]; grid?: GridComponentOption[]; title?: TitleComponentOption[]; legend?: LegendComponentOption[]; tooltip?: TooltipComponentOption[]; polar?: PolarComponentOption[]; radar?: RadarComponentOption[]; radiusAxis?: RadiusAxisComponentOption[]; angleAxis?: AngleAxisComponentOption[]; dataZoom?: DataZoomComponentOption[]; visualMap?: VisualMapComponentOption[]; axisPointer?: AxisPointerComponentOption[]; toolbox?: ToolboxComponentOption[]; brush?: BrushComponentOption[]; geo?: GeoComponentOption[]; parallel?: ParallelComponentOption[]; parallelAxis?: ParallelAxisComponentOption[]; singleAxis?: SingleAxisComponentOption[]; timeline?: TimelineComponentOption[]; calendar?: CalendarComponentOption[]; dataset?: DatasetComponentOption[]; matrix?: MatrixComponentOption[]; thumbnail?: ThumbnailComponentOption[]; }; export type MainType = "series" | "xAxis" | "yAxis" | "grid" | "title" | "legend" | "tooltip" | "polar" | "radar" | "radiusAxis" | "angleAxis" | "dataZoom" | "visualMap" | "axisPointer" | "toolbox" | "brush" | "geo" | "parallel" | "parallelAxis" | "singleAxis" | "timeline" | "calendar" | "dataset" | "matrix" | "thumbnail"; export type MainTypeMap = { series: SeriesOption; xAxis: XAXisComponentOption; yAxis: YAXisComponentOption; grid: GridComponentOption; title: TitleComponentOption; legend: LegendComponentOption; tooltip: TooltipComponentOption; polar: PolarComponentOption; radar: RadarComponentOption; radiusAxis: RadiusAxisComponentOption; angleAxis: AngleAxisComponentOption; dataZoom: DataZoomComponentOption; visualMap: VisualMapComponentOption; axisPointer: AxisPointerComponentOption; toolbox: ToolboxComponentOption; brush: BrushComponentOption; geo: GeoComponentOption; parallel: ParallelComponentOption; parallelAxis: ParallelAxisComponentOption[]; singleAxis: SingleAxisComponentOption; timeline: TimelineComponentOption; calendar: CalendarComponentOption; dataset: DatasetComponentOption; matrix: MatrixComponentOption; thumbnail: ThumbnailComponentOption; };