mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-04 19:42:46 +08:00
Merge branch 'PriceSpider-NeuIntel-master'
This commit is contained in:
39
types/chart.js/index.d.ts
vendored
39
types/chart.js/index.d.ts
vendored
@@ -24,11 +24,50 @@ declare class Chart {
|
||||
getElementAtEvent: (e: any) => {};
|
||||
getElementsAtEvent: (e: any) => {}[];
|
||||
getDatasetAtEvent: (e: any) => {}[];
|
||||
static pluginService: PluginServiceStatic;
|
||||
|
||||
static defaults: {
|
||||
global: Chart.ChartOptions;
|
||||
}
|
||||
}
|
||||
declare class PluginServiceStatic {
|
||||
register(plugin?: PluginServiceRegistrationOptions): void;
|
||||
}
|
||||
|
||||
declare interface PluginServiceRegistrationOptions {
|
||||
beforeInit?: (chartInstance: Chart) => void,
|
||||
afterInit?: (chartInstance: Chart) => void,
|
||||
|
||||
resize?: (chartInstance: Chart, newChartSize: Size) => void,
|
||||
|
||||
beforeUpdate?: (chartInstance: Chart) => void,
|
||||
afterScaleUpdate?: (chartInstance: Chart) => void,
|
||||
beforeDatasetsUpdate?: (chartInstance: Chart) => void,
|
||||
afterDatasetsUpdate?: (chartInstance: Chart) => void,
|
||||
afterUpdate?: (chartInstance: Chart) => void,
|
||||
|
||||
// This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw
|
||||
// to do something on each animation frame
|
||||
beforeRender?: (chartInstance: Chart) => void,
|
||||
|
||||
// Easing is for animation
|
||||
beforeDraw?: (chartInstance: Chart, easing: string) => void,
|
||||
afterDraw?: (chartInstance: Chart, easing: string) => void,
|
||||
// Before the datasets are drawn but after scales are drawn
|
||||
beforeDatasetsDraw?: (chartInstance: Chart, easing: string) => void,
|
||||
afterDatasetsDraw?: (chartInstance: Chart, easing: string) => void,
|
||||
|
||||
destroy?: (chartInstance: Chart) => void,
|
||||
|
||||
// Called when an event occurs on the chart
|
||||
beforeEvent?: (chartInstance: Chart, event: Event) => void,
|
||||
afterEvent?: (chartInstance: Chart, event: Event) => void
|
||||
}
|
||||
|
||||
declare interface Size {
|
||||
height: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
declare namespace Chart {
|
||||
export type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble';
|
||||
|
||||
Reference in New Issue
Block a user