Skip to content

Commit 6cb10dc

Browse files
authored
chore: #10963 revert (#11102)
1 parent d20b59f commit 6cb10dc

File tree

2 files changed

+7
-74
lines changed

2 files changed

+7
-74
lines changed

src/types/index.d.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export declare class Chart<
492492
readonly id: string;
493493
readonly canvas: HTMLCanvasElement;
494494
readonly ctx: CanvasRenderingContext2D;
495-
readonly config: ChartConfigurationInstance;
495+
readonly config: ChartConfiguration<TType, TData, TLabel> | ChartConfigurationCustomTypesPerDataset<TType, TData, TLabel>;
496496
readonly width: number;
497497
readonly height: number;
498498
readonly aspectRatio: number;
@@ -502,11 +502,11 @@ export declare class Chart<
502502
readonly scales: { [key: string]: Scale };
503503
readonly attached: boolean;
504504

505-
readonly legend?: LegendElement; // Only available if legend plugin is registered and enabled
506-
readonly tooltip?: TooltipModel; // Only available if tooltip plugin is registered and enabled
505+
readonly legend?: LegendElement<TType>; // Only available if legend plugin is registered and enabled
506+
readonly tooltip?: TooltipModel<TType>; // Only available if tooltip plugin is registered and enabled
507507

508-
data: ChartData;
509-
options: ChartOptions;
508+
data: ChartData<TType, TData, TLabel>;
509+
options: ChartOptions<TType>;
510510

511511
constructor(item: ChartItem, config: ChartConfiguration<TType, TData, TLabel> | ChartConfigurationCustomTypesPerDataset<TType, TData, TLabel>);
512512

@@ -2197,7 +2197,7 @@ export interface LegendItem {
21972197
textAlign?: TextAlign;
21982198
}
21992199

2200-
export interface LegendElement<TType extends ChartType = ChartType> extends Element<AnyObject, LegendOptions<TType>>, LayoutItem {
2200+
export interface LegendElement<TType extends ChartType> extends Element<AnyObject, LegendOptions<TType>>, LayoutItem {
22012201
chart: Chart<TType>;
22022202
ctx: CanvasRenderingContext2D;
22032203
legendItems?: LegendItem[];
@@ -2431,7 +2431,7 @@ export interface TooltipLabelStyle {
24312431
*/
24322432
borderRadius?: number | BorderRadius;
24332433
}
2434-
export interface TooltipModel<TType extends ChartType = ChartType> extends Element<AnyObject, TooltipOptions<TType>> {
2434+
export interface TooltipModel<TType extends ChartType> extends Element<AnyObject, TooltipOptions<TType>> {
24352435
readonly chart: Chart<TType>;
24362436

24372437
// The items that we are rendering in the tooltip. See Tooltip Item Interface section
@@ -3676,5 +3676,3 @@ export interface ChartConfigurationCustomTypesPerDataset<
36763676
options?: ChartOptions<TType>;
36773677
plugins?: Plugin<TType>[];
36783678
}
3679-
3680-
export type ChartConfigurationInstance = ChartConfiguration | ChartConfigurationCustomTypesPerDataset & { type?: undefined }

test/types/config_types.ts

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)