Declaring the following options:
public bubbleChartOptions: ChartOptions<'bubble'> = {
scales: {
x: {
min: 0,
max: 30,
ticks: {}
},
y: {
min: 0,
max: 30,
ticks: {}
},
}
};
Throws a type error:
Property 'scales' is incompatible with index signature.
Type '{ x: { min: number; max: number; ticks: {}; }; y: { min: number; max: number; ticks: {}; }; }' is not assignable to type 'never'.
Expected Behavior
No error is thrown, the config should be valid
Possible Solution
I believe it's due to EmptyObject in
|
chartOptions: EmptyObject; |
type: never takes precedence on the other options? If I use
ChartOptions<'bubble'> as a type for the value above, it matches typings correctly, but I need to allow all options.
Environment
Declaring the following options:
Throws a type error:
Expected Behavior
No error is thrown, the config should be valid
Possible Solution
I believe it's due to EmptyObject in
Chart.js/types/index.esm.d.ts
Line 3187 in 275fdaf
type: nevertakes precedence on the other options? If I useChartOptions<'bubble'>as a type for the value above, it matches typings correctly, but I need to allow all options.Environment