-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.d.ts
146 lines (131 loc) · 5.84 KB
/
types.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
export default class ChartJSImage {
constructor(options?: {
timeout?: number;
secret?: string;
host?: string;
protocol?: string;
port?: number;
pathname?: string;
})
/**
* Javascript/JSON definition of the chart. Use a Chart.js configuration object.
* [Reference documentation]{@link }
* @example
* const chart = ImageCharts().c("{type:'bar',data:{labels:['Q1','Q2','Q3','Q4'],datasets:[{label:'Users',data:[50,60,70,180]},{label:'Revenue',data:[100,200,300,400]}]}}");
*
* @param {string} value - Javascript/JSON definition of the chart. Use a Chart.js configuration object.
* @return {ImageCharts.constructor}
*/
c(value: string): this;
/**
* Javascript/JSON definition of the chart. Use a Chart.js configuration object.
* [Reference documentation]{@link }
* @example
* const chart = ImageCharts().chart("{type:'bar',data:{labels:['Q1','Q2','Q3','Q4'],datasets:[{label:'Users',data:[50,60,70,180]},{label:'Revenue',data:[100,200,300,400]}]}}");
*
* @param {string} value - Javascript/JSON definition of the chart. Use a Chart.js configuration object.
* @return {ImageCharts.constructor}
*/
chart(value: string): this;
/**
* Width of the chart
* [Reference documentation]{@link }
* @example
* const chart = ImageCharts().width("400");
* @default "500"
* @param {integer} value - Width of the chart
* @return {ImageCharts.constructor}
*/
width(value: string): this;
/**
* Height of the chart
* [Reference documentation]{@link }
* @example
* const chart = ImageCharts().height("300");
* @default "300"
* @param {integer} value - Height of the chart
* @return {ImageCharts.constructor}
*/
height(value: string): this;
/**
* Background of the chart canvas. Accepts rgb (rgb(255,255,120)), colors (red), and url-encoded hex values (%23ff00ff). Abbreviated as "bkg"
* [Reference documentation]{@link }
* @example
* const chart = ImageCharts().backgroundColor("black");
* const chart = ImageCharts().backgroundColor("rgb(255,255,120)");
* const chart = ImageCharts().backgroundColor("%23ff00ff");
*
* @param {string} value - Background of the chart canvas. Accepts rgb (rgb(255,255,120)), colors (red), and url-encoded hex values (%23ff00ff). Abbreviated as "bkg"
* @return {ImageCharts.constructor}
*/
backgroundColor(value: string): this;
/**
* Background of the chart canvas. Accepts rgb (rgb(255,255,120)), colors (red), and url-encoded hex values (%23ff00ff). Abbreviated as "bkg"
* [Reference documentation]{@link }
* @example
* const chart = ImageCharts().bkg("black");
* const chart = ImageCharts().bkg("rgb(255,255,120)");
* const chart = ImageCharts().bkg("%23ff00ff");
*
* @param {string} value - Background of the chart canvas. Accepts rgb (rgb(255,255,120)), colors (red), and url-encoded hex values (%23ff00ff). Abbreviated as "bkg"
* @return {ImageCharts.constructor}
*/
bkg(value: string): this;
/**
* Encoding of your "chart" parameter. Accepted values are url and base64.
* [Reference documentation]{@link }
* @example
* const chart = ImageCharts().encoding("url");
* const chart = ImageCharts().encoding("base64");
* @default "url"
* @param {string} value - Encoding of your "chart" parameter. Accepted values are url and base64.
* @return {ImageCharts.constructor}
*/
encoding(value: string): this;
/**
* image-charts enterprise `account_id`
* [Reference documentation]{@link https://documentation.image-charts.com/enterprise/}
* @example
* const chart = ImageCharts().icac("accountId");
*
* @param {string} value - image-charts enterprise `account_id`
* @return {ImageCharts.constructor}
*/
icac(value: string): this;
/**
* HMAC-SHA256 signature required to activate paid features
* [Reference documentation]{@link https://documentation.image-charts.com/enterprise/}
* @example
* const chart = ImageCharts().ichm("0785cf22a0381c2e0239e27c126de4181f501d117c2c81745611e9db928b0376");
*
* @param {string} value - HMAC-SHA256 signature required to activate paid features
* @return {ImageCharts.constructor}
*/
ichm(value: string): this;
/**
* Retina is a marketing term coined by Apple that refers to devices and monitors that have a resolution and pixel density so high — roughly 300 or more pixels per inch – that a person is unable to discern the individual pixels at a normal viewing distance.
* In order to generate beautiful charts for these Retina displays, Image-Charts supports a retina mode that can be activated through the icretina=1 parameter
* [Reference documentation]{@link https://documentation.image-charts.com/reference/retina/}
* @example
* const chart = ImageCharts().icretina("1");
*
* @param {string} value - retina mode
* @return {ImageCharts.constructor}
*/
icretina(value: string): this;
/**
* Get the full Image-Charts API url (signed and encoded if necessary)
* @return full generated url
*/
toURL(): string;
/**
* Do a request to Image-Charts API with current configuration and yield a promise of a NodeJS buffer
* @return binary image represented as a NodeJS Buffer wrapped inside a promise
*/
toBuffer(): Promise<Buffer>;
/**
* Do a request to Image-Charts API with current configuration and yield a promise of a base64 encoded data URI
* @return base64 data URI wrapped inside a promise
*/
toDataURI(): Promise<string>;
}