Skip to content

Commit

Permalink
chore: #10963 revert (#11102)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen authored Feb 7, 2023
1 parent d20b59f commit 6cb10dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 74 deletions.
16 changes: 7 additions & 9 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export declare class Chart<
readonly id: string;
readonly canvas: HTMLCanvasElement;
readonly ctx: CanvasRenderingContext2D;
readonly config: ChartConfigurationInstance;
readonly config: ChartConfiguration<TType, TData, TLabel> | ChartConfigurationCustomTypesPerDataset<TType, TData, TLabel>;
readonly width: number;
readonly height: number;
readonly aspectRatio: number;
Expand All @@ -502,11 +502,11 @@ export declare class Chart<
readonly scales: { [key: string]: Scale };
readonly attached: boolean;

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

data: ChartData;
options: ChartOptions;
data: ChartData<TType, TData, TLabel>;
options: ChartOptions<TType>;

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

Expand Down Expand Up @@ -2197,7 +2197,7 @@ export interface LegendItem {
textAlign?: TextAlign;
}

export interface LegendElement<TType extends ChartType = ChartType> extends Element<AnyObject, LegendOptions<TType>>, LayoutItem {
export interface LegendElement<TType extends ChartType> extends Element<AnyObject, LegendOptions<TType>>, LayoutItem {
chart: Chart<TType>;
ctx: CanvasRenderingContext2D;
legendItems?: LegendItem[];
Expand Down Expand Up @@ -2431,7 +2431,7 @@ export interface TooltipLabelStyle {
*/
borderRadius?: number | BorderRadius;
}
export interface TooltipModel<TType extends ChartType = ChartType> extends Element<AnyObject, TooltipOptions<TType>> {
export interface TooltipModel<TType extends ChartType> extends Element<AnyObject, TooltipOptions<TType>> {
readonly chart: Chart<TType>;

// The items that we are rendering in the tooltip. See Tooltip Item Interface section
Expand Down Expand Up @@ -3676,5 +3676,3 @@ export interface ChartConfigurationCustomTypesPerDataset<
options?: ChartOptions<TType>;
plugins?: Plugin<TType>[];
}

export type ChartConfigurationInstance = ChartConfiguration | ChartConfigurationCustomTypesPerDataset & { type?: undefined }
65 changes: 0 additions & 65 deletions test/types/config_types.ts

This file was deleted.

0 comments on commit 6cb10dc

Please sign in to comment.