Skip to content

Commit 28bf4e7

Browse files
trodiValentinH
authored andcommitted
fix(Typescript): typescript support for ticksArray as array of objects (#666)
1 parent 3499df0 commit 28bf4e7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dist/rzslider.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ declare module "angular" {
7575
* {value: 10, legend: 'Legend for 10'} // the display value will be 10 and a legend will be displayed under the corresponding tick.
7676
* ]
7777
*/
78-
stepsArray?: any[];
78+
stepsArray?: number[] | Array<{value: number; legend?: string}>;
7979
/**
8080
* Boolean (defaults to false): Set to true to bind the index of the selected item to rz-slider-model and rz-slider-high.
8181
* (This was the default behavior prior to 4.0).
@@ -131,8 +131,8 @@ declare module "angular" {
131131
showTicks?: boolean | number;
132132
/** Boolean or Number (defaults to false): Set to true to display a tick and the step value for each step of the slider. Set an integer to display ticks and the step value at intermediate positions. */
133133
showTicksValues?: boolean | number;
134-
/** Array (defaults to null): Use to display ticks at specific positions. The array contains the index of the ticks that should be displayed. For example, [0, 1, 5] will display a tick for the first, second and sixth values. */
135-
ticksArray?: number[];
134+
/** Array (defaults to null): Use to display ticks at specific positions. The array contains the index of the ticks that should be displayed. For example, [0, 1, 5] will display a tick for the first, second and sixth values. It also supports the { value: 0, legend: 'Bad' } format to display a legend for each tick. */
135+
ticksArray?: number[] | Array<{value: number; legend?: string}>;
136136
/** Function(value) (defaults to null): (requires angular-ui bootstrap) Used to display a tooltip when a tick is hovered. Set to a function that returns the tooltip content for a given value. */
137137
ticksTooltip?: (value: number) => string;
138138
/** Function(value) (defaults to null): Same as ticksTooltip but for ticks values. */

rzslider.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ declare module "angular" {
7575
* {value: 10, legend: 'Legend for 10'} // the display value will be 10 and a legend will be displayed under the corresponding tick.
7676
* ]
7777
*/
78-
stepsArray?: any[];
78+
stepsArray?: number[] | Array<{value: number; legend?: string}>;
7979
/**
8080
* Boolean (defaults to false): Set to true to bind the index of the selected item to rz-slider-model and rz-slider-high.
8181
* (This was the default behavior prior to 4.0).
@@ -131,8 +131,8 @@ declare module "angular" {
131131
showTicks?: boolean | number;
132132
/** Boolean or Number (defaults to false): Set to true to display a tick and the step value for each step of the slider. Set an integer to display ticks and the step value at intermediate positions. */
133133
showTicksValues?: boolean | number;
134-
/** Array (defaults to null): Use to display ticks at specific positions. The array contains the index of the ticks that should be displayed. For example, [0, 1, 5] will display a tick for the first, second and sixth values. */
135-
ticksArray?: number[];
134+
/** Array (defaults to null): Use to display ticks at specific positions. The array contains the index of the ticks that should be displayed. For example, [0, 1, 5] will display a tick for the first, second and sixth values. It also supports the { value: 0, legend: 'Bad' } format to display a legend for each tick. */
135+
ticksArray?: number[] | Array<{value: number; legend?: string}>;
136136
/** Function(value) (defaults to null): (requires angular-ui bootstrap) Used to display a tooltip when a tick is hovered. Set to a function that returns the tooltip content for a given value. */
137137
ticksTooltip?: (value: number) => string;
138138
/** Function(value) (defaults to null): Same as ticksTooltip but for ticks values. */

0 commit comments

Comments
 (0)