utools-api-types 2.6.4 → 3.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/package.json +1 -1
- package/utools.api.d.ts +21 -17
package/package.json
CHANGED
package/utools.api.d.ts
CHANGED
|
@@ -225,19 +225,19 @@ interface DbReturn {
|
|
|
225
225
|
|
|
226
226
|
interface UToolsApi {
|
|
227
227
|
/**
|
|
228
|
-
*
|
|
228
|
+
* 插件应用进入时触发
|
|
229
229
|
*/
|
|
230
230
|
onPluginEnter(callback: (action: {code: string, type: string, payload: any }) => void): void;
|
|
231
231
|
/**
|
|
232
|
-
*
|
|
232
|
+
* 插件应用隐藏后台或完全退出时触发
|
|
233
233
|
*/
|
|
234
|
-
onPluginOut(callback: () => void): void;
|
|
234
|
+
onPluginOut(callback: (processExit: boolean) => void): void;
|
|
235
235
|
/**
|
|
236
|
-
*
|
|
236
|
+
* 插件应用分离时触发
|
|
237
237
|
*/
|
|
238
238
|
onPluginDetach(callback: () => void): void;
|
|
239
239
|
/**
|
|
240
|
-
*
|
|
240
|
+
* 插件应用从云端拉取到数据时触发
|
|
241
241
|
*/
|
|
242
242
|
onDbPull(callback: (docs: { _id: string, _rev: string }[]) => void): void;
|
|
243
243
|
/**
|
|
@@ -250,7 +250,7 @@ interface UToolsApi {
|
|
|
250
250
|
*/
|
|
251
251
|
showMainWindow(): boolean;
|
|
252
252
|
/**
|
|
253
|
-
*
|
|
253
|
+
* 设置插件应用自身高度
|
|
254
254
|
*/
|
|
255
255
|
setExpendHeight(height: number): boolean;
|
|
256
256
|
/**
|
|
@@ -277,7 +277,7 @@ interface UToolsApi {
|
|
|
277
277
|
*/
|
|
278
278
|
subInputSelect(): boolean;
|
|
279
279
|
/**
|
|
280
|
-
*
|
|
280
|
+
* 子输入框失去焦点,插件应用获得焦点
|
|
281
281
|
*/
|
|
282
282
|
subInputBlur(): boolean;
|
|
283
283
|
/**
|
|
@@ -288,7 +288,7 @@ interface UToolsApi {
|
|
|
288
288
|
*/
|
|
289
289
|
createBrowserWindow(url: string, options: { width?: number, height?: number }, callback?: () => void): { id: number, [key: string]: any, webContents: { id: number, [key: string]: any } };
|
|
290
290
|
/**
|
|
291
|
-
*
|
|
291
|
+
* 隐藏插件应用到后台
|
|
292
292
|
*/
|
|
293
293
|
outPlugin(): boolean;
|
|
294
294
|
/**
|
|
@@ -309,7 +309,7 @@ interface UToolsApi {
|
|
|
309
309
|
*/
|
|
310
310
|
openPayment(options: {
|
|
311
311
|
/**
|
|
312
|
-
* 商品ID,在 “uTools 开发者工具”
|
|
312
|
+
* 商品ID,在 “uTools 开发者工具” 插件应用中创建
|
|
313
313
|
*/
|
|
314
314
|
goodsId: string,
|
|
315
315
|
/**
|
|
@@ -326,7 +326,7 @@ interface UToolsApi {
|
|
|
326
326
|
*/
|
|
327
327
|
fetchUserPayments(): Promise<{ order_id: string, total_fee: number, body: string, attach: string, goods_id: string, out_order_id: string, paid_at: string }[]>;
|
|
328
328
|
/**
|
|
329
|
-
*
|
|
329
|
+
* 设置插件应用动态功能
|
|
330
330
|
*/
|
|
331
331
|
setFeature(feature: {
|
|
332
332
|
code: string,
|
|
@@ -339,13 +339,13 @@ interface UToolsApi {
|
|
|
339
339
|
})[]
|
|
340
340
|
}): boolean;
|
|
341
341
|
/**
|
|
342
|
-
*
|
|
342
|
+
* 移除插件应用动态功能
|
|
343
343
|
*/
|
|
344
344
|
removeFeature(code: string): boolean;
|
|
345
345
|
/**
|
|
346
|
-
*
|
|
346
|
+
* 获取插件应用动态功能,参数为空获取所有动态功能
|
|
347
347
|
*/
|
|
348
|
-
getFeatures(): {
|
|
348
|
+
getFeatures(codes?: string[]): {
|
|
349
349
|
code: string,
|
|
350
350
|
explain: string,
|
|
351
351
|
platform: ('darwin' | 'win32' | 'linux') | (Array<'darwin' | 'win32' | 'linux'>),
|
|
@@ -356,7 +356,7 @@ interface UToolsApi {
|
|
|
356
356
|
}[]
|
|
357
357
|
}[];
|
|
358
358
|
/**
|
|
359
|
-
*
|
|
359
|
+
* 插件应用间跳转
|
|
360
360
|
*/
|
|
361
361
|
redirect(label: string, payload: string | { type: 'text' | 'img' | 'files', data: any }): void;
|
|
362
362
|
/**
|
|
@@ -402,7 +402,7 @@ interface UToolsApi {
|
|
|
402
402
|
securityScopedBookmarks?: boolean
|
|
403
403
|
}): (string) | (undefined);
|
|
404
404
|
/**
|
|
405
|
-
*
|
|
405
|
+
* 插件应用页面中查找
|
|
406
406
|
*/
|
|
407
407
|
findInPage(text: string, options?: {
|
|
408
408
|
forward?: boolean,
|
|
@@ -412,7 +412,7 @@ interface UToolsApi {
|
|
|
412
412
|
medialCapitalAsWordStart?: boolean
|
|
413
413
|
}): void;
|
|
414
414
|
/**
|
|
415
|
-
*
|
|
415
|
+
* 停止插件应用页面中查找
|
|
416
416
|
*/
|
|
417
417
|
stopFindInPage (action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
|
|
418
418
|
/**
|
|
@@ -487,6 +487,10 @@ interface UToolsApi {
|
|
|
487
487
|
* 播放哔哔声
|
|
488
488
|
*/
|
|
489
489
|
shellBeep(): void;
|
|
490
|
+
/*
|
|
491
|
+
* 隐藏主窗口并键入字符串
|
|
492
|
+
*/
|
|
493
|
+
hideMainWindowTypeString(str: string): void;
|
|
490
494
|
/**
|
|
491
495
|
* 模拟键盘按键
|
|
492
496
|
*/
|
|
@@ -538,7 +542,7 @@ interface UToolsApi {
|
|
|
538
542
|
/**
|
|
539
543
|
* 是否 MacOs 操作系统
|
|
540
544
|
*/
|
|
541
|
-
|
|
545
|
+
isMacOS(): boolean;
|
|
542
546
|
/**
|
|
543
547
|
* 是否 Windows 操作系统
|
|
544
548
|
*/
|