Skip to content

Commit

Permalink
fix(type): fix wrong .grid() API param type
Browse files Browse the repository at this point in the history
Fix wrong .grid API parameter type

Ref #3037
  • Loading branch information
netil authored Jan 17, 2023
1 parent 6145f1e commit 0ef8a51
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions types/chart.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,30 @@ export interface Chart {
* Update regions.
* @param regions Regions will be replaced with this argument. The format of this argument is the same as regions.
*/
(regions: any[]): void;
(regions: Array<{
axis: "x" | "y" | "y2",
start?: number | Date,
end?: number | Date,
class?: string
}>): void;

/**
* Add new region. This API adds new region instead of replacing like regions.
* @param grids New region will be added. The format of this argument is the same as regions and it's possible to give an Object if only one region will be added.
*/
add(regions: any[] | {}): void;
add<T = {
axis: "x" | "y" | "y2",
start?: number | Date,
end?: number | Date,
class?: string
}>(regions: T | T[]): void;

/**
* Remove regions. This API removes regions.
* @param args This argument should include classes. If classes is given, the regions that have one of the specified classes will be removed. If args is not given, all of regions will be
* removed.
*/
remove(args?: { value?: number | string; class?: string }): void;
remove(args?: { classes: string[] }): void;
};

data: {
Expand Down

0 comments on commit 0ef8a51

Please sign in to comment.