@dao42/d42paas-front 0.9.87 → 0.9.89

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/DaoPaaS.d.ts DELETED
@@ -1,291 +0,0 @@
1
- export { Messages } from '../constants/messages';
2
- export { ThemeType } from '../theme';
3
- import { ITheme } from 'xterm';
4
-
5
- export type InsertCodeLineCode = number | 'TOP' | 'BOTTOM';
6
- export interface IExtralAction {
7
- replaceSelection?: Array<any> | string;
8
- }
9
- export type ContextMenuTypeItem = {
10
- id?: number;
11
- action: string;
12
- text: string;
13
- icon: string;
14
- iconLabel: string;
15
- commentStartLabel: string;
16
- // commentEndLabel: string;
17
- commentTips?: string;
18
- hideCodeBlock: boolean;
19
- };
20
- export type CodeSnippetOption = {
21
- template: string;
22
- option: {
23
- label: string;
24
- detail?: string;
25
- };
26
- };
27
- export type TranslateTypeOption = {
28
- [typeof I18nLanguageType]: string;
29
- };
30
- export type TranslateType = Record<string, Record<TranslateTypeOption>>;
31
- export type CodeSnippetType = Record<string, Array<CodeSnippetOption>>;
32
- export type ContextMenuType = {
33
- handleSelect: (
34
- e: any,
35
- callback?: (data: any, extralAction: IExtralAction) => void,
36
- ) => void;
37
- items: Array<ContextMenuTypeItem>;
38
- };
39
- export type ResultType = {
40
- status: boolean;
41
- message: string;
42
- };
43
- /**
44
- * SDK内部组件名
45
- */
46
- export type ComponentType =
47
- | 'Tree'
48
- | 'Editor'
49
- | 'Browser'
50
- | 'Console'
51
- | 'Shell'
52
- | 'MarkdownPreview';
53
-
54
- /**
55
- * Playground状态类型
56
- */
57
- export type PlaygroundStatus = 'EMPTY' | 'ACTIVE' | 'INACTIVE';
58
- /**
59
- * Docker运行状态
60
- */
61
- export type DockerStatus = 'RUNNING' | 'STOP' | 'DEBUG_RUNNING';
62
- /**
63
- * 用于挂载组件的的配置接口
64
- */
65
- export interface Component {
66
- /** SDK内部组件挂载的dom元素选择器,如“.dom-classname”,"#dom-id","div span" */
67
- container: string | HTMLElement | Element;
68
- /** SDK内部组件名 */
69
- item: ComponentType;
70
- /** 传给SDK内部组件的props */
71
- // props?: any;
72
- }
73
-
74
- /**
75
- * SDK消息监听数据类型
76
- */
77
- export type Message = {
78
- /** 消息类型 */
79
- name: Messages;
80
- /** 消息内容 */
81
- payload?: any;
82
- /** 错误信息 */
83
- error?: string;
84
- };
85
-
86
- /**
87
- * xterm样式设置
88
- */
89
- export interface XtermStyleType {
90
- console?: ITheme;
91
- terminal?: ITheme;
92
- }
93
-
94
- /**
95
- * SDK构造函数参数
96
- * @category PaaSOptions [Required]
97
- */
98
- export interface PaaSOptions {
99
- /** 票 */
100
- ticket: string;
101
- /** 租户id */
102
- tenantId: string;
103
- /** 用户信息 */
104
- userInfo: UserInfo;
105
- /** 可选, 默认连接到 www.1024paas.com */
106
- paasDomain?: string;
107
- /** SDK主题,默认dark */
108
- themeType?: ThemeType;
109
- /** SDK国际化语言,默认ZH */
110
- i18nLanguage?: I18nLanguageType;
111
- /** 是否插入CRDT数据 - 1.是否开启回放功能 */
112
- isInsertCrdt?: boolean;
113
- /** 是否兼容遗留的markdown数学公式解析 - false不兼容(标准语法) true(标准语法 + `$ $`)*/
114
- isLegacyMarkdownMath?: boolean;
115
- /** 回放模式:两针间隔最大时长触发事件参数 */
116
- triggerEventForMaxTimespan?: number;
117
- /** websocket最大尝试重连次数:5 */
118
- reconnectMaxTimes?: number;
119
- /** xterm样式配置 */
120
- xtermStyle?: XtermStyleType;
121
- /** 是否开启debug模式 */
122
- isOpenDebugMode?: boolean;
123
- }
124
-
125
- export type EditorMode = 'default' | 'vim' | 'emacs';
126
-
127
- export type EditorIndentMode = 'space' | 'tab';
128
-
129
- export type GlobalConfig = {
130
- editorMode?: EditorMode;
131
- editorTabSize?: number;
132
- editorWordWrap?: boolean;
133
- fontSize?: string;
134
- editorIndentMode?: EditorIndentMode;
135
- };
136
-
137
- export type Config = {
138
- disableEditable?: boolean;
139
- disableFileTreeAction?: boolean;
140
- };
141
-
142
- /**
143
- * 这是应用程序入口
144
- *
145
- * 使用如下:
146
- * ```ts
147
- * let options = {...};
148
- * let dao = new DaoPaaS(options);
149
- * ```
150
- */
151
- export interface IDaoPaaS {
152
- /** 主题类型 */
153
- themeType: ThemeType;
154
- /** 国际化语言 */
155
- i18nLanguage: I18nLanguageType;
156
- /** sdk版本 */
157
- sdkVersion: string;
158
- /**
159
- * 错误消息侦听器.
160
- * @param {(error: Message) => void} callback 回调函数
161
- * @event
162
- */
163
- onError?: (callback: (error: Message) => void) => void;
164
- /**
165
- * 消息侦听器.
166
- * @param {(message: Message) => void} callback 回调函数
167
- * @event
168
- */
169
- onMessage?: (callback: (message: Message) => void) => void;
170
- /**
171
- * 页面卸载的时候需要销毁实例和相关的缓存数据
172
- */
173
- dispose(): void;
174
- /**
175
- * 取消用户跟随
176
- * @param { UserInfo } user 用户信息
177
- * @param { (userInfo: UserInfo) => void } callback 回调函数
178
- */
179
- unFollowUser(user: UserInfo, callback: (userInfo: UserInfo) => void): void;
180
- /**
181
- * 用户跟随
182
- * @param { string } agentUserId 用户id
183
- * @param { (userInfo: UserInfo) => void } callback 回调函数
184
- */
185
- followUser(agentUserId: string, callback: (userInfo: UserInfo) => void): void;
186
-
187
- /**
188
- * 准备回放数据,回放摘要信息到达后,会触发PlaybackInfo
189
- */
190
- preparePlayback();
191
- /**
192
- * 启动播放,可以指定相对开始时间和速率
193
- * @param { number } start The difference relative to the absolute start time
194
- * @param { number } rate The multiplier relative to the original rate
195
- */
196
- startPlayback(start: number, rate: number);
197
- /**
198
- * 启动播放,可以指定相对开始时间和速率
199
- * @param { number } rate The multiplier relative to the original rate
200
- */
201
- restartPlayback(rate?: number);
202
- /**
203
- * 改变相对开始时间,一般发生在用户托动进度条
204
- * @param start The difference relative to the absolute start time
205
- */
206
- goToPlayback(start: number): void;
207
- /**
208
- * 暂停回放
209
- */
210
- pausePlayback(): void;
211
- /**
212
- * 设置播放速率
213
- * @param {number} rate 播放速率
214
- */
215
- setRate(rate: number);
216
- /**
217
- * 激活playground
218
- */
219
- activePlayground(): void;
220
- /**
221
- * 运行 playground 方法
222
- */
223
- runPlayground(): void;
224
- /**
225
- * 停止 playground 方法
226
- */
227
- stopPlayground(): void;
228
- /**
229
- * 挂载SDK内部组件
230
- * @param {Component[]} components 组件配置信息
231
- */
232
- mapRender(components: Component[]): void;
233
- /**
234
- * 设置本地logger打印是否开启的方法
235
- * @param {any} data 设置的值,当这个值存在就会打印logger
236
- */
237
- loggerEnable(data: any): void;
238
- /**
239
- * 切换主题
240
- * @param {ThemeType} type 主题类型
241
- */
242
- loadTheme(type: ThemeType): void;
243
- /**
244
- * 打开内部指定文件
245
- * @param filePath
246
- */
247
- openFile(filePath: string): Promise<ResultType>;
248
- /**
249
- * 更新全局配置
250
- * @param globalConfig 全局配置
251
- */
252
- updateGlobalConfig(globalConfig: GlobalConfig);
253
- /**
254
- * 更新配置
255
- * @param config 配置
256
- */
257
- updateConfig(config: Config);
258
- /**
259
- * 重新加载
260
- *
261
- * 默认参数 ['Editor', 'Tree']
262
- * @param {ModuleType[]} components 需要刷新的组件
263
- * @memberof IDaoPaaS
264
- */
265
- reload(components: ModuleType[] = ['Editor', 'Tree']): void;
266
- /**
267
- * 切换国际化语言
268
- * @param {I18nLanguageType} language 语言
269
- */
270
- switchI18nLanguage(language: I18nLanguageType): void;
271
- /**
272
- * 切换国际化语言
273
- * @param {Array<I18nResourcesType> | I18nLanguageType} lngOrSource -语言类型或者整体资源数组文件
274
- * @param {any} resource 国际化文本资源(只有lngOrSource为语言类型需要传入) 兼容旧写法
275
- *
276
- * 用法:
277
- * https://snyk.io/advisor/npm-package/i18next/functions/i18next.addResources
278
- */
279
- reloadI18nResources(
280
- lngOrSource: Array<I18nResourcesType> | I18nLanguageType,
281
- resource?: any,
282
- ): void;
283
- /**
284
- * 设置文件样式
285
- * @param {FileStyleType} params 参数 - paths文件路径/styles为对应class
286
- *
287
- * PS:
288
- * paths文件路径支持minimatch所支持的模糊路径
289
- */
290
- setFileStyle(params: FileStyleType): void;
291
- }