Chart.js/types/animation.d.ts
Dan Onoshko ce375a6876
feat: add ESM support (#10525)
* feat: add ESM support

* build: rename UMD bundle

* chore: edit supbackages description

* style: disable es/no-import-meta linter rule

* test: dynamic import in cjs module

* docs: edit integrations page

* docs: review fixes

* chore: remove useless regex in webpack config

* ci: test size-limit only for ESM bundle
2022-08-04 18:43:26 -04:00

34 lines
940 B
TypeScript

import { Chart } from '.';
import { AnyObject } from './basic';
export class Animation {
constructor(cfg: AnyObject, target: AnyObject, prop: string, to?: unknown);
active(): boolean;
update(cfg: AnyObject, to: unknown, date: number): void;
cancel(): void;
tick(date: number): void;
}
export interface AnimationEvent {
chart: Chart;
numSteps: number;
initial: boolean;
currentStep: number;
}
export class Animator {
listen(chart: Chart, event: 'complete' | 'progress', cb: (event: AnimationEvent) => void): void;
add(chart: Chart, items: readonly Animation[]): void;
has(chart: Chart): boolean;
start(chart: Chart): void;
running(chart: Chart): boolean;
stop(chart: Chart): void;
remove(chart: Chart): boolean;
}
export class Animations {
constructor(chart: Chart, animations: AnyObject);
configure(animations: AnyObject): void;
update(target: AnyObject, values: AnyObject): undefined | boolean;
}