import {Chart, ChartMeta} from "chart.js";

export interface ChartPlugin {
  id: string;

  beforeDraw?(chart: Chart): void;
  beforeDatasetsDraw?(chart: Chart, args?: { cancellable: true }, options?: any): void;
  beforeDatasetDraw?(chart: Chart, args: { index: number; meta: ChartMeta }): void;

  afterDatasetDraw?(chart: Chart, args: { index: number; meta: ChartMeta }): void;
  afterDatasetsDraw?(chart: Chart, args?: unknown, options?: any): void;
  afterDraw?(chart: Chart): void;
}