tabby-ai-assistant 1.0.8 → 1.0.10

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.
Files changed (54) hide show
  1. package/dist/components/chat/ai-sidebar.component.d.ts +16 -3
  2. package/dist/components/chat/chat-input.component.d.ts +4 -0
  3. package/dist/components/chat/chat-interface.component.d.ts +22 -1
  4. package/dist/components/chat/chat-settings.component.d.ts +21 -11
  5. package/dist/components/settings/ai-settings-tab.component.d.ts +14 -4
  6. package/dist/components/settings/general-settings.component.d.ts +43 -12
  7. package/dist/components/settings/provider-config.component.d.ts +110 -5
  8. package/dist/components/settings/security-settings.component.d.ts +14 -4
  9. package/dist/i18n/index.d.ts +48 -0
  10. package/dist/i18n/translations/en-US.d.ts +5 -0
  11. package/dist/i18n/translations/ja-JP.d.ts +5 -0
  12. package/dist/i18n/translations/zh-CN.d.ts +5 -0
  13. package/dist/i18n/types.d.ts +198 -0
  14. package/dist/index.js +1 -1
  15. package/dist/services/chat/ai-sidebar.service.d.ts +23 -1
  16. package/dist/services/core/theme.service.d.ts +53 -0
  17. package/dist/services/core/toast.service.d.ts +15 -0
  18. package/package.json +1 -1
  19. package/src/components/chat/ai-sidebar.component.scss +468 -0
  20. package/src/components/chat/ai-sidebar.component.ts +47 -344
  21. package/src/components/chat/chat-input.component.scss +2 -2
  22. package/src/components/chat/chat-input.component.ts +16 -5
  23. package/src/components/chat/chat-interface.component.html +11 -11
  24. package/src/components/chat/chat-interface.component.scss +410 -4
  25. package/src/components/chat/chat-interface.component.ts +105 -14
  26. package/src/components/chat/chat-message.component.scss +3 -3
  27. package/src/components/chat/chat-message.component.ts +3 -2
  28. package/src/components/chat/chat-settings.component.html +95 -61
  29. package/src/components/chat/chat-settings.component.scss +224 -50
  30. package/src/components/chat/chat-settings.component.ts +56 -30
  31. package/src/components/security/risk-confirm-dialog.component.scss +7 -7
  32. package/src/components/settings/ai-settings-tab.component.html +27 -27
  33. package/src/components/settings/ai-settings-tab.component.scss +34 -20
  34. package/src/components/settings/ai-settings-tab.component.ts +59 -20
  35. package/src/components/settings/general-settings.component.html +69 -40
  36. package/src/components/settings/general-settings.component.scss +151 -58
  37. package/src/components/settings/general-settings.component.ts +168 -55
  38. package/src/components/settings/provider-config.component.html +183 -60
  39. package/src/components/settings/provider-config.component.scss +332 -153
  40. package/src/components/settings/provider-config.component.ts +268 -19
  41. package/src/components/settings/security-settings.component.html +70 -39
  42. package/src/components/settings/security-settings.component.scss +104 -8
  43. package/src/components/settings/security-settings.component.ts +48 -10
  44. package/src/i18n/index.ts +129 -0
  45. package/src/i18n/translations/en-US.ts +193 -0
  46. package/src/i18n/translations/ja-JP.ts +193 -0
  47. package/src/i18n/translations/zh-CN.ts +193 -0
  48. package/src/i18n/types.ts +224 -0
  49. package/src/index.ts +6 -0
  50. package/src/services/chat/ai-sidebar.service.ts +157 -5
  51. package/src/services/core/theme.service.ts +480 -0
  52. package/src/services/core/toast.service.ts +36 -0
  53. package/src/styles/ai-assistant.scss +8 -88
  54. package/src/styles/themes.scss +161 -0
@@ -1,19 +1,26 @@
1
- import { OnInit, OnDestroy, ElementRef, AfterViewChecked } from '@angular/core';
1
+ import { OnInit, OnDestroy, ElementRef, AfterViewChecked, AfterViewInit } from '@angular/core';
2
2
  import { ChatMessage } from '../../types/ai.types';
3
3
  import { AiAssistantService } from '../../services/core/ai-assistant.service';
4
4
  import { ConfigProviderService } from '../../services/core/config-provider.service';
5
5
  import { LoggerService } from '../../services/core/logger.service';
6
6
  import { ChatHistoryService } from '../../services/chat/chat-history.service';
7
7
  import { AiSidebarService } from '../../services/chat/ai-sidebar.service';
8
+ import { ThemeService } from '../../services/core/theme.service';
8
9
  /**
9
10
  * AI Sidebar 组件 - 替代 ChatInterfaceComponent
10
11
  * 使用内联模板和样式,支持 Tabby 主题
11
12
  */
12
- export declare class AiSidebarComponent implements OnInit, OnDestroy, AfterViewChecked {
13
+ export declare class AiSidebarComponent implements OnInit, OnDestroy, AfterViewChecked, AfterViewInit {
13
14
  private aiService;
14
15
  private config;
15
16
  private logger;
16
17
  private chatHistory;
18
+ private themeService;
19
+ displayStyle: string;
20
+ flexDirection: string;
21
+ heightStyle: string;
22
+ widthStyle: string;
23
+ overflowStyle: string;
17
24
  chatContainerRef: ElementRef;
18
25
  textInput: ElementRef<HTMLTextAreaElement>;
19
26
  sidebarService: AiSidebarService;
@@ -28,9 +35,15 @@ export declare class AiSidebarComponent implements OnInit, OnDestroy, AfterViewC
28
35
  charLimit: number;
29
36
  private destroy$;
30
37
  private shouldScrollToBottom;
31
- constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService, chatHistory: ChatHistoryService);
38
+ constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService, chatHistory: ChatHistoryService, themeService: ThemeService);
32
39
  ngOnInit(): void;
33
40
  ngOnDestroy(): void;
41
+ ngAfterViewInit(): void;
42
+ /**
43
+ * 强制设置滚动容器样式
44
+ * 使用 JavaScript 直接设置,优先级最高
45
+ */
46
+ private forceScrollStyles;
34
47
  ngAfterViewChecked(): void;
35
48
  /**
36
49
  * 加载当前提供商信息
@@ -1,5 +1,7 @@
1
1
  import { EventEmitter, ElementRef, OnInit, OnDestroy } from '@angular/core';
2
+ import { ConfigProviderService } from '../../services/core/config-provider.service';
2
3
  export declare class ChatInputComponent implements OnInit, OnDestroy {
4
+ private config;
3
5
  disabled: boolean;
4
6
  placeholder: string;
5
7
  send: EventEmitter<string>;
@@ -8,6 +10,8 @@ export declare class ChatInputComponent implements OnInit, OnDestroy {
8
10
  private inputSubject;
9
11
  private destroy$;
10
12
  isComposing: boolean;
13
+ enterToSend: boolean;
14
+ constructor(config: ConfigProviderService);
11
15
  ngOnInit(): void;
12
16
  ngOnDestroy(): void;
13
17
  /**
@@ -5,12 +5,14 @@ import { ConfigProviderService } from '../../services/core/config-provider.servi
5
5
  import { LoggerService } from '../../services/core/logger.service';
6
6
  import { ChatHistoryService } from '../../services/chat/chat-history.service';
7
7
  import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
8
+ import { TranslateService } from '../../i18n';
8
9
  export declare class ChatInterfaceComponent implements OnInit, OnDestroy, AfterViewChecked {
9
10
  private aiService;
10
11
  private config;
11
12
  private logger;
12
13
  private modal;
13
14
  private chatHistory;
15
+ private translate;
14
16
  chatContainerRef: ElementRef;
15
17
  messages: ChatMessage[];
16
18
  isLoading: boolean;
@@ -18,10 +20,25 @@ export declare class ChatInterfaceComponent implements OnInit, OnDestroy, AfterV
18
20
  currentSessionId: string;
19
21
  showScrollTop: boolean;
20
22
  showScrollBottom: boolean;
23
+ showTimestamps: boolean;
24
+ showAvatars: boolean;
25
+ soundEnabled: boolean;
26
+ compactMode: boolean;
27
+ fontSize: number;
28
+ t: any;
21
29
  private destroy$;
22
30
  private shouldScrollToBottom;
23
- constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService, modal: NgbModal, chatHistory: ChatHistoryService);
31
+ private notificationSound;
32
+ constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService, modal: NgbModal, chatHistory: ChatHistoryService, translate: TranslateService);
24
33
  ngOnInit(): void;
34
+ /**
35
+ * 加载 UI 设置
36
+ */
37
+ private loadUISettings;
38
+ /**
39
+ * 应用存储的 UI 设置
40
+ */
41
+ private applyStoredSettings;
25
42
  ngOnDestroy(): void;
26
43
  ngAfterViewChecked(): void;
27
44
  /**
@@ -92,6 +109,10 @@ export declare class ChatInterfaceComponent implements OnInit, OnDestroy, AfterV
92
109
  * 获取消息时间格式
93
110
  */
94
111
  formatTimestamp(timestamp: Date): string;
112
+ /**
113
+ * 播放提示音
114
+ */
115
+ private playNotificationSound;
95
116
  /**
96
117
  * 检查是否为今天的消息
97
118
  */
@@ -1,9 +1,13 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
2
  import { ConfigProviderService } from '../../services/core/config-provider.service';
3
3
  import { LoggerService } from '../../services/core/logger.service';
4
- export declare class ChatSettingsComponent implements OnInit {
4
+ import { ThemeService } from '../../services/core/theme.service';
5
+ import { TranslateService } from '../../i18n';
6
+ export declare class ChatSettingsComponent implements OnInit, OnDestroy {
5
7
  private config;
6
8
  private logger;
9
+ private translate;
10
+ private themeService;
7
11
  settings: {
8
12
  chatHistoryEnabled: boolean;
9
13
  maxChatHistory: number;
@@ -16,13 +20,23 @@ export declare class ChatSettingsComponent implements OnInit {
16
20
  enterToSend: boolean;
17
21
  soundEnabled: boolean;
18
22
  };
19
- themes: {
20
- value: string;
21
- label: string;
22
- }[];
23
+ t: any;
23
24
  fontSizes: number[];
24
- constructor(config: ConfigProviderService, logger: LoggerService);
25
+ private destroy$;
26
+ constructor(config: ConfigProviderService, logger: LoggerService, translate: TranslateService, themeService: ThemeService);
25
27
  ngOnInit(): void;
28
+ ngOnDestroy(): void;
29
+ /**
30
+ * 更新主题标签翻译
31
+ */
32
+ private updateThemeLabels;
33
+ /**
34
+ * 获取主题选项
35
+ */
36
+ get themes(): {
37
+ value: string;
38
+ label: any;
39
+ }[];
26
40
  /**
27
41
  * 加载设置
28
42
  */
@@ -35,10 +49,6 @@ export declare class ChatSettingsComponent implements OnInit {
35
49
  * 更新主题
36
50
  */
37
51
  updateTheme(theme: string): void;
38
- /**
39
- * 应用主题
40
- */
41
- private applyTheme;
42
52
  /**
43
53
  * 更新字体大小
44
54
  */
@@ -1,22 +1,32 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
2
  import { AiAssistantService } from '../../services/core/ai-assistant.service';
3
3
  import { ConfigProviderService } from '../../services/core/config-provider.service';
4
4
  import { LoggerService } from '../../services/core/logger.service';
5
- export declare class AiSettingsTabComponent implements OnInit {
5
+ import { TranslateService } from '../../i18n';
6
+ export declare class AiSettingsTabComponent implements OnInit, OnDestroy {
6
7
  private aiService;
7
8
  private config;
8
9
  private logger;
10
+ private translate;
9
11
  activeTab: string;
10
12
  isEnabled: boolean;
11
13
  currentProvider: string;
12
14
  providerStatus: any;
15
+ pluginVersion: string;
16
+ t: any;
13
17
  tabs: {
14
18
  id: string;
15
- label: string;
19
+ labelKey: string;
16
20
  icon: string;
17
21
  }[];
18
- constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService);
22
+ private destroy$;
23
+ constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService, translate: TranslateService);
19
24
  ngOnInit(): void;
25
+ ngOnDestroy(): void;
26
+ /**
27
+ * 更新 Tab 标签
28
+ */
29
+ private updateTabLabels;
20
30
  /**
21
31
  * 加载设置
22
32
  */
@@ -1,38 +1,76 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
1
+ import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
2
2
  import { AiAssistantService } from '../../services/core/ai-assistant.service';
3
3
  import { ConfigProviderService } from '../../services/core/config-provider.service';
4
4
  import { LoggerService } from '../../services/core/logger.service';
5
+ import { ThemeService } from '../../services/core/theme.service';
5
6
  import { ConfigService } from 'tabby-core';
6
- export declare class GeneralSettingsComponent implements OnInit {
7
+ import { TranslateService } from '../../i18n';
8
+ export declare class GeneralSettingsComponent implements OnInit, OnDestroy {
7
9
  private aiService;
8
10
  private config;
9
11
  private tabbyConfig;
10
12
  private logger;
13
+ private translate;
14
+ private themeService;
11
15
  providerChanged: EventEmitter<string>;
12
16
  availableProviders: any[];
13
17
  selectedProvider: string;
14
18
  isEnabled: boolean;
15
19
  language: string;
16
20
  theme: string;
21
+ t: any;
22
+ private localProviderStatus;
23
+ private readonly statusCacheDuration;
24
+ private destroy$;
17
25
  languages: {
18
26
  value: string;
19
27
  label: string;
28
+ flag: string;
20
29
  }[];
21
30
  themes: {
22
31
  value: string;
23
32
  label: string;
24
33
  }[];
25
34
  private providerNames;
26
- constructor(aiService: AiAssistantService, config: ConfigProviderService, tabbyConfig: ConfigService, logger: LoggerService);
35
+ constructor(aiService: AiAssistantService, config: ConfigProviderService, tabbyConfig: ConfigService, logger: LoggerService, translate: TranslateService, themeService: ThemeService);
27
36
  ngOnInit(): void;
37
+ ngOnDestroy(): void;
38
+ /**
39
+ * 更新主题标签翻译
40
+ */
41
+ private updateThemeLabels;
28
42
  /**
29
43
  * 加载设置
30
44
  */
31
45
  private loadSettings;
32
46
  /**
33
- * 加载可用提供商 - 从配置服务读取已配置的提供商
47
+ * 加载可用提供商 - 支持云端和本地供应商
34
48
  */
35
49
  private loadProviders;
50
+ /**
51
+ * 获取供应商描述
52
+ */
53
+ private getProviderDescription;
54
+ /**
55
+ * 获取云端提供商状态(同步返回)
56
+ */
57
+ getProviderStatus(providerName: string): {
58
+ text: string;
59
+ color: string;
60
+ icon: string;
61
+ };
62
+ /**
63
+ * 检测本地供应商状态(异步)
64
+ */
65
+ private checkLocalProviderStatus;
66
+ /**
67
+ * 获取本地供应商状态(同步返回,异步更新缓存)
68
+ */
69
+ getLocalProviderStatus(providerName: string): {
70
+ text: string;
71
+ color: string;
72
+ icon: string;
73
+ };
36
74
  /**
37
75
  * 更新默认提供商
38
76
  */
@@ -50,14 +88,7 @@ export declare class GeneralSettingsComponent implements OnInit {
50
88
  */
51
89
  updateTheme(theme: string): void;
52
90
  /**
53
- * 应用主题 - 同步 Tabby 主题或手动设置
91
+ * 应用主题 - 使用 ThemeService
54
92
  */
55
93
  private applyTheme;
56
- /**
57
- * 获取提供商状态
58
- */
59
- getProviderStatus(providerName: string): {
60
- text: string;
61
- color: string;
62
- };
63
94
  }
@@ -1,9 +1,13 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
1
+ import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
2
2
  import { ConfigProviderService } from '../../services/core/config-provider.service';
3
3
  import { LoggerService } from '../../services/core/logger.service';
4
- export declare class ProviderConfigComponent implements OnInit {
4
+ import { ToastService } from '../../services/core/toast.service';
5
+ import { TranslateService } from '../../i18n';
6
+ export declare class ProviderConfigComponent implements OnInit, OnDestroy {
5
7
  private config;
6
8
  private logger;
9
+ private toast;
10
+ private translate;
7
11
  providerStatus: any;
8
12
  refreshStatus: EventEmitter<void>;
9
13
  switchProvider: EventEmitter<string>;
@@ -12,10 +16,23 @@ export declare class ProviderConfigComponent implements OnInit {
12
16
  configs: {
13
17
  [key: string]: any;
14
18
  };
15
- providerTemplates: {
19
+ expandedProvider: string;
20
+ localStatus: {
21
+ [key: string]: boolean;
22
+ };
23
+ passwordVisibility: {
24
+ [key: string]: {
25
+ [fieldKey: string]: boolean;
26
+ };
27
+ };
28
+ t: any;
29
+ private apiKeyPatterns;
30
+ private destroy$;
31
+ cloudProviderTemplates: {
16
32
  openai: {
17
33
  name: string;
18
34
  description: string;
35
+ icon: string;
19
36
  fields: ({
20
37
  key: string;
21
38
  label: string;
@@ -42,6 +59,7 @@ export declare class ProviderConfigComponent implements OnInit {
42
59
  anthropic: {
43
60
  name: string;
44
61
  description: string;
62
+ icon: string;
45
63
  fields: ({
46
64
  key: string;
47
65
  label: string;
@@ -68,6 +86,7 @@ export declare class ProviderConfigComponent implements OnInit {
68
86
  minimax: {
69
87
  name: string;
70
88
  description: string;
89
+ icon: string;
71
90
  fields: ({
72
91
  key: string;
73
92
  label: string;
@@ -94,6 +113,7 @@ export declare class ProviderConfigComponent implements OnInit {
94
113
  glm: {
95
114
  name: string;
96
115
  description: string;
116
+ icon: string;
97
117
  fields: ({
98
118
  key: string;
99
119
  label: string;
@@ -118,12 +138,74 @@ export declare class ProviderConfigComponent implements OnInit {
118
138
  })[];
119
139
  };
120
140
  };
121
- constructor(config: ConfigProviderService, logger: LoggerService);
141
+ localProviderTemplates: {
142
+ ollama: {
143
+ name: string;
144
+ description: string;
145
+ icon: string;
146
+ defaultURL: string;
147
+ fields: {
148
+ key: string;
149
+ label: string;
150
+ type: string;
151
+ default: string;
152
+ required: boolean;
153
+ placeholder: string;
154
+ }[];
155
+ };
156
+ vllm: {
157
+ name: string;
158
+ description: string;
159
+ icon: string;
160
+ defaultURL: string;
161
+ fields: ({
162
+ key: string;
163
+ label: string;
164
+ type: string;
165
+ default: string;
166
+ required: boolean;
167
+ placeholder: string;
168
+ } | {
169
+ key: string;
170
+ label: string;
171
+ type: string;
172
+ required: boolean;
173
+ default?: undefined;
174
+ placeholder?: undefined;
175
+ })[];
176
+ };
177
+ };
178
+ constructor(config: ConfigProviderService, logger: LoggerService, toast: ToastService, translate: TranslateService);
122
179
  ngOnInit(): void;
180
+ ngOnDestroy(): void;
123
181
  /**
124
182
  * 加载配置
125
183
  */
126
184
  private loadConfigs;
185
+ /**
186
+ * 切换展开/折叠
187
+ */
188
+ toggleExpand(providerName: string): void;
189
+ /**
190
+ * 检查是否是本地提供商
191
+ */
192
+ isLocalProvider(providerName: string): boolean;
193
+ /**
194
+ * 检测本地供应商状态
195
+ */
196
+ private checkLocalProviderStatus;
197
+ /**
198
+ * 获取本地供应商在线状态
199
+ */
200
+ getLocalStatus(providerName: string): {
201
+ text: string;
202
+ color: string;
203
+ icon: string;
204
+ };
205
+ /**
206
+ * 测试本地提供商连接
207
+ */
208
+ testLocalProvider(providerName: string): Promise<void>;
127
209
  /**
128
210
  * 保存配置
129
211
  */
@@ -177,9 +259,13 @@ export declare class ProviderConfigComponent implements OnInit {
177
259
  */
178
260
  isRequired(field: any): boolean;
179
261
  /**
180
- * 获取提供商模板
262
+ * 获取提供商模板(支持云端和本地)
181
263
  */
182
264
  getProviderTemplate(providerName: string): any;
265
+ /**
266
+ * 获取提供商图标
267
+ */
268
+ getProviderIcon(providerName: string): string;
183
269
  /**
184
270
  * 检查是否有配置
185
271
  */
@@ -192,4 +278,23 @@ export declare class ProviderConfigComponent implements OnInit {
192
278
  * 更新配置值
193
279
  */
194
280
  updateConfigValue(providerName: string, key: string, value: any): void;
281
+ /**
282
+ * 切换密码字段可见性
283
+ */
284
+ togglePasswordVisibility(providerName: string, fieldKey: string): void;
285
+ /**
286
+ * 获取密码字段可见性状态
287
+ */
288
+ isPasswordVisible(providerName: string, fieldKey: string): boolean;
289
+ /**
290
+ * 验证 API Key 格式
291
+ */
292
+ validateApiKeyFormat(providerName: string, apiKey: string): {
293
+ valid: boolean;
294
+ message: string;
295
+ };
296
+ /**
297
+ * 获取输入框的验证状态类
298
+ */
299
+ getInputValidationClass(providerName: string, fieldKey: string): string;
195
300
  }
@@ -1,23 +1,33 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
2
  import { ConfigProviderService } from '../../services/core/config-provider.service';
3
3
  import { LoggerService } from '../../services/core/logger.service';
4
- export declare class SecuritySettingsComponent implements OnInit {
4
+ import { TranslateService } from '../../i18n';
5
+ export declare class SecuritySettingsComponent implements OnInit, OnDestroy {
5
6
  private config;
6
7
  private logger;
8
+ private translate;
7
9
  settings: {
8
10
  enablePasswordProtection: boolean;
11
+ enableRiskAssessment: boolean;
12
+ defaultRiskLevel: string;
13
+ enableConsentPersistence: boolean;
9
14
  consentExpiryDays: number;
10
15
  autoApproveLowRisk: boolean;
11
16
  promptForMediumRisk: boolean;
12
17
  requirePasswordForHighRisk: boolean;
13
- enableRiskAssessment: boolean;
14
18
  };
19
+ password: string;
20
+ newPattern: string;
15
21
  dangerousPatterns: string[];
16
- constructor(config: ConfigProviderService, logger: LoggerService);
22
+ t: any;
23
+ private destroy$;
24
+ constructor(config: ConfigProviderService, logger: LoggerService, translate: TranslateService);
17
25
  ngOnInit(): void;
26
+ ngOnDestroy(): void;
18
27
  private loadSettings;
19
28
  updateSetting(key: string, value: any): void;
20
29
  addDangerousPattern(pattern: string): void;
21
30
  removeDangerousPattern(index: number): void;
31
+ saveSettings(): void;
22
32
  resetToDefaults(): void;
23
33
  }
@@ -0,0 +1,48 @@
1
+ import { Observable } from 'rxjs';
2
+ import { TranslationKeys, SupportedLanguage, LanguageConfig } from './types';
3
+ import { ConfigProviderService } from '../services/core/config-provider.service';
4
+ export declare const languageConfigs: LanguageConfig[];
5
+ export { TranslationKeys, SupportedLanguage, LanguageConfig } from './types';
6
+ export declare class TranslateService {
7
+ private config;
8
+ private currentLang$;
9
+ private currentTranslation$;
10
+ constructor(config: ConfigProviderService);
11
+ /**
12
+ * 获取当前语言
13
+ */
14
+ get currentLanguage(): SupportedLanguage;
15
+ /**
16
+ * 监听语言变化
17
+ */
18
+ get language$(): Observable<SupportedLanguage>;
19
+ /**
20
+ * 获取翻译对象
21
+ */
22
+ get t(): TranslationKeys;
23
+ /**
24
+ * 监听翻译变化
25
+ */
26
+ get translation$(): Observable<TranslationKeys>;
27
+ /**
28
+ * 获取所有语言配置
29
+ */
30
+ get languages(): LanguageConfig[];
31
+ /**
32
+ * 设置语言
33
+ */
34
+ setLanguage(lang: SupportedLanguage): void;
35
+ /**
36
+ * 获取翻译 - 支持插值
37
+ * 例如: translate('general.providerCount', { count: 3 })
38
+ */
39
+ translate(key: string, params?: Record<string, any>): string;
40
+ /**
41
+ * 简写方法
42
+ */
43
+ _(key: string, params?: Record<string, any>): string;
44
+ /**
45
+ * 获取指定语言的翻译
46
+ */
47
+ getTranslationForLang(lang: SupportedLanguage): TranslationKeys;
48
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * English translations
3
+ */
4
+ import { TranslationKeys } from '../types';
5
+ export declare const enUS: TranslationKeys;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 日本語翻訳
3
+ */
4
+ import { TranslationKeys } from '../types';
5
+ export declare const jaJP: TranslationKeys;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 中文翻译
3
+ */
4
+ import { TranslationKeys } from '../types';
5
+ export declare const zhCN: TranslationKeys;