candleview 1.1.5 → 2.0.1

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.
package/dist/index.d.ts CHANGED
@@ -1,11 +1,39 @@
1
1
  import { default as default_2 } from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
3
 
4
+ export declare enum AIBrandType {
5
+ Aliyun = "aliyun",
6
+ OpenAI = "openai",
7
+ DeepSeek = "deepseek",
8
+ Claude = "claude",
9
+ Gemini = "gemini"
10
+ }
11
+
12
+ declare interface AIConfig {
13
+ apiKey: string;
14
+ brand: AIBrandType;
15
+ model: string;
16
+ maxAnalyzeData?: number;
17
+ }
18
+
19
+ declare enum AIFunctionType {
20
+ OpenaiChart = "openai-chart",
21
+ OpenaiPredict = "openai-predict",
22
+ AliyunChart = "aliyun-chart",
23
+ AliyunPredict = "aliyun-predict",
24
+ DeepseekChart = "deepseek-chart",
25
+ DeepseekPredict = "deepseek-predict",
26
+ ClaudeChart = "claude-chart",
27
+ ClaudePredict = "claude-predict",
28
+ GeminiChart = "gemini-chart",
29
+ GeminiPredict = "gemini-predict"
30
+ }
31
+
4
32
  declare class CandleView extends default_2.Component<CandleViewProps, CandleViewState> {
5
- candleViewContainerRef: default_2.RefObject<HTMLDivElement | null>;
33
+ candleViewRef: default_2.RefObject<HTMLDivElement | null>;
6
34
  private chartRef;
7
35
  private chartContainerRef;
8
- private drawingLayerRef;
36
+ private chartLayerRef;
9
37
  private chart;
10
38
  private resizeObserver;
11
39
  private realTimeInterval;
@@ -14,12 +42,31 @@ declare class CandleView extends default_2.Component<CandleViewProps, CandleView
14
42
  private updateTimeout;
15
43
  private viewportManager;
16
44
  private chartEventManager;
45
+ private aiPanelResizeRef;
46
+ private isDragging;
47
+ private startX;
48
+ private startChartWidth;
49
+ private startPanelWidth;
50
+ private containerWidth;
51
+ private terminalResizeRef;
52
+ private isDraggingTerminal;
53
+ private startY;
54
+ private startTerminalHeightRatio;
55
+ private containerHeight;
17
56
  private preparedData;
18
57
  private originalData;
58
+ private aiManager;
59
+ private LOGO;
19
60
  constructor(props: CandleViewProps);
20
61
  componentDidMount(): void;
21
62
  componentDidUpdate(prevProps: CandleViewProps, prevState: CandleViewState): void;
22
63
  componentWillUnmount(): void;
64
+ private handleTerminalResizeMouseDown;
65
+ private handleTerminalMouseMove;
66
+ private handleTerminalMouseUp;
67
+ private handleResizeMouseDown;
68
+ private handleMouseMove;
69
+ private handleMouseUp;
23
70
  private loadDataAsync;
24
71
  private loadExternalData;
25
72
  private loadInternalData;
@@ -36,6 +83,7 @@ declare class CandleView extends default_2.Component<CandleViewProps, CandleView
36
83
  private refreshChart;
37
84
  private refreshExternalData;
38
85
  private refreshInternalData;
86
+ handleExternalSelectedSubChartIndicator: (indicatorType: SubChartIndicatorType) => void;
39
87
  handleSelectedSubChartIndicator: (indicators: SubChartIndicatorType[]) => void;
40
88
  handleRemoveSubChartIndicator: (indicatorId: string) => void;
41
89
  handleCameraClick: () => void;
@@ -79,6 +127,11 @@ declare class CandleView extends default_2.Component<CandleViewProps, CandleView
79
127
  handleRefreshClick: () => void;
80
128
  handleZoomIn: () => void;
81
129
  handleZoomOut: () => void;
130
+ handleAIFunctionSelect: (aiTooleId: string) => void;
131
+ private handleTerminalCommand;
132
+ private handleToggleTerminal;
133
+ openTerminal: () => void;
134
+ closeTerminal: () => void;
82
135
  render(): JSX.Element;
83
136
  }
84
137
  export { CandleView }
@@ -88,14 +141,18 @@ declare interface CandleViewProps {
88
141
  theme?: 'dark' | 'light';
89
142
  i18n?: 'en' | 'zh-cn';
90
143
  height?: number | string;
144
+ width?: number | string;
91
145
  title: string;
92
- showTopPanel?: boolean;
93
- showLeftPanel?: boolean;
146
+ toppanel?: boolean;
147
+ leftpanel?: boolean;
94
148
  markData?: IStaticMarkData[];
95
149
  timeframe?: string;
96
150
  timezone?: string;
97
151
  data?: ICandleViewDataPoint[];
98
152
  url?: string;
153
+ ai?: boolean;
154
+ aiconfigs?: AIConfig[];
155
+ terminal?: boolean;
99
156
  handleScreenshotCapture?: (imageData: {
100
157
  dataUrl: string;
101
158
  blob: Blob;
@@ -142,8 +199,19 @@ declare interface CandleViewState {
142
199
  isDataLoading: boolean;
143
200
  dataLoadProgress: number;
144
201
  loadError: string | null;
145
- showTopPanel: boolean;
146
- showLeftPanel: boolean;
202
+ toppanel: boolean;
203
+ leftpanel: boolean;
204
+ ai: boolean;
205
+ aiconfigs: AIConfig[];
206
+ openAiChat: boolean;
207
+ currentAIFunctionType: AIFunctionType | null;
208
+ currentAIBrandType: AIBrandType | null;
209
+ aiPanelWidthRatio: number;
210
+ isResizingAiPanel: boolean;
211
+ terminalCommand: string;
212
+ terminal: boolean;
213
+ terminalHeightRatio: number;
214
+ isResizingTerminal: boolean;
147
215
  }
148
216
 
149
217
  declare interface I18n {
@@ -439,6 +507,21 @@ declare interface I18n {
439
507
  selectEmoji: string;
440
508
  selectedEmoji: string;
441
509
  clickToPlaceEmoji: string;
510
+ aiTools: string;
511
+ aiModelSelection: string;
512
+ aiFunctions: string;
513
+ openai: string;
514
+ openaiDesc: string;
515
+ gemini: string;
516
+ geminiDesc: string;
517
+ claude: string;
518
+ claudeDesc: string;
519
+ deepseek: string;
520
+ deepseekDesc: string;
521
+ describeChart: string;
522
+ describeChartDesc: string;
523
+ predictTrend: string;
524
+ predictTrendDesc: string;
442
525
  };
443
526
  systemSettings: {
444
527
  title: string;
@@ -561,6 +644,13 @@ declare interface I18n {
561
644
  calendarDay: string;
562
645
  exchangeHours: string;
563
646
  };
647
+ terminal: {
648
+ isEn: string;
649
+ placeholderText: string;
650
+ };
651
+ ai: {
652
+ aliyun: string;
653
+ };
564
654
  }
565
655
 
566
656
  export declare interface ICandleViewDataPoint {
@@ -700,6 +790,11 @@ declare interface ThemeConfig {
700
790
  boxShadow: string;
701
791
  };
702
792
  };
793
+ divider: {
794
+ normal: string;
795
+ hover: string;
796
+ dragging: string;
797
+ };
703
798
  }
704
799
 
705
800
  declare enum TimeframeEnum {