forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
highstock.d.ts
120 lines (108 loc) · 3.82 KB
/
highstock.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Type definitions for Highstock 2.1.5
// Project: http://www.highcharts.com/
// Definitions by: David Deutsch <http://github.com/DavidKDeutsch>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="highcharts.d.ts" />
interface HighstockChartObject extends HighchartsChartObject {
options: HighstockOptions;
}
interface HighstockNavigatorOptions {
adaptToUpdatedData?: boolean;
baseSeries?: string | number;
enabled?: boolean;
handles?: {
backgroundColor?: string;
borderColor?: string;
};
height?: number;
margin?: number;
maskFill?: string;
maskInside?: boolean;
outlineColor?: string;
outlineWidth?: number;
series?: HighchartsIndividualSeriesOptions;
xAxis?: HighchartsAxisOptions;
yAxis?: HighchartsAxisOptions;
}
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
}
interface HighstockRangeSelectorOptions {
allButtonsEnabled?: boolean;
buttonSpacing?: number;
buttonTheme?: any;
buttons?: RangeSelectorButton[];
enabled?: boolean;
inputBoxBorderColor?: string;
inputBoxHeight?: number;
inputBoxWidth?: number;
inputDateFormat?: string;
inputDateParser?: (date: string) => number;
inputEditDateFormat?: string;
inputEnabled?: boolean;
inputPosition?: {
align?: string;
verticalAlign?: string;
x?: number;
y?: number;
};
inputStyle?: HighchartsCSSObject;
labelStyle?: HighchartsCSSObject;
selected?: number;
}
interface HighstockScrollbarOptions {
barBackgroundColor?: string;
barBorderColor?: string;
barBorderRadius?: number;
barBorderWidth?: number;
buttonArrowColor?: string;
buttonBackgroundColor?: string;
buttonBorderColor?: string;
buttonBorderRadius?: number;
buttonBorderWidth?: number;
enabled?: boolean;
height?: number;
liveRedraw?: boolean;
minWidth?: number;
rifleColor?: string;
trackBackgroundColor?: string;
trackBorderColor?: string;
trackBorderRadius?: number;
trackBorderWidth?: number;
}
interface HighstockOptions extends HighchartsOptions {
navigator?: HighstockNavigatorOptions;
rangeSelector?: HighstockRangeSelectorOptions;
scrollbar?: HighstockScrollbarOptions;
}
interface HighstockChart {
new (options: HighstockOptions): HighstockChartObject;
new (options: HighstockOptions, callback: (chart: HighstockChartObject) => void): HighstockChartObject;
}
interface HighchartsStatic {
StockChart: HighstockChart;
}
interface JQuery {
highcharts(type: "StockChart"): HighstockChartObject;
/**
* Creates a new Highcharts.Chart for the current JQuery selector; usually
* a div selected by $('#container')
* @param {HighchartsOptions} options Options for this chart
* @return current {JQuery} selector the current JQuery selector
**/
highcharts(type: "StockChart", options: HighstockOptions): JQuery;
/**
* Creates a new Highcharts.Chart for the current JQuery selector; usually
* a div selected by $('#container')
* @param {HighchartsOptions} options Options for this chart
* @param callback Callback function used to manipulate the constructed chart instance
* @return current {JQuery} selector the current JQuery selector
**/
highcharts(type: "StockChart", options: HighstockOptions, callback: (chart: HighstockChartObject) => void): JQuery;
highcharts(type: string): HighchartsChartObject;
highcharts(type: string, options: HighchartsOptions): JQuery;
highcharts(type: string, options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): JQuery;
}