Skip to content

Commit d2385b6

Browse files
committed
Rename PluginOptions to PluginOptionsByType
Add new PluginChartOptions and remove some duplicates
1 parent 17e4f49 commit d2385b6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

types/index.esm.d.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,12 @@ export interface DatasetControllerChartComponent extends ChartComponent {
594594
}
595595

596596
export type AnyObject = Record<string, unknown>;
597-
export interface Defaults extends CoreChartOptions, ElementChartOptions {
597+
export interface Defaults extends CoreChartOptions, ElementChartOptions, PluginChartOptions {
598598
controllers: {
599599
[key in ChartType]: DeepPartial<
600600
CoreChartOptions &
601601
ElementChartOptions &
602+
PluginChartOptions &
602603
DatasetChartOptions<key>[key] &
603604
ScaleChartOptions<key> &
604605
ChartTypeRegistry[key]['chartOptions']
@@ -610,8 +611,6 @@ export interface Defaults extends CoreChartOptions, ElementChartOptions {
610611
[key in ScaleType]: ScaleOptions<key>;
611612
};
612613

613-
plugins: PluginOptions;
614-
615614
set(values: AnyObject): AnyObject;
616615
set(scope: string, values: AnyObject): AnyObject;
617616
get(scope: string): AnyObject;
@@ -1411,8 +1410,6 @@ export interface CoreChartOptions extends ParsingOptions {
14111410
layout: {
14121411
padding: Scriptable<number | ChartArea, ScriptableContext>;
14131412
};
1414-
1415-
plugins: PluginOptions;
14161413
}
14171414

14181415
export type EasingFunction =
@@ -2479,12 +2476,16 @@ export interface TooltipItem {
24792476
element: Element;
24802477
}
24812478

2482-
export interface PluginOptions {
2479+
export interface PluginOptionsByType {
24832480
filler: FillerOptions;
24842481
legend: LegendOptions;
24852482
title: TitleOptions;
24862483
tooltip: TooltipOptions;
24872484
}
2485+
export interface PluginChartOptions {
2486+
plugins: { [k in keyof PluginOptionsByType]: PluginOptionsByType[k]; };
2487+
}
2488+
24882489
export interface GridLineOptions {
24892490
/**
24902491
* @default true
@@ -3141,6 +3142,7 @@ export type ScaleChartOptions<TType extends ChartType = ChartType> = {
31413142
export type ChartOptions<TType extends ChartType = ChartType> = DeepPartial<
31423143
CoreChartOptions &
31433144
ElementChartOptions &
3145+
PluginChartOptions &
31443146
DatasetChartOptions<TType> &
31453147
ScaleChartOptions<TType> &
31463148
ChartTypeRegistry[TType]['chartOptions']

0 commit comments

Comments
 (0)