xframelib 0.4.0 → 0.4.5

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 (61) hide show
  1. package/README.md +5 -0
  2. package/dist/api/Token.d.ts +20 -0
  3. package/dist/api/User.d.ts +45 -0
  4. package/dist/api/index.d.ts +2 -0
  5. package/dist/controls/collapsepanel/VCollapsiblePanel.vue.d.ts +26 -0
  6. package/dist/controls/collapsepanel/VCollapsiblePanelGroup.vue.d.ts +30 -0
  7. package/dist/controls/collapsepanel/color.util.d.ts +1 -0
  8. package/dist/controls/collapsepanel/composables/store.d.ts +7 -0
  9. package/dist/controls/collapsepanel/constant.d.ts +1 -0
  10. package/dist/controls/collapsepanel/index.d.ts +3 -0
  11. package/dist/controls/layoutcontainer/LayoutManager.d.ts +107 -0
  12. package/dist/controls/layoutcontainer/index.d.ts +3 -0
  13. package/dist/controls/layoutcontainer/layout.vue.d.ts +37 -0
  14. package/dist/controls/splitpanes/index.d.ts +3 -0
  15. package/dist/controls/vuewindow/SinglePointerEvent.d.ts +23 -0
  16. package/dist/controls/vuewindow/dom.d.ts +16 -0
  17. package/dist/controls/vuewindow/draggable_helper.d.ts +20 -0
  18. package/dist/controls/vuewindow/index.d.ts +6 -0
  19. package/dist/controls/vuewindow/resizable_helper.d.ts +16 -0
  20. package/dist/controls/vuewindow/style.d.ts +110 -0
  21. package/dist/controls/vuewindow/window/Button.vue.d.ts +26 -0
  22. package/dist/controls/vuewindow/window/index.vue.d.ts +160 -0
  23. package/dist/controls/vuewindow/window/utils.d.ts +17 -0
  24. package/dist/controls/vuewindow/z_element.d.ts +11 -0
  25. package/dist/core/Global.d.ts +26 -0
  26. package/dist/core/IModel.d.ts +34 -0
  27. package/dist/core/MsgHelper.d.ts +12 -0
  28. package/dist/core/SysEvents.d.ts +16 -0
  29. package/dist/core/index.d.ts +3 -0
  30. package/dist/hprose/HproseClient.d.ts +20 -0
  31. package/dist/hprose/ProxyClient.d.ts +22 -0
  32. package/dist/hprose/index.d.ts +11 -0
  33. package/dist/index.cjs +3 -3
  34. package/dist/index.css +69 -0
  35. package/dist/index.d.ts +10 -1024
  36. package/dist/index.js +3 -3
  37. package/dist/mitt/index.d.ts +25 -0
  38. package/dist/model/Config.d.ts +94 -0
  39. package/dist/model/Constants.d.ts +15 -0
  40. package/dist/model/Layout.d.ts +75 -0
  41. package/dist/model/Token.d.ts +66 -0
  42. package/dist/model/index.d.ts +4 -0
  43. package/dist/public/mitm.html +166 -0
  44. package/dist/public/sw.js +128 -0
  45. package/dist/utils/AxiosHelper.d.ts +51 -0
  46. package/dist/utils/BigFileDownload.d.ts +106 -0
  47. package/dist/utils/Color.d.ts +74 -0
  48. package/dist/utils/FileDownload.d.ts +36 -0
  49. package/dist/utils/FileUpload.d.ts +90 -0
  50. package/dist/utils/H5Tool.d.ts +98 -0
  51. package/dist/utils/IsTool.d.ts +101 -0
  52. package/dist/utils/JQuery.d.ts +35 -0
  53. package/dist/utils/LockHelper.d.ts +17 -0
  54. package/dist/utils/Storage.d.ts +57 -0
  55. package/dist/utils/StringUtils.d.ts +15 -0
  56. package/dist/utils/Time.d.ts +1 -0
  57. package/dist/utils/TokenHelper.d.ts +18 -0
  58. package/dist/utils/URLTool.d.ts +18 -0
  59. package/dist/utils/index.d.ts +16 -0
  60. package/dist/utils/uuid.d.ts +3 -0
  61. package/package.json +15 -15
package/dist/index.d.ts CHANGED
@@ -1,1024 +1,10 @@
1
- import { ClientContext, Client } from '@hprose/rpc-core';
2
- import { XhrHeaders } from 'xhr';
3
-
4
- declare class ProxyClient {
5
- private hproseClient;
6
- private hpProxyObj;
7
- private readonly defaultContext;
8
- constructor(hproseUrl: string);
9
- getClientContext(): ClientContext | null;
10
- getHproseProxy(): Promise<any>;
11
- hproseInvoke(methodName: string, args?: any[] | undefined): Promise<any>;
12
- hproseInvokeContext(methodName: string, context: ClientContext | undefined, ...args: any): Promise<any>;
13
- /**
14
- * 编码参数方式请求
15
- * @param request
16
- */
17
- hproseInvokeEncode(requestParamsEncode: string): Promise<any>;
18
- /**
19
- * 对请求参数编码
20
- * @param name 方法名
21
- * @param args 请求参数
22
- */
23
- encodeRequest(name: string, ...args: any): string;
24
- }
25
-
26
- declare type EventType = string | symbol;
27
- declare type Handler<T = any> = (event?: T) => void;
28
- declare type WildcardHandler = (type: EventType, event?: any) => void;
29
- declare type EventHandlerList = Array<Handler>;
30
- declare type WildCardEventHandlerList = Array<WildcardHandler>;
31
- declare type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;
32
- interface Emitter {
33
- all: EventHandlerMap;
34
- on<T = any>(type: EventType, handler: Handler<T>): void;
35
- on(type: '*', handler: WildcardHandler): void;
36
- off<T = any>(type: EventType, handler: Handler<T>): void;
37
- off(type: '*', handler: WildcardHandler): void;
38
- emit<T = any>(type: EventType, event?: T): void;
39
- emit(type: '*', event?: any): void;
40
- }
41
- /**
42
- * 默认全局总线对象
43
- */
44
- declare const GlobalMitt: Emitter;
45
-
46
- declare class MsgHelper {
47
- private message;
48
- private eventBus;
49
- constructor(messageui: any, eventbus?: Emitter | undefined);
50
- /**共用消息 */
51
- msg(msgInfo: string, seconds?: number, typename?: string): void;
52
- info(msgInfo: string, seconds?: number): void;
53
- warn(msgInfo: string, seconds?: number): void;
54
- err(msgInfo: string, seconds?: number): void;
55
- }
56
-
57
- /**
58
- * UI界面相关
59
- */
60
- interface IUIObject {
61
- /**
62
- * 网站标题
63
- */
64
- SiteTitle: string;
65
- /**
66
- * 版权
67
- */
68
- CopyRight: string; //'Copyright ©XXX 2021-2025',
69
- /**
70
- * 官方链接
71
- */
72
- WebSite?: string; //网站链接
73
- /**
74
- * 超时锁屏时间(单位:秒s)
75
- */
76
- LockTime?: number; //
77
- /**
78
- * 其他扩展的属性
79
- */
80
- [props: string]: any;
81
- }
82
- /**
83
- * 服务URL
84
- */
85
- interface IServiceURL {
86
- /**
87
- * 用户登录(统一用户登录)
88
- */
89
- LoginAuthURL: string; //用户验证
90
- /**
91
- * Axios普通WebAPI的BaseURL
92
- * 全局默认的http请求地址(一般与主hprose相同或不同);文件上传地址
93
- */
94
- DefaultWebAPI?: string;
95
- /**
96
- * 默认HproseAPI的服务地址
97
- */
98
- DefaultHproseAPI?: string;
99
- /**
100
- * 其他扩展的URL属性
101
- */
102
- [props: string]: any;
103
- }
104
-
105
- /**
106
- * 地图相关Keys
107
- */
108
- interface IMapKeys {
109
- /**
110
- * 天地图Key
111
- */
112
- TDTKey?: string;
113
- /**
114
- * MapboxKey
115
- */
116
- MapboxKey?: string;
117
- /**
118
- * Cesium Key
119
- */
120
- CesiumKey?: string;
121
- /**
122
- * Google地图Key
123
- */
124
- GoogleKey?: string;
125
- /**
126
- * 其他扩展的Key属性
127
- */
128
- [props: string]: any;
129
- }
130
- /**
131
- * 系统配置信息
132
- */
133
- interface ISystemConfig {
134
- /**
135
- * 用户界面配置
136
- */
137
- UI?: IUIObject;
138
- /**
139
- * 服务URL
140
- */
141
- ServiceURL: IServiceURL;
142
- /**
143
- * 地图相关Keys
144
- */
145
- MapKeys?: IMapKeys;
146
- /**
147
- * API服务路径
148
- */
149
- APIPath?: object; //
150
- //其他配置信息
151
- [props: string]: any;
152
- }
153
-
154
- /**
155
- * 当前存储的token对象
156
- */
157
- interface ITokenInfo {
158
- id: string;
159
- name: string;
160
- token: string;
161
- expire: string;
162
- refresh: string;
163
- }
164
- /**
165
- * 单个token对象内容
166
- * 与后台相匹配
167
- */
168
- interface IToken {
169
- /**
170
- * token内容
171
- */
172
- tokenContent: string;
173
- /**
174
- * 超时时间
175
- */
176
- expires: string;
177
- }
178
-
179
- /**
180
- * 双Token接口定义
181
- */
182
- interface IDoubleToken {
183
- /**
184
- * 当前有效token
185
- */
186
- accessToken: IToken;
187
- /**
188
- * 用于刷新的token
189
- */
190
- refreshToken: IToken;
191
- }
192
- /**
193
- * 系统用户
194
- */
195
- interface ISystemUser {
196
- /**
197
- * 用户ID
198
- */
199
- id: string;
200
- /**
201
- * 用户名
202
- */
203
- name: string;
204
- /**
205
- * 用户组ID
206
- */
207
- groupid?: string;
208
- photo?: string;
209
- mobile?: string;
210
- qq?: string;
211
- email?: string;
212
- img?: string;
213
- issystem?: boolean;
214
- createtime?: string;
215
- updatetime?: string;
216
- issecurity?: boolean;
217
- appkey?: string;
218
- role?: string;
219
- doubleToken?: IDoubleToken;
220
- }
221
-
222
- interface InnerObject {
223
- /**
224
- * 当前登录用户对象
225
- */
226
- User?: ISystemUser;
227
- /**
228
- * axios对象
229
- */
230
- Axios: any;
231
- Config: ISystemConfig;
232
- EventBus: Emitter;
233
- DefaultProxyClient: ProxyClient | null | undefined;
234
- Message?: MsgHelper;
235
- [props: string]: any;
236
- }
237
- /**
238
- * 初始化配置信息
239
- */
240
- interface XOptions {
241
- config?: any;
242
- message?: any;
243
- axios?: any;
244
- defaultHproseURL?: string;
245
- }
246
-
247
- declare const Global: InnerObject;
248
- /**
249
- * 通过配置文件初始化系统
250
- * @param options 配置参数对象
251
- */
252
- declare function initXFrame(options: XOptions): void;
253
- /**
254
- * 框架初始化
255
- * @param messageUI 消息UI
256
- * @param defaultHproseURL 默认HproseURL
257
- */
258
- declare const init: (messageUI: any, axiosObj: any, defaultHproseURL?: string | undefined) => void;
259
- /**
260
- * 获取HproseProxy对象
261
- * @param hproseURL Hprose服务链接地址
262
- * @returns Hprose代理对象
263
- */
264
- declare function getProxyClient(hproseURL?: string): ProxyClient | undefined;
265
- /**
266
- * 初始化Global.DefaultProxyClient对象
267
- * @param defaulthproseURL 默认的Hprose服务对象URL
268
- * @returns ProxyClient对象
269
- */
270
- declare function initDefaultProxyClient(defaulthproseURL?: string): ProxyClient | undefined;
271
-
272
- declare const SysEvents: {
273
- HproseServiceErrorEvent: string;
274
- WebAPIErrorEvent: string;
275
- AlertInfoEvent: string;
276
- /**
277
- * 一般通用警告或错误
278
- */
279
- CommonWarnEvent: string;
280
- };
281
-
282
- /**
283
- * 常用H5相关操作
284
- */
285
- declare class H5Tool {
286
- /**
287
- * HTML元素事件监听
288
- * @param element Window或HTMLElement
289
- * @param type 事件名称
290
- * @param handler 处理函数
291
- */
292
- static addHandler(element: Window | HTMLElement | any, type: string, handler: Function): void;
293
- /**
294
- * 窗体变化事件
295
- * @param handlerFunc 窗体变化处理函数
296
- */
297
- static windowResizeHandler(handlerFunc: Function): void;
298
- /**
299
- * 是否支持全屏操作
300
- * @returns true/false
301
- */
302
- static fullscreenEnabled(): boolean;
303
- /**
304
- * 全屏
305
- * @param el HTML元素
306
- * @param isfull 是否全屏
307
- */
308
- static fullScreen(el: any | Element, isfull: boolean): void;
309
- /**
310
- * 进入全屏
311
- * @param element 全屏要素容器
312
- */
313
- static requestFullScreen(element: any | Element): void;
314
- /**
315
- * 退出全屏
316
- */
317
- static exitFullScreen(): void;
318
- /**
319
- * 获取全屏的容器元素
320
- * @returns 全屏的容器元素
321
- */
322
- static fullScreenElement(): Element | HTMLElement | Document | null;
323
- /**
324
- * 是否是全屏
325
- * @returns 全屏状态
326
- */
327
- static isFullScreen(): boolean;
328
- /**
329
- * 监听全屏变化状态
330
- * @param handlerFunc 全屏状态变化的处理函数
331
- */
332
- static onFullScreenChanged(handlerFunc: (isfullscreen: boolean) => any): void;
333
- /**
334
- * 解决对象Json化循环引用问题
335
- * @param key
336
- * @param value
337
- * @returns
338
- */
339
- static stringifyCircularHandler(key: string, value: any): any;
340
- /**
341
- * 对象Json化——解决循环引用问题
342
- * @param obj 传入对象参数
343
- * @returns 无循环引用的新对象
344
- */
345
- static jsonStringify(obj: any): string;
346
- /**
347
- * 去掉JSON循环引用关系
348
- * @param obj 传入对象参数
349
- * @returns 无循环引用的新对象
350
- */
351
- static jsonParse(obj: any): any;
352
- /**
353
- * 获取input File的对象的数据路径
354
- * @param file File对象
355
- * @returns
356
- */
357
- static getObjectURL(file: any): string | undefined;
358
- /**
359
- * 获取文件的短MD5摘要
360
- * @param fileObj file对象
361
- * @param handleMd5Result 处理文件MD5结果
362
- */
363
- static getFileShortMD5(fileObj: any, handleMd5Result: (data: {
364
- isOK: boolean;
365
- data: string;
366
- }) => void): any;
367
- /**
368
- * 提供MD5值计算
369
- * @param content 字符串
370
- * @param needRawHash 是否需要是二进制格式的结果,默认为false
371
- * @returns MD5值
372
- */
373
- static MD5(content: string, needRawHash?: boolean): string;
374
- /**
375
- * 复制文本
376
- * @param text
377
- */
378
- static copyText: (text: string) => Promise<unknown>;
379
- }
380
-
381
- declare class StringUtils {
382
- /**
383
- * 判断字符串是否为空或undefined,不判断为0,不判断为false
384
- * @param str
385
- * @returns {boolean}
386
- */
387
- static isNullOrEmpty: (str: any) => boolean;
388
- static isNotEmpty: (str: any) => boolean;
389
- /**
390
- * / _ - 转换成驼峰并将view替换成空字符串
391
- * @param {*} name name
392
- */
393
- static toHump(name: any): any;
394
- }
395
-
396
- /**
397
- * 创建本地缓存对象
398
- */
399
- declare class StorageHelper {
400
- private prefixKey;
401
- private storage;
402
- constructor(prefixKey?: string, storage?: Storage);
403
- private getKey;
404
- /**
405
- * @description 设置缓存
406
- * @param {string} key 缓存键
407
- * @param {*} value 缓存值
408
- * @param expire
409
- */
410
- set(key: string, value: any, expire?: number | null): void;
411
- /**
412
- * 读取缓存
413
- * @param {string} key 缓存键
414
- * @param {*=} def 默认值
415
- */
416
- get(key: string, def?: any): any;
417
- /**
418
- * 从缓存删除某项
419
- * @param {string} key
420
- */
421
- remove(key: string): void;
422
- /**
423
- * 清空所有缓存
424
- * @memberOf Cache
425
- */
426
- clear(): void;
427
- /**
428
- * 设置cookie
429
- * @param {string} name cookie 名称
430
- * @param {*} value cookie 值
431
- * @param {number=} expire 过期时间
432
- * 如果过期时间为设置,默认关闭浏览器自动删除
433
- * @example
434
- */
435
- setCookie(name: string, value: any, expire?: number | null): void;
436
- /**
437
- * 根据名字获取cookie值
438
- * @param name
439
- */
440
- getCookie(name: string): string;
441
- /**
442
- * 根据名字删除指定的cookie
443
- * @param {string} key
444
- */
445
- removeCookie(key: string): void;
446
- /**
447
- * 清空cookie,使所有cookie失效
448
- */
449
- clearCookie(): void;
450
- }
451
- declare const storage: StorageHelper;
452
-
453
- declare function uuid(): string;
454
- declare function newGuid(): string;
455
-
456
- /**
457
- * rgb转十六进制
458
- * @param colorRGB rgb颜色值
459
- * @returns
460
- */
461
- declare function getHexColor(colorRGB: string): string;
462
- /**
463
- * 十六进制转RGB
464
- * @param color16 十六进制颜色值
465
- * @returns
466
- */
467
- declare function getRGBColor(color16: string): string;
468
- /**
469
- * 解决十六进制短颜色问题
470
- * @param colorHex 十六进制颜色
471
- * @returns
472
- */
473
- declare function getLongHexColor(colorHex: string): string;
474
- declare enum EnumColor {
475
- RGBA = 0,
476
- Hex = 1,
477
- Hsla = 2
478
- }
479
- /**
480
- * 判断是否是16进制颜色
481
- * @param colorStr 颜色字符串
482
- * @returns
483
- */
484
- declare function isEnumColor(colorStr: string): EnumColor | undefined;
485
- declare function getRGBColorFromHSLA(colorHSLA: string): string | undefined;
486
- /**
487
- * 判断是否 十六进制颜色值.
488
- * 输入形式可为 #fff000 #f00
489
- *
490
- * @param String color 十六进制颜色值
491
- * @return Boolean
492
- */
493
- declare function isHexColor(color: string): boolean;
494
- /**
495
- * RGB 颜色值转换为 十六进制颜色值.
496
- * r, g, 和 b 需要在 [0, 255] 范围内
497
- *
498
- * @return String 类似#ff00ff
499
- * @param r
500
- * @param g
501
- * @param b
502
- */
503
- declare function rgbToHex(r: number, g: number, b: number): string;
504
- /**
505
- * Transform a HEX color to its RGB representation
506
- * @param {string} hex The color to transform
507
- * @returns The RGB representation of the passed color
508
- */
509
- declare function hexToRGB(hex: string): string;
510
- declare function colorIsDark(color: string): boolean | undefined;
511
- /**
512
- * Darkens a HEX color given the passed percentage
513
- * @param {string} color The color to process
514
- * @param {number} amount The amount to change the color by
515
- * @returns {string} The HEX representation of the processed color
516
- */
517
- declare function darken(color: string, amount: number): string;
518
- /**
519
- * Lightens a 6 char HEX color according to the passed percentage
520
- * @param {string} color The color to change
521
- * @param {number} amount The amount to change the color by
522
- * @returns {string} The processed color represented as HEX
523
- */
524
- declare function lighten(color: string, amount: number): string;
525
- /**
526
- * Determines what the best text color is (black or white) based con the contrast with the background
527
- * @param hexColor - Last selected color by the user
528
- */
529
- declare function calculateBestTextColor(hexColor: string): "#000000" | "#FFFFFF";
530
-
531
- /**
532
- * 下载文件
533
- * @param content 文本或二进制文件
534
- * @param filename 文件名
535
- */
536
- declare const Download: (content: string | any, filename: string) => void;
537
- /**
538
- * URL方式保存文件到本地
539
- * @param data 文件的blob数据
540
- * @param name 文件名
541
- */
542
- declare function SaveAs(data: string | any, name: string): void;
543
- /**
544
- * JSON对象下载为.json文件
545
- * @param jsonObject Json对象
546
- * @param jsonID 名称(不需要后缀名)
547
- */
548
- declare const JsonDownload: (jsonObject: object, jsonID: string) => void;
549
- /**
550
- * 从Web上下载文件
551
- * (通过axios下载)
552
- * @param requestUrl URL下载地址
553
- * @param fileName 文件名
554
- */
555
- declare const HttpDownload: (axios: any, requestUrl: string, fileName: string) => void;
556
- /**
557
- * 根据文件地址下载文件
558
- * (网站内部文件或外部图片地址)
559
- * @param {*} sUrl
560
- */
561
- declare function DownloadByUrl({ url, target, fileName }: {
562
- url: string;
563
- target?: '_self' | '_blank';
564
- fileName?: string;
565
- }): Promise<boolean>;
566
-
567
- declare function sleep(delay: any): void;
568
-
569
- declare type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
570
- /**
571
- * Get服务请求
572
- * @param apiUrl API接口路径
573
- * @param baseUrl 基础服务路径
574
- * @param _params 参数
575
- * @param headers headers参数
576
- * @param responseType 响应类型,默认为json
577
- * @param cancelToken 取消标识
578
- * @returns 返回Promise对象
579
- */
580
- declare function requestGet(apiUrl: string, baseUrl?: string, _params?: any, headers?: any, responseType?: ResponseType, cancelToken?: any): Promise<any>;
581
- /**
582
- * Post服务请求-FormData
583
- * @param apiUrl API接口路径
584
- * @param baseUrl 基础服务路径
585
- * @param _params 参数
586
- * @param headers headers参数
587
- * @returns 返回Promise对象
588
- */
589
- declare function requestPost(apiUrl: string, baseUrl?: string, _bodyParams?: any, _queryParams?: any, headers?: any, responseType?: ResponseType): Promise<any>;
590
- /**
591
- * Post服务请求-Body方式
592
- * @param apiUrl API接口路径
593
- * @param baseUrl 基础服务路径
594
- * @param _params 参数
595
- * @returns 返回Promise对象
596
- */
597
- declare function requestPostBody(apiUrl: string, baseUrl?: string, _bodyParams?: any, _queryParams?: any, headers?: any, responseType?: ResponseType): Promise<any>;
598
- /**
599
- * 业务服务Get请求
600
- * @param apiUrl API接口路径
601
- * @param _params 参数
602
- * @returns 返回Promise对象
603
- */
604
- declare function get(apiUrl: string, _params?: any): Promise<any>;
605
- /**
606
- * 业务服务Post请求
607
- * @param apiUrl API接口路径
608
- * @param _params 参数
609
- * @returns 返回Promise对象
610
- */
611
- declare function post(apiUrl: string, _params?: any): Promise<any>;
612
- /**
613
- * 独立的外部Get请求(无token验证信息)
614
- * @param fullRequestURL 完整请求路径
615
- * @param _params 请求参数
616
- * @returns 返回Promise对象
617
- */
618
- declare function getData(fullRequestURL: string, _params?: any): Promise<any>;
619
-
620
- declare const storageHelper: StorageHelper;
621
- /**
622
- * 获取token中的授权Key
623
- * @returns
624
- */
625
- declare function getLocalToken(): ITokenInfo;
626
- /**
627
- * 清除本地Token
628
- */
629
- declare function clearLocalToken(): void;
630
- /**
631
- * 获得RefreshToken
632
- * @returns
633
- */
634
- declare function getRefreshToken(): string;
635
-
636
- declare type FileEventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success';
637
- declare type AllowedMethods = 'PUT' | 'POST' | 'PATCH';
638
- /**
639
- * 文件上传配置
640
- */
641
- interface FileUploadOptions {
642
- endpoint: string | ((file?: File) => Promise<string>);
643
- file: File;
644
- method?: AllowedMethods;
645
- headers?: XhrHeaders;
646
- maxFileSize?: number;
647
- chunkSize?: number;
648
- attempts?: number;
649
- /**
650
- * 单位:秒
651
- */
652
- delayBeforeAttempt?: number;
653
- md5?: string;
654
- }
655
- /**
656
- * 文件上传类
657
- */
658
- declare class FileUpload {
659
- endpoint: string | ((file?: File) => Promise<string>);
660
- file: File;
661
- headers: XhrHeaders;
662
- method: AllowedMethods;
663
- chunkSize: number;
664
- attempts: number;
665
- delayBeforeAttempt: number;
666
- md5: string;
667
- private chunk?;
668
- private chunkCount;
669
- private chunkByteSize;
670
- private maxFileBytes;
671
- private endpointValue?;
672
- private totalChunks;
673
- private attemptCount;
674
- private offline;
675
- private paused;
676
- private success;
677
- private currentXhr?;
678
- private reader;
679
- private eventTarget;
680
- private fileName;
681
- constructor(options: FileUploadOptions);
682
- /**
683
- * 订阅事件
684
- */
685
- on(FileEventName: FileEventName, fn: (event: any) => void): void;
686
- abort(): void;
687
- pause(): void;
688
- resume(): void;
689
- /**
690
- * 发送消息
691
- */
692
- private dispatch;
693
- /**
694
- *验证参数的正确性
695
- */
696
- private validateOptions;
697
- /**
698
- * Endpoint can either be a URL or a function that returns a promise that resolves to a string.
699
- */
700
- private getEndpoint;
701
- /**
702
- * Get portion of the file of x bytes corresponding to chunkSize
703
- */
704
- private getChunk;
705
- private xhrPromise;
706
- /**
707
- * Send chunk of the file with appropriate headers and add post parameters if it's last chunk
708
- */
709
- private sendChunk;
710
- /**
711
- * 失败处理和尝试
712
- */
713
- private manageRetries;
714
- /**
715
- * 进行分片上传,并处理错误和重试
716
- */
717
- private sendChunks;
718
- }
719
- /**
720
- * 创建文件上传对象方法
721
- * @param options
722
- * @returns
723
- */
724
- declare const createFileUpload: (options: FileUploadOptions) => FileUpload;
725
-
726
- /**
727
- * 模仿JQuery相关方法
728
- */
729
- declare class JQuery {
730
- /**
731
- * 是否有Style类名
732
- * @param ele HTML元素
733
- * @param className 类名
734
- * @returns
735
- */
736
- hasClass(ele: HTMLElement, className: string): RegExpMatchArray | null;
737
- /**
738
- * 为元素添加Style类名
739
- * @param ele HTML元素
740
- * @param className 类名
741
- */
742
- addClass(ele: HTMLElement, className: string): void;
743
- /**
744
- * 移除元素的Style类名
745
- * @param ele HTML元素
746
- * @param className 类名
747
- */
748
- removeClass(ele: HTMLElement, className: string): void;
749
- /**
750
- * 切换Style类名
751
- * @param ele HTML元素
752
- * @param className 类名
753
- */
754
- toggleClass(ele: HTMLElement, className: string): void;
755
- }
756
- /**
757
- * jquery对象
758
- */
759
- declare const jquery: JQuery;
760
-
761
- interface ILockState {
762
- isLock: boolean;
763
- lockTime: number;
764
- }
765
- /**
766
- * 获取当前Lock状态
767
- * @returns 是否Locked
768
- */
769
- declare function getLockState(): any;
770
- /**
771
- * 全局监听Lock
772
- */
773
- declare function onLockListener(): void;
774
- /**
775
- * 取消全局监听Lock
776
- */
777
- declare function unLockListener(): void;
778
-
779
- /**
780
- * 下载文件信息模型
781
- */
782
- interface IFileMeta {
783
- id?: string;
784
- name: string;
785
- length: number;
786
- downloadID: string;
787
- chunkSize?: number;
788
- }
789
- /**
790
- * 文件下载事件
791
- */
792
- declare type FileDownloadEvent = 'init' | 'info' | 'error' | 'downloadProgress' | 'saveProgress' | 'success';
793
-
794
- /**
795
- * @description: 判断值是否未某个类型
796
- */
797
- declare function is(val: unknown, type: string): boolean;
798
- /**
799
- * @description: 是否为函数
800
- */
801
- declare function isFunction<T = Function>(val: unknown): val is T;
802
- /**
803
- * @description: 是否已定义
804
- */
805
- declare const isDef: <T = unknown>(val?: T | undefined) => val is T;
806
- declare const isUnDef: <T = unknown>(val?: T | undefined) => val is T;
807
- declare function isNull(val: unknown): val is null;
808
- declare function isNullAndUnDef(val: unknown): val is null | undefined;
809
- declare function isNullOrUnDef(val: unknown): val is null | undefined;
810
- /**
811
- * @description: 是否为对象
812
- */
813
- declare const isObject: (val: any) => val is Record<any, any>;
814
- /**
815
- * @description: 是否为时间
816
- */
817
- declare function isDate(val: unknown): val is Date;
818
- /**
819
- * @description: 是否为数值
820
- */
821
- declare function isNumber(val: unknown): val is number;
822
- /**
823
- * @description: 是否为AsyncFunction
824
- */
825
- declare function isAsyncFunction<T = any>(val: unknown): val is Promise<T>;
826
- /**
827
- * @description: 是否为promise
828
- */
829
- declare function isPromise<T = any>(val: unknown): val is Promise<T>;
830
- /**
831
- * @description: 是否为字符串
832
- */
833
- declare function isString(val: unknown): val is string;
834
- /**
835
- * @description: 是否为boolean类型
836
- */
837
- declare function isBoolean(val: unknown): val is boolean;
838
- /**
839
- * @description: 是否为数组
840
- */
841
- declare function isArray(val: any): val is Array<any>;
842
- /**
843
- * @description: 是否客户端
844
- */
845
- declare const isClient: () => boolean;
846
- /**
847
- * @description: 是否为浏览器
848
- */
849
- declare const isWindow: (val: any) => val is Window;
850
- declare const isElement: (val: unknown) => val is Element;
851
- declare const isServer: boolean;
852
- declare function isImageDom(o: Element): boolean;
853
- /**
854
- * 是否为空
855
- * @param source
856
- * @returns
857
- */
858
- declare function isEmpty(source: unknown): boolean;
859
- /**
860
- * 是否是异常
861
- * @param val
862
- * @returns
863
- */
864
- declare function isError(val: unknown): boolean;
865
- /**
866
- * 判断元素是否为WeakSet
867
- * @param source
868
- * @returns
869
- */
870
- declare function isWeakSet(source: unknown): boolean;
871
- /**
872
- * @description 判断元素是否为WeakMap
873
- * @param {*} source 元素
874
- * @return {Boolen}
875
- */
876
- declare function isWeakMap(source: unknown): boolean;
877
- /**
878
- * @description 判断元素是否为Symbol
879
- * @param {*} source 元素
880
- * @return {Boolen}
881
- */
882
- declare function isSymbol(source: unknown): boolean;
883
- /**
884
- * @description 判断元素是否为Map
885
- * @param {*} source 元素
886
- * @return {Boolen}
887
- */
888
- declare function isMap(source: unknown): boolean;
889
- /**
890
- * 是否有效的URL地址
891
- * @param url
892
- * @returns
893
- */
894
- declare const isValidURL: (url: string) => boolean;
895
-
896
- /**
897
- * 将对象添加当作参数拼接到URL上面
898
- * @param baseUrl 需要拼接的url
899
- * @param obj 参数对象
900
- * @returns {string} 拼接后的对象
901
- * 例子:
902
- * let obj = {a: '3', b: '4'}
903
- * setObjToUrlParams('www.baidu.com', obj)
904
- * ==>www.baidu.com?a=3&b=4
905
- */
906
- declare function ObjToUrlParams(baseUrl: string, obj: object): string;
907
- /**
908
- * 深入拷贝对象
909
- * @param src
910
- * @param target
911
- * @returns
912
- */
913
- declare function deepMerge<T = any>(src?: any, target?: any): T;
914
-
915
- declare class HproseClient {
916
- private hproseURL?;
917
- client?: Client;
918
- private hproseProxy;
919
- private static httpTransport?;
920
- constructor(url?: string);
921
- private init;
922
- /**
923
- * 获取HproseProxy
924
- */
925
- getProxy(): Promise<any>;
926
- invoke(methodName: string, args?: any[], context?: ClientContext): Promise<any>;
927
- /**
928
- * 解码和编码
929
- */
930
- encode(name: string, args: any[], context: ClientContext): Uint8Array | undefined;
931
- decode(response: Uint8Array, context: ClientContext): any;
932
- }
933
-
934
- interface GIHprose {
935
- getDefaultClient(): ProxyClient;
936
- registerHprose(hpClientName: string, hproseUrl: string): HproseClient | undefined;
937
- getHprose(hpClientName: string): HproseClient | undefined;
938
- getProxyHprose(hpClientName: string): ProxyClient | undefined;
939
- unregisterHprose(hpClientName: string): void;
940
- }
941
- declare const GlobalHprose: GIHprose;
942
-
943
- /**
944
- * 刷新Token
945
- */
946
- declare function doRefreshToken(): void;
947
- /**
948
- * 检查和刷新Token
949
- * @param userToken
950
- */
951
- declare function checkDoRefreshToken(userToken: ITokenInfo): void;
952
- /**
953
- * 存储Token对象
954
- * @param userToken
955
- */
956
- declare function setLocalToken(userToken: IDoubleToken): void;
957
- /**
958
- * 设置当前用户
959
- * @param userInfo
960
- */
961
- declare function setUser(userInfo: ISystemUser): void;
962
-
963
- interface IUserInfo {
964
- /**
965
- * 用户名
966
- */
967
- username: string;
968
- oldpwd: string;
969
- newpwd: string;
970
- }
971
- interface IUser {
972
- username: string;
973
- pwd: string;
974
- /**
975
- * 所属系统
976
- */
977
- system?: string;
978
- }
979
- /**
980
- * 用户登录
981
- * @param data 用户信息
982
- * @returns
983
- */
984
- declare function login(data: IUser): Promise<any>;
985
- /**
986
- * 检查某一系统的用户
987
- * @param data 用户对象
988
- * @returns
989
- */
990
- declare function checkLogin(data: IUser): Promise<any>;
991
- /**
992
- * 修改密码
993
- * @param data 用户数据
994
- * @returns
995
- */
996
- declare function changePWD(data: IUserInfo): Promise<any>;
997
- /**
998
- * 退出登录
999
- */
1000
- declare function logout(): void;
1001
- /**
1002
- * 验证 已有的token
1003
- * @param token 需要验证的token
1004
- * @returns
1005
- */
1006
- declare function checkToken(token: string): Promise<any>;
1007
-
1008
- /**
1009
- * 刷新提前量(毫秒,ms)
1010
- */
1011
- declare const TOKEN_REFRESH_TIME: number;
1012
- /**
1013
- * 用户和Token相关服务API
1014
- */
1015
- declare const USER_TOKEN_API: {
1016
- Login: string;
1017
- CheckLogin: string;
1018
- Logout: string;
1019
- ChangePWD: string;
1020
- RefreshToken: string;
1021
- CheckToken: string;
1022
- };
1023
-
1024
- export { AllowedMethods, Download, DownloadByUrl, Emitter, EnumColor, EventHandlerList, EventHandlerMap, EventType, FileDownloadEvent, FileEventName, FileUploadOptions, GIHprose, Global, GlobalHprose, GlobalMitt, H5Tool, Handler, HproseClient, HttpDownload, IDoubleToken, IFileMeta, ILockState, IMapKeys, IServiceURL, ISystemConfig, ISystemUser, IToken, ITokenInfo, IUIObject, IUser, JsonDownload, ObjToUrlParams, ProxyClient, ResponseType, SaveAs, StorageHelper as Storage, StringUtils, SysEvents, TOKEN_REFRESH_TIME, USER_TOKEN_API, WildCardEventHandlerList, WildcardHandler, calculateBestTextColor, changePWD, checkDoRefreshToken, checkLogin, checkToken, clearLocalToken, colorIsDark, createFileUpload, darken, deepMerge, doRefreshToken, get, getData, getHexColor, getLocalToken, getLockState, getLongHexColor, getProxyClient, getRGBColor, getRGBColorFromHSLA, getRefreshToken, hexToRGB, init, initDefaultProxyClient, initXFrame, is, isArray, isAsyncFunction, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEnumColor, isError, isFunction, isHexColor, isImageDom, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isServer, isString, isSymbol, isUnDef, isValidURL, isWeakMap, isWeakSet, isWindow, jquery, lighten, login, logout, newGuid, onLockListener, post, requestGet, requestPost, requestPostBody, rgbToHex, setLocalToken, setUser, sleep, storage, storageHelper, unLockListener, uuid };
1
+ export * from './controls/splitpanes';
2
+ export * from './controls/collapsepanel';
3
+ export * from './controls/vuewindow';
4
+ export * from './controls/layoutcontainer';
5
+ export * from './core';
6
+ export * from './mitt';
7
+ export * from './utils';
8
+ export * from './hprose';
9
+ export * from './api';
10
+ export * from './model';