-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
Description
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
Line 3187 in 275fdaf
| 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
- Chart.js version: 3.0.0-beta.13
- Link to your project: Upgrade to Chart.js 3.0 valor-software/ng2-charts#1276