From d20b59fb0364b68838997c1d015e58b021442168 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Tue, 7 Feb 2023 14:19:00 +0100 Subject: [PATCH] Add colors plugin TS options to be configured (#11115) --- src/types/index.d.ts | 2 ++ test/types/plugins/plugin.colors/colors.ts | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/types/plugins/plugin.colors/colors.ts diff --git a/src/types/index.d.ts b/src/types/index.d.ts index da4ab6a130c..9dbf5b1debf 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -12,6 +12,7 @@ import {ChartArea, Padding, Point} from './geometric.js'; import {LayoutItem, LayoutPosition} from './layout.js'; import {RenderTextOpts} from './helpers/helpers.canvas.js'; import {CanvasFontSpec} from '../helpers/helpers.options.js'; +import type {ColorsPluginOptions} from '../plugins/plugin.colors.js'; export {EasingFunction} from '../helpers/helpers.easing.js'; export {default as ArcElement, ArcProps} from '../elements/element.arc.js'; @@ -2791,6 +2792,7 @@ export interface TooltipItem { } export interface PluginOptionsByType { + colors: ColorsPluginOptions; decimation: DecimationOptions; filler: FillerOptions; legend: LegendOptions; diff --git a/test/types/plugins/plugin.colors/colors.ts b/test/types/plugins/plugin.colors/colors.ts new file mode 100644 index 00000000000..180709bdb88 --- /dev/null +++ b/test/types/plugins/plugin.colors/colors.ts @@ -0,0 +1,19 @@ +import { Chart } from '../../../../src/types.js'; + +const chart = new Chart('id', { + type: 'bubble', + data: { + labels: [], + datasets: [{ + data: [] + }] + }, + options: { + plugins: { + colors: { + enabled: true, + forceOverride: false, + } + } + } +});