mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Correct type for updateHoverStyle (#10131)
* Correct type for updateHoverStyle * Lint fixes
This commit is contained in:
parent
49dc77ec0b
commit
2995775f68
2
types/index.esm.d.ts
vendored
2
types/index.esm.d.ts
vendored
@ -529,7 +529,7 @@ export declare class Chart<
|
||||
toBase64Image(type?: string, quality?: unknown): string;
|
||||
bindEvents(): void;
|
||||
unbindEvents(): void;
|
||||
updateHoverStyle(items: Element, mode: 'dataset', enabled: boolean): void;
|
||||
updateHoverStyle(items: InteractionItem[], mode: 'dataset', enabled: boolean): void;
|
||||
|
||||
notifyPlugins(hook: string, args?: AnyObject): boolean | void;
|
||||
|
||||
|
17
types/tests/interaction.ts
Normal file
17
types/tests/interaction.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import {
|
||||
Chart, ChartData, ChartConfiguration, Element
|
||||
} from '../index.esm';
|
||||
|
||||
const data: ChartData<'line'> = { datasets: [] };
|
||||
const chartItem = 'item';
|
||||
const config: ChartConfiguration<'line'> = { type: 'line', data };
|
||||
const chart: Chart = new Chart(chartItem, config);
|
||||
|
||||
type Item = {
|
||||
element: Element,
|
||||
datasetIndex: number,
|
||||
index: number
|
||||
}
|
||||
|
||||
const elements: Item[] = [];
|
||||
chart.updateHoverStyle(elements, 'dataset', true);
|
Loading…
Reference in New Issue
Block a user