From: Jon Dufresne Date: Tue, 21 May 2024 13:07:35 +0000 (-0700) Subject: types: Allow passing undefined for chart options (#11780) X-Git-Tag: v4.4.4~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=228a4856037cafcaa955eccde31e79968c94a8c8;p=thirdparty%2FChart.js.git 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. --- 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[]; }