mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
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
This commit is contained in:
parent
b10d994017
commit
b54bd272fb
4
types/core/index.d.ts
vendored
4
types/core/index.d.ts
vendored
@ -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<O = {}> {
|
||||
export interface Plugin<O = {}> extends ExtendedPlugin {
|
||||
id: string;
|
||||
|
||||
/**
|
||||
|
||||
5
types/plugins/index.d.ts
vendored
5
types/plugins/index.d.ts
vendored
@ -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<O = {}> {
|
||||
export interface ExtendedPlugin<O = {}> {
|
||||
/**
|
||||
* @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<O = {}> {
|
||||
*/
|
||||
afterTooltipDraw?(chart: Chart, args: { tooltip: TooltipModel }, options: O): void;
|
||||
}
|
||||
|
||||
export interface TooltipOptions extends CoreInteractionOptions {
|
||||
/**
|
||||
* Are on-canvas tooltips enabled?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user