Skip to content

Commit 228a485

Browse files
authored
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.
1 parent 5c9e5c6 commit 228a485

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3815,7 +3815,7 @@ export interface ChartConfiguration<
38153815
> {
38163816
type: TType;
38173817
data: ChartData<TType, TData, TLabel>;
3818-
options?: ChartOptions<TType>;
3818+
options?: ChartOptions<TType> | undefined;
38193819
plugins?: Plugin<TType>[];
38203820
platform?: typeof BasePlatform;
38213821
}
@@ -3826,6 +3826,6 @@ export interface ChartConfigurationCustomTypesPerDataset<
38263826
TLabel = unknown
38273827
> {
38283828
data: ChartDataCustomTypesPerDataset<TType, TData, TLabel>;
3829-
options?: ChartOptions<TType>;
3829+
options?: ChartOptions<TType> | undefined;
38303830
plugins?: Plugin<TType>[];
38313831
}

0 commit comments

Comments
 (0)