]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Split animation definitions (#8208)
authorEvert Timberg <evert.timberg+github@gmail.com>
Sun, 20 Dec 2020 18:26:09 +0000 (13:26 -0500)
committerGitHub <noreply@github.com>
Sun, 20 Dec 2020 18:26:09 +0000 (13:26 -0500)
types/animation.d.ts [new file with mode: 0644]
types/index.esm.d.ts

diff --git a/types/animation.d.ts b/types/animation.d.ts
new file mode 100644 (file)
index 0000000..e383e82
--- /dev/null
@@ -0,0 +1,31 @@
+import { Chart } from './index.esm';
+
+export class Animation {
+       constructor(cfg: any, target: any, prop: string, to?: any);
+       active(): boolean;
+       update(cfg: any, to: any, date: number): void;
+       cancel(): void;
+       tick(date: number): void;
+}
+
+export interface AnimationEvent {
+       chart: Chart;
+       numSteps: number;
+       currentState: 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: {});
+       configure(animations: {}): void;
+       update(target: any, values: any): undefined | boolean;
+}
index cfe43bb6af58e0b370a271916af785ab31025b77..c8be1c4d8c28d0762e79fe091b642756520c4adc 100644 (file)
  */
 
 import { TimeUnit } from "./adapters";
+import { AnimationEvent } from './animation';
 import { Element }from './element';
 import { ChartArea, Point } from './geometric';
 
 export { DateAdapterBase, DateAdapter, TimeUnit, _adapters } from './adapters';
+export { Animation, Animations, Animator, AnimationEvent } from './animation';
 export { Element } from './element';
 export { ChartArea, Point } from './geometric';
 
@@ -351,37 +353,6 @@ export const RadarController: ChartComponent & {
   prototype: RadarController;
   new (chart: Chart, datasetIndex: number): RadarController;
 };
-
-export class Animation {
-       constructor(cfg: any, target: any, prop: string, to?: any);
-       active(): boolean;
-       update(cfg: any, to: any, date: number): void;
-       cancel(): void;
-       tick(date: number): void;
-}
-
-export interface AnimationEvent {
-       chart: Chart;
-       numSteps: number;
-       currentState: 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: {});
-       configure(animations: {}): void;
-       update(target: any, values: any): undefined | boolean;
-}
-
 export interface ChartMeta<TElement extends Element = Element, TDatasetElement extends Element = Element> {
        type: string;
        controller: DatasetController;