import type { IChartSpecInfo } from '../../chart/interface'; import type { VChartRenderActionSource, IVChart } from '../../core/interface'; import type { IBasePlugin, IBasePluginService, MaybePromise } from '../base/interface'; export interface IChartPlugin extends IBasePlugin { specKey?: string; onInit?: (service: T, chartSpec: any) => MaybePromise; onBeforeResize?: (service: T, width: number, height: number) => MaybePromise; onAfterChartSpecTransform?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise; onAfterModelSpecTransform?: (service: T, chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource) => MaybePromise; onBeforeInitChart?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise; onAfterInitChart?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise; } export interface IChartPluginConstructor { readonly pluginType: 'chart'; readonly specKey?: string; readonly type: string; new (): IChartPlugin; } export interface IChartPluginService extends IBasePluginService { globalInstance: IVChart; onInit?: (chartSpec: any) => MaybePromise; onBeforeResize?: (width: number, height: number) => MaybePromise; onAfterChartSpecTransform?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise; onAfterModelSpecTransform?: (chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource) => MaybePromise; onBeforeInitChart?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise; onAfterInitChart?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise; }