Skip to content

Commit

Permalink
fix(types): Fix axis types definition
Browse files Browse the repository at this point in the history
Fix wrong types gropings for some axis options.

Fix #2499
  • Loading branch information
netil committed Jan 12, 2022
1 parent 5978725 commit 92fb033
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions types/axis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export interface xAxisConfiguration extends AxisConfigurationBase {
* Set default extent for subchart and zoom.
* This can be an array or function that returns an array.
*/
extent?: number[] | string[] | (
extent?: Array<number|string> | (
(
this: Chart,
domain: Date|string|number[],
domain: Array<Date|string|number>,
scale: (value: any) => number
) => number[]
);
Expand Down Expand Up @@ -233,7 +233,7 @@ export interface XTickConfiguration {
* If this option is provided, the position of the ticks will be determined based on those values.
* This option works with timeseries data and the x values will be parsed accoding to the type of the value and data.xFormat option.
*/
values?: number[] | string[] | ((this: Chart) => number[]);
values?: Array<number|string> | ((this: Chart) => number[]);

/**
* Rotate x axis tick text.
Expand Down Expand Up @@ -414,6 +414,6 @@ export interface AxesConfiguration {
/**
* Set tick values manually
*/
values?: number|string|Date[];
values?: Array<number|string|Date>;
};
}
2 changes: 1 addition & 1 deletion types/chart.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export interface Chart {
load(this: Chart, args: {
append?: boolean;
url?: string;
json?: [{ [key: string]: string | number }] | {[key: string]: string[] | number[]};
json?: [{ [key: string]: string | number }] | {[key: string]: Array<string|number>};
rows?: PrimitiveArray[];
columns?: PrimitiveArray[];
data?: Array<{ [key: string]: number }>;
Expand Down

0 comments on commit 92fb033

Please sign in to comment.