utools-api-types 3.0.0 → 4.0.0

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/utools.api.d.ts CHANGED
@@ -1,665 +1,711 @@
1
- interface UBrowser {
2
- /**
3
- * 设置 User-Agent
4
- */
5
- useragent(userAgent: string): this;
6
- /**
7
- * 前往
8
- * @param url 链接地址,支持 http 或 file 协议
9
- * @param headers 请求头参数
10
- * @param timeout 加载超时,默认 60000 ms(60秒)
11
- */
12
- goto(url: string, headers?: { Referer: string, userAgent: string }, timeout?: number): this;
13
- /**
14
- * 页面大小
15
- */
16
- viewport(width: number, height: number): this;
17
- /**
18
- * 隐藏 ubrowser 窗口
19
- */
20
- hide(): this;
21
- /**
22
- * 显示 ubrowser 窗口
23
- */
24
- show(): this;
25
- /**
26
- * 注入样式
27
- */
28
- css(css: string): this;
29
- /**
30
- * 键盘按键
31
- */
32
- press(key: string, ...modifier: ('control' | 'ctrl' | 'shift' | 'meta' | 'alt' | 'command' | 'cmd')[]): this;
33
- /**
34
- * 粘贴
35
- * @param text 如果是图片的base64编码字符串,粘贴图片,为空只执行粘贴动作
36
- */
37
- paste(text?: string): this;
38
- /**
39
- * 页面截图
40
- * @param arg 1.字符串 - 要截取的DOM元素, 2.对象 - 截图位置和大小, 3.空 - 为截取整个窗口
41
- * @param savePath 截图保存路径,可以是文件夹 或 .png文件完全路径, 默认保存临时目录
42
- */
43
- screenshot(arg: string | { x: number, y: number, width: number, height: number }, savePath?: string): this;
44
- /**
45
- * 保存为PDF
46
- * @param options 选项
47
- * @param savePath PDF保存路径,可以是文件夹 或 .pdf文件完全路径, 默认保存临时目录
48
- */
49
- pdf(options?: { marginsType: 0 | 1 | 2, pageSize: ('A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid') | ({ width: number, height: number }) }, savePath?: string): this;
50
- /**
51
- * 模拟设备
52
- */
53
- device(arg: ('iPhone 11' | 'iPhone X' | 'iPad' | 'iPhone 6/7/8 Plus' | 'iPhone 6/7/8' | 'iPhone 5/SE' | 'HUAWEI Mate10' | 'HUAWEI Mate20' | 'HUAWEI Mate30' | 'HUAWEI Mate30 Pro') | { size: { width: number, height: number }, useragent: string }): this;
54
- /**
55
- * 获取 cookie
56
- * @param name 为空获取全部cookie
57
- */
58
- cookies(name?: string): this;
59
- /**
60
- * 设置Cookie
61
- */
62
- setCookies(name: string, value: string): this;
63
- /**
64
- * 设置Cookie
65
- */
66
- setCookies(cookies: { name: string, value: string }[]): this;
67
- /**
68
- * 删除 cookie
69
- */
70
- removeCookies(name: string): this;
71
- /**
72
- * 清空cookie
73
- * @param url 在执行"goto"前执行 url参数必需
74
- */
75
- clearCookies(url?: string): this;
76
- /**
77
- * 打开开发者工具
78
- */
79
- devTools(mode?: 'right' | 'bottom' | 'undocked' | 'detach'): this;
80
- /**
81
- * 执行JS计算 并获得结果
82
- * @param func 在目标网页中执行
83
- * @param params 传到 func 中的参数
84
- */
85
- evaluate(func: (...params: any[]) => any, ...params: any[]): this;
86
- /**
87
- * 等待时间
88
- * @param ms 毫秒
89
- */
90
- wait(ms: number): this;
91
- /**
92
- * 等待元素出现
93
- * @param selector DOM元素
94
- * @param timeout 超时 默认60000 ms(60秒)
95
- */
96
- wait(selector: string, timeout?: number): this;
97
- /**
98
- * 等待 JS函数 执行返回 true
99
- * @param func 执行的JS函数
100
- * @param timeout 超时 默认60000 ms(60秒)
101
- * @param params 传到 func 中的参数
102
- */
103
- wait(func: (...params: any[]) => boolean, timeout?: number, ...params: any[]): this;
104
- /**
105
- * 当元素存在时执行直到碰到 end
106
- * @param selector DOM元素
107
- */
108
- when(selector: string): this;
109
- /**
110
- * 当 JS函数执行返回 true 时执行直到碰到 end
111
- * @param func 执行的JS函数
112
- * @param params 传到 func 中的参数
113
- */
114
- when(func: (...params: any[]) => boolean, ...params: any[]): this;
115
- /**
116
- * 配合 when 使用
117
- */
118
- end(): this;
119
- /**
120
- * 单击元素
121
- */
122
- click(selector: string): this;
123
- /**
124
- * 元素触发按下鼠标左键
125
- */
126
- mousedown(selector: string): this;
127
- /**
128
- * 元素触发释放鼠标左键
129
- */
130
- mouseup(selector: string): this;
131
- /**
132
- * 赋值 file input
133
- * @param selector <input type='file' /> 元素
134
- * @param payload 1. string - 文件路径 或 图片的base64编码,2. string[] - 文件路径集合,3. Uint8Array[]
135
- */
136
- file(selector: string, payload: string | string[] | Uint8Array): this;
137
- /**
138
- * input textarea select 等元素赋值并触发 input 或 change事件
139
- */
140
- value(selector: string, value: string): this;
141
- /**
142
- * checkbox radio 元素选中或取消选中
143
- */
144
- check(selector: string, checked: boolean): this;
145
- /**
146
- * 元素获得焦点
147
- */
148
- focus(selector: string): this;
149
- /**
150
- * 滚动到元素位置
151
- */
152
- scroll(selector: string): this;
153
- /**
154
- * Y轴滚动
155
- */
156
- scroll(y: number): this;
157
- /**
158
- * X轴和Y轴滚动
159
- */
160
- scroll(x: number, y: number): this;
161
- /**
162
- * 运行在闲置的 ubrowser 上
163
- * @param ubrowserId utools.getIdleUBrowsers() 中获得
164
- */
165
- run(ubrowserId: number): Promise<any[]>;
166
- /**
167
- * 启动一个 ubrowser 运行
168
- * 当运行结束后,窗口如果为隐藏状态将自动销毁窗口
169
- * @param options
170
- */
171
- run(options: {
172
- show?: boolean,
173
- width?: number,
174
- height?: number,
175
- x?: number,
176
- y?: number,
177
- center?: boolean,
178
- minWidth?: number,
179
- minHeight?: number,
180
- maxWidth?: number,
181
- maxHeight?: number,
182
- resizable?: boolean,
183
- movable?: boolean,
184
- minimizable?: boolean,
185
- maximizable?: boolean,
186
- alwaysOnTop?: boolean,
187
- fullscreen?: boolean,
188
- fullscreenable?: boolean,
189
- enableLargerThanScreen?: boolean,
190
- opacity?: number
191
- }): Promise<any[]>;
192
- }
193
-
194
- interface Display {
195
- accelerometerSupport: ('available' | 'unavailable' | 'unknown');
196
- bounds: { x: number, y: number, width: number, height: number };
197
- colorDepth: number;
198
- colorSpace: string;
199
- depthPerComponent: number;
200
- id: number;
201
- internal: boolean;
202
- monochrome: boolean;
203
- rotation: number;
204
- scaleFactor: number;
205
- size: { width: number, height: number };
206
- touchSupport: ('available' | 'unavailable' | 'unknown');
207
- workArea: { x: number, y: number, width: number, height: number };
208
- workAreaSize: { width: number, height: number };
209
- }
210
-
211
- interface DbDoc {
212
- _id: string,
213
- _rev?: string,
214
- [key: string]: any
215
- }
216
-
217
- interface DbReturn {
218
- id: string,
219
- rev?: string,
220
- ok?: boolean,
221
- error?: boolean,
222
- name?: string,
223
- message?: string
224
- }
225
-
226
- interface UToolsApi {
227
- /**
228
- * 插件应用进入时触发
229
- */
230
- onPluginEnter(callback: (action: {code: string, type: string, payload: any }) => void): void;
231
- /**
232
- * 插件应用隐藏后台或完全退出时触发
233
- */
234
- onPluginOut(callback: (processExit: boolean) => void): void;
235
- /**
236
- * 插件应用分离时触发
237
- */
238
- onPluginDetach(callback: () => void): void;
239
- /**
240
- * 插件应用从云端拉取到数据时触发
241
- */
242
- onDbPull(callback: (docs: { _id: string, _rev: string }[]) => void): void;
243
- /**
244
- * 隐藏主窗口
245
- * @param isRestorePreWindow 是否焦点回归到前面的活动窗口,默认 true
246
- */
247
- hideMainWindow(isRestorePreWindow?: boolean): boolean;
248
- /**
249
- * 显示主窗口
250
- */
251
- showMainWindow(): boolean;
252
- /**
253
- * 设置插件应用自身高度
254
- */
255
- setExpendHeight(height: number): boolean;
256
- /**
257
- * 设置子输入框
258
- * @param onChange 修改时触发
259
- * @param placeholder 占位符, 默认为空
260
- * @param isFocus 是否获得焦点,默认为 true
261
- */
262
- setSubInput(onChange: (text: string) => void, placeholder?: string, isFocus?: boolean): boolean;
263
- /**
264
- * 移除子输入框
265
- */
266
- removeSubInput(): boolean;
267
- /**
268
- * 赋值子输入框
269
- */
270
- setSubInputValue(value: string): boolean;
271
- /**
272
- * 子输入框获得焦点
273
- */
274
- subInputFocus(): boolean;
275
- /**
276
- * 子输入框获得焦点并选中
277
- */
278
- subInputSelect(): boolean;
279
- /**
280
- * 子输入框失去焦点,插件应用获得焦点
281
- */
282
- subInputBlur(): boolean;
283
- /**
284
- * 创建独立窗口
285
- * @param url 相对路径 html 文件
286
- * @param options 参考 https://www.electronjs.org/docs/api/browser-window#new-browserwindowoptions
287
- * @param callback url 加载完成时的回调
288
- */
289
- createBrowserWindow(url: string, options: { width?: number, height?: number }, callback?: () => void): { id: number, [key: string]: any, webContents: { id: number, [key: string]: any } };
290
- /**
291
- * 隐藏插件应用到后台
292
- */
293
- outPlugin(): boolean;
294
- /**
295
- * 是否深色模式
296
- */
297
- isDarkColors(): boolean;
298
- /**
299
- * 获取用户
300
- */
301
- getUser(): { avatar: string, nickname: string, type: string } | null;
302
- /**
303
- * 获取用户服务端临时令牌
304
- */
305
- fetchUserServerTemporaryToken(): Promise<{ token: string, expiredAt: number }>;
306
- /**
307
- * 打开支付
308
- * @param callback 支付成功触发
309
- */
310
- openPayment(options: {
311
- /**
312
- * 商品ID,在 “uTools 开发者工具” 插件应用中创建
313
- */
314
- goodsId: string,
315
- /**
316
- * 第三方服务生成的订单号(可选)
317
- */
318
- outOrderId?: string,
319
- /**
320
- * 第三方服务附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用(可选)
321
- */
322
- attach?: string
323
- }, callback?: () => void): void;
324
- /**
325
- * 获取用户支付记录
326
- */
327
- fetchUserPayments(): Promise<{ order_id: string, total_fee: number, body: string, attach: string, goods_id: string, out_order_id: string, paid_at: string }[]>;
328
- /**
329
- * 设置插件应用动态功能
330
- */
331
- setFeature(feature: {
332
- code: string,
333
- explain: string,
334
- platform: ('darwin' | 'win32' | 'linux') | (Array<'darwin' | 'win32' | 'linux'>),
335
- icon?: string,
336
- cmds: (string | {
337
- type: 'img' | 'files' | 'regex' | 'over' | 'window',
338
- label: string
339
- })[]
340
- }): boolean;
341
- /**
342
- * 移除插件应用动态功能
343
- */
344
- removeFeature(code: string): boolean;
345
- /**
346
- * 获取插件应用动态功能,参数为空获取所有动态功能
347
- */
348
- getFeatures(codes?: string[]): {
349
- code: string,
350
- explain: string,
351
- platform: ('darwin' | 'win32' | 'linux') | (Array<'darwin' | 'win32' | 'linux'>),
352
- icon?: string,
353
- cmds: string | {
354
- type: 'img' | 'files' | 'regex' | 'over' | 'window',
355
- label: string
356
- }[]
357
- }[];
358
- /**
359
- * 插件应用间跳转
360
- */
361
- redirect(label: string, payload: string | { type: 'text' | 'img' | 'files', data: any }): void;
362
- /**
363
- * 获取闲置的 ubrowser
364
- */
365
- getIdleUBrowsers(): { id: number, title: string, url: string}[];
366
- /**
367
- * 设置 ubrowser 代理 https://www.electronjs.org/docs/api/session#sessetproxyconfig
368
- */
369
- setUBrowserProxy(config: {pacScript?: string, proxyRules?: string, proxyBypassRules?: string}): boolean;
370
- /**
371
- * 清空 ubrowser 缓存
372
- */
373
- clearUBrowserCache(): boolean;
374
- /**
375
- * 显示系统通知
376
- */
377
- showNotification(body: string): void;
378
- /**
379
- * 弹出文件选择框
380
- */
381
- showOpenDialog(options: {
382
- title?: string,
383
- defaultPath?: string,
384
- buttonLabel?: string,
385
- filters?: { name: string, extensions: string[] }[],
386
- properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>,
387
- message?: string,
388
- securityScopedBookmarks?: boolean
389
- }): (string[]) | (undefined);
390
- /**
391
- * 弹出文件保存框
392
- */
393
- showSaveDialog(options: {
394
- title?: string,
395
- defaultPath?: string,
396
- buttonLabel?: string,
397
- filters?: { name: string, extensions: string[] }[],
398
- message?: string,
399
- nameFieldLabel?: string,
400
- showsTagField?: string,
401
- properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>,
402
- securityScopedBookmarks?: boolean
403
- }): (string) | (undefined);
404
- /**
405
- * 插件应用页面中查找
406
- */
407
- findInPage(text: string, options?: {
408
- forward?: boolean,
409
- findNext?: boolean,
410
- matchCase?: boolean,
411
- wordStart?: boolean,
412
- medialCapitalAsWordStart?: boolean
413
- }): void;
414
- /**
415
- * 停止插件应用页面中查找
416
- */
417
- stopFindInPage (action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
418
- /**
419
- * 拖拽文件
420
- */
421
- startDrag(file: string | string[]): void;
422
- /**
423
- * 屏幕取色
424
- */
425
- screenColorPick(callback: (color: { hex: string, rgb: string }) => void): void;
426
- /**
427
- * 屏幕截图
428
- */
429
- screenCapture(callback: (imgBase64: string) => void): void;
430
- /**
431
- * 获取本地 ID
432
- */
433
- getNativeId(): string;
434
- /**
435
- * 获取软件版本
436
- */
437
- getAppVersion(): string;
438
- /**
439
- * 获取路径
440
- */
441
- getPath(name: 'home' | 'appData' | 'userData' | 'cache' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'logs' | 'pepperFlashSystemPlugin'): string;
442
- /**
443
- * 获取文件图标
444
- */
445
- getFileIcon(filePath: string): string;
446
- /**
447
- * 复制文件到剪贴板
448
- */
449
- copyFile(file: string | string[]): boolean;
450
- /**
451
- * 复制图片到剪贴板
452
- * @param img base64、buffer、图片路径
453
- */
454
- copyImage(img: string | Uint8Array): boolean;
455
- /**
456
- * 复制文本到剪贴板
457
- */
458
- copyText(text: string): boolean;
459
- /**
460
- * 获取复制的文件或文件夹
461
- */
462
- getCopyedFiles(): { isFile: boolean, isDirectory: boolean, name: string, path: string }[];
463
- /**
464
- * 读取当前文件管理器路径(linux 不支持)
465
- */
466
- readCurrentFolderPath(): Promise<string>;
467
- /**
468
- * 读取当前浏览器窗口的URL(linux 不支持)
469
- * MacOs 支持浏览器 Safari、Chrome、Opera、Vivaldi、Brave
470
- * Windows 支持浏览器 Chrome、Firefox、Edge、IE、Opera、Brave
471
- * Linux 不支持
472
- */
473
- readCurrentBrowserUrl(): Promise<string>;
474
- /**
475
- * 默认方式打开给定的文件
476
- */
477
- shellOpenPath(fullPath: string): void;
478
- /**
479
- * 在文件管理器中显示给定的文件
480
- */
481
- shellShowItemInFolder(fullPath: string): void;
482
- /**
483
- * 系统默认的协议打开URL
484
- */
485
- shellOpenExternal(url: string): void;
486
- /**
487
- * 播放哔哔声
488
- */
489
- shellBeep(): void;
490
- /*
491
- * 隐藏主窗口并键入字符串
492
- */
493
- hideMainWindowTypeString(str: string): void;
494
- /**
495
- * 模拟键盘按键
496
- */
497
- simulateKeyboardTap(key: string, ...modifier: ('control' | 'ctrl' | 'shift' | 'option' | 'alt' | 'command' | 'super')[]): void;
498
- /**
499
- * 模拟鼠标单击
500
- */
501
- simulateMouseClick(x?: number, y?: number): void;
502
- /**
503
- * 模拟鼠标右击
504
- */
505
- simulateMouseRightClick(x?: number, y?: number): void;
506
- /**
507
- * 模拟鼠标双击
508
- */
509
- simulateMouseDoubleClick(x?: number, y?: number): void;
510
- /**
511
- * 模拟鼠标移动
512
- */
513
- simulateMouseMove(x: number, y: number): void;
514
- /**
515
- * 获取鼠标绝对位置
516
- */
517
- getCursorScreenPoint(): { x: number, y: number };
518
- /**
519
- * 获取主显示器
520
- */
521
- getPrimaryDisplay(): Display;
522
- /**
523
- * 获取所有显示器
524
- */
525
- getAllDisplays(): Display[];
526
- /**
527
- * 获取位置所在的显示器
528
- */
529
- getDisplayNearestPoint(point: { x: number, y: number }): Display;
530
- /**
531
- * 获取矩形所在的显示器
532
- */
533
- getDisplayMatching(rect: { x: number, y: number, width: number, height: number }): Display;
534
- /**
535
- * 录屏源
536
- */
537
- desktopCaptureSources(options: { types: string[], thumbnailSize?: { width: number, height: number }, fetchWindowIcons?: boolean }):Promise<{appIcon: {}, display_id: string, id: string, name: string, thumbnail: {} }>;
538
- /**
539
- * 是否开发中
540
- */
541
- isDev(): boolean;
542
- /**
543
- * 是否 MacOs 操作系统
544
- */
545
- isMacOS(): boolean;
546
- /**
547
- * 是否 Windows 操作系统
548
- */
549
- isWindows(): boolean;
550
- /**
551
- * 是否 Linux 操作系统
552
- */
553
- isLinux(): boolean;
554
-
555
- db: {
556
- /**
557
- * 创建/更新文档
558
- */
559
- put(doc: DbDoc): DbReturn;
560
- /**
561
- * 获取文档
562
- */
563
- get(id: string): DbDoc | null;
564
- /**
565
- * 删除文档
566
- */
567
- remove(doc: string | DbDoc): DbReturn;
568
- /**
569
- * 批量操作文档(新增、修改、删除)
570
- */
571
- bulkDocs(docs: DbDoc[]): DbReturn[];
572
- /**
573
- * 获取所有文档 可根据文档id前缀查找
574
- */
575
- allDocs(key?: string): DbDoc[];
576
- /**
577
- * 存储附件到新文档
578
- * @param docId 文档ID
579
- * @param attachment 附件 buffer
580
- * @param type 附件类型,示例:image/png, text/plain
581
- */
582
- postAttachment(docId: string, attachment: Uint8Array, type: string): DbReturn;
583
- /**
584
- * 获取附件
585
- * @param docId 文档ID
586
- */
587
- getAttachment(docId: string): Uint8Array | null;
588
- /**
589
- * 获取附件类型
590
- * @param docId 文档ID
591
- */
592
- getAttachmentType(docId: string): string | null;
593
- /**
594
- * 云端复制数据状态 (null: 未开启数据同步、0: 已完成复制、1:复制中)
595
- */
596
- replicateStateFromCloud(): null | 0 | 1;
597
- /**
598
- * 异步
599
- */
600
- promises: {
601
- /**
602
- * 创建/更新文档
603
- */
604
- put(doc: DbDoc): Promise<DbReturn>;
605
- /**
606
- * 获取文档
607
- */
608
- get(id: string): Promise<DbDoc | null>;
609
- /**
610
- * 删除文档
611
- */
612
- remove(doc: string | DbDoc): Promise<DbReturn>;
613
- /**
614
- * 批量操作文档(新增、修改、删除)
615
- */
616
- bulkDocs(docs: DbDoc[]): Promise<DbReturn[]>;
617
- /**
618
- * 获取所有文档 可根据文档id前缀查找
619
- */
620
- allDocs(key?: string): Promise<DbDoc[]>;
621
- /**
622
- * 存储附件到新文档
623
- * @param docId 文档ID
624
- * @param attachment 附件 buffer
625
- * @param type 附件类型,示例:image/png, text/plain
626
- */
627
- postAttachment(docId: string, attachment: Uint8Array, type: string): Promise<DbReturn>;
628
- /**
629
- * 获取附件
630
- * @param docId 文档ID
631
- */
632
- getAttachment(docId: string): Promise<Uint8Array | null>;
633
- /**
634
- * 获取附件类型
635
- * @param docId 文档ID
636
- */
637
- getAttachmentType(docId: string): Promise<string | null>;
638
- /**
639
- * 云端复制数据状态 (null: 未开启数据同步、0: 已完成复制、1:复制中)
640
- */
641
- replicateStateFromCloud(): Promise<null | 0 | 1>;
642
- }
643
- };
644
-
645
- dbStorage: {
646
- /**
647
- * 键值对存储,如果键名存在,则更新其对应的值
648
- * @param key 键名(同时为文档ID)
649
- * @param value 键值
650
- */
651
- setItem (key: string, value: any): void;
652
- /**
653
- * 获取键名对应的值
654
- */
655
- getItem (key: string): any;
656
- /**
657
- * 删除键值对(删除文档)
658
- */
659
- removeItem (key: string): void;
660
- };
661
-
662
- ubrowser: UBrowser;
663
- }
664
-
665
- declare var utools: UToolsApi;
1
+ interface UBrowser {
2
+ /**
3
+ * 设置 User-Agent
4
+ */
5
+ useragent(userAgent: string): this;
6
+ /**
7
+ * 前往
8
+ * @param url 链接地址,支持 http 或 file 协议
9
+ * @param headers 请求头参数
10
+ * @param timeout 加载超时,默认 60000 ms(60秒)
11
+ */
12
+ goto(url: string, headers?: { Referer: string, userAgent: string }, timeout?: number): this;
13
+ /**
14
+ * 页面大小
15
+ */
16
+ viewport(width: number, height: number): this;
17
+ /**
18
+ * 隐藏 ubrowser 窗口
19
+ */
20
+ hide(): this;
21
+ /**
22
+ * 显示 ubrowser 窗口
23
+ */
24
+ show(): this;
25
+ /**
26
+ * 注入样式
27
+ */
28
+ css(css: string): this;
29
+ /**
30
+ * 键盘按键
31
+ */
32
+ press(key: string, ...modifier: ('ctrl' | 'shift' | 'alt' | 'meta')[]): this;
33
+ /**
34
+ * 粘贴
35
+ * @param text 如果是图片的base64编码字符串,粘贴图片,为空只执行粘贴动作
36
+ */
37
+ paste(text?: string): this;
38
+ /**
39
+ * 页面截图
40
+ * @param arg 1.字符串 - 要截取的DOM元素, 2.对象 - 截图位置和大小, 3.空 - 为截取整个窗口
41
+ * @param savePath 截图保存路径,可以是文件夹 或 .png文件完全路径, 默认保存临时目录
42
+ */
43
+ screenshot(arg: string | { x: number, y: number, width: number, height: number }, savePath?: string): this;
44
+ /**
45
+ * 保存为PDF
46
+ * @param options 选项
47
+ * @param savePath PDF保存路径,可以是文件夹 或 .pdf文件完全路径, 默认保存临时目录
48
+ */
49
+ pdf(options?: { marginsType: 0 | 1 | 2, pageSize: ('A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid') | ({ width: number, height: number }) }, savePath?: string): this;
50
+ /**
51
+ * 模拟设备
52
+ */
53
+ device(arg: ('iPhone 11' | 'iPhone X' | 'iPad' | 'iPhone 6/7/8 Plus' | 'iPhone 6/7/8' | 'iPhone 5/SE' | 'HUAWEI Mate10' | 'HUAWEI Mate20' | 'HUAWEI Mate30' | 'HUAWEI Mate30 Pro') | { size: { width: number, height: number }, useragent: string }): this;
54
+ /**
55
+ * 获取 cookie
56
+ * @param name 为空获取全部cookie
57
+ */
58
+ cookies(name?: string): this;
59
+ /**
60
+ * 设置Cookie
61
+ */
62
+ setCookies(name: string, value: string): this;
63
+ /**
64
+ * 设置Cookie
65
+ */
66
+ setCookies(cookies: { name: string, value: string }[]): this;
67
+ /**
68
+ * 删除 cookie
69
+ */
70
+ removeCookies(name: string): this;
71
+ /**
72
+ * 清空cookie
73
+ * @param url 在执行"goto"前执行 url参数必需
74
+ */
75
+ clearCookies(url?: string): this;
76
+ /**
77
+ * 打开开发者工具
78
+ */
79
+ devTools(mode?: 'right' | 'bottom' | 'undocked' | 'detach'): this;
80
+ /**
81
+ * 执行JS计算 并获得结果
82
+ * @param func 在目标网页中执行
83
+ * @param params 传到 func 中的参数
84
+ */
85
+ evaluate(func: (...params: any[]) => any, ...params: any[]): this;
86
+ /**
87
+ * 等待时间
88
+ * @param ms 毫秒
89
+ */
90
+ wait(ms: number): this;
91
+ /**
92
+ * 等待元素出现
93
+ * @param selector DOM元素
94
+ * @param timeout 超时 默认60000 ms(60秒)
95
+ */
96
+ wait(selector: string, timeout?: number): this;
97
+ /**
98
+ * 等待 JS函数 执行返回 true
99
+ * @param func 执行的JS函数
100
+ * @param timeout 超时 默认60000 ms(60秒)
101
+ * @param params 传到 func 中的参数
102
+ */
103
+ wait(func: (...params: any[]) => boolean, timeout?: number, ...params: any[]): this;
104
+ /**
105
+ * 当元素存在时执行直到碰到 end
106
+ * @param selector DOM元素
107
+ */
108
+ when(selector: string): this;
109
+ /**
110
+ * 当 JS函数执行返回 true 时执行直到碰到 end
111
+ * @param func 执行的JS函数
112
+ * @param params 传到 func 中的参数
113
+ */
114
+ when(func: (...params: any[]) => boolean, ...params: any[]): this;
115
+ /**
116
+ * 配合 when 使用
117
+ */
118
+ end(): this;
119
+ /**
120
+ * 单击元素
121
+ */
122
+ click(selector: string): this;
123
+ /**
124
+ * 元素触发按下鼠标左键
125
+ */
126
+ mousedown(selector: string): this;
127
+ /**
128
+ * 元素触发释放鼠标左键
129
+ */
130
+ mouseup(selector: string): this;
131
+ /**
132
+ * 赋值 file input
133
+ * @param selector <input type='file' /> 元素
134
+ * @param payload 1. string - 文件路径 或 图片的base64编码,2. string[] - 文件路径集合,3. Uint8Array[]
135
+ */
136
+ file(selector: string, payload: string | string[] | Uint8Array): this;
137
+ /**
138
+ * input textarea select 等元素赋值并触发 input 或 change事件
139
+ */
140
+ value(selector: string, value: string): this;
141
+ /**
142
+ * checkbox radio 元素选中或取消选中
143
+ */
144
+ check(selector: string, checked: boolean): this;
145
+ /**
146
+ * 元素获得焦点
147
+ */
148
+ focus(selector: string): this;
149
+ /**
150
+ * 滚动到元素位置
151
+ */
152
+ scroll(selector: string): this;
153
+ /**
154
+ * Y轴滚动
155
+ */
156
+ scroll(y: number): this;
157
+ /**
158
+ * X轴和Y轴滚动
159
+ */
160
+ scroll(x: number, y: number): this;
161
+ /**
162
+ * 下载文件
163
+ */
164
+ download(url: string, savePath?: string): this;
165
+ /**
166
+ * 启动一个 ubrowser 运行
167
+ * 当运行结束后,窗口如果为隐藏状态将自动销毁窗口
168
+ * @param options
169
+ */
170
+ run(options: {
171
+ show?: boolean,
172
+ width?: number,
173
+ height?: number,
174
+ x?: number,
175
+ y?: number,
176
+ center?: boolean,
177
+ minWidth?: number,
178
+ minHeight?: number,
179
+ maxWidth?: number,
180
+ maxHeight?: number,
181
+ resizable?: boolean,
182
+ movable?: boolean,
183
+ minimizable?: boolean,
184
+ maximizable?: boolean,
185
+ alwaysOnTop?: boolean,
186
+ fullscreen?: boolean,
187
+ fullscreenable?: boolean,
188
+ enableLargerThanScreen?: boolean,
189
+ opacity?: number
190
+ }): Promise<any[]>;
191
+ /**
192
+ * 运行在闲置的 ubrowser 上
193
+ * @param ubrowserId 1. run(options) 运行结束后, 当 ubrowser 实例窗口仍然显示时返回 2. utools.getIdleUBrowsers() 中获得
194
+ */
195
+ run(ubrowserId: number): Promise<any[]>;
196
+ }
197
+
198
+ interface Display {
199
+ accelerometerSupport: ('available' | 'unavailable' | 'unknown');
200
+ bounds: { x: number, y: number, width: number, height: number };
201
+ colorDepth: number;
202
+ colorSpace: string;
203
+ depthPerComponent: number;
204
+ id: number;
205
+ internal: boolean;
206
+ monochrome: boolean;
207
+ rotation: number;
208
+ scaleFactor: number;
209
+ size: { width: number, height: number };
210
+ touchSupport: ('available' | 'unavailable' | 'unknown');
211
+ workArea: { x: number, y: number, width: number, height: number };
212
+ workAreaSize: { width: number, height: number };
213
+ }
214
+
215
+ interface DbDoc {
216
+ _id: string,
217
+ _rev?: string,
218
+ [key: string]: any
219
+ }
220
+
221
+ interface DbReturn {
222
+ id: string,
223
+ rev?: string,
224
+ ok?: boolean,
225
+ error?: boolean,
226
+ name?: string,
227
+ message?: string
228
+ }
229
+
230
+ interface UToolsApi {
231
+ /**
232
+ * 插件应用进入时触发
233
+ */
234
+ onPluginEnter(callback: (action: {code: string, type: string, payload: any, option: any }) => void): void;
235
+ /**
236
+ * 向搜索面板推送消息
237
+ */
238
+ onMainPush(callback: (action: {code: string, type: string, payload: any }) => { icon?: string, text: string, title?: string }[], selectCallback: (action: {code: string, type: string, payload: any, option: { icon?: string, text: string, title?: string }}) => void): void;
239
+ /**
240
+ * 插件应用隐藏后台或完全退出时触发
241
+ */
242
+ onPluginOut(callback: (processExit: boolean) => void): void;
243
+ /**
244
+ * 插件应用分离时触发
245
+ */
246
+ onPluginDetach(callback: () => void): void;
247
+ /**
248
+ * 插件应用从云端拉取到数据时触发
249
+ */
250
+ onDbPull(callback: (docs: { _id: string, _rev: string }[]) => void): void;
251
+ /**
252
+ * 隐藏主窗口
253
+ * @param isRestorePreWindow 是否焦点回归到前面的活动窗口,默认 true
254
+ */
255
+ hideMainWindow(isRestorePreWindow?: boolean): boolean;
256
+ /**
257
+ * 显示主窗口
258
+ */
259
+ showMainWindow(): boolean;
260
+ /**
261
+ * 设置插件应用自身高度
262
+ */
263
+ setExpendHeight(height: number): boolean;
264
+ /**
265
+ * 设置子输入框
266
+ * @param onChange 修改时触发
267
+ * @param placeholder 占位符, 默认为空
268
+ * @param isFocus 是否获得焦点,默认为 true
269
+ */
270
+ setSubInput(onChange: (text: string) => void, placeholder?: string, isFocus?: boolean): boolean;
271
+ /**
272
+ * 移除子输入框
273
+ */
274
+ removeSubInput(): boolean;
275
+ /**
276
+ * 赋值子输入框
277
+ */
278
+ setSubInputValue(value: string): boolean;
279
+ /**
280
+ * 子输入框获得焦点
281
+ */
282
+ subInputFocus(): boolean;
283
+ /**
284
+ * 子输入框获得焦点并选中
285
+ */
286
+ subInputSelect(): boolean;
287
+ /**
288
+ * 子输入框失去焦点,插件应用获得焦点
289
+ */
290
+ subInputBlur(): boolean;
291
+ /**
292
+ * 创建独立窗口
293
+ * @param url 相对路径 html 文件
294
+ * @param options 参考 https://www.electronjs.org/docs/api/browser-window#new-browserwindowoptions
295
+ * @param callback url 加载完成时的回调
296
+ */
297
+ createBrowserWindow(url: string, options: { width?: number, height?: number }, callback?: () => void): { id: number, [key: string]: any, webContents: { id: number, [key: string]: any } };
298
+ /**
299
+ * 隐藏插件应用到后台
300
+ */
301
+ outPlugin(): boolean;
302
+ /**
303
+ * 是否深色模式
304
+ */
305
+ isDarkColors(): boolean;
306
+ /**
307
+ * 获取用户
308
+ */
309
+ getUser(): { avatar: string, nickname: string, type: string } | null;
310
+ /**
311
+ * 获取用户服务端临时令牌
312
+ */
313
+ fetchUserServerTemporaryToken(): Promise<{ token: string, expiredAt: number }>;
314
+ /**
315
+ * 是否插件应用的付费用户
316
+ */
317
+ isPurchasedUser(): boolean;
318
+ /**
319
+ * 打开付费 (软件付费)
320
+ * @param callback 购买成功触发
321
+ */
322
+ openPurchase(options: {
323
+ /**
324
+ * 商品 ID,在「开发者工具」插件应用中创建
325
+ */
326
+ goodsId: string,
327
+ /**
328
+ * 第三方服务生成的订单号(可选)
329
+ */
330
+ outOrderId?: string,
331
+ /**
332
+ * 第三方服务附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用(可选)
333
+ */
334
+ attach?: string
335
+ }, callback?: () => void): void;
336
+ /**
337
+ * 打开支付 (付费付费)
338
+ * @param callback 支付成功触发
339
+ */
340
+ openPayment(options: {
341
+ /**
342
+ * 商品 ID,在「开发者工具」插件应用中创建
343
+ */
344
+ goodsId: string,
345
+ /**
346
+ * 第三方服务生成的订单号(可选)
347
+ */
348
+ outOrderId?: string,
349
+ /**
350
+ * 第三方服务附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用(可选)
351
+ */
352
+ attach?: string
353
+ }, callback?: () => void): void;
354
+ /**
355
+ * 获取用户支付记录
356
+ */
357
+ fetchUserPayments(): Promise<{ order_id: string, total_fee: number, body: string, attach: string, goods_id: string, out_order_id: string, paid_at: string }[]>;
358
+ /**
359
+ * 设置插件应用动态功能
360
+ */
361
+ setFeature(feature: {
362
+ code: string,
363
+ explain: string,
364
+ platform: ('darwin' | 'win32' | 'linux') | (Array<'darwin' | 'win32' | 'linux'>),
365
+ icon?: string,
366
+ cmds: (string | {
367
+ type: 'img' | 'files' | 'regex' | 'over' | 'window',
368
+ label: string
369
+ })[]
370
+ }): boolean;
371
+ /**
372
+ * 移除插件应用动态功能
373
+ */
374
+ removeFeature(code: string): boolean;
375
+ /**
376
+ * 获取插件应用动态功能,参数为空获取所有动态功能
377
+ */
378
+ getFeatures(codes?: string[]): {
379
+ code: string,
380
+ explain: string,
381
+ platform: ('darwin' | 'win32' | 'linux') | (Array<'darwin' | 'win32' | 'linux'>),
382
+ icon?: string,
383
+ cmds: string | {
384
+ type: 'img' | 'files' | 'regex' | 'over' | 'window',
385
+ label: string
386
+ }[]
387
+ }[];
388
+ /**
389
+ * 插件应用间跳转
390
+ */
391
+ redirect(label: string | string[], payload: string | { type: 'text' | 'img' | 'files', data: any }): void;
392
+ /**
393
+ * 获取闲置的 ubrowser
394
+ */
395
+ getIdleUBrowsers(): { id: number, title: string, url: string}[];
396
+ /**
397
+ * 设置 ubrowser 代理 https://www.electronjs.org/docs/api/session#sessetproxyconfig
398
+ */
399
+ setUBrowserProxy(config: {pacScript?: string, proxyRules?: string, proxyBypassRules?: string}): boolean;
400
+ /**
401
+ * 清空 ubrowser 缓存
402
+ */
403
+ clearUBrowserCache(): boolean;
404
+ /**
405
+ * 显示系统通知
406
+ */
407
+ showNotification(body: string): void;
408
+ /**
409
+ * 弹出文件选择框
410
+ */
411
+ showOpenDialog(options: {
412
+ title?: string,
413
+ defaultPath?: string,
414
+ buttonLabel?: string,
415
+ filters?: { name: string, extensions: string[] }[],
416
+ properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>,
417
+ message?: string,
418
+ securityScopedBookmarks?: boolean
419
+ }): (string[]) | (undefined);
420
+ /**
421
+ * 弹出文件保存框
422
+ */
423
+ showSaveDialog(options: {
424
+ title?: string,
425
+ defaultPath?: string,
426
+ buttonLabel?: string,
427
+ filters?: { name: string, extensions: string[] }[],
428
+ message?: string,
429
+ nameFieldLabel?: string,
430
+ showsTagField?: string,
431
+ properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>,
432
+ securityScopedBookmarks?: boolean
433
+ }): (string) | (undefined);
434
+ /**
435
+ * 插件应用页面中查找
436
+ */
437
+ findInPage(text: string, options?: {
438
+ forward?: boolean,
439
+ findNext?: boolean,
440
+ matchCase?: boolean,
441
+ wordStart?: boolean,
442
+ medialCapitalAsWordStart?: boolean
443
+ }): void;
444
+ /**
445
+ * 停止插件应用页面中查找
446
+ */
447
+ stopFindInPage (action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
448
+ /**
449
+ * 拖拽文件
450
+ */
451
+ startDrag(file: string | string[]): void;
452
+ /**
453
+ * 屏幕取色
454
+ */
455
+ screenColorPick(callback: (color: { hex: string, rgb: string }) => void): void;
456
+ /**
457
+ * 屏幕截图
458
+ */
459
+ screenCapture(callback: (imgBase64: string) => void): void;
460
+ /**
461
+ * 获取本地 ID
462
+ */
463
+ getNativeId(): string;
464
+ /**
465
+ * 获取软件版本
466
+ */
467
+ getAppVersion(): string;
468
+ /**
469
+ * 获取软件名称
470
+ */
471
+ getAppName(): string;
472
+ /**
473
+ * 获取路径
474
+ */
475
+ getPath(name: 'home' | 'appData' | 'userData' | 'cache' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'logs' | 'pepperFlashSystemPlugin'): string;
476
+ /**
477
+ * 获取文件图标
478
+ */
479
+ getFileIcon(filePath: string): string;
480
+ /**
481
+ * 复制文件到剪贴板
482
+ */
483
+ copyFile(file: string | string[]): boolean;
484
+ /**
485
+ * 复制图片到剪贴板
486
+ * @param img base64、buffer、图片路径
487
+ */
488
+ copyImage(img: string | Uint8Array): boolean;
489
+ /**
490
+ * 复制文本到剪贴板
491
+ */
492
+ copyText(text: string): boolean;
493
+ /**
494
+ * 获取复制的文件或文件夹
495
+ */
496
+ getCopyedFiles(): { isFile: boolean, isDirectory: boolean, name: string, path: string }[];
497
+ /**
498
+ * 读取当前文件管理器路径(linux 不支持)
499
+ */
500
+ readCurrentFolderPath(): Promise<string>;
501
+ /**
502
+ * 读取当前浏览器窗口的URL(linux 不支持)
503
+ * MacOs 支持浏览器 Safari、Chrome、Opera、Vivaldi、Brave
504
+ * Windows 支持浏览器 Chrome、Firefox、Edge、IE、Opera、Brave
505
+ * Linux 不支持
506
+ */
507
+ readCurrentBrowserUrl(): Promise<string>;
508
+ /**
509
+ * 默认方式打开给定的文件
510
+ */
511
+ shellOpenPath(fullPath: string): void;
512
+ /**
513
+ * 在文件管理器中显示给定的文件
514
+ */
515
+ shellShowItemInFolder(fullPath: string): void;
516
+ /**
517
+ * 系统默认的协议打开URL
518
+ */
519
+ shellOpenExternal(url: string): void;
520
+ /**
521
+ * 播放哔哔声
522
+ */
523
+ shellBeep(): void;
524
+ /*
525
+ * 键入字符串
526
+ */
527
+ hideMainWindowTypeString(str: string): void;
528
+ /*
529
+ * 粘贴文件
530
+ */
531
+ hideMainWindowPasteFile(file: string | string[]): void;
532
+ /*
533
+ * 粘贴图像
534
+ */
535
+ hideMainWindowPasteImage(img: string): void;
536
+ /*
537
+ * 粘贴文本
538
+ */
539
+ hideMainWindowPasteText(text: string): void;
540
+ /**
541
+ * 模拟键盘按键
542
+ */
543
+ simulateKeyboardTap(key: string, ...modifier: ('control' | 'ctrl' | 'shift' | 'option' | 'alt' | 'command' | 'super')[]): void;
544
+ /**
545
+ * 模拟鼠标单击
546
+ */
547
+ simulateMouseClick(x?: number, y?: number): void;
548
+ /**
549
+ * 模拟鼠标右击
550
+ */
551
+ simulateMouseRightClick(x?: number, y?: number): void;
552
+ /**
553
+ * 模拟鼠标双击
554
+ */
555
+ simulateMouseDoubleClick(x?: number, y?: number): void;
556
+ /**
557
+ * 模拟鼠标移动
558
+ */
559
+ simulateMouseMove(x: number, y: number): void;
560
+ /**
561
+ * 获取鼠标绝对位置
562
+ */
563
+ getCursorScreenPoint(): { x: number, y: number };
564
+ /**
565
+ * 获取主显示器
566
+ */
567
+ getPrimaryDisplay(): Display;
568
+ /**
569
+ * 获取所有显示器
570
+ */
571
+ getAllDisplays(): Display[];
572
+ /**
573
+ * 获取位置所在的显示器
574
+ */
575
+ getDisplayNearestPoint(point: { x: number, y: number }): Display;
576
+ /**
577
+ * 获取矩形所在的显示器
578
+ */
579
+ getDisplayMatching(rect: { x: number, y: number, width: number, height: number }): Display;
580
+ /**
581
+ * 录屏源
582
+ */
583
+ desktopCaptureSources(options: { types: string[], thumbnailSize?: { width: number, height: number }, fetchWindowIcons?: boolean }):Promise<{appIcon: {}, display_id: string, id: string, name: string, thumbnail: {} }>;
584
+ /**
585
+ * 是否开发中
586
+ */
587
+ isDev(): boolean;
588
+ /**
589
+ * 是否 MacOs 操作系统
590
+ */
591
+ isMacOS(): boolean;
592
+ /**
593
+ * 是否 Windows 操作系统
594
+ */
595
+ isWindows(): boolean;
596
+ /**
597
+ * 是否 Linux 操作系统
598
+ */
599
+ isLinux(): boolean;
600
+
601
+ db: {
602
+ /**
603
+ * 创建/更新文档
604
+ */
605
+ put(doc: DbDoc): DbReturn;
606
+ /**
607
+ * 获取文档
608
+ */
609
+ get(id: string): DbDoc | null;
610
+ /**
611
+ * 删除文档
612
+ */
613
+ remove(doc: string | DbDoc): DbReturn;
614
+ /**
615
+ * 批量操作文档(新增、修改、删除)
616
+ */
617
+ bulkDocs(docs: DbDoc[]): DbReturn[];
618
+ /**
619
+ * 获取所有文档 可根据文档id前缀查找
620
+ */
621
+ allDocs(key?: string): DbDoc[];
622
+ /**
623
+ * 存储附件到新文档
624
+ * @param docId 文档ID
625
+ * @param attachment 附件 buffer
626
+ * @param type 附件类型,示例:image/png, text/plain
627
+ */
628
+ postAttachment(docId: string, attachment: Uint8Array, type: string): DbReturn;
629
+ /**
630
+ * 获取附件
631
+ * @param docId 文档ID
632
+ */
633
+ getAttachment(docId: string): Uint8Array | null;
634
+ /**
635
+ * 获取附件类型
636
+ * @param docId 文档ID
637
+ */
638
+ getAttachmentType(docId: string): string | null;
639
+ /**
640
+ * 云端复制数据状态 (null: 未开启数据同步、0: 已完成复制、1:复制中)
641
+ */
642
+ replicateStateFromCloud(): null | 0 | 1;
643
+ /**
644
+ * 异步
645
+ */
646
+ promises: {
647
+ /**
648
+ * 创建/更新文档
649
+ */
650
+ put(doc: DbDoc): Promise<DbReturn>;
651
+ /**
652
+ * 获取文档
653
+ */
654
+ get(id: string): Promise<DbDoc | null>;
655
+ /**
656
+ * 删除文档
657
+ */
658
+ remove(doc: string | DbDoc): Promise<DbReturn>;
659
+ /**
660
+ * 批量操作文档(新增、修改、删除)
661
+ */
662
+ bulkDocs(docs: DbDoc[]): Promise<DbReturn[]>;
663
+ /**
664
+ * 获取所有文档 可根据文档id前缀查找
665
+ */
666
+ allDocs(key?: string): Promise<DbDoc[]>;
667
+ /**
668
+ * 存储附件到新文档
669
+ * @param docId 文档ID
670
+ * @param attachment 附件 buffer
671
+ * @param type 附件类型,示例:image/png, text/plain
672
+ */
673
+ postAttachment(docId: string, attachment: Uint8Array, type: string): Promise<DbReturn>;
674
+ /**
675
+ * 获取附件
676
+ * @param docId 文档ID
677
+ */
678
+ getAttachment(docId: string): Promise<Uint8Array | null>;
679
+ /**
680
+ * 获取附件类型
681
+ * @param docId 文档ID
682
+ */
683
+ getAttachmentType(docId: string): Promise<string | null>;
684
+ /**
685
+ * 云端复制数据状态 (null: 未开启数据同步、0: 已完成复制、1:复制中)
686
+ */
687
+ replicateStateFromCloud(): Promise<null | 0 | 1>;
688
+ }
689
+ };
690
+
691
+ dbStorage: {
692
+ /**
693
+ * 键值对存储,如果键名存在,则更新其对应的值
694
+ * @param key 键名(同时为文档ID)
695
+ * @param value 键值
696
+ */
697
+ setItem (key: string, value: any): void;
698
+ /**
699
+ * 获取键名对应的值
700
+ */
701
+ getItem (key: string): any;
702
+ /**
703
+ * 删除键值对(删除文档)
704
+ */
705
+ removeItem (key: string): void;
706
+ };
707
+
708
+ ubrowser: UBrowser;
709
+ }
710
+
711
+ declare var utools: UToolsApi;