- 
                Notifications
    You must be signed in to change notification settings 
- Fork 12k
Description
Expected behavior
It should not give a typescript error while accessing the 'type' property on the chart instance.
"Property 'type' does not exist on type 'ChartConfigurationCustomTypesPerDataset'"
Current behavior
After migrating the 'chart.js' library from 3.7.1 to 3.9.1, the typescript compiler throws an error while accessing the 'type' property on the chart instance config object.
I have noticed that in this recent version a change has been introduced for the interface of chart instance type, but there is no 'type' attribute has been exposed on it -
export interface ChartConfigurationCustomTypesPerDataset<
  TType extends ChartType = ChartType,
  TData = DefaultDataPoint<TType>,
  TLabel = unknown
> {
  data: ChartDataCustomTypesPerDataset<TType, TData, TLabel>;
  options?: ChartOptions<TType>;
  plugins?: Plugin<TType>[];
}After drilling down further into it, I noticed that in the 4.0.0-alpha.3 release, this property has been introduced on this interface against commit number. When I upgrade the library to this version, this issue went away. -
interface ChartConfigurationCustomTypesPerDataset<
  TType extends ChartType = ChartType,
  TData = DefaultDataPoint<TType>,
  TLabel = unknown
> {
  type: TType;
  data: ChartDataCustomTypesPerDataset<TType, TData, TLabel>;
  options?: ChartOptions<TType>;
  plugins?: Plugin<TType>[];
}The problem is, this version is currently in alpha release so we can't use it now, and no 3.9.x version contains this fix.
Reproducible sample
Optional extra steps/info to reproduce
It can directly be seen in the typescript playground example -
Possible solution
The solution already has been introduced in the 4.0.0-alpha.3 but needs to backport for the 3.9.x version.
Context
No response
chart.js version
v3.9.1
Browser name and version
No response
Link to your project
No response
