From 228a4856037cafcaa955eccde31e79968c94a8c8 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 21 May 2024 06:07:35 -0700 Subject: [PATCH] types: Allow passing undefined for chart options (#11780) When exactOptionalPropertyTypes, TypeScript distinguishes between the value undefined and the property not existing. See: https://www.typescriptlang.org/tsconfig/#exactOptionalPropertyTypes For Chart.js options, this difference is not important and either passing undefined or not including it have the same effect. --- src/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 98bdf09a2..7a2c8a766 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -3815,7 +3815,7 @@ export interface ChartConfiguration< > { type: TType; data: ChartData; - options?: ChartOptions; + options?: ChartOptions | undefined; plugins?: Plugin[]; platform?: typeof BasePlatform; } @@ -3826,6 +3826,6 @@ export interface ChartConfigurationCustomTypesPerDataset< TLabel = unknown > { data: ChartDataCustomTypesPerDataset; - options?: ChartOptions; + options?: ChartOptions | undefined; plugins?: Plugin[]; } -- 2.47.3