From: Evert Timberg Date: Thu, 17 Dec 2020 23:10:29 +0000 (-0500) Subject: Move tooltip plugin hooks to the core Plugin type (#8160) X-Git-Tag: v3.0.0-beta.8~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b54bd272fbe532923a2a7398b70c8dab1ea564f6;p=thirdparty%2FChart.js.git Move tooltip plugin hooks to the core Plugin type (#8160) * Move tooltip plugin hooks to the core * Try and use declaration merging for Plugin type * Merge Plugin types --- diff --git a/types/core/index.d.ts b/types/core/index.d.ts index 0359e31b0..c0bee8ba6 100644 --- a/types/core/index.d.ts +++ b/types/core/index.d.ts @@ -25,7 +25,7 @@ import { ScaleType } from '../interfaces'; import { ElementChartOptions } from '../elements'; -import { PluginOptions } from '../plugins'; +import { ExtendedPlugin, PluginOptions } from '../plugins'; export interface DateAdapterBase { /** @@ -564,7 +564,7 @@ export const layouts: { update(chart: Chart, width: number, height: number): void; }; -export interface Plugin { +export interface Plugin extends ExtendedPlugin { id: string; /** diff --git a/types/plugins/index.d.ts b/types/plugins/index.d.ts index dc53806ba..3c2ee6b53 100644 --- a/types/plugins/index.d.ts +++ b/types/plugins/index.d.ts @@ -1,4 +1,4 @@ -import { ActiveDataPoint, ActiveElement, Chart, Element, InteractionMode, LayoutPosition, Plugin } from '../core'; +import { ActiveDataPoint, ActiveElement, Chart, Element, LayoutPosition } from 'core'; import { AnimationSpecContainer, Color, ChartArea, FontSpec, Scriptable, TextAlign, ChartEvent, CoreInteractionOptions } from '../core/interfaces'; import { PointStyle } from '../elements'; import { ChartData, ChartDataset } from '../interfaces'; @@ -312,7 +312,7 @@ export interface TooltipCallbacks { afterFooter(this: TooltipModel, tooltipItems: TooltipItem[]): string | string[]; } -export interface TooltipPlugin { +export interface ExtendedPlugin { /** * @desc Called before drawing the `tooltip`. If any plugin returns `false`, * the tooltip drawing is cancelled until another `render` is triggered. @@ -333,7 +333,6 @@ export interface TooltipPlugin { */ afterTooltipDraw?(chart: Chart, args: { tooltip: TooltipModel }, options: O): void; } - export interface TooltipOptions extends CoreInteractionOptions { /** * Are on-canvas tooltips enabled?