Chart.js/types/index.esm.d.ts
Josh Kelley efbaf2c082
TypeScript updates (#8190)
* Update type definitions and docs for legends

* Fix types for onHover and onClick callbacks

core.controller.js's implementation also passes the Chart instance as `this`. However, that isn't documented, and it's my impression that Chart.js is moving away from passing items as `this`, so I didn't declare it in the type definitions.

* Allow multi-line ticks

* Stricter DeepPartial definition

The previous definition resolved to `{}` (which can allow primitives) if it was given a function, so it was far too broad for any `Scriptable<>` properties.

* Grammar and writing style

* Updates to animation docs

Document the `fn` option, since it's in the type definitions.

Fix callback usage to match example code.

* Fix AnimationEvent parameter

The onProgress and onComplete events were mistakenly declared as taking the standard DOM AnimationEvent.  (Should Chart.js's AnimationEvent be renamed to ChartAnimationEvent to avoid any possible ambiguity?)

* Allow false for disabling animations

* Add comments explaining the layout and usage of Rollup
2020-12-18 12:46:54 -05:00

23 lines
739 B
TypeScript

/**
* Top-level type definitions. These are processed by Rollup and rollup-plugin-dts
* to make a combined .d.ts file under dist; that way, all of the type definitions
* appear directly within the "chart.js" module; that matches the layout of the
* distributed chart.esm.js bundle and means that users of Chart.js can easily use
* module augmentation to extend Chart.js's types and plugins within their own
* code, like so:
*
* @example
* declare module "chart.js" {
* // Add types here
* }
*/
export * from './controllers';
export * from './core';
export * from './elements';
export * from './core/interfaces';
export * from './platform';
export * from './plugins';
export * from './scales';
export * from './interfaces';