From: Jukka Kurkela Date: Wed, 6 Oct 2021 12:53:27 +0000 (+0300) Subject: Types: Move tooltip methods to model from plugin (#9729) X-Git-Tag: v3.6.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7993fc95dcea17edf1050283580078423d63a82d;p=thirdparty%2FChart.js.git Types: Move tooltip methods to model from plugin (#9729) --- diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index f3824e4ba..848d824c1 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -2427,15 +2427,15 @@ export interface TooltipModel { // tooltip options options: TooltipOptions; + + getActiveElements(): ActiveElement[]; + setActiveElements(active: ActiveDataPoint[], eventPosition: { x: number, y: number }): void; } export const Tooltip: Plugin & { readonly positioners: { [key: string]: (items: readonly ActiveElement[], eventPosition: { x: number; y: number }) => { x: number; y: number } | false; }; - - getActiveElements(): ActiveElement[]; - setActiveElements(active: ActiveDataPoint[], eventPosition: { x: number, y: number }): void; }; export interface TooltipCallbacks< diff --git a/types/tests/plugins/plugin.tooltip/chart.tooltip.ts b/types/tests/plugins/plugin.tooltip/chart.tooltip.ts index 7aacb72dc..66c824412 100644 --- a/types/tests/plugins/plugin.tooltip/chart.tooltip.ts +++ b/types/tests/plugins/plugin.tooltip/chart.tooltip.ts @@ -11,3 +11,5 @@ const chart = new Chart('id', { }); const tooltip = chart.tooltip; + +const active = tooltip && tooltip.getActiveElements();