Correct type for updateHoverStyle (#10131)

* Correct type for updateHoverStyle
* Lint fixes
This commit is contained in:
Evert Timberg 2022-02-05 09:26:31 -05:00 committed by GitHub
parent 49dc77ec0b
commit 2995775f68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -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;

View 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);