utools-api-types 2.3.0 → 2.6.4
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/package.json +1 -1
- package/utools.api.d.ts +63 -13
package/package.json
CHANGED
package/utools.api.d.ts
CHANGED
|
@@ -5,12 +5,11 @@ interface UBrowser {
|
|
|
5
5
|
useragent(userAgent: string): this;
|
|
6
6
|
/**
|
|
7
7
|
* 前往
|
|
8
|
+
* @param url 链接地址,支持 http 或 file 协议
|
|
9
|
+
* @param headers 请求头参数
|
|
10
|
+
* @param timeout 加载超时,默认 60000 ms(60秒)
|
|
8
11
|
*/
|
|
9
|
-
goto(url: string, headers?: { Referer: string, userAgent: string }): this;
|
|
10
|
-
/**
|
|
11
|
-
* 显示Markdown
|
|
12
|
-
*/
|
|
13
|
-
goto(mdText: string, title?: string): this;
|
|
12
|
+
goto(url: string, headers?: { Referer: string, userAgent: string }, timeout?: number): this;
|
|
14
13
|
/**
|
|
15
14
|
* 页面大小
|
|
16
15
|
*/
|
|
@@ -92,13 +91,13 @@ interface UBrowser {
|
|
|
92
91
|
/**
|
|
93
92
|
* 等待元素出现
|
|
94
93
|
* @param selector DOM元素
|
|
95
|
-
* @param timeout 超时 默认
|
|
94
|
+
* @param timeout 超时 默认60000 ms(60秒)
|
|
96
95
|
*/
|
|
97
96
|
wait(selector: string, timeout?: number): this;
|
|
98
97
|
/**
|
|
99
98
|
* 等待 JS函数 执行返回 true
|
|
100
99
|
* @param func 执行的JS函数
|
|
101
|
-
* @param timeout 超时 默认
|
|
100
|
+
* @param timeout 超时 默认60000 ms(60秒)
|
|
102
101
|
* @param params 传到 func 中的参数
|
|
103
102
|
*/
|
|
104
103
|
wait(func: (...params: any[]) => boolean, timeout?: number, ...params: any[]): this;
|
|
@@ -166,6 +165,7 @@ interface UBrowser {
|
|
|
166
165
|
run(ubrowserId: number): Promise<any[]>;
|
|
167
166
|
/**
|
|
168
167
|
* 启动一个 ubrowser 运行
|
|
168
|
+
* 当运行结束后,窗口如果为隐藏状态将自动销毁窗口
|
|
169
169
|
* @param options
|
|
170
170
|
*/
|
|
171
171
|
run(options: {
|
|
@@ -224,10 +224,6 @@ interface DbReturn {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
interface UToolsApi {
|
|
227
|
-
/**
|
|
228
|
-
* 插件装配初始化完成触发
|
|
229
|
-
*/
|
|
230
|
-
onPluginReady(callback: () => void): void;
|
|
231
227
|
/**
|
|
232
228
|
* 插件进入时触发
|
|
233
229
|
*/
|
|
@@ -337,10 +333,10 @@ interface UToolsApi {
|
|
|
337
333
|
explain: string,
|
|
338
334
|
platform: ('darwin' | 'win32' | 'linux') | (Array<'darwin' | 'win32' | 'linux'>),
|
|
339
335
|
icon?: string,
|
|
340
|
-
cmds: string | {
|
|
336
|
+
cmds: (string | {
|
|
341
337
|
type: 'img' | 'files' | 'regex' | 'over' | 'window',
|
|
342
338
|
label: string
|
|
343
|
-
}[]
|
|
339
|
+
})[]
|
|
344
340
|
}): boolean;
|
|
345
341
|
/**
|
|
346
342
|
* 移除插件动态功能
|
|
@@ -531,6 +527,10 @@ interface UToolsApi {
|
|
|
531
527
|
* 获取矩形所在的显示器
|
|
532
528
|
*/
|
|
533
529
|
getDisplayMatching(rect: { x: number, y: number, width: number, height: number }): Display;
|
|
530
|
+
/**
|
|
531
|
+
* 录屏源
|
|
532
|
+
*/
|
|
533
|
+
desktopCaptureSources(options: { types: string[], thumbnailSize?: { width: number, height: number }, fetchWindowIcons?: boolean }):Promise<{appIcon: {}, display_id: string, id: string, name: string, thumbnail: {} }>;
|
|
534
534
|
/**
|
|
535
535
|
* 是否开发中
|
|
536
536
|
*/
|
|
@@ -586,6 +586,56 @@ interface UToolsApi {
|
|
|
586
586
|
* @param docId 文档ID
|
|
587
587
|
*/
|
|
588
588
|
getAttachmentType(docId: string): string | null;
|
|
589
|
+
/**
|
|
590
|
+
* 云端复制数据状态 (null: 未开启数据同步、0: 已完成复制、1:复制中)
|
|
591
|
+
*/
|
|
592
|
+
replicateStateFromCloud(): null | 0 | 1;
|
|
593
|
+
/**
|
|
594
|
+
* 异步
|
|
595
|
+
*/
|
|
596
|
+
promises: {
|
|
597
|
+
/**
|
|
598
|
+
* 创建/更新文档
|
|
599
|
+
*/
|
|
600
|
+
put(doc: DbDoc): Promise<DbReturn>;
|
|
601
|
+
/**
|
|
602
|
+
* 获取文档
|
|
603
|
+
*/
|
|
604
|
+
get(id: string): Promise<DbDoc | null>;
|
|
605
|
+
/**
|
|
606
|
+
* 删除文档
|
|
607
|
+
*/
|
|
608
|
+
remove(doc: string | DbDoc): Promise<DbReturn>;
|
|
609
|
+
/**
|
|
610
|
+
* 批量操作文档(新增、修改、删除)
|
|
611
|
+
*/
|
|
612
|
+
bulkDocs(docs: DbDoc[]): Promise<DbReturn[]>;
|
|
613
|
+
/**
|
|
614
|
+
* 获取所有文档 可根据文档id前缀查找
|
|
615
|
+
*/
|
|
616
|
+
allDocs(key?: string): Promise<DbDoc[]>;
|
|
617
|
+
/**
|
|
618
|
+
* 存储附件到新文档
|
|
619
|
+
* @param docId 文档ID
|
|
620
|
+
* @param attachment 附件 buffer
|
|
621
|
+
* @param type 附件类型,示例:image/png, text/plain
|
|
622
|
+
*/
|
|
623
|
+
postAttachment(docId: string, attachment: Uint8Array, type: string): Promise<DbReturn>;
|
|
624
|
+
/**
|
|
625
|
+
* 获取附件
|
|
626
|
+
* @param docId 文档ID
|
|
627
|
+
*/
|
|
628
|
+
getAttachment(docId: string): Promise<Uint8Array | null>;
|
|
629
|
+
/**
|
|
630
|
+
* 获取附件类型
|
|
631
|
+
* @param docId 文档ID
|
|
632
|
+
*/
|
|
633
|
+
getAttachmentType(docId: string): Promise<string | null>;
|
|
634
|
+
/**
|
|
635
|
+
* 云端复制数据状态 (null: 未开启数据同步、0: 已完成复制、1:复制中)
|
|
636
|
+
*/
|
|
637
|
+
replicateStateFromCloud(): Promise<null | 0 | 1>;
|
|
638
|
+
}
|
|
589
639
|
};
|
|
590
640
|
|
|
591
641
|
dbStorage: {
|