utools-api-types 7.5.1 → 8.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/README.md +75 -65
- package/package.json +2 -2
- package/utools.api.d.ts +4265 -1101
- package/electron.d.ts +0 -66
- package/resource/utools.schema.json +0 -142
- package/ubw.d.ts +0 -211
package/electron.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
declare module "electron" {
|
|
2
|
-
type ClipboardType = 'selection' | 'clipboard'
|
|
3
|
-
module clipboard {
|
|
4
|
-
function availableFormats(type?: ClipboardType): void
|
|
5
|
-
function clear(type?: ClipboardType): void
|
|
6
|
-
function has(fmt: string, type?: ClipboardType): boolean
|
|
7
|
-
function read(fmt: string): string
|
|
8
|
-
function readBookmark(): {
|
|
9
|
-
title: string
|
|
10
|
-
url: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function readBuffer(fmt: string): Uint8Array
|
|
14
|
-
function readHTML(type?: ClipboardType): string
|
|
15
|
-
function readImage(type?: ClipboardType): BrowserWindow.NativeImage
|
|
16
|
-
function readRTF(type?: ClipboardType): string
|
|
17
|
-
function readText(type?: ClipboardType): string
|
|
18
|
-
function write(data: {
|
|
19
|
-
text?: string
|
|
20
|
-
html?: string
|
|
21
|
-
image?: BrowserWindow.NativeImage
|
|
22
|
-
rtf?: string
|
|
23
|
-
bookmark?: string
|
|
24
|
-
}, type?: ClipboardType): void
|
|
25
|
-
function writeBookmark(title: string, url: string, type?: ClipboardType): void
|
|
26
|
-
function writeBuffer(fmt: string, buffer: Uint8Array, type?: ClipboardType): void
|
|
27
|
-
function writeHTML(markup: string, type?: ClipboardType): void
|
|
28
|
-
function writeImage(img: BrowserWindow.NativeImage, type?: ClipboardType): void
|
|
29
|
-
function writeRTF(text: string, type?: ClipboardType): void
|
|
30
|
-
function writeText(text: string, type?: ClipboardType): void
|
|
31
|
-
}
|
|
32
|
-
interface UIpcSendEventInit {
|
|
33
|
-
senderId: number
|
|
34
|
-
}
|
|
35
|
-
type UIpcSendEventListener<T extends any[]> = (event: UIpcSendEventInit, ...args: T) => void
|
|
36
|
-
module ipcRenderer {
|
|
37
|
-
function on<T extends any[] = any[]>(channel: string, listener: UIpcSendEventListener<T>): void
|
|
38
|
-
function once<T extends any[] = any[]>(channel: string, listener: UIpcSendEventListener<T>): void
|
|
39
|
-
function off<T extends any[] = any[]>(channel: string, listener: UIpcSendEventListener<T>): void
|
|
40
|
-
function sendTo<T extends any[] = any[]>(id: number, channel: string, ...args: T): void
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
module contextBridge { }
|
|
44
|
-
|
|
45
|
-
module webFrame { }
|
|
46
|
-
|
|
47
|
-
module shell { }
|
|
48
|
-
|
|
49
|
-
module nativeImage {
|
|
50
|
-
type NativeImage = BrowserWindow.NativeImage
|
|
51
|
-
function createEmpty(): NativeImage
|
|
52
|
-
function createFromPath(path: string): NativeImage
|
|
53
|
-
function createFromBitmap(buffer: Uint8Array, options: {
|
|
54
|
-
width: number
|
|
55
|
-
height: number
|
|
56
|
-
scaleFator?: number
|
|
57
|
-
}): NativeImage
|
|
58
|
-
function createFromBuffer(buffer: Uint8Array, options?: {
|
|
59
|
-
width?: number
|
|
60
|
-
height?: number
|
|
61
|
-
scaleFator?: number
|
|
62
|
-
}): NativeImage
|
|
63
|
-
function createFromDataURL(dataURL: string): NativeImage
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://u.tools/docs/plugin.json",
|
|
4
|
-
"title": "uTools 插件配置文件",
|
|
5
|
-
"description": "uTools 插件配置文件,用于描述插件的基本信息,以及插件的入口文件。",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"main": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "入口文件,当该配置为空时,表示插件应用为模板插件应用。 main 与 preload 至少存在其一。"
|
|
11
|
-
},
|
|
12
|
-
"preload": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"description": "这是一个关键文件,你可以在此文件内调用 uTools、 nodejs、 electron 提供的 api。 main 与 preload 至少存在其一。"
|
|
15
|
-
},
|
|
16
|
-
"logo": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "插件图标,支持png,jpg格式"
|
|
19
|
-
},
|
|
20
|
-
"development": {
|
|
21
|
-
"type": "object",
|
|
22
|
-
"properties": {
|
|
23
|
-
"main": {
|
|
24
|
-
"type": "string",
|
|
25
|
-
"description": "入口文件,当该配置为空时,表示插件应用为模板插件应用。 main 与 preload 至少存在其一。"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"pluginSetting": {
|
|
30
|
-
"type": "object",
|
|
31
|
-
"properties": {
|
|
32
|
-
"single": {
|
|
33
|
-
"type": "boolean",
|
|
34
|
-
"description": "插件应用是否允许多开(默认不允许)。多开方式:分离插件应用后,再次创建。"
|
|
35
|
-
},
|
|
36
|
-
"height": {
|
|
37
|
-
"type": "number",
|
|
38
|
-
"description": "插件应用高度。可动态修改(参考),该项被设置后,用户则不能再调整高度。最小值为 1 。"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"features": {
|
|
43
|
-
"type": "array",
|
|
44
|
-
"description": "features 描述了当 uTools 主输入框内容产生变化时,此插件应用是否显示在搜索结果列表中,一个插件应用可以有多个功能,一个功能可以提供多个命令供用户搜索。",
|
|
45
|
-
"items": {
|
|
46
|
-
"type": "object",
|
|
47
|
-
"properties": {
|
|
48
|
-
"code": {
|
|
49
|
-
"type": "string",
|
|
50
|
-
"description": "插件应用提供的某个功能的唯一标示,此为必选项,且插件应用内不可重复。"
|
|
51
|
-
},
|
|
52
|
-
"explain": {
|
|
53
|
-
"type": "string",
|
|
54
|
-
"description": "对此功能的说明,将在搜索列表对应位置中显示。"
|
|
55
|
-
},
|
|
56
|
-
"icon": {
|
|
57
|
-
"type": "string",
|
|
58
|
-
"description": "此功能的图标,支持png,jpg,svg格式。"
|
|
59
|
-
},
|
|
60
|
-
"mainPush": {
|
|
61
|
-
"type": "boolean"
|
|
62
|
-
},
|
|
63
|
-
"mainHide": {
|
|
64
|
-
"type": "boolean",
|
|
65
|
-
"description": "设置为 `true` 时,打开对应的 `feature` 不主动弹出搜索框窗口"
|
|
66
|
-
},
|
|
67
|
-
"cmds": {
|
|
68
|
-
"type": "array",
|
|
69
|
-
"description": "该功能下可响应的命令集,支持 6 种类型,由 cmds 的类型或 cmds.type 决定。",
|
|
70
|
-
"items": {
|
|
71
|
-
"type": [
|
|
72
|
-
"string",
|
|
73
|
-
"object"
|
|
74
|
-
],
|
|
75
|
-
"properties": {
|
|
76
|
-
"type": {
|
|
77
|
-
"type": "string",
|
|
78
|
-
"description": "类型",
|
|
79
|
-
"enum": [
|
|
80
|
-
"regex",
|
|
81
|
-
"over",
|
|
82
|
-
"img",
|
|
83
|
-
"files",
|
|
84
|
-
"window"
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
|
-
"label": {
|
|
88
|
-
"type": "string",
|
|
89
|
-
"description": "关键字"
|
|
90
|
-
},
|
|
91
|
-
"match": {
|
|
92
|
-
"type": [
|
|
93
|
-
"string",
|
|
94
|
-
"object"
|
|
95
|
-
],
|
|
96
|
-
"description": "匹配模式",
|
|
97
|
-
"properties": {
|
|
98
|
-
"app": {
|
|
99
|
-
"type": "array"
|
|
100
|
-
},
|
|
101
|
-
"title": {
|
|
102
|
-
"type": "string"
|
|
103
|
-
},
|
|
104
|
-
"class": {
|
|
105
|
-
"type": "array"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"minLength": {
|
|
110
|
-
"type": "number",
|
|
111
|
-
"description": "最小匹配长度",
|
|
112
|
-
"minimum": 1
|
|
113
|
-
},
|
|
114
|
-
"maxLength": {
|
|
115
|
-
"type": "number",
|
|
116
|
-
"description": "最大匹配长度",
|
|
117
|
-
"minimum": 1,
|
|
118
|
-
"maximum": 10000
|
|
119
|
-
},
|
|
120
|
-
"fileType": {
|
|
121
|
-
"type": "string",
|
|
122
|
-
"description": "文件类型",
|
|
123
|
-
"enum": [
|
|
124
|
-
"file",
|
|
125
|
-
"directory"
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
"extensions": {
|
|
129
|
-
"type": "array",
|
|
130
|
-
"description": "文件扩展名",
|
|
131
|
-
"items": {
|
|
132
|
-
"type": "string"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
package/ubw.d.ts
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
declare module BrowserWindow {
|
|
2
|
-
interface WebPreferences {
|
|
3
|
-
devTools?: boolean
|
|
4
|
-
preload?: string
|
|
5
|
-
zoomFactor: number
|
|
6
|
-
[key: string]: any
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface InitOptions {
|
|
10
|
-
width?: number,
|
|
11
|
-
height?: number,
|
|
12
|
-
webPreferences: WebPreferences
|
|
13
|
-
show?: boolean
|
|
14
|
-
title?: string
|
|
15
|
-
x?: number
|
|
16
|
-
y?: number
|
|
17
|
-
center?: boolean
|
|
18
|
-
resizable?: boolean
|
|
19
|
-
fullscreen?: boolean
|
|
20
|
-
fullscreenable?: boolean
|
|
21
|
-
skipTaskbar?: true
|
|
22
|
-
closable?: boolean
|
|
23
|
-
frame?: boolean
|
|
24
|
-
alwayOnTop?: boolean
|
|
25
|
-
[key: string]: any
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface NativeImage {
|
|
29
|
-
toPng: (options?: { scaleFator?: number }) => Uint8Array
|
|
30
|
-
toJPEG: (options?: { quality?: number }) => Uint8Array
|
|
31
|
-
isEmpty: () => boolean
|
|
32
|
-
[key: string]: any
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface PrinterSync {
|
|
36
|
-
description: string
|
|
37
|
-
displayName: string
|
|
38
|
-
isDefault: boolean
|
|
39
|
-
status: number
|
|
40
|
-
options?: {
|
|
41
|
-
'printer-location'?: string
|
|
42
|
-
'printer-make-and-model'?: string
|
|
43
|
-
'system_driverinfo'?: string
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
type WebRTCIPHandlingPolicy =
|
|
48
|
-
| 'default'
|
|
49
|
-
| 'default_public_interface_only'
|
|
50
|
-
| 'default_public_and_private_interfaces'
|
|
51
|
-
| 'disable_non_proxied_udp'
|
|
52
|
-
|
|
53
|
-
interface WebContents {
|
|
54
|
-
id: number
|
|
55
|
-
capturePage: () => Promise<NativeImage>
|
|
56
|
-
closeDevTools: () => void
|
|
57
|
-
copy: () => void
|
|
58
|
-
copyImageAt: (x: number, y: number) => void
|
|
59
|
-
cut: () => void
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated
|
|
62
|
-
*/
|
|
63
|
-
decrementCapturerCount: () => any
|
|
64
|
-
delete: () => void
|
|
65
|
-
disableDeviceEmulation: () => void
|
|
66
|
-
enableDeviceEmulation: () => void
|
|
67
|
-
executeJavaScript: <T>(code: string, userGesture?: boolean) => Promise<T>
|
|
68
|
-
findInPage: (text: string, options?: {
|
|
69
|
-
forward?: boolean
|
|
70
|
-
findNext?: boolean
|
|
71
|
-
matchCase?: boolean
|
|
72
|
-
}) => number
|
|
73
|
-
focus: () => void
|
|
74
|
-
getBackgroundThrottling: () => boolean
|
|
75
|
-
getFrameRate: () => number
|
|
76
|
-
getOSProcessId: () => number
|
|
77
|
-
getPrinters: () => PrinterSync[]
|
|
78
|
-
getProcessId: () => number
|
|
79
|
-
getUserAgent: () => string
|
|
80
|
-
getWebRTCIPHandlingPolicy: () => WebRTCIPHandlingPolicy
|
|
81
|
-
getZoomFactor: () => number
|
|
82
|
-
/**
|
|
83
|
-
* @deprecated
|
|
84
|
-
*/
|
|
85
|
-
incrementCapturerCount: () => any
|
|
86
|
-
insertCSS: (css: string, options?: {
|
|
87
|
-
/**
|
|
88
|
-
* @default 'author'
|
|
89
|
-
*/
|
|
90
|
-
cssOrigin?: 'user' | 'author'
|
|
91
|
-
}) => Promise<string>
|
|
92
|
-
insertText: (text: string) => Promise<void>
|
|
93
|
-
invalidate: () => void
|
|
94
|
-
isAudioMuted: () => boolean
|
|
95
|
-
isBeingCaptured: () => boolean
|
|
96
|
-
isCrashed: () => boolean
|
|
97
|
-
isCurrentlyAudible: () => boolean
|
|
98
|
-
isDestroyed: () => boolean
|
|
99
|
-
isDevToolsFocused: () => boolean
|
|
100
|
-
isDevToolsOpened: () => boolean
|
|
101
|
-
isFocused: () => boolean
|
|
102
|
-
isLoading: () => boolean
|
|
103
|
-
isLoadingMainFrame: () => boolean
|
|
104
|
-
isOffscreen: () => boolean
|
|
105
|
-
isPainting: () => void
|
|
106
|
-
isWaitingForResponse: () => boolean
|
|
107
|
-
openDevTools: (options?: {
|
|
108
|
-
mode: 'left' | 'right' | 'bottom' | 'undocked' | 'detach'
|
|
109
|
-
activate?: boolean
|
|
110
|
-
title?: string
|
|
111
|
-
}) => void
|
|
112
|
-
paste: () => void
|
|
113
|
-
pasteAndMatchStyle: () => void
|
|
114
|
-
print: (options?: Record<string, any>, callback?: (success: boolean, errorType?: string) => void) => void
|
|
115
|
-
printToPDF: (options: Record<string, any>) => Promise<Uint8Array>
|
|
116
|
-
redo: () => void
|
|
117
|
-
removeInsertedCSS: (key: string) => Promise<void>
|
|
118
|
-
replace: (text: string) => void
|
|
119
|
-
replaceMisspelling: (text: string) => void
|
|
120
|
-
savePage: (fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML') => Promise<void>
|
|
121
|
-
selectAll: () => void
|
|
122
|
-
sendInputEvent: (e: any) => void
|
|
123
|
-
setAudioMuted: (muted: boolean) => void
|
|
124
|
-
setBackgroundThrottling: (allowed: boolean) => void
|
|
125
|
-
setFrameRate: (fps: number) => void
|
|
126
|
-
setIgnoreMenuShortcuts: (ignore: boolean) => void
|
|
127
|
-
setUserAgent: (userAgent: string) => void
|
|
128
|
-
setWebRTCIPHandlingPolicy: (policy: WebRTCIPHandlingPolicy) => void
|
|
129
|
-
setZoomFactor: (factor: number) => void
|
|
130
|
-
startPainting: () => void
|
|
131
|
-
stopFindInPage: (action: 'clearSelection' | 'keepSelection' | 'activateSelection') => void
|
|
132
|
-
stopPainting: () => void
|
|
133
|
-
takeHeapSnapshot: (filePath: string) => Promise<void>
|
|
134
|
-
toggleDevTools: () => void
|
|
135
|
-
undo: () => void
|
|
136
|
-
unselect: () => void
|
|
137
|
-
|
|
138
|
-
[key: string]: any
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
interface Rectangle {
|
|
142
|
-
x: number
|
|
143
|
-
y: number
|
|
144
|
-
width: number
|
|
145
|
-
height: number
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
interface WindowInstance {
|
|
149
|
-
id: number
|
|
150
|
-
webContents: WebContents
|
|
151
|
-
show: () => void
|
|
152
|
-
hide: () => void
|
|
153
|
-
destory: () => void
|
|
154
|
-
close: () => void
|
|
155
|
-
isFocused: () => boolean
|
|
156
|
-
isDestroyed: () => boolean
|
|
157
|
-
setResizable: (resizable: boolean) => void
|
|
158
|
-
setSize: (width: number, height: number) => void
|
|
159
|
-
getSize: () => [width: number, height: number]
|
|
160
|
-
isVisible: () => boolean
|
|
161
|
-
maximize: () => void
|
|
162
|
-
unmaximize: () => void
|
|
163
|
-
isMaximized: () => void
|
|
164
|
-
minimize: () => void
|
|
165
|
-
restore: () => void
|
|
166
|
-
isMinimized: () => boolean
|
|
167
|
-
setFullScreen: (flag: boolean) => void
|
|
168
|
-
isFullScreen: () => boolean
|
|
169
|
-
isNormal: () => boolean
|
|
170
|
-
setAspectRatio: (aspectiRotio: number) => void
|
|
171
|
-
setBackgroundColor: (backgroundColor: string) => void
|
|
172
|
-
getBounds: () => Rectangle
|
|
173
|
-
getBackgroundColor: () => string
|
|
174
|
-
setContentBounds: (bounds: Rectangle) => void
|
|
175
|
-
getContentBounds: () => Rectangle
|
|
176
|
-
getNormalBounds: () => Rectangle
|
|
177
|
-
setEnabled: (enable: boolean) => void
|
|
178
|
-
isEnabled: () => boolean
|
|
179
|
-
setContentSize: (width: number, height: number) => void
|
|
180
|
-
getContentSize: () => [width: number, height: number]
|
|
181
|
-
setMinimumSize: (width: number, height: number) => void
|
|
182
|
-
getMinimumSize: () => [width: number, height: number]
|
|
183
|
-
setMaximumSize: (width: number, height: number) => void
|
|
184
|
-
getMaximumSize: () => [width: number, height: number]
|
|
185
|
-
isResizable: () => boolean
|
|
186
|
-
setFullScreenable: (fullscreenable: boolean) => void
|
|
187
|
-
isFullScreenable: () => boolean
|
|
188
|
-
setClosable: (closable: boolean) => void
|
|
189
|
-
isClosable: () => boolean
|
|
190
|
-
setAlwaysOnTop: (flag: boolean) => void
|
|
191
|
-
isAlwaysOnTop: () => boolean
|
|
192
|
-
moveTop: () => void
|
|
193
|
-
setPosition: (x: number, y: number) => void
|
|
194
|
-
getPosition: () => [x: number, y: number]
|
|
195
|
-
setTitle: (title: string) => void
|
|
196
|
-
getTitle: () => string
|
|
197
|
-
flashFrame: (flag: boolean) => void
|
|
198
|
-
setKiosk: (flag: boolean) => void
|
|
199
|
-
isKiosk: () => boolean
|
|
200
|
-
focusOnWebView: () => void
|
|
201
|
-
blurWebView: () => void
|
|
202
|
-
capturePage: (rect?: Rectangle, options?: {
|
|
203
|
-
stayHidden?: boolean
|
|
204
|
-
stayAwake?: boolean
|
|
205
|
-
}) => Promise<NativeImage>
|
|
206
|
-
reload: () => void
|
|
207
|
-
|
|
208
|
-
[key: string]: any
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|