forked from 472647301/react-native-kline
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
502 lines (495 loc) · 9.15 KB
/
index.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
import * as React from "react";
import { ViewProps } from "react-native";
export interface KLineBar {
amount: number;
open: number;
close: number;
high: number;
id: number;
low: number;
vol: number;
}
export type KLineEvent = "update" | "add";
export interface KLineCallbackParams {
id: number;
}
export declare enum CandleHollow {
/**
* 全实心
*/
NONE_HOLLOW,
/**
* 全空心
*/
ALL_HOLLOW,
/**
* 涨空心
*/
DECREASE_HOLLOW,
/**
* 跌实心
*/
INCREASE_HOLLOW,
}
export declare enum KLineIndicator {
MainMA,
MainBOLL,
MainNONE,
ChildMACD,
ChildKDJ,
ChildRSI,
ChildWR,
ChildNONE,
/**
* 分时图显示
*/
TimeLineShow,
TimeLineHide,
/**
* 成交量显示
*/
VolumeShow,
VolumeHide,
}
export interface ByronKlineProps {
/**
* K线历史数据
*/
datas: Array<KLineBar>;
/**
* 多语言配置
*/
locales: Array<string>;
/**
* 指标配置
*/
indicators: Array<KLineIndicator>;
/**
* 价格精度
*/
pricePrecision: number;
/**
* 数量精度
*/
volumePrecision: number;
/**
* 图表请求加载更多历史数据
*/
onMoreKLineData: (params: KLineCallbackParams) => void;
/**
* 周期
*/
period: number;
/**
*主图背景色
*/
mainBackgroundColor: string;
/**
* 设置选中X轴坐标背景色
*/
selectedXLabelBackgroundColor: string;
/**
* 设置价格线上的文字颜色
*/
priceLabelInLineTextColor: string;
/**
* 设置价格线上的文字大小
*/
priceLabelInLineTextSize: number;
/**
* 设置选中X坐标文字颜色
*/
selectedLabelTextColor: string;
/**
* 设置选中X坐标文字大小
*/
selectedLabelTextSize: number;
/**
* 设置价格线上价格框离右距离
*/
priceLabelInLineBoxMarginRight: number;
/**
* 价格线上价格图形宽
*/
priceLabelInLineShapeWidth: number;
/**
* 价格线上价格图形高
*/
priceLabelInLineShapeHeight: number;
/**
* 设置价格线上价格框高度
*/
priceLabelInLineBoxHeight: number;
/**
* 设置价格线上价格框内边距
*/
priceLabelInLineBoxPadding: number;
/**
* 价格线上价格文字与图形的间隔
*/
priceLabelInLineBoxShapeTextMargin: number;
/**
* 设置价格线价格框可点击
*/
priceLabelInLineClickable: boolean;
/**
* 设置右侧价格框背景色
*/
priceLabelInLineBoxBackgroundColor: string;
/**
* 设置价格线右侧框背景
*/
priceLabelRightBackgroundColor: string;
/**
* 设置价格线右侧框边框颜色
*/
priceLabelInLineBoxBorderColor: string;
/**
* 设置价格线框边框宽度
*/
priceLabelInLineBoxBorderWidth: number;
/**
* 设置价格线上价格框圆角半径
*/
priceLabelInLineBoxRadius: number;
/**
* 设置价格线右侧标签的背景透明度
*/
priceLineRightLabelBackGroundAlpha: number;
/**
* 设置价格线右侧价格文字的颜色
*/
priceLabelRightTextColor: string;
/**
* 设置价格线右侧的颜色
*/
priceLineRightColor: string;
/**
* 设置价格线的宽度
*/
priceLineWidth: number;
/**
* 设置价格线颜色
*/
priceLineColor: string;
/**
* 价格线虚线实心宽度
*/
priceLineDotSolidWidth: number;
/**
* 价格线实心间隔
*/
priceLineDotStrokeWidth: number;
/**
* 设置选择器横线宽
*/
selectedXLineWidth: number;
/**
* 设置十字线竖线宽度
*/
selectedYLineWidth: number;
/**
* 设置十字线横线颜色
*/
selectedXLineColor: string;
/**
* 设置十字线竖线画笔颜色
*/
selectedYLineColor: string;
/**
* 选中的线的Y轴颜色
*/
selectedYColor: string;
/**
* 设置都十字线选中点外圆颜色
*/
selectedCrossBigColor: string;
/**
* 设置十字线相交小圆半径
*/
selectedCrossPointRadius: number;
/**
* 设置十字线交点小圆颜色
*/
selectedCrossPointColor: string;
/**
* 设置选中时是否显示十字线的交点圆
*/
selectedShowCrossPoint: boolean;
/**
* 设置选中Y值背景色
*/
selectedPriceBoxBackgroundColor: string;
/**
* 设置选择器文字大小
*/
selectedInfoTextSize: number;
/**
* 选中时价格label的横向padding
*/
selectedPriceBoxHorizontalPadding: number;
/**
* 选中时价格label的纵向padding
*/
selectedPriceBoxVerticalPadding: number;
/**
* 选中信息框内边距,上下为此值*2
*/
selectedInfoBoxPadding: number;
/**
* 选中行弹出框与边缘的距离
*/
selectedInfoBoxMargin: number;
/**
* 设置选择器弹出框文字颜色
*/
selectedInfoBoxTextColor: string;
/**
* 设置选择器弹出框边框颜色
*/
selectedInfoBoxBorderColor: string;
/**
* 设置选择器背景颜色
*/
selectedInfoBoxBackgroundColor: string;
/**
* 选中时X坐标边框线宽
*/
selectedLabelBorderWidth: number;
/**
* 选中时X坐标边框线颜色
*/
selectedLabelBorderColor: string;
/**
* 设置背景色顶部颜色
*/
backgroundFillTopColor: string;
/**
* 设置背景色底部颜色
*/
backgroundFillBottomColor: string;
/**
* 设置分时线颜色
*/
timeLineColor: string;
/**
* 设置分时线填充渐变的顶部颜色
*/
timeLineFillTopColor: string;
/**
* 设置分时线填充渐变的底部颜色
*/
timeLineFillBottomColor: string;
/**
* 分时线呼吸灯的颜色
*/
timeLineEndPointColor: string;
/**
* 分时线呼吸灯的颜色半径
*/
timeLineEndRadius: number;
/**
* 选中十字线X轴坐标连框纵向内边距
*/
selectedDateBoxVerticalPadding: number;
/**
* 选中十字线X轴坐标连框横向内边距
*/
selectedDateBoxHorizontalPadding: number;
/**
* 设置主实图图例距离视图上边缘的距离
*/
mainLegendMarginTop: number;
/**
* 设置图例距离视图左边缘的距离
*/
legendMarginLeft: number;
/**
* 设置涨的颜色
*/
increaseColor: string;
/**
* 设置跌的颜色
*/
decreaseColor: string;
/**
* 设置是否自适应X左右边轴坐标的位置,默认true
*/
betterXLabel: boolean;
/**
* 设置坐标文字大小
*/
labelTextSize: number;
/**
* 设置坐标轴坐标文字颜色
*/
labelTextColor: string;
/**
* 设置Y轴显示在左侧/右侧
*/
yLabelAlign: boolean;
/**
* b设置是否自适应X左右边轴坐标的位置,默认true
*/
betterSelectedXLabel: boolean;
/**
* 统一设置设置文字大小
*/
commonTextSize: number;
/**
* 设置上方padding
*/
mainMarginTop: number;
/**
* 设置下方padding
*/
paddingBottom: number;
/**
* 子视图的顶部padding
*/
childPaddingTop: number;
/**
* 设置通用文字颜色
*/
commonTextColor: string;
/**
* 全局通用线宽
*/
lineWidth: number;
/**
* 设置每根蜡烛图宽度
*/
candleWidth: number;
/**
* 设置蜡烛线画笔宽(空心时的线宽)
*/
candleLineWidth: number;
/**
* 设置主视图最大/最小值文字颜色
*/
limitTextColor: string;
/**
* 蜡烛是否空心
*/
candleHollow: CandleHollow;
/**
* 设置背景网格线宽
*/
gridLineWidth: number;
/**
* 设置背景网格线颜色
*/
gridLineColor: string;
/**
* 设置背景网格行数
*/
gridLineRows: number;
/**
* 设置背景网格列数
*/
gridLineColumns: number;
/**
* macd空心时线宽
*/
macdStrokeWidth: number;
/**
* 设置macd 上涨颜色
*/
macdIncreaseColor: string;
/**
* 设置macd 下跌颜色
*/
macdDecreaseColor: string;
/**
* macd柱状图宽
*/
macdWidth: number;
/**
* 设置DIF颜色
*/
difColor: string;
/**
* 设置DEA颜色
*/
deaColor: string;
/**
* 设置MACD颜色
*/
macdColor: string;
/**
* 设置WR1颜色
*/
wr1Color: string;
/**
* 设置WR2颜色
*/
wr2Color: string;
/**
* 设置WR3颜色
*/
wr3Color: string;
/**
* 设置K颜色
*/
kColor: string;
/**
* 设置D颜色
*/
dColor: string;
/**
* 设置J颜色
*/
jColor: string;
/**
* 设置RSI1颜色
*/
rsi1Color: string;
/**
* 设置RSI2颜色
*/
rsi2Color: string;
/**
* 设置RSI3颜色
*/
rsi3Color: string;
/**
* 设置MA1颜色
*/
ma1Color: string;
/**
* 设置MA2颜色
*/
ma2Color: string;
/**
* 设置MA3颜色
*/
ma3Color: string;
/**
* 设置交易量MA1颜色
*/
volMa1Color: string;
/**
* 设置交易量MA2颜色
*/
volMa2Color: string;
/**
* 交易量图例颜色
*/
volLegendColor: string;
/**
* 设置当成交量视图显示为线时的颜色
*/
volLineChartColor: string;
/**
* 交易量图例距离量视图上边缘的距离
*/
volLegendMarginTop: number;
}
declare class ByronKlineComponent extends React.Component<
Partial<ByronKlineProps> & ViewProps
> {}
export default class ByronKlineChart extends ByronKlineComponent {}
export declare function dispatchByronKline(
event: KLineEvent,
list?: Array<KLineBar>
): void;