diff --git a/types/highcharts/highstock.d.ts b/types/highcharts/highstock.d.ts index a97ae9effa..cc92bebe36 100644 --- a/types/highcharts/highstock.d.ts +++ b/types/highcharts/highstock.d.ts @@ -2,7 +2,8 @@ // Project: http://www.highcharts.com/ // Definitions by: David Deutsch -// Definitions by: Dave Baumann +// Dave Baumann +// Richard Ison // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as Highcharts from "highcharts"; @@ -31,11 +32,16 @@ declare namespace Highstock { yAxis?: Highcharts.AxisOptions; } + interface RangeSelectorButtonEvent { + click?(event: Event): void; + } + interface RangeSelectorButton { type: string; // Defines the timespan, can be one of 'millisecond', 'second', 'minute', 'day', 'week', 'month', 'ytd' (year to date), 'year' and 'all'. count?: number; text: string; dataGrouping?: any; // not sure how this works + events?: RangeSelectorButtonEvent; } interface RangeSelectorOptions { diff --git a/types/highcharts/test/highstock.ts b/types/highcharts/test/highstock.ts index 2021e65b68..f1a464f491 100644 --- a/types/highcharts/test/highstock.ts +++ b/types/highcharts/test/highstock.ts @@ -25,6 +25,14 @@ $(() => { rangeSelector: { allButtonsEnabled: true, selected: 1, + buttons: [{ + type: 'month', + count: 1, + text: '1m', + events: { + click: () => { } + } + }], buttonTheme: { // styles for the buttons fill: 'none', stroke: 'none',