export declare const Tooltip: Tooltip;
-export interface TooltipCallbacks<
+export interface TooltipDatasetCallbacks<
TType extends ChartType,
Model = TooltipModel<TType>,
Item = TooltipItem<TType>> {
+ beforeLabel(this: Model, tooltipItem: Item): string | string[] | void;
+ label(this: Model, tooltipItem: Item): string | string[] | void;
+ afterLabel(this: Model, tooltipItem: Item): string | string[] | void;
+
+ labelColor(this: Model, tooltipItem: Item): TooltipLabelStyle | void;
+ labelTextColor(this: Model, tooltipItem: Item): Color | void;
+ labelPointStyle(this: Model, tooltipItem: Item): { pointStyle: PointStyle; rotation: number } | void;
+}
+
+export interface TooltipCallbacks<
+ TType extends ChartType,
+ Model = TooltipModel<TType>,
+ Item = TooltipItem<TType>> extends TooltipDatasetCallbacks<TType, Model, Item> {
beforeTitle(this: Model, tooltipItems: Item[]): string | string[] | void;
title(this: Model, tooltipItems: Item[]): string | string[] | void;
callbacks: TooltipCallbacks<TType>;
}
+export interface TooltipDatasetOptions<TType extends ChartType = ChartType> {
+ callbacks: TooltipDatasetCallbacks<TType>;
+}
+
export interface TooltipItem<TType extends ChartType> {
/**
* The chart the tooltip is being shown on
element: Element;
}
+export interface PluginDatasetOptionsByType<TType extends ChartType> {
+ tooltip: TooltipDatasetOptions<TType>;
+}
+
export interface PluginOptionsByType<TType extends ChartType> {
colors: ColorsPluginOptions;
decimation: DecimationOptions;
TData = DefaultDataPoint<TType>
> = DeepPartial<
{ [key in ChartType]: { type: key } & ChartTypeRegistry[key]['datasetOptions'] }[TType]
+> & DeepPartial<
+PluginDatasetOptionsByType<TType>
> & ChartDatasetProperties<TType, TData>;
export type ChartDatasetCustomTypesPerDataset<
TData = DefaultDataPoint<TType>
> = DeepPartial<
{ [key in ChartType]: { type: key } & ChartTypeRegistry[key]['datasetOptions'] }[TType]
+> & DeepPartial<
+PluginDatasetOptionsByType<TType>
> & ChartDatasetPropertiesCustomTypesPerDataset<TType, TData>;
/**