@ibiz-template/core 0.6.0 → 0.6.1-alpha.2

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 (106) hide show
  1. package/dist/index.esm.js +27 -21
  2. package/dist/index.system.min.js +1 -1
  3. package/out/interface/i-devtool-config/i-devtool-config.d.ts +7 -0
  4. package/out/interface/i-devtool-config/i-devtool-config.d.ts.map +1 -1
  5. package/out/utils/bit-mask/bit-mask.d.ts +27 -0
  6. package/out/utils/bit-mask/bit-mask.d.ts.map +1 -1
  7. package/out/utils/bit-mask/bit-mask.js +27 -0
  8. package/out/utils/color/color.d.ts.map +1 -1
  9. package/out/utils/color/color.js +8 -4
  10. package/out/utils/download-file/download-file.js +17 -17
  11. package/out/utils/string-util/string-util.d.ts +6 -0
  12. package/out/utils/string-util/string-util.d.ts.map +1 -1
  13. package/out/utils/string-util/string-util.js +6 -0
  14. package/out/utils/sync/await-timeout.d.ts +6 -0
  15. package/out/utils/sync/await-timeout.d.ts.map +1 -1
  16. package/out/utils/sync/await-timeout.js +6 -0
  17. package/out/utils/types/types.d.ts +3 -1
  18. package/out/utils/types/types.d.ts.map +1 -1
  19. package/out/utils/util/util.d.ts +137 -0
  20. package/out/utils/util/util.d.ts.map +1 -1
  21. package/out/utils/util/util.js +137 -0
  22. package/package.json +4 -5
  23. package/src/command/command-register.ts +0 -135
  24. package/src/command/command.ts +0 -79
  25. package/src/command/index.ts +0 -11
  26. package/src/command/interface/command/command-option.ts +0 -22
  27. package/src/command/interface/command/command.ts +0 -86
  28. package/src/command/interface/disposable/disposable.ts +0 -3
  29. package/src/command/interface/index.ts +0 -9
  30. package/src/command/utils/index.ts +0 -2
  31. package/src/command/utils/linked-list.ts +0 -136
  32. package/src/command/utils/util.ts +0 -95
  33. package/src/constant/core/core.ts +0 -63
  34. package/src/constant/http-status-message/http-status-message.ts +0 -20
  35. package/src/constant/index.ts +0 -5
  36. package/src/constant/login-mode/login-mode.ts +0 -23
  37. package/src/constant/menu-permission-mode/menu-permission-mode.ts +0 -23
  38. package/src/constant/util/util.ts +0 -5
  39. package/src/context/index.ts +0 -231
  40. package/src/environment/environment.ts +0 -39
  41. package/src/error/http-error/http-error.ts +0 -45
  42. package/src/error/index.ts +0 -5
  43. package/src/error/model-error/model-error.ts +0 -26
  44. package/src/error/notice-error/notice-error.ts +0 -19
  45. package/src/error/runtime-error/runtime-error.ts +0 -16
  46. package/src/error/runtime-model-error/runtime-model-error.ts +0 -27
  47. package/src/ibizsys.ts +0 -78
  48. package/src/index.ts +0 -14
  49. package/src/install.ts +0 -15
  50. package/src/interface/click-outside/click-outside.ts +0 -71
  51. package/src/interface/i-18n/i-18n.ts +0 -68
  52. package/src/interface/i-chat-message/i-chat-message.ts +0 -83
  53. package/src/interface/i-devtool-config/i-devtool-config.ts +0 -16
  54. package/src/interface/i-environment/i-environment.ts +0 -289
  55. package/src/interface/i-internal-message/i-internal-message.ts +0 -151
  56. package/src/interface/i-mark-open-data/i-mark-open-data.ts +0 -39
  57. package/src/interface/i-portal-async-action/i-portal-async-action.ts +0 -177
  58. package/src/interface/i-portal-message/i-portal-message.ts +0 -84
  59. package/src/interface/index.ts +0 -14
  60. package/src/interface/org-data/org-data.ts +0 -42
  61. package/src/params/params.ts +0 -134
  62. package/src/types.ts +0 -110
  63. package/src/utils/bit-mask/bit-mask.ts +0 -85
  64. package/src/utils/click-outside/click-outside.ts +0 -110
  65. package/src/utils/clone/clone.ts +0 -43
  66. package/src/utils/color/color.ts +0 -84
  67. package/src/utils/data-type/data-types.ts +0 -99
  68. package/src/utils/download-file/download-file.ts +0 -109
  69. package/src/utils/event/event.ts +0 -77
  70. package/src/utils/history-list/history-item.ts +0 -45
  71. package/src/utils/history-list/history-list.ts +0 -151
  72. package/src/utils/index.ts +0 -24
  73. package/src/utils/interceptor/core-interceptor.ts +0 -40
  74. package/src/utils/interceptor/index.ts +0 -2
  75. package/src/utils/interceptor/interceptor.ts +0 -126
  76. package/src/utils/logger/logger.ts +0 -10
  77. package/src/utils/message-center/base/message-all.ts +0 -12
  78. package/src/utils/message-center/base/message-base.ts +0 -86
  79. package/src/utils/message-center/command/async-action/command-async-action.ts +0 -24
  80. package/src/utils/message-center/command/change/command-change.ts +0 -12
  81. package/src/utils/message-center/command/command-base/command-base.ts +0 -30
  82. package/src/utils/message-center/command/create/command-create.ts +0 -24
  83. package/src/utils/message-center/command/internal-message/command-internal-message.ts +0 -24
  84. package/src/utils/message-center/command/mark-open-data/command-mark-open-data.ts +0 -24
  85. package/src/utils/message-center/command/message-command.ts +0 -158
  86. package/src/utils/message-center/command/remove/command-remove.ts +0 -24
  87. package/src/utils/message-center/command/update/command-update.ts +0 -24
  88. package/src/utils/message-center/console/message-console.ts +0 -31
  89. package/src/utils/message-center/index.ts +0 -1
  90. package/src/utils/message-center/interface/i-app-data-entity.ts +0 -19
  91. package/src/utils/message-center/interface/index.ts +0 -1
  92. package/src/utils/message-center/message-center.ts +0 -82
  93. package/src/utils/namespace/namespace.ts +0 -247
  94. package/src/utils/net/http-response.ts +0 -106
  95. package/src/utils/net/net.ts +0 -469
  96. package/src/utils/recursive/find-recursive-child.ts +0 -133
  97. package/src/utils/string-util/string-util.ts +0 -60
  98. package/src/utils/style/remote-style.ts +0 -20
  99. package/src/utils/sync/await-timeout.ts +0 -27
  100. package/src/utils/sync/count-latch.ts +0 -95
  101. package/src/utils/sync/index.ts +0 -2
  102. package/src/utils/types/types.ts +0 -22
  103. package/src/utils/upload/select-file.ts +0 -86
  104. package/src/utils/upload/upload-file.ts +0 -208
  105. package/src/utils/url-helper/url-helper.ts +0 -63
  106. package/src/utils/util/util.ts +0 -376
@@ -1,231 +0,0 @@
1
- import { clone } from 'ramda';
2
-
3
- /**
4
- * 上下文处理类
5
- *
6
- * @author chitanda
7
- * @date 2022-07-14 10:07:24
8
- * @export
9
- * @class IBizContext
10
- */
11
- export class IBizContext implements IIBizContext {
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- [key: string | symbol]: any;
14
-
15
- /**
16
- * 当前所归属的应用
17
- *
18
- * @author chitanda
19
- * @date 2023-12-06 21:12:52
20
- * @type {string}
21
- */
22
- declare srfappid: string;
23
-
24
- /**
25
- * 界面域标识,每个独立路由导航的视图生成
26
- *
27
- * @author chitanda
28
- * @date 2023-12-22 10:12:06
29
- * @type {string}
30
- */
31
- declare srfsessionid: string;
32
-
33
- /**
34
- * clone 后引用的上下文实例,需要在实例销毁时,同时销毁
35
- *
36
- * @author chitanda
37
- * @date 2023-03-13 16:03:31
38
- * @protected
39
- * @type {IBizContext[]}
40
- */
41
- protected declare _associationContext: IBizContext[];
42
-
43
- /**
44
- * 修改的父上下文
45
- *
46
- * @author lxm
47
- * @date 2022-12-08 18:12:16
48
- * @protected
49
- * @type {IData}
50
- */
51
- protected declare _context: IData;
52
-
53
- /**
54
- * 父的上下文源对象
55
- *
56
- * @author lxm
57
- * @date 2022-12-08 18:12:31
58
- * @type {IContext}
59
- */
60
- declare _parent?: IContext;
61
-
62
- /**
63
- * Creates an instance of IBizContext.
64
- *
65
- * @author chitanda
66
- * @date 2022-07-14 10:07:15
67
- * @param {IData} [context={}] 自身的上下文
68
- * @param {IContext} [parent]
69
- */
70
- // eslint-disable-next-line default-param-last
71
- private constructor(context: IData = {}, parent?: IContext) {
72
- Object.defineProperty(this, '_associationContext', {
73
- enumerable: false,
74
- value: [],
75
- });
76
-
77
- if (parent) {
78
- this.initWithParent(parent);
79
- }
80
-
81
- // 合并给入上下文
82
- Object.assign(this, context);
83
- }
84
-
85
- private initWithParent(parent: IContext): void {
86
- // eslint-disable-next-line @typescript-eslint/no-this-alias
87
- const self = this;
88
-
89
- // 定义私有变量,存放父上下文源对象
90
- Object.defineProperty(this, '_parent', {
91
- enumerable: false,
92
- writable: true,
93
- value: parent,
94
- });
95
-
96
- // 定义私有变量,用于存储对父已有上下文的修改。
97
- Object.defineProperty(this, '_context', {
98
- enumerable: false,
99
- writable: true,
100
- value: {},
101
- });
102
- // 监控父上下文参数,自身不存在时从父取
103
- const properties: { [key: string]: PropertyDescriptor } = {};
104
- const keys = Object.keys(parent);
105
- keys.forEach(key => {
106
- if (Object.prototype.hasOwnProperty.call(this, key)) {
107
- // !已经定义的不重复定义,会报错
108
- return;
109
- }
110
- properties[key] = {
111
- enumerable: true,
112
- set(val: unknown): void {
113
- if (val == null) {
114
- self._context[key] = null;
115
- } else {
116
- self._context[key] = val;
117
- }
118
- },
119
- get(): IContext {
120
- if (self._context[key] !== undefined) {
121
- return self._context[key];
122
- }
123
- return self._parent![key];
124
- },
125
- };
126
- });
127
- Object.defineProperties(this, properties);
128
- }
129
-
130
- /**
131
- * 返回自身的上下文,独有的和与父有差异的。
132
- *
133
- * @author lxm
134
- * @date 2022-12-08 17:12:26
135
- * @returns {*} {IData}
136
- */
137
- getOwnContext(): IData {
138
- const result: IData = {};
139
- Object.keys(this).forEach(key => {
140
- // 父没有的,或者修改了父的上下文
141
- // 父不存在则返回所有自身的属性
142
- if (
143
- !this._parent ||
144
- !Object.prototype.hasOwnProperty.call(this._parent, key) ||
145
- Object.prototype.hasOwnProperty.call(this._context, key)
146
- ) {
147
- result[key] = this[key];
148
- }
149
- });
150
- return result;
151
- }
152
-
153
- /**
154
- * 销毁当前上下文对象
155
- *
156
- * @author chitanda
157
- * @date 2023-03-13 15:03:04
158
- */
159
- destroy(): void {
160
- this._parent = undefined;
161
- this._context = {};
162
- this._associationContext.forEach(item => {
163
- item.destroy();
164
- });
165
- }
166
-
167
- /**
168
- * 在非视图中,需要断开视图上下文联系时。只能使用 clone 创建新的局部上下文
169
- *
170
- * @author chitanda
171
- * @date 2023-03-13 16:03:13
172
- * @return {*} {IBizContext}
173
- */
174
- clone(): IBizContext {
175
- const newContext = new IBizContext(
176
- clone(this.getOwnContext()),
177
- this._parent,
178
- );
179
- this._associationContext.push(newContext);
180
- return newContext;
181
- }
182
-
183
- /**
184
- * 在不改变对象引用的情况下,重置上下文
185
- * 等效于重新实例化,但是引用不变
186
- * @author lxm
187
- * @date 2023-05-24 10:30:40
188
- * @param {IData} [context={}]
189
- * @param {IContext} [parent]
190
- */
191
- // eslint-disable-next-line default-param-last
192
- reset(context: IData = {}, parent?: IContext): void {
193
- // 清空_associationContext
194
- this._associationContext.forEach(item => {
195
- item.destroy();
196
- });
197
- // 置空parent相关属性
198
- if (this._parent) {
199
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
200
- this._parent = {} as any;
201
- this._context = {};
202
- }
203
- // 删除自身的属性,define的删不掉,上面置空了就不管了
204
- Object.keys(this).forEach(key => {
205
- try {
206
- delete this[key];
207
- } catch (error) {
208
- // 删不掉的不管了,上面已经变成uneducated了
209
- }
210
- });
211
- if (parent) {
212
- this.initWithParent(parent);
213
- }
214
- // 合并默认值
215
- Object.assign(this, context);
216
- }
217
-
218
- /**
219
- * 上下文只有在视图初始化时,调用 create 方法
220
- *
221
- * @author chitanda
222
- * @date 2023-03-13 16:03:32
223
- * @static
224
- * @param {IData} [context]
225
- * @param {IContext} [parent]
226
- * @return {*} {IContext}
227
- */
228
- static create(context?: IData, parent?: IContext): IBizContext {
229
- return new IBizContext(context, parent);
230
- }
231
- }
@@ -1,39 +0,0 @@
1
- import { LoginMode, MenuPermissionMode } from '../constant';
2
- import { IEnvironment } from '../interface';
3
-
4
- /**
5
- * 环境变量
6
- */
7
- export const Environment: IEnvironment = {
8
- dev: false,
9
- hub: true,
10
- enableMqtt: false,
11
- mqttUrl: '/portal/mqtt/mqtt',
12
- isEnableMultiLan: false,
13
- anonymousUser: '',
14
- anonymousPwd: '',
15
- enableAnonymous: false,
16
- logLevel: 'ERROR',
17
- baseUrl: '/api',
18
- appId: '',
19
- pluginBaseUrl: 'http://172.16.240.221',
20
- isLocalModel: false,
21
- remoteModelUrl: '/remotemodel',
22
- assetsUrl: './assets',
23
- dcSystem: '',
24
- // {cat} 会替换模型 IApplication的getDefaultOSSCat 参数 如果没有会截取掉/{cat}
25
- // getDefaultOSSCat 配置方法 系统应用-高级设置-自定义参数:DefaultOSSCat
26
- // 配置示例 DefaultOSSCat=cat
27
- downloadFileUrl: '/ibizutil/download/{cat}',
28
- uploadFileUrl: '/ibizutil/upload/{cat}',
29
- casLoginUrl: '',
30
- loginMode: LoginMode.DEFAULT,
31
- menuPermissionMode: MenuPermissionMode.MIXIN,
32
- enablePermission: true,
33
- routePlaceholder: '-',
34
- enableWfAllHistory: false,
35
- isMob: false,
36
- isSaaSMode: true,
37
- AppTitle: '应用',
38
- favicon: './favicon.ico',
39
- };
@@ -1,45 +0,0 @@
1
- import { AxiosResponse } from 'axios';
2
-
3
- type InputError = {
4
- message: string;
5
- response?: AxiosResponse;
6
- };
7
-
8
- /**
9
- * 请求异常
10
- *
11
- * @author chitanda
12
- * @date 2022-09-18 17:09:10
13
- * @export
14
- * @class HttpError
15
- * @implements {Error}
16
- */
17
- export class HttpError extends Error {
18
- name: string = 'HttpError';
19
-
20
- message: string;
21
-
22
- status: number;
23
-
24
- response?: AxiosResponse;
25
-
26
- constructor(err: InputError) {
27
- super('HttpError');
28
- const res = err.response;
29
- this.response = err.response;
30
- if (res) {
31
- if (res.data) {
32
- this.message = (res.data as IData).message;
33
- } else {
34
- this.message = res.statusText;
35
- }
36
- if (!this.message) {
37
- this.message = '网络异常,请稍后重试!';
38
- }
39
- this.status = res.status;
40
- } else {
41
- this.message = err.message || '';
42
- this.status = 500;
43
- }
44
- }
45
- }
@@ -1,5 +0,0 @@
1
- export { HttpError } from './http-error/http-error';
2
- export { ModelError } from './model-error/model-error';
3
- export { RuntimeError } from './runtime-error/runtime-error';
4
- export { RuntimeModelError } from './runtime-model-error/runtime-model-error';
5
- export { NoticeError } from './notice-error/notice-error';
@@ -1,26 +0,0 @@
1
- /**
2
- * 未支持的模型
3
- *
4
- * @author chitanda
5
- * @date 2022-08-30 16:08:03
6
- * @export
7
- * @class ModelError
8
- */
9
- export class ModelError extends Error {
10
- name: string = '未支持的模型';
11
-
12
- /**
13
- * Creates an instance of ModelError.
14
- *
15
- * @author chitanda
16
- * @date 2022-08-30 16:08:38
17
- * @param {IModelObject} model 模板未支持的模型
18
- * @param {string} [msg]
19
- */
20
- constructor(
21
- public model: IData,
22
- msg?: string,
23
- ) {
24
- super(`「${model.id}」模型${msg ? `: ${msg}` : ''}`);
25
- }
26
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * 纯输出通知信息的异常
3
- *
4
- * @author lxm
5
- * @date 2022-09-21 18:09:09
6
- * @export
7
- * @class NoticeError
8
- * @implements {Error}
9
- */
10
- export class NoticeError extends Error {
11
- name: string = 'notice Error';
12
-
13
- constructor(
14
- public message: string,
15
- public duration?: number,
16
- ) {
17
- super(message);
18
- }
19
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * 运行时异常
3
- *
4
- * @author lxm
5
- * @date 2022-09-21 18:09:09
6
- * @export
7
- * @class RuntimeError
8
- * @implements {Error}
9
- */
10
- export class RuntimeError extends Error {
11
- name: string = 'Runtime Error';
12
-
13
- constructor(public message: string) {
14
- super(message);
15
- }
16
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * 模型配置缺失
3
- *
4
- * @author chitanda
5
- * @date 2022-08-30 16:08:15
6
- * @export
7
- * @class DefectModelError
8
- * @extends {Error}
9
- */
10
- export class RuntimeModelError extends Error {
11
- name: string = '模型配置缺失';
12
-
13
- /**
14
- * Creates an instance of DefectModelError.
15
- *
16
- * @author chitanda
17
- * @date 2022-08-30 16:08:58
18
- * @param {IModelObject} model 丢失配置的模型
19
- * @param {string} [msg] 缺失配置描述
20
- */
21
- constructor(
22
- public model: IData,
23
- msg?: string,
24
- ) {
25
- super(`「${model.id}」模型${msg ? `: ${msg}` : ''}`);
26
- }
27
- }
package/src/ibizsys.ts DELETED
@@ -1,78 +0,0 @@
1
- import { Logger } from 'loglevel';
2
- import { CommandController } from './command';
3
- import { Environment } from './environment/environment';
4
- import { OrgData } from './interface';
5
- import { MessageCenter, Net } from './utils';
6
- import { logger } from './utils/logger/logger';
7
-
8
- /**
9
- * 全局对象
10
- *
11
- * @author chitanda
12
- * @date 2022-07-19 16:07:50
13
- * @export
14
- * @class IBizSys
15
- */
16
- export class IBizSys {
17
- /**
18
- * 环境变量
19
- *
20
- * @author chitanda
21
- * @date 2022-07-19 18:07:04
22
- */
23
- env = Environment;
24
-
25
- /**
26
- * 日志输出工具类
27
- *
28
- * @author chitanda
29
- * @date 2023-07-10 18:07:05
30
- * @type {Logger}
31
- */
32
- log: Logger = logger;
33
-
34
- /**
35
- * 网络请求工具类(发送默认请求)
36
- *
37
- * @author chitanda
38
- * @date 2022-07-19 17:07:56
39
- * @type {Net}
40
- */
41
- net: Net = new Net();
42
-
43
- /**
44
- * 指令集
45
- *
46
- * @author chitanda
47
- * @date 2022-07-20 10:07:33
48
- * @type {AuthService}
49
- */
50
- commands: CommandController = new CommandController();
51
-
52
- /**
53
- * 界面消息中心
54
- *
55
- * @author chitanda
56
- * @date 2023-09-05 17:09:38
57
- * @type {MessageCenter}
58
- */
59
- mc: MessageCenter = new MessageCenter();
60
-
61
- /**
62
- * sass 模式下的中心系统标识
63
- *
64
- * @author chitanda
65
- * @date 2022-07-19 18:07:23
66
- * @type {string}
67
- */
68
- orgData?: OrgData;
69
-
70
- /**
71
- * 应用数据
72
- *
73
- * @author chitanda
74
- * @date 2022-07-20 19:07:22
75
- * @type {IData}
76
- */
77
- appData?: IData;
78
- }
package/src/index.ts DELETED
@@ -1,14 +0,0 @@
1
- import './types';
2
-
3
- export * from '@microsoft/fetch-event-source';
4
-
5
- export * from './command';
6
- export * from './constant';
7
- export { IBizContext } from './context';
8
- export { IBizParams } from './params/params';
9
- export { Environment } from './environment/environment';
10
- export * from './error';
11
- export * from './interface';
12
- export * from './utils';
13
- export { IBizSys } from './ibizsys';
14
- export { install } from './install';
package/src/install.ts DELETED
@@ -1,15 +0,0 @@
1
- import { IBizSys } from './ibizsys';
2
-
3
- /**
4
- * 初始化全局对象
5
- *
6
- * @author chitanda
7
- * @date 2022-07-19 17:07:37
8
- * @export
9
- */
10
- export function install(): void {
11
- if (window.ibiz) {
12
- throw new Error('ibiz 已经存在, 无需重复安装');
13
- }
14
- window.ibiz = new IBizSys();
15
- }
@@ -1,71 +0,0 @@
1
- /**
2
- * 可选配置参数
3
- *
4
- * @author lxm
5
- * @date 2022-10-28 16:10:48
6
- * @export
7
- * @interface OnClickOutsideOptions
8
- * @extends {ConfigurableWindow}
9
- * @template E
10
- */
11
- export interface OnClickOutsideOptions {
12
- /**
13
- * 指定使用的window,不给就用默认的window
14
- * 一般是在iframe或测试环境中使用。
15
- *
16
- * @author lxm
17
- * @date 2022-10-28 17:10:49
18
- * @type {Window}
19
- */
20
- window?: Window;
21
- /**
22
- * 指定需要忽略的元素,用于排除某些外部的元素
23
- *
24
- * @author lxm
25
- * @date 2022-10-28 17:10:50
26
- * @type {HTMLElement[]}
27
- */
28
- ignore?: HTMLElement[];
29
- /**
30
- * 是否捕获内部元素。默认为是,内部元素不会触发回调。
31
- * @default true
32
- */
33
- capture?: boolean;
34
- }
35
-
36
- /**
37
- * 回调处理函数类型
38
- */
39
- export type OnClickOutsideHandler = (_evt: PointerEvent | MouseEvent) => void;
40
-
41
- /**
42
- * OnClickOutside返回对象类型
43
- *
44
- * @author lxm
45
- * @date 2022-10-31 11:10:59
46
- * @export
47
- * @interface OnClickOutsideResult
48
- */
49
- export interface OnClickOutsideResult {
50
- /**
51
- * 停止监听,并移除相关监听事件
52
- *
53
- * @author lxm
54
- * @date 2022-10-31 11:10:28
55
- */
56
- stop: () => void;
57
- /**
58
- * 暂停监听
59
- *
60
- * @author lxm
61
- * @date 2022-10-31 11:10:30
62
- */
63
- pause: () => void;
64
- /**
65
- * 继续监听
66
- *
67
- * @author lxm
68
- * @date 2022-10-31 11:10:32
69
- */
70
- proceed: () => void;
71
- }
@@ -1,68 +0,0 @@
1
- /**
2
- * 多语言接口
3
- *
4
- * @author chitanda
5
- * @date 2023-08-11 16:08:21
6
- * @export
7
- * @interface I18n
8
- */
9
- export interface I18n {
10
- /**
11
- * 异步初始化,加载多语言文件
12
- *
13
- * @author chitanda
14
- * @date 2023-08-24 17:08:03
15
- * @return {*} {Promise<void>}
16
- */
17
- init(): Promise<void>;
18
-
19
- /**
20
- * 设置异步加载的多语言模块
21
- *
22
- * @author chitanda
23
- * @date 2023-08-24 23:08:28
24
- * @param {Record<string, () => Promise<IData>>} languages
25
- */
26
- setLangConfigs(languages: Record<string, () => Promise<IData>>): void;
27
-
28
- /**
29
- * 设置当前语言
30
- *
31
- * @author chitanda
32
- * @date 2023-08-24 16:08:11
33
- * @param {string} lang
34
- */
35
- setLang(lang: string): void;
36
-
37
- /**
38
- * 获取当前语言
39
- *
40
- * @author chitanda
41
- * @date 2023-08-24 16:08:04
42
- * @return {*} {string}
43
- */
44
- getLang(): string;
45
-
46
- /**
47
- * 消息格式化
48
- *
49
- * @author chitanda
50
- * @date 2023-08-11 16:08:40
51
- * @param {string} tag
52
- * @param {IParams} [options]
53
- * @return {*} {string}
54
- */
55
- t(tag: string, options?: IParams): string;
56
-
57
- /**
58
- * 消息格式化
59
- *
60
- * @author chitanda
61
- * @date 2023-08-11 16:08:42
62
- * @param {string} tag
63
- * @param {string} [defaultMsg]
64
- * @param {IParams} [options]
65
- * @return {*} {string}
66
- */
67
- t(tag: string, defaultMsg?: string, options?: IParams): string;
68
- }