@chartspire/chartspire-chart 0.5.0 → 10.0.0-alpha2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1195 @@
1
+ /**
2
+ * Licensed under the Apache License, Version 2.0 (the "License");
3
+ * you may not use this file except in compliance with the License.
4
+ * You may obtain a copy of the License at
5
+
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ */
14
+ export type Nullable<T> = T | null;
15
+ export interface KLineData {
16
+ timestamp: number;
17
+ open: number;
18
+ high: number;
19
+ low: number;
20
+ close: number;
21
+ volume?: number;
22
+ turnover?: number;
23
+ [key: string]: unknown;
24
+ }
25
+ export interface Margin {
26
+ marginLeft: number;
27
+ marginTop: number;
28
+ marginRight: number;
29
+ marginBottom: number;
30
+ }
31
+ export interface Padding {
32
+ paddingLeft: number;
33
+ paddingTop: number;
34
+ paddingRight: number;
35
+ paddingBottom: number;
36
+ }
37
+ export interface Offset {
38
+ offsetLeft: number;
39
+ offsetTop: number;
40
+ offsetRight: number;
41
+ offsetBottom: number;
42
+ }
43
+ /**
44
+ * line type
45
+ */
46
+ export declare enum LineType {
47
+ Dashed = "dashed",
48
+ Solid = "solid"
49
+ }
50
+ export interface LineStyle {
51
+ style: LineType;
52
+ size: number;
53
+ color: string;
54
+ dashedValue: number[];
55
+ }
56
+ export interface SmoothLineStyle extends LineStyle {
57
+ smooth: boolean | number;
58
+ }
59
+ export interface StateLineStyle extends LineStyle {
60
+ show: boolean;
61
+ }
62
+ export declare enum PolygonType {
63
+ Stroke = "stroke",
64
+ Fill = "fill",
65
+ StrokeFill = "stroke_fill"
66
+ }
67
+ export interface PolygonStyle {
68
+ style: PolygonType;
69
+ color: string | CanvasGradient;
70
+ borderColor: string;
71
+ borderSize: number;
72
+ borderStyle: LineType;
73
+ borderDashedValue: number[];
74
+ }
75
+ export interface RectStyle extends PolygonStyle {
76
+ borderRadius: number;
77
+ }
78
+ export interface TextStyle extends Padding {
79
+ style: PolygonType;
80
+ color: string;
81
+ size: number;
82
+ family: string;
83
+ weight: number | string;
84
+ borderStyle: LineType;
85
+ borderDashedValue: number[];
86
+ borderSize: number;
87
+ borderColor: string;
88
+ borderRadius: number;
89
+ backgroundColor: string | CanvasGradient;
90
+ }
91
+ export interface StateTextStyle extends TextStyle {
92
+ show: boolean;
93
+ }
94
+ export type LastValueMarkTextStyle = Omit<StateTextStyle, "backgroundColor">;
95
+ export declare enum TooltipShowRule {
96
+ Always = "always",
97
+ FollowCross = "follow_cross",
98
+ None = "none"
99
+ }
100
+ export declare enum TooltipShowType {
101
+ Standard = "standard",
102
+ Rect = "rect"
103
+ }
104
+ export interface ChangeColor {
105
+ upColor: string;
106
+ downColor: string;
107
+ noChangeColor: string;
108
+ }
109
+ export interface GradientColor {
110
+ offset: number;
111
+ color: string;
112
+ }
113
+ export interface GridStyle {
114
+ show: boolean;
115
+ horizontal: StateLineStyle;
116
+ vertical: StateLineStyle;
117
+ }
118
+ export type TooltipTextStyle = Pick<TextStyle, "color" | "size" | "family" | "weight"> & Margin;
119
+ export interface TooltipLegendChild {
120
+ text: string;
121
+ color: string;
122
+ }
123
+ export interface TooltipLegend {
124
+ title: string | TooltipLegendChild;
125
+ value: string | TooltipLegendChild;
126
+ }
127
+ export declare enum TooltipIconPosition {
128
+ Left = "left",
129
+ Middle = "middle",
130
+ Right = "right"
131
+ }
132
+ export interface TooltipIconStyle extends Padding, Margin {
133
+ id: string;
134
+ position: TooltipIconPosition;
135
+ color: string;
136
+ activeColor: string;
137
+ size: number;
138
+ fontFamily: string;
139
+ icon: string;
140
+ backgroundColor: string;
141
+ activeBackgroundColor: string;
142
+ }
143
+ export interface TooltipStyle {
144
+ showRule: TooltipShowRule;
145
+ showType: TooltipShowType;
146
+ defaultValue: string;
147
+ text: TooltipTextStyle;
148
+ icons: TooltipIconStyle[];
149
+ }
150
+ export interface CandleAreaPointStyle {
151
+ show: boolean;
152
+ color: string;
153
+ radius: number;
154
+ rippleColor: string;
155
+ rippleRadius: number;
156
+ animation: boolean;
157
+ animationDuration: number;
158
+ }
159
+ export interface CandleAreaStyle {
160
+ lineSize: number;
161
+ lineColor: string;
162
+ value: string;
163
+ smooth: boolean;
164
+ backgroundColor: string | GradientColor[];
165
+ point: CandleAreaPointStyle;
166
+ }
167
+ export interface CandleHighLowPriceMarkStyle {
168
+ show: boolean;
169
+ color: string;
170
+ textOffset: number;
171
+ textSize: number;
172
+ textFamily: string;
173
+ textWeight: string;
174
+ }
175
+ export type CandleLastPriceMarkLineStyle = Omit<StateLineStyle, "color">;
176
+ export interface CandleLastPriceMarkStyle extends ChangeColor {
177
+ show: boolean;
178
+ line: CandleLastPriceMarkLineStyle;
179
+ text: LastValueMarkTextStyle;
180
+ }
181
+ export interface CandlePriceMarkStyle {
182
+ show: boolean;
183
+ high: CandleHighLowPriceMarkStyle;
184
+ low: CandleHighLowPriceMarkStyle;
185
+ last: CandleLastPriceMarkStyle;
186
+ }
187
+ export declare enum CandleTooltipRectPosition {
188
+ Fixed = "fixed",
189
+ Pointer = "pointer"
190
+ }
191
+ export interface CandleTooltipRectStyle extends Omit<RectStyle, "style" | "borderDashedValue" | "borderStyle">, Padding, Offset {
192
+ position: CandleTooltipRectPosition;
193
+ }
194
+ export interface CandleTooltipCustomCallbackData {
195
+ prev: Nullable<KLineData>;
196
+ current: KLineData;
197
+ next: Nullable<KLineData>;
198
+ }
199
+ export type CandleTooltipCustomCallback = (data: CandleTooltipCustomCallbackData, styles: CandleStyle) => TooltipLegend[];
200
+ export interface CandleTooltipStyle extends TooltipStyle, Offset {
201
+ custom: CandleTooltipCustomCallback | TooltipLegend[];
202
+ rect: CandleTooltipRectStyle;
203
+ }
204
+ export declare enum CandleType {
205
+ HeikinAshi = "heikin_ashi",
206
+ CandleSolid = "candle_solid",
207
+ CandleStroke = "candle_stroke",
208
+ CandleUpStroke = "candle_up_stroke",
209
+ CandleDownStroke = "candle_down_stroke",
210
+ Ohlc = "ohlc",
211
+ Area = "area"
212
+ }
213
+ export interface CandleBarColor extends ChangeColor {
214
+ upBorderColor: string;
215
+ downBorderColor: string;
216
+ noChangeBorderColor: string;
217
+ upWickColor: string;
218
+ downWickColor: string;
219
+ noChangeWickColor: string;
220
+ }
221
+ export interface CandleStyle {
222
+ type: CandleType;
223
+ bar: CandleBarColor;
224
+ area: CandleAreaStyle;
225
+ priceMark: CandlePriceMarkStyle;
226
+ tooltip: CandleTooltipStyle;
227
+ }
228
+ export type IndicatorPolygonStyle = Omit<PolygonStyle, "color" | "borderColor"> & ChangeColor;
229
+ export interface IndicatorLastValueMarkStyle {
230
+ show: boolean;
231
+ text: LastValueMarkTextStyle;
232
+ }
233
+ export interface IndicatorTooltipStyle extends TooltipStyle, Offset {
234
+ showName: boolean;
235
+ showParams: boolean;
236
+ }
237
+ export interface IndicatorStyle {
238
+ ohlc: ChangeColor;
239
+ bars: IndicatorPolygonStyle[];
240
+ lines: SmoothLineStyle[];
241
+ circles: IndicatorPolygonStyle[];
242
+ lastValueMark: IndicatorLastValueMarkStyle;
243
+ tooltip: IndicatorTooltipStyle;
244
+ [key: string]: unknown;
245
+ }
246
+ export type AxisLineStyle = Omit<StateLineStyle, "style" | "dashedValue">;
247
+ export interface AxisTickLineStyle extends AxisLineStyle {
248
+ length: number;
249
+ }
250
+ export interface AxisTickTextStyle extends Pick<StateTextStyle, "show" | "color" | "weight" | "family" | "size"> {
251
+ marginStart: number;
252
+ marginEnd: number;
253
+ }
254
+ export interface AxisStyle {
255
+ show: boolean;
256
+ size: number | "auto";
257
+ axisLine: AxisLineStyle;
258
+ tickLine: AxisTickLineStyle;
259
+ tickText: AxisTickTextStyle;
260
+ }
261
+ export interface CrosshairDirectionStyle {
262
+ show: boolean;
263
+ line: StateLineStyle;
264
+ text: StateTextStyle;
265
+ }
266
+ export interface CrosshairStyle {
267
+ show: boolean;
268
+ horizontal: CrosshairDirectionStyle;
269
+ vertical: CrosshairDirectionStyle;
270
+ }
271
+ export interface OverlayPointStyle {
272
+ color: string;
273
+ borderColor: string;
274
+ borderSize: number;
275
+ radius: number;
276
+ activeColor: string;
277
+ activeBorderColor: string;
278
+ activeBorderSize: number;
279
+ activeRadius: number;
280
+ }
281
+ export interface OverlayStyle {
282
+ point: OverlayPointStyle;
283
+ line: SmoothLineStyle;
284
+ rect: RectStyle;
285
+ polygon: PolygonStyle;
286
+ circle: PolygonStyle;
287
+ arc: LineStyle;
288
+ text: TextStyle;
289
+ [key: string]: unknown;
290
+ }
291
+ export interface SeparatorStyle {
292
+ size: number;
293
+ color: string;
294
+ fill: boolean;
295
+ activeBackgroundColor: string;
296
+ }
297
+ export interface Styles {
298
+ grid: GridStyle;
299
+ candle: CandleStyle;
300
+ indicator: IndicatorStyle;
301
+ xAxis: AxisStyle;
302
+ yAxis: AxisStyle;
303
+ separator: SeparatorStyle;
304
+ crosshair: CrosshairStyle;
305
+ overlay: OverlayStyle;
306
+ }
307
+ declare function merge(target: any, source: any): void;
308
+ declare function clone<T>(target: T): T;
309
+ declare function isArray<T = unknown>(value: unknown): value is T[];
310
+ declare function isFunction<T = (...args: unknown[]) => unknown>(value: unknown): value is T;
311
+ declare function isObject(value: unknown): value is object;
312
+ declare function isNumber(value: unknown): value is number;
313
+ declare function isValid<T>(value: T | null | undefined): value is T;
314
+ declare function isBoolean(value: unknown): value is boolean;
315
+ declare function isString(value: unknown): value is string;
316
+ declare function formatValue(data: unknown, key: string, defaultValue?: unknown): unknown;
317
+ declare function formatTimestampToString(dateTimeFormat: Intl.DateTimeFormat, timestamp: number, format: string): string;
318
+ declare function formatPrecision(value: string | number, precision?: number): string;
319
+ declare function formatBigNumber(value: string | number): string;
320
+ declare function formatThousands(value: string | number, sign: string): string;
321
+ declare function formatFoldDecimal(value: string | number, threshold: number): string;
322
+ declare function calcTextWidth(text: string, size?: number, weight?: string | number, family?: string): number;
323
+ /**
324
+ * Licensed under the Apache License, Version 2.0 (the "License");
325
+ * you may not use this file except in compliance with the License.
326
+ * You may obtain a copy of the License at
327
+
328
+ * http://www.apache.org/licenses/LICENSE-2.0
329
+
330
+ * Unless required by applicable law or agreed to in writing, software
331
+ * distributed under the License is distributed on an "AS IS" BASIS,
332
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
333
+ * See the License for the specific language governing permissions and
334
+ * limitations under the License.
335
+ */
336
+ export type ActionCallback = (data?: unknown) => void;
337
+ export declare enum ActionType {
338
+ OnZoom = "onZoom",
339
+ OnScroll = "onScroll",
340
+ OnVisibleRangeChange = "onVisibleRangeChange",
341
+ OnTooltipIconClick = "onTooltipIconClick",
342
+ OnCrosshairChange = "onCrosshairChange",
343
+ OnCandleBarClick = "onCandleBarClick",
344
+ OnPaneDrag = "onPaneDrag"
345
+ }
346
+ /**
347
+ * Licensed under the Apache License, Version 2.0 (the "License");
348
+ * you may not use this file except in compliance with the License.
349
+ * You may obtain a copy of the License at
350
+
351
+ * http://www.apache.org/licenses/LICENSE-2.0
352
+
353
+ * Unless required by applicable law or agreed to in writing, software
354
+ * distributed under the License is distributed on an "AS IS" BASIS,
355
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
356
+ * See the License for the specific language governing permissions and
357
+ * limitations under the License.
358
+ */
359
+ export type DeepPartial<T> = {
360
+ [P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends ReadonlyArray<infer X> ? ReadonlyArray<DeepPartial<X>> : T[P] extends object ? DeepPartial<T[P]> : T[P];
361
+ };
362
+ /**
363
+ * Licensed under the Apache License, Version 2.0 (the "License");
364
+ * you may not use this file except in compliance with the License.
365
+ * You may obtain a copy of the License at
366
+
367
+ * http://www.apache.org/licenses/LICENSE-2.0
368
+
369
+ * Unless required by applicable law or agreed to in writing, software
370
+ * distributed under the License is distributed on an "AS IS" BASIS,
371
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
372
+ * See the License for the specific language governing permissions and
373
+ * limitations under the License.
374
+ */
375
+ export type PickRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
376
+ export type ExcludePickPartial<T, K extends keyof T> = PickRequired<Partial<T>, K>;
377
+ /**
378
+ * Licensed under the Apache License, Version 2.0 (the "License");
379
+ * you may not use this file except in compliance with the License.
380
+ * You may obtain a copy of the License at
381
+
382
+ * http://www.apache.org/licenses/LICENSE-2.0
383
+
384
+ * Unless required by applicable law or agreed to in writing, software
385
+ * distributed under the License is distributed on an "AS IS" BASIS,
386
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
387
+ * See the License for the specific language governing permissions and
388
+ * limitations under the License.
389
+ */
390
+ export interface Bounding {
391
+ width: number;
392
+ height: number;
393
+ left: number;
394
+ right: number;
395
+ top: number;
396
+ bottom: number;
397
+ }
398
+ /**
399
+ * Licensed under the Apache License, Version 2.0 (the "License");
400
+ * you may not use this file except in compliance with the License.
401
+ * You may obtain a copy of the License at
402
+
403
+ * http://www.apache.org/licenses/LICENSE-2.0
404
+
405
+ * Unless required by applicable law or agreed to in writing, software
406
+ * distributed under the License is distributed on an "AS IS" BASIS,
407
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
408
+ * See the License for the specific language governing permissions and
409
+ * limitations under the License.
410
+ */
411
+ export interface BarSpace {
412
+ bar: number;
413
+ halfBar: number;
414
+ gapBar: number;
415
+ halfGapBar: number;
416
+ }
417
+ /**
418
+ * Licensed under the Apache License, Version 2.0 (the "License");
419
+ * you may not use this file except in compliance with the License.
420
+ * You may obtain a copy of the License at
421
+
422
+ * http://www.apache.org/licenses/LICENSE-2.0
423
+
424
+ * Unless required by applicable law or agreed to in writing, software
425
+ * distributed under the License is distributed on an "AS IS" BASIS,
426
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
427
+ * See the License for the specific language governing permissions and
428
+ * limitations under the License.
429
+ */
430
+ export interface Coordinate {
431
+ x: number;
432
+ y: number;
433
+ }
434
+ export interface Crosshair extends Partial<Coordinate> {
435
+ paneId?: string;
436
+ realX?: number;
437
+ timestamp?: number;
438
+ kLineData?: KLineData;
439
+ dataIndex?: number;
440
+ realDataIndex?: number;
441
+ }
442
+ /**
443
+ * Licensed under the Apache License, Version 2.0 (the "License");
444
+ * you may not use this file except in compliance with the License.
445
+ * You may obtain a copy of the License at
446
+
447
+ * http://www.apache.org/licenses/LICENSE-2.0
448
+
449
+ * Unless required by applicable law or agreed to in writing, software
450
+ * distributed under the License is distributed on an "AS IS" BASIS,
451
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
452
+ * See the License for the specific language governing permissions and
453
+ * limitations under the License.
454
+ */
455
+ export interface VisibleRange {
456
+ readonly from: number;
457
+ readonly to: number;
458
+ readonly realFrom: number;
459
+ readonly realTo: number;
460
+ }
461
+ export interface MouseTouchEvent extends Coordinate {
462
+ pageX: number;
463
+ pageY: number;
464
+ isTouch?: boolean;
465
+ preventDefault?: () => void;
466
+ }
467
+ /**
468
+ * Licensed under the Apache License, Version 2.0 (the "License");
469
+ * you may not use this file except in compliance with the License.
470
+ * You may obtain a copy of the License at
471
+
472
+ * http://www.apache.org/licenses/LICENSE-2.0
473
+
474
+ * Unless required by applicable law or agreed to in writing, software
475
+ * distributed under the License is distributed on an "AS IS" BASIS,
476
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
477
+ * See the License for the specific language governing permissions and
478
+ * limitations under the License.
479
+ */
480
+ export interface Point {
481
+ dataIndex: number;
482
+ timestamp: number;
483
+ value: number;
484
+ }
485
+ declare enum LoadDataType {
486
+ Init = "init",
487
+ Forward = "forward",
488
+ Backward = "backward",
489
+ Update = "update"
490
+ }
491
+ export interface LoadDataParams {
492
+ type: LoadDataType;
493
+ data: Nullable<KLineData>;
494
+ callback: (dataList: KLineData[], more?: boolean) => void;
495
+ }
496
+ export interface LoadDataMore {
497
+ [LoadDataType.Backward]: boolean;
498
+ [LoadDataType.Forward]: boolean;
499
+ }
500
+ export type LoadDataCallback = (params: LoadDataParams) => void;
501
+ /**
502
+ * Licensed under the Apache License, Version 2.0 (the "License");
503
+ * you may not use this file except in compliance with the License.
504
+ * You may obtain a copy of the License at
505
+
506
+ * http://www.apache.org/licenses/LICENSE-2.0
507
+
508
+ * Unless required by applicable law or agreed to in writing, software
509
+ * distributed under the License is distributed on an "AS IS" BASIS,
510
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
511
+ * See the License for the specific language governing permissions and
512
+ * limitations under the License.
513
+ */
514
+ export interface Precision {
515
+ price: number;
516
+ volume: number;
517
+ }
518
+ export declare const enum PaneState {
519
+ Normal = "normal",
520
+ Maximize = "maximize",
521
+ Minimize = "minimize"
522
+ }
523
+ export interface PaneOptions {
524
+ id?: string;
525
+ height?: number;
526
+ minHeight?: number;
527
+ dragEnabled?: boolean;
528
+ order?: number;
529
+ state?: PaneState;
530
+ axis?: Partial<AxisCreate>;
531
+ }
532
+ export declare enum FormatDateType {
533
+ Tooltip = 0,
534
+ Crosshair = 1,
535
+ XAxis = 2
536
+ }
537
+ export type FormatDate = (timestamp: number, format: string, type: FormatDateType) => string;
538
+ export type FormatBigNumber = (value: string | number) => string;
539
+ export interface CustomApi {
540
+ formatDate: FormatDate;
541
+ formatBigNumber: FormatBigNumber;
542
+ }
543
+ export interface Locales {
544
+ time: string;
545
+ open: string;
546
+ high: string;
547
+ low: string;
548
+ close: string;
549
+ volume: string;
550
+ change: string;
551
+ turnover: string;
552
+ [key: string]: string;
553
+ }
554
+ export declare const enum LayoutChildType {
555
+ Candle = "candle",
556
+ Indicator = "indicator",
557
+ XAxis = "xAxis"
558
+ }
559
+ export interface LayoutChild {
560
+ type: LayoutChildType;
561
+ content?: Array<string | IndicatorCreate>;
562
+ options?: PaneOptions;
563
+ }
564
+ export interface DecimalFold {
565
+ threshold: number;
566
+ format: (value: string | number) => string;
567
+ }
568
+ export interface ThousandsSeparator {
569
+ sign: string;
570
+ format: (value: string | number) => string;
571
+ }
572
+ export interface Options {
573
+ locale?: string;
574
+ timezone?: string;
575
+ styles?: string | DeepPartial<Styles>;
576
+ customApi?: Partial<CustomApi>;
577
+ thousandsSeparator?: Partial<ThousandsSeparator>;
578
+ decimalFold?: Partial<DecimalFold>;
579
+ layout?: LayoutChild[];
580
+ }
581
+ export type YAxisTemplate = AxisTemplate;
582
+ export interface YAxis extends Axis, Required<YAxisTemplate> {
583
+ isFromZero: () => boolean;
584
+ isInCandle: () => boolean;
585
+ convertToNicePixel: (value: number) => number;
586
+ }
587
+ export declare enum OverlayMode {
588
+ Normal = "normal",
589
+ WeakMagnet = "weak_magnet",
590
+ StrongMagnet = "strong_magnet"
591
+ }
592
+ export interface OverlayPerformEventParams {
593
+ currentStep: number;
594
+ mode: OverlayMode;
595
+ points: Array<Partial<Point>>;
596
+ performPointIndex: number;
597
+ performPoint: Partial<Point>;
598
+ }
599
+ export type OverlayFigureIgnoreEventType = "mouseClickEvent" | "mouseRightClickEvent" | "tapEvent" | "doubleTapEvent" | "mouseDownEvent" | "touchStartEvent" | "mouseMoveEvent" | "touchMoveEvent" | "mouseDoubleClickEvent";
600
+ export interface OverlayFigure {
601
+ key?: string;
602
+ type: string;
603
+ attrs: unknown;
604
+ styles?: unknown;
605
+ ignoreEvent?: boolean | OverlayFigureIgnoreEventType[];
606
+ }
607
+ export interface OverlayCreateFiguresCallbackParams {
608
+ chart: Chart;
609
+ overlay: Overlay;
610
+ coordinates: Coordinate[];
611
+ bounding: Bounding;
612
+ xAxis: Nullable<XAxis>;
613
+ yAxis: Nullable<YAxis>;
614
+ }
615
+ export interface OverlayEvent extends Partial<MouseTouchEvent> {
616
+ figureKey?: string;
617
+ figureIndex?: number;
618
+ overlay: Overlay;
619
+ chart: Chart;
620
+ }
621
+ export type OverlayEventCallback = (event: OverlayEvent) => boolean;
622
+ export type OverlayCreateFiguresCallback = (params: OverlayCreateFiguresCallbackParams) => OverlayFigure | OverlayFigure[];
623
+ export interface Overlay {
624
+ /**
625
+ * Unique identification
626
+ */
627
+ id: string;
628
+ /**
629
+ * Group id
630
+ */
631
+ groupId: string;
632
+ /**
633
+ * Pane id
634
+ */
635
+ paneId: string;
636
+ /**
637
+ * Name
638
+ */
639
+ name: string;
640
+ /**
641
+ * Total number of steps required to complete mouse operation
642
+ */
643
+ totalStep: number;
644
+ /**
645
+ * Current step
646
+ */
647
+ currentStep: number;
648
+ /**
649
+ * Whether it is locked. When it is true, it will not respond to events
650
+ */
651
+ lock: boolean;
652
+ /**
653
+ * Whether the overlay is visible
654
+ */
655
+ visible: boolean;
656
+ /**
657
+ * Draw level
658
+ */
659
+ zLevel: number;
660
+ /**
661
+ * Whether the default figure corresponding to the point is required
662
+ */
663
+ needDefaultPointFigure: boolean;
664
+ /**
665
+ * Whether the default figure on the Y axis is required
666
+ */
667
+ needDefaultXAxisFigure: boolean;
668
+ /**
669
+ * Whether the default figure on the X axis is required
670
+ */
671
+ needDefaultYAxisFigure: boolean;
672
+ /**
673
+ * Mode
674
+ */
675
+ mode: OverlayMode;
676
+ /**
677
+ * When mode is weak_magnet is the response distance
678
+ */
679
+ modeSensitivity: number;
680
+ /**
681
+ * Time and value information
682
+ */
683
+ points: Array<Partial<Point>>;
684
+ /**
685
+ * Extended Data
686
+ */
687
+ extendData: unknown;
688
+ /**
689
+ * The style information and format are consistent with the overlay in the unified configuration
690
+ */
691
+ styles: Nullable<DeepPartial<OverlayStyle>>;
692
+ /**
693
+ * Create figures corresponding to points
694
+ */
695
+ createPointFigures: Nullable<OverlayCreateFiguresCallback>;
696
+ /**
697
+ * Create figures on the Y axis
698
+ */
699
+ createXAxisFigures: Nullable<OverlayCreateFiguresCallback>;
700
+ /**
701
+ * Create figures on the X axis
702
+ */
703
+ createYAxisFigures: Nullable<OverlayCreateFiguresCallback>;
704
+ /**
705
+ * Special handling callbacks when pressing events
706
+ */
707
+ performEventPressedMove: Nullable<(params: OverlayPerformEventParams) => void>;
708
+ /**
709
+ * In drawing, special handling callback when moving events
710
+ */
711
+ performEventMoveForDrawing: Nullable<(params: OverlayPerformEventParams) => void>;
712
+ /**
713
+ * Start drawing event
714
+ */
715
+ onDrawStart: Nullable<OverlayEventCallback>;
716
+ /**
717
+ * In drawing event
718
+ */
719
+ onDrawing: Nullable<OverlayEventCallback>;
720
+ /**
721
+ * Draw End Event
722
+ */
723
+ onDrawEnd: Nullable<OverlayEventCallback>;
724
+ /**
725
+ * Click event
726
+ */
727
+ onClick: Nullable<OverlayEventCallback>;
728
+ /**
729
+ * Double Click event
730
+ */
731
+ onDoubleClick: Nullable<OverlayEventCallback>;
732
+ /**
733
+ * Right click event
734
+ */
735
+ onRightClick: Nullable<OverlayEventCallback>;
736
+ /**
737
+ * Pressed move start event
738
+ */
739
+ onPressedMoveStart: Nullable<OverlayEventCallback>;
740
+ /**
741
+ * Pressed moving event
742
+ */
743
+ onPressedMoving: Nullable<OverlayEventCallback>;
744
+ /**
745
+ * Pressed move end event
746
+ */
747
+ onPressedMoveEnd: Nullable<OverlayEventCallback>;
748
+ /**
749
+ * Mouse enter event
750
+ */
751
+ onMouseEnter: Nullable<OverlayEventCallback>;
752
+ /**
753
+ * Mouse leave event
754
+ */
755
+ onMouseLeave: Nullable<OverlayEventCallback>;
756
+ /**
757
+ * Removed event
758
+ */
759
+ onRemoved: Nullable<OverlayEventCallback>;
760
+ /**
761
+ * Selected event
762
+ */
763
+ onSelected: Nullable<OverlayEventCallback>;
764
+ /**
765
+ * Deselected event
766
+ */
767
+ onDeselected: Nullable<OverlayEventCallback>;
768
+ }
769
+ export type OverlayTemplate = ExcludePickPartial<Omit<Overlay, "id" | "groupId" | "paneId" | "points" | "currentStep">, "name">;
770
+ export type OverlayCreate = ExcludePickPartial<Omit<Overlay, "currentStep" | "totalStep" | "createPointFigures" | "createXAxisFigures" | "createYAxisFigures" | "performEventPressedMove" | "performEventMoveForDrawing">, "name">;
771
+ export type OverlayFilter = Partial<Pick<Overlay, "id" | "groupId" | "name" | "paneId">>;
772
+ export type OverlayConstructor = new () => Overlay;
773
+ export interface Store {
774
+ setStyles: (value: string | DeepPartial<Styles>) => void;
775
+ getStyles: () => Styles;
776
+ setCustomApi: (api: Partial<CustomApi>) => void;
777
+ getCustomApi: () => CustomApi;
778
+ setLocale: (locale: string) => void;
779
+ getLocale: () => string;
780
+ setTimezone: (timezone: string) => void;
781
+ getTimezone: () => string;
782
+ setThousandsSeparator: (thousandsSeparator: Partial<ThousandsSeparator>) => void;
783
+ getThousandsSeparator: () => ThousandsSeparator;
784
+ setDecimalFold: (decimalFold: Partial<DecimalFold>) => void;
785
+ getDecimalFold: () => DecimalFold;
786
+ getPrecision: () => Precision;
787
+ setPrecision: (precision: Partial<Precision>) => void;
788
+ getDataList: () => KLineData[];
789
+ setOffsetRightDistance: (distance: number) => void;
790
+ getOffsetRightDistance: () => number;
791
+ setMaxOffsetLeftDistance: (distance: number) => void;
792
+ setMaxOffsetRightDistance: (distance: number) => void;
793
+ setLeftMinVisibleBarCount: (barCount: number) => void;
794
+ setRightMinVisibleBarCount: (barCount: number) => void;
795
+ setBarSpace: (space: number) => void;
796
+ getBarSpace: () => BarSpace;
797
+ getVisibleRange: () => VisibleRange;
798
+ setLoadMoreDataCallback: (callback: LoadDataCallback) => void;
799
+ overrideIndicator: (override: IndicatorCreate, paneId?: string) => boolean;
800
+ removeIndicator: (filter?: IndicatorFilter) => boolean;
801
+ overrideOverlay: (override: Partial<OverlayCreate>) => boolean;
802
+ removeOverlay: (filter?: OverlayFilter) => boolean;
803
+ setZoomEnabled: (enabled: boolean) => void;
804
+ isZoomEnabled: () => boolean;
805
+ setScrollEnabled: (enabled: boolean) => void;
806
+ isScrollEnabled: () => boolean;
807
+ clearData: () => void;
808
+ }
809
+ export declare enum DomPosition {
810
+ Root = "root",
811
+ Main = "main",
812
+ YAxis = "yAxis"
813
+ }
814
+ export interface ConvertFilter {
815
+ paneId?: string;
816
+ absolute?: boolean;
817
+ }
818
+ export interface Chart extends Store {
819
+ id: string;
820
+ getDom: (paneId?: string, position?: DomPosition) => Nullable<HTMLElement>;
821
+ getSize: (paneId?: string, position?: DomPosition) => Nullable<Bounding>;
822
+ applyNewData: (dataList: KLineData[], more?: boolean | Partial<LoadDataMore>) => void;
823
+ updateData: (data: KLineData) => void;
824
+ createIndicator: (value: string | IndicatorCreate, isStack?: boolean, paneOptions?: PaneOptions) => Nullable<string>;
825
+ getIndicators: (filter?: IndicatorFilter) => Map<string, Indicator[]>;
826
+ createOverlay: (value: string | OverlayCreate | Array<string | OverlayCreate>) => Nullable<string> | Array<Nullable<string>>;
827
+ getOverlays: (filter?: OverlayFilter) => Map<string, Overlay[]>;
828
+ setPaneOptions: (options: PaneOptions) => void;
829
+ getPaneOptions: (id?: string) => Nullable<PaneOptions> | PaneOptions[];
830
+ scrollByDistance: (distance: number, animationDuration?: number) => void;
831
+ scrollToRealTime: (animationDuration?: number) => void;
832
+ scrollToDataIndex: (dataIndex: number, animationDuration?: number) => void;
833
+ scrollToTimestamp: (timestamp: number, animationDuration?: number) => void;
834
+ zoomAtCoordinate: (scale: number, coordinate?: Coordinate, animationDuration?: number) => void;
835
+ zoomAtDataIndex: (scale: number, dataIndex: number, animationDuration?: number) => void;
836
+ zoomAtTimestamp: (scale: number, timestamp: number, animationDuration?: number) => void;
837
+ convertToPixel: (points: Partial<Point> | Array<Partial<Point>>, filter?: ConvertFilter) => Partial<Coordinate> | Array<Partial<Coordinate>>;
838
+ convertFromPixel: (coordinates: Array<Partial<Coordinate>>, filter?: ConvertFilter) => Partial<Point> | Array<Partial<Point>>;
839
+ executeAction: (type: ActionType, data: Crosshair) => void;
840
+ subscribeAction: (type: ActionType, callback: ActionCallback) => void;
841
+ unsubscribeAction: (type: ActionType, callback?: ActionCallback) => void;
842
+ getConvertPictureUrl: (includeOverlay?: boolean, type?: "png" | "jpeg" | "bmp", backgroundColor?: string) => string;
843
+ resize: () => void;
844
+ }
845
+ export interface AxisTick {
846
+ coord: number;
847
+ value: number | string;
848
+ text: string;
849
+ }
850
+ export interface AxisRange extends VisibleRange {
851
+ readonly range: number;
852
+ readonly realRange: number;
853
+ readonly displayFrom: number;
854
+ readonly displayTo: number;
855
+ readonly displayRange: number;
856
+ }
857
+ export interface AxisGap {
858
+ top?: number;
859
+ bottom?: number;
860
+ }
861
+ declare enum AxisPosition {
862
+ Left = "left",
863
+ Right = "right"
864
+ }
865
+ export interface AxisValueToValueParams {
866
+ range: AxisRange;
867
+ }
868
+ export type AxisValueToValueCallback = (value: number, params: AxisValueToValueParams) => number;
869
+ export interface AxisCreateRangeParams {
870
+ chart: Chart;
871
+ paneId: string;
872
+ defaultRange: AxisRange;
873
+ }
874
+ export type AxisCreateRangeCallback = (params: AxisCreateRangeParams) => AxisRange;
875
+ export interface AxisCreateTicksParams {
876
+ range: AxisRange;
877
+ bounding: Bounding;
878
+ defaultTicks: AxisTick[];
879
+ }
880
+ export type AxisCreateTicksCallback = (params: AxisCreateTicksParams) => AxisTick[];
881
+ export type AxisMinSpanCallback = (value: number) => number;
882
+ export interface AxisTemplate {
883
+ name: string;
884
+ reverse?: boolean;
885
+ inside?: boolean;
886
+ position?: AxisPosition;
887
+ scrollZoomEnabled?: boolean;
888
+ gap?: AxisGap;
889
+ valueToRealValue?: AxisValueToValueCallback;
890
+ realValueToDisplayValue?: AxisValueToValueCallback;
891
+ displayValueToRealValue?: AxisValueToValueCallback;
892
+ realValueToValue?: AxisValueToValueCallback;
893
+ displayValueToText?: (value: number, precision: number) => string;
894
+ minSpan?: AxisMinSpanCallback;
895
+ createRange?: AxisCreateRangeCallback;
896
+ createTicks?: AxisCreateTicksCallback;
897
+ }
898
+ export interface Axis {
899
+ override: (axis: AxisTemplate) => void;
900
+ getTicks: () => AxisTick[];
901
+ getRange: () => AxisRange;
902
+ getAutoSize: () => number;
903
+ convertToPixel: (value: number) => number;
904
+ convertFromPixel: (px: number) => number;
905
+ }
906
+ export type AxisCreate = Omit<AxisTemplate, "displayValueToText" | "valueToRealValue" | "realValueToDisplayValue" | "displayValueToRealValue" | "realValueToValue">;
907
+ export type XAxisTemplate = Pick<AxisTemplate, "name" | "scrollZoomEnabled" | "createTicks">;
908
+ export interface XAxis extends Axis, Required<XAxisTemplate> {
909
+ convertTimestampFromPixel: (pixel: number) => Nullable<number>;
910
+ convertTimestampToPixel: (timestamp: number) => number;
911
+ }
912
+ export interface Figure<A = unknown, S = unknown> {
913
+ name: string;
914
+ attrs: A;
915
+ styles: S;
916
+ draw: (ctx: CanvasRenderingContext2D, attrs: A, styles: S) => void;
917
+ checkEventOn: (coordinate: Coordinate, attrs: A, styles: S) => boolean;
918
+ }
919
+ export type FigureTemplate<A = unknown, S = unknown> = Pick<Figure<A, S>, "name" | "draw" | "checkEventOn">;
920
+ export type FigureCreate<A = unknown, S = unknown> = Pick<Figure<A, S>, "name" | "attrs" | "styles">;
921
+ export type FigureConstructor<A = unknown, S = unknown> = new (figure: FigureCreate<A, S>) => ({
922
+ draw: (ctx: CanvasRenderingContext2D) => void;
923
+ });
924
+ declare function checkCoordinateOnCircle(coordinate: Coordinate, attrs: CircleAttrs | CircleAttrs[]): boolean;
925
+ export interface CircleAttrs {
926
+ x: number;
927
+ y: number;
928
+ r: number;
929
+ }
930
+ declare function checkCoordinateOnArc(coordinate: Coordinate, attrs: ArcAttrs | ArcAttrs[]): boolean;
931
+ export interface ArcAttrs extends CircleAttrs {
932
+ startAngle: number;
933
+ endAngle: number;
934
+ }
935
+ declare function checkCoordinateOnRect(coordinate: Coordinate, attrs: RectAttrs | RectAttrs[]): boolean;
936
+ export interface RectAttrs {
937
+ x: number;
938
+ y: number;
939
+ width: number;
940
+ height: number;
941
+ }
942
+ declare function checkCoordinateOnText(coordinate: Coordinate, attrs: TextAttrs | TextAttrs[], styles: Partial<TextStyle>): boolean;
943
+ export interface TextAttrs {
944
+ x: number;
945
+ y: number;
946
+ text: string;
947
+ width?: number;
948
+ height?: number;
949
+ align?: CanvasTextAlign;
950
+ baseline?: CanvasTextBaseline;
951
+ }
952
+ export declare enum IndicatorSeries {
953
+ Normal = "normal",
954
+ Price = "price",
955
+ Volume = "volume"
956
+ }
957
+ export type IndicatorFigureStyle = Partial<Omit<SmoothLineStyle, "style">> & Partial<Omit<RectStyle, "style">> & Partial<TextStyle> & Partial<{
958
+ style: LineType[keyof LineType];
959
+ }> & Record<string, unknown>;
960
+ export type IndicatorFigureAttrs = Partial<ArcAttrs> & Partial<LineStyle> & Partial<RectAttrs> & Partial<TextAttrs> & Record<string, unknown>;
961
+ export interface IndicatorFigureCallbackBrother<PCN> {
962
+ prev: PCN;
963
+ current: PCN;
964
+ next: PCN;
965
+ }
966
+ export interface IndicatorFigureAttrsCallbackParams<D> {
967
+ data: IndicatorFigureCallbackBrother<Nullable<D>>;
968
+ coordinate: IndicatorFigureCallbackBrother<Record<keyof D, number> & {
969
+ x: number;
970
+ }>;
971
+ bounding: Bounding;
972
+ barSpace: BarSpace;
973
+ xAxis: XAxis;
974
+ yAxis: YAxis;
975
+ }
976
+ export interface IndicatorFigureStylesCallbackParams<D> {
977
+ data: IndicatorFigureCallbackBrother<Nullable<D>>;
978
+ indicator: Indicator<D>;
979
+ defaultStyles?: IndicatorStyle;
980
+ }
981
+ export type IndicatorFigureAttrsCallback<D> = (params: IndicatorFigureAttrsCallbackParams<D>) => IndicatorFigureAttrs;
982
+ export type IndicatorFigureStylesCallback<D> = (params: IndicatorFigureStylesCallbackParams<D>) => IndicatorFigureStyle;
983
+ export interface IndicatorFigure<D = unknown> {
984
+ key: string;
985
+ title?: string;
986
+ type?: string;
987
+ baseValue?: number;
988
+ attrs?: IndicatorFigureAttrsCallback<D>;
989
+ styles?: IndicatorFigureStylesCallback<D>;
990
+ }
991
+ export type IndicatorRegenerateFiguresCallback<D> = (calcParams: unknown[]) => Array<IndicatorFigure<D>>;
992
+ export interface IndicatorTooltipData {
993
+ name: string;
994
+ calcParamsText: string;
995
+ icons: TooltipIconStyle[];
996
+ legends: TooltipLegend[];
997
+ }
998
+ export interface IndicatorCreateTooltipDataSourceParams<D> {
999
+ chart: Chart;
1000
+ indicator: Indicator<D>;
1001
+ bounding: Bounding;
1002
+ crosshair: Crosshair;
1003
+ xAxis: XAxis;
1004
+ yAxis: YAxis;
1005
+ }
1006
+ export type IndicatorCreateTooltipDataSourceCallback<D> = (params: IndicatorCreateTooltipDataSourceParams<D>) => IndicatorTooltipData;
1007
+ export interface IndicatorDrawParams<D> {
1008
+ ctx: CanvasRenderingContext2D;
1009
+ chart: Chart;
1010
+ indicator: Indicator<D>;
1011
+ bounding: Bounding;
1012
+ xAxis: XAxis;
1013
+ yAxis: YAxis;
1014
+ }
1015
+ export type IndicatorDrawCallback<D> = (params: IndicatorDrawParams<D>) => boolean;
1016
+ export type IndicatorCalcCallback<D> = (dataList: KLineData[], indicator: Indicator<D>) => Promise<D[]> | D[];
1017
+ export type IndicatorShouldUpdateCallback<D> = (prev: Indicator<D>, current: Indicator<D>) => (boolean | {
1018
+ calc: boolean;
1019
+ draw: boolean;
1020
+ });
1021
+ declare enum IndicatorDataState {
1022
+ Loading = "loading",
1023
+ Error = "error",
1024
+ Ready = "ready"
1025
+ }
1026
+ export interface IndicatorOnDataStateChangeParams<D> {
1027
+ state: IndicatorDataState;
1028
+ type: LoadDataType;
1029
+ indicator: Indicator<D>;
1030
+ }
1031
+ export type IndicatorOnDataStateChangeCallback<D> = (params: IndicatorOnDataStateChangeParams<D>) => void;
1032
+ export interface Indicator<D = unknown> {
1033
+ /**
1034
+ * Indicator name
1035
+ */
1036
+ name: string;
1037
+ /**
1038
+ * Short name, for display
1039
+ */
1040
+ shortName: string;
1041
+ /**
1042
+ * Precision
1043
+ */
1044
+ precision: number;
1045
+ /**
1046
+ * Calculation parameters
1047
+ */
1048
+ calcParams: unknown[];
1049
+ /**
1050
+ * Whether ohlc column is required
1051
+ */
1052
+ shouldOhlc: boolean;
1053
+ /**
1054
+ * Whether large data values need to be formatted, starting from 1000, for example, whether 100000 needs to be formatted with 100K
1055
+ */
1056
+ shouldFormatBigNumber: boolean;
1057
+ /**
1058
+ * Whether the indicator is visible
1059
+ */
1060
+ visible: boolean;
1061
+ /**
1062
+ * Z index
1063
+ */
1064
+ zLevel: number;
1065
+ /**
1066
+ * Extend data
1067
+ */
1068
+ extendData: unknown;
1069
+ /**
1070
+ * Indicator series
1071
+ */
1072
+ series: IndicatorSeries;
1073
+ /**
1074
+ * Figure configuration information
1075
+ */
1076
+ figures: Array<IndicatorFigure<D>>;
1077
+ /**
1078
+ * Specified minimum value
1079
+ */
1080
+ minValue: Nullable<number>;
1081
+ /**
1082
+ * Specified maximum value
1083
+ */
1084
+ maxValue: Nullable<number>;
1085
+ /**
1086
+ * Style configuration
1087
+ */
1088
+ styles: Nullable<DeepPartial<IndicatorStyle>>;
1089
+ /**
1090
+ * Should update, should calc or draw
1091
+ */
1092
+ shouldUpdate: Nullable<IndicatorShouldUpdateCallback<D>>;
1093
+ /**
1094
+ * Indicator calculation
1095
+ */
1096
+ calc: IndicatorCalcCallback<D>;
1097
+ /**
1098
+ * Regenerate figure configuration
1099
+ */
1100
+ regenerateFigures: Nullable<IndicatorRegenerateFiguresCallback<D>>;
1101
+ /**
1102
+ * Create custom tooltip text
1103
+ */
1104
+ createTooltipDataSource: Nullable<IndicatorCreateTooltipDataSourceCallback<D>>;
1105
+ /**
1106
+ * Custom draw
1107
+ */
1108
+ draw: Nullable<IndicatorDrawCallback<D>>;
1109
+ /**
1110
+ * Data state change
1111
+ */
1112
+ onDataStateChange: Nullable<IndicatorOnDataStateChangeCallback<D>>;
1113
+ /**
1114
+ * Calculation result
1115
+ */
1116
+ result: D[];
1117
+ }
1118
+ export type IndicatorTemplate<D = unknown> = ExcludePickPartial<Omit<Indicator<D>, "result">, "name" | "calc">;
1119
+ export type IndicatorCreate<D = unknown> = ExcludePickPartial<Omit<Indicator<D>, "result">, "name">;
1120
+ export interface IndicatorFilter {
1121
+ name?: string;
1122
+ paneId?: string;
1123
+ }
1124
+ declare function checkCoordinateOnLine(coordinate: Coordinate, attrs: LineAttrs | LineAttrs[]): boolean;
1125
+ declare function getLinearYFromSlopeIntercept(kb: Nullable<number[]>, coordinate: Coordinate): number;
1126
+ declare function getLinearYFromCoordinates(coordinate1: Coordinate, coordinate2: Coordinate, targetCoordinate: Coordinate): number;
1127
+ declare function getLinearSlopeIntercept(coordinate1: Coordinate, coordinate2: Coordinate): Nullable<number[]>;
1128
+ export interface LineAttrs {
1129
+ coordinates: Coordinate[];
1130
+ }
1131
+ declare function checkCoordinateOnPolygon(coordinate: Coordinate, attrs: PolygonAttrs | PolygonAttrs[]): boolean;
1132
+ export interface PolygonAttrs {
1133
+ coordinates: Coordinate[];
1134
+ }
1135
+ export declare function getSupportedFigures(): string[];
1136
+ export declare function registerFigure<A = unknown, S = unknown>(figure: FigureTemplate<A, S>): void;
1137
+ export declare function getFigureClass<A = unknown, S = unknown>(name: string): Nullable<FigureConstructor<A, S>>;
1138
+ export declare function registerIndicator<D>(indicator: IndicatorTemplate<D>): void;
1139
+ export declare function getSupportedIndicators(): string[];
1140
+ export declare function registerLocale(locale: string, ls: Locales): void;
1141
+ export declare function getSupportedLocales(): string[];
1142
+ export declare function registerOverlay(template: OverlayTemplate): void;
1143
+ export declare function getOverlayClass(name: string): Nullable<OverlayConstructor>;
1144
+ export declare function getSupportedOverlays(): string[];
1145
+ export declare function registerStyles(name: string, ss: DeepPartial<Styles>): void;
1146
+ export declare function registerXAxis(axis: XAxisTemplate): void;
1147
+ export declare function registerYAxis(axis: YAxisTemplate): void;
1148
+ /**
1149
+ * Chart version
1150
+ * @return {string}
1151
+ */
1152
+ export declare function version(): string;
1153
+ /**
1154
+ * Init chart instance
1155
+ * @param ds
1156
+ * @param options
1157
+ * @returns {Chart}
1158
+ */
1159
+ export declare function init(ds: HTMLElement | string, options?: Options): Nullable<Chart>;
1160
+ /**
1161
+ * Destroy chart instance
1162
+ * @param dcs
1163
+ */
1164
+ export declare function dispose(dcs: HTMLElement | Chart | string): void;
1165
+ export declare const utils: {
1166
+ clone: typeof clone;
1167
+ merge: typeof merge;
1168
+ isString: typeof isString;
1169
+ isNumber: typeof isNumber;
1170
+ isValid: typeof isValid;
1171
+ isObject: typeof isObject;
1172
+ isArray: typeof isArray;
1173
+ isFunction: typeof isFunction;
1174
+ isBoolean: typeof isBoolean;
1175
+ formatValue: typeof formatValue;
1176
+ formatPrecision: typeof formatPrecision;
1177
+ formatBigNumber: typeof formatBigNumber;
1178
+ formatDate: typeof formatTimestampToString;
1179
+ formatThousands: typeof formatThousands;
1180
+ formatFoldDecimal: typeof formatFoldDecimal;
1181
+ calcTextWidth: typeof calcTextWidth;
1182
+ getLinearSlopeIntercept: typeof getLinearSlopeIntercept;
1183
+ getLinearYFromSlopeIntercept: typeof getLinearYFromSlopeIntercept;
1184
+ getLinearYFromCoordinates: typeof getLinearYFromCoordinates;
1185
+ checkCoordinateOnArc: typeof checkCoordinateOnArc;
1186
+ checkCoordinateOnCircle: typeof checkCoordinateOnCircle;
1187
+ checkCoordinateOnLine: typeof checkCoordinateOnLine;
1188
+ checkCoordinateOnPolygon: typeof checkCoordinateOnPolygon;
1189
+ checkCoordinateOnRect: typeof checkCoordinateOnRect;
1190
+ checkCoordinateOnText: typeof checkCoordinateOnText;
1191
+ };
1192
+
1193
+ export as namespace klinecharts;
1194
+
1195
+ export {};