Skip to content

Commit

Permalink
types: Allow passing undefined for chart options (#11780)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jdufresne committed May 21, 2024
1 parent 5c9e5c6 commit 228a485
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3815,7 +3815,7 @@ export interface ChartConfiguration<
> {
type: TType;
data: ChartData<TType, TData, TLabel>;
options?: ChartOptions<TType>;
options?: ChartOptions<TType> | undefined;
plugins?: Plugin<TType>[];
platform?: typeof BasePlatform;
}
Expand All @@ -3826,6 +3826,6 @@ export interface ChartConfigurationCustomTypesPerDataset<
TLabel = unknown
> {
data: ChartDataCustomTypesPerDataset<TType, TData, TLabel>;
options?: ChartOptions<TType>;
options?: ChartOptions<TType> | undefined;
plugins?: Plugin<TType>[];
}

0 comments on commit 228a485

Please sign in to comment.