|
1 |
| -declare module 'chart.js-image' { |
2 |
| - export default class ChartJSImage { |
3 |
| - constructor(options?: { |
4 |
| - timeout?: number; |
5 |
| - secret?: string; |
6 |
| - host?: string; |
7 |
| - protocol?: string; |
8 |
| - port?: number; |
9 |
| - pathname?: string; |
10 |
| - }) |
| 1 | +export default class ChartJSImage { |
| 2 | + constructor(options?: { |
| 3 | + timeout?: number; |
| 4 | + secret?: string; |
| 5 | + host?: string; |
| 6 | + protocol?: string; |
| 7 | + port?: number; |
| 8 | + pathname?: string; |
| 9 | + }) |
11 | 10 |
|
12 |
| - |
13 |
| - /** |
14 |
| - * Javascript/JSON definition of the chart. Use a Chart.js configuration object. |
15 |
| - * [Reference documentation]{@link } |
16 |
| - * @example |
| 11 | + |
| 12 | + /** |
| 13 | + * Javascript/JSON definition of the chart. Use a Chart.js configuration object. |
| 14 | + * [Reference documentation]{@link } |
| 15 | + * @example |
17 | 16 | * 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]}]}}");
|
18 |
| - * |
19 |
| - * @param {string} value - Javascript/JSON definition of the chart. Use a Chart.js configuration object. |
20 |
| - * @return {ImageCharts.constructor} |
21 |
| - */ |
22 |
| - c(value: string): this; |
23 |
| - |
24 |
| - /** |
25 |
| - * Javascript/JSON definition of the chart. Use a Chart.js configuration object. |
26 |
| - * [Reference documentation]{@link } |
27 |
| - * @example |
| 17 | + * |
| 18 | + * @param {string} value - Javascript/JSON definition of the chart. Use a Chart.js configuration object. |
| 19 | + * @return {ImageCharts.constructor} |
| 20 | + */ |
| 21 | + c(value: string): this; |
| 22 | + |
| 23 | + /** |
| 24 | + * Javascript/JSON definition of the chart. Use a Chart.js configuration object. |
| 25 | + * [Reference documentation]{@link } |
| 26 | + * @example |
28 | 27 | * 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]}]}}");
|
29 |
| - * |
30 |
| - * @param {string} value - Javascript/JSON definition of the chart. Use a Chart.js configuration object. |
31 |
| - * @return {ImageCharts.constructor} |
32 |
| - */ |
33 |
| - chart(value: string): this; |
34 |
| - |
35 |
| - /** |
36 |
| - * Width of the chart |
37 |
| - * [Reference documentation]{@link } |
38 |
| - * @example |
| 28 | + * |
| 29 | + * @param {string} value - Javascript/JSON definition of the chart. Use a Chart.js configuration object. |
| 30 | + * @return {ImageCharts.constructor} |
| 31 | + */ |
| 32 | + chart(value: string): this; |
| 33 | + |
| 34 | + /** |
| 35 | + * Width of the chart |
| 36 | + * [Reference documentation]{@link } |
| 37 | + * @example |
39 | 38 | * const chart = ImageCharts().width("400");
|
40 |
| - * @default "500" |
41 |
| - * @param {integer} value - Width of the chart |
42 |
| - * @return {ImageCharts.constructor} |
43 |
| - */ |
44 |
| - width(value: string): this; |
45 |
| - |
46 |
| - /** |
47 |
| - * Height of the chart |
48 |
| - * [Reference documentation]{@link } |
49 |
| - * @example |
| 39 | + * @default "500" |
| 40 | + * @param {integer} value - Width of the chart |
| 41 | + * @return {ImageCharts.constructor} |
| 42 | + */ |
| 43 | + width(value: string): this; |
| 44 | + |
| 45 | + /** |
| 46 | + * Height of the chart |
| 47 | + * [Reference documentation]{@link } |
| 48 | + * @example |
50 | 49 | * const chart = ImageCharts().height("300");
|
51 |
| - * @default "300" |
52 |
| - * @param {integer} value - Height of the chart |
53 |
| - * @return {ImageCharts.constructor} |
54 |
| - */ |
55 |
| - height(value: string): this; |
56 |
| - |
57 |
| - /** |
58 |
| - * Background of the chart canvas. Accepts rgb (rgb(255,255,120)), colors (red), and url-encoded hex values (%23ff00ff). Abbreviated as "bkg" |
59 |
| - * [Reference documentation]{@link } |
60 |
| - * @example |
| 50 | + * @default "300" |
| 51 | + * @param {integer} value - Height of the chart |
| 52 | + * @return {ImageCharts.constructor} |
| 53 | + */ |
| 54 | + height(value: string): this; |
| 55 | + |
| 56 | + /** |
| 57 | + * Background of the chart canvas. Accepts rgb (rgb(255,255,120)), colors (red), and url-encoded hex values (%23ff00ff). Abbreviated as "bkg" |
| 58 | + * [Reference documentation]{@link } |
| 59 | + * @example |
61 | 60 | * const chart = ImageCharts().backgroundColor("black");
|
62 | 61 | * const chart = ImageCharts().backgroundColor("rgb(255,255,120)");
|
63 | 62 | * const chart = ImageCharts().backgroundColor("%23ff00ff");
|
64 |
| - * |
65 |
| - * @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" |
66 |
| - * @return {ImageCharts.constructor} |
67 |
| - */ |
68 |
| - backgroundColor(value: string): this; |
69 |
| - |
70 |
| - /** |
71 |
| - * Background of the chart canvas. Accepts rgb (rgb(255,255,120)), colors (red), and url-encoded hex values (%23ff00ff). Abbreviated as "bkg" |
72 |
| - * [Reference documentation]{@link } |
73 |
| - * @example |
| 63 | + * |
| 64 | + * @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" |
| 65 | + * @return {ImageCharts.constructor} |
| 66 | + */ |
| 67 | + backgroundColor(value: string): this; |
| 68 | + |
| 69 | + /** |
| 70 | + * Background of the chart canvas. Accepts rgb (rgb(255,255,120)), colors (red), and url-encoded hex values (%23ff00ff). Abbreviated as "bkg" |
| 71 | + * [Reference documentation]{@link } |
| 72 | + * @example |
74 | 73 | * const chart = ImageCharts().bkg("black");
|
75 | 74 | * const chart = ImageCharts().bkg("rgb(255,255,120)");
|
76 | 75 | * const chart = ImageCharts().bkg("%23ff00ff");
|
77 |
| - * |
78 |
| - * @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" |
79 |
| - * @return {ImageCharts.constructor} |
80 |
| - */ |
81 |
| - bkg(value: string): this; |
82 |
| - |
83 |
| - /** |
84 |
| - * Encoding of your "chart" parameter. Accepted values are url and base64. |
85 |
| - * [Reference documentation]{@link } |
86 |
| - * @example |
| 76 | + * |
| 77 | + * @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" |
| 78 | + * @return {ImageCharts.constructor} |
| 79 | + */ |
| 80 | + bkg(value: string): this; |
| 81 | + |
| 82 | + /** |
| 83 | + * Encoding of your "chart" parameter. Accepted values are url and base64. |
| 84 | + * [Reference documentation]{@link } |
| 85 | + * @example |
87 | 86 | * const chart = ImageCharts().encoding("url");
|
88 | 87 | * const chart = ImageCharts().encoding("base64");
|
89 |
| - * @default "url" |
90 |
| - * @param {string} value - Encoding of your "chart" parameter. Accepted values are url and base64. |
91 |
| - * @return {ImageCharts.constructor} |
92 |
| - */ |
93 |
| - encoding(value: string): this; |
94 |
| - |
95 |
| - /** |
96 |
| - * image-charts enterprise `account_id` |
97 |
| - * [Reference documentation]{@link https://documentation.image-charts.com/enterprise/} |
98 |
| - * @example |
| 88 | + * @default "url" |
| 89 | + * @param {string} value - Encoding of your "chart" parameter. Accepted values are url and base64. |
| 90 | + * @return {ImageCharts.constructor} |
| 91 | + */ |
| 92 | + encoding(value: string): this; |
| 93 | + |
| 94 | + /** |
| 95 | + * image-charts enterprise `account_id` |
| 96 | + * [Reference documentation]{@link https://documentation.image-charts.com/enterprise/} |
| 97 | + * @example |
99 | 98 | * const chart = ImageCharts().icac("accountId");
|
100 |
| - * |
101 |
| - * @param {string} value - image-charts enterprise `account_id` |
102 |
| - * @return {ImageCharts.constructor} |
103 |
| - */ |
104 |
| - icac(value: string): this; |
105 |
| - |
106 |
| - /** |
107 |
| - * HMAC-SHA256 signature required to activate paid features |
108 |
| - * [Reference documentation]{@link https://documentation.image-charts.com/enterprise/} |
109 |
| - * @example |
| 99 | + * |
| 100 | + * @param {string} value - image-charts enterprise `account_id` |
| 101 | + * @return {ImageCharts.constructor} |
| 102 | + */ |
| 103 | + icac(value: string): this; |
| 104 | + |
| 105 | + /** |
| 106 | + * HMAC-SHA256 signature required to activate paid features |
| 107 | + * [Reference documentation]{@link https://documentation.image-charts.com/enterprise/} |
| 108 | + * @example |
110 | 109 | * const chart = ImageCharts().ichm("0785cf22a0381c2e0239e27c126de4181f501d117c2c81745611e9db928b0376");
|
111 |
| - * |
112 |
| - * @param {string} value - HMAC-SHA256 signature required to activate paid features |
113 |
| - * @return {ImageCharts.constructor} |
114 |
| - */ |
115 |
| - ichm(value: string): this; |
116 |
| - |
117 |
| - /** |
118 |
| - * 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. |
| 110 | + * |
| 111 | + * @param {string} value - HMAC-SHA256 signature required to activate paid features |
| 112 | + * @return {ImageCharts.constructor} |
| 113 | + */ |
| 114 | + ichm(value: string): this; |
| 115 | + |
| 116 | + /** |
| 117 | + * 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. |
119 | 118 | * 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
|
120 |
| - * [Reference documentation]{@link https://documentation.image-charts.com/reference/retina/} |
121 |
| - * @example |
| 119 | + * [Reference documentation]{@link https://documentation.image-charts.com/reference/retina/} |
| 120 | + * @example |
122 | 121 | * const chart = ImageCharts().icretina("1");
|
123 |
| - * |
124 |
| - * @param {string} value - retina mode |
125 |
| - * @return {ImageCharts.constructor} |
126 |
| - */ |
127 |
| - icretina(value: string): this; |
128 |
| - |
| 122 | + * |
| 123 | + * @param {string} value - retina mode |
| 124 | + * @return {ImageCharts.constructor} |
| 125 | + */ |
| 126 | + icretina(value: string): this; |
| 127 | + |
129 | 128 |
|
130 |
| - /** |
131 |
| - * Get the full Image-Charts API url (signed and encoded if necessary) |
132 |
| - * @return full generated url |
133 |
| - */ |
134 |
| - toURL(): string; |
| 129 | + /** |
| 130 | + * Get the full Image-Charts API url (signed and encoded if necessary) |
| 131 | + * @return full generated url |
| 132 | + */ |
| 133 | + toURL(): string; |
135 | 134 |
|
136 |
| - /** |
137 |
| - * Do a request to Image-Charts API with current configuration and yield a promise of a NodeJS buffer |
138 |
| - * @return binary image represented as a NodeJS Buffer wrapped inside a promise |
139 |
| - */ |
140 |
| - toBuffer(): Promise<Buffer>; |
| 135 | + /** |
| 136 | + * Do a request to Image-Charts API with current configuration and yield a promise of a NodeJS buffer |
| 137 | + * @return binary image represented as a NodeJS Buffer wrapped inside a promise |
| 138 | + */ |
| 139 | + toBuffer(): Promise<Buffer>; |
141 | 140 |
|
142 |
| - /** |
143 |
| - * Do a request to Image-Charts API with current configuration and yield a promise of a base64 encoded data URI |
144 |
| - * @return base64 data URI wrapped inside a promise |
145 |
| - */ |
146 |
| - toDataURI(): Promise<string>; |
147 |
| - } |
| 141 | + /** |
| 142 | + * Do a request to Image-Charts API with current configuration and yield a promise of a base64 encoded data URI |
| 143 | + * @return base64 data URI wrapped inside a promise |
| 144 | + */ |
| 145 | + toDataURI(): Promise<string>; |
148 | 146 | }
|
0 commit comments