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

export interface ChartPlugin {
  id: string;

  beforeUpdate?(chart: Chart, args?, options?): void;
  beforeElementsUpdate?(chart: Chart, args?, options?): void;
  beforeDatasetsUpdate?(chart: Chart, args?, options?): void;

  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;
}
