ms-types 0.5.2 → 0.5.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 +22 -22
- package/types/action.d.ts +285 -285
- package/types/appleocr.d.ts +102 -102
- package/types/config.d.ts +40 -40
- package/types/cryptoUtils.d.ts +59 -59
- package/types/device.d.ts +117 -117
- package/types/draw.d.ts +98 -98
- package/types/global.d.ts +243 -239
- package/types/hid.d.ts +344 -351
- package/types/hotUpdate.d.ts +104 -104
- package/types/http.d.ts +300 -300
- package/types/ime.d.ts +99 -99
- package/types/index.d.ts +28 -28
- package/types/media.d.ts +101 -101
- package/types/mysql.d.ts +178 -178
- package/types/netCard.d.ts +77 -77
- package/types/node.d.ts +292 -292
- package/types/paddleocr.d.ts +73 -73
- package/types/pip.d.ts +51 -51
- package/types/system.d.ts +196 -196
- package/types/thread.d.ts +42 -42
- package/types/tomatoocr.d.ts +209 -209
- package/types/tts.d.ts +91 -91
- package/types/ui.d.ts +191 -191
- package/types/utils.d.ts +77 -77
- package/types/yolo.d.ts +114 -114
- package/types/zh/HID/346/250/241/345/235/227.d.ts +348 -355
- package/types/zh/HTTP/346/250/241/345/235/227.d.ts +301 -301
- package/types/zh/MySql/346/250/241/345/235/227.d.ts +179 -179
- package/types/zh/PaddleOCR/346/250/241/345/235/227.d.ts +74 -74
- package/types/zh/YOLO/346/250/241/345/235/227.d.ts +118 -118
- package/types/zh/index.d.ts +25 -25
- package/types/zh//345/205/250/345/261/200/346/250/241/345/235/227.d.ts +233 -229
- package/types/zh//345/212/250/344/275/234/346/250/241/345/235/227.d.ts +287 -287
- package/types/zh//345/215/241/345/257/206/346/250/241/345/235/227.d.ts +90 -90
- package/types/zh//345/252/222/344/275/223/346/250/241/345/235/227.d.ts +102 -102
- package/types/zh//345/267/245/345/205/267/346/250/241/345/235/227.d.ts +77 -77
- package/types/zh//346/202/254/346/265/256/347/252/227/346/250/241/345/235/227.d.ts +55 -55
- package/types/zh//346/226/207/345/255/227/350/275/254/350/257/255/351/237/263/346/250/241/345/235/227.d.ts +92 -92
- package/types/zh//347/203/255/346/233/264/346/226/260/346/250/241/345/235/227.d.ts +105 -105
- package/types/zh//347/263/273/347/273/237/346/250/241/345/235/227.d.ts +197 -197
- package/types/zh//347/272/277/347/250/213/346/250/241/345/235/227.d.ts +43 -43
- package/types/zh//347/273/230/345/233/276/346/250/241/345/235/227.d.ts +100 -100
- package/types/zh//350/212/202/347/202/271/346/250/241/345/235/227.d.ts +290 -290
- package/types/zh//350/213/271/346/236/234OCR.d.ts +104 -104
- package/types/zh//350/247/206/345/233/276/346/250/241/345/235/227.d.ts +90 -90
- package/types/zh//350/256/276/345/244/207/346/250/241/345/235/227.d.ts +118 -118
- package/types/zh//350/276/223/345/205/245/346/263/225/346/250/241/345/235/227.d.ts +100 -100
- package/types/zh//351/205/215/347/275/256/346/250/241/345/235/227.d.ts +42 -42
package/types/draw.d.ts
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 绘图模块 包含绘制操作等功能
|
|
3
|
-
*/
|
|
4
|
-
declare namespace draw {
|
|
5
|
-
/**
|
|
6
|
-
* 绘制矩形
|
|
7
|
-
* @param x 矩形左上角x坐标
|
|
8
|
-
* @param y 矩形左上角y坐标
|
|
9
|
-
* @param ex 矩形右下角x坐标
|
|
10
|
-
* @param ey 矩形右下角y坐标
|
|
11
|
-
* @param lineWidth 线宽 默认1
|
|
12
|
-
* @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
|
|
13
|
-
* @returns 绘制的矩形ID
|
|
14
|
-
* @example
|
|
15
|
-
* draw.drawRect(0, 0, 100, 100);
|
|
16
|
-
*/
|
|
17
|
-
function drawRect(
|
|
18
|
-
x: number,
|
|
19
|
-
y: number,
|
|
20
|
-
ex: number,
|
|
21
|
-
ey: number,
|
|
22
|
-
lineWidth?: number,
|
|
23
|
-
color?: string,
|
|
24
|
-
): string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 绘制圆
|
|
28
|
-
* @param x 圆中心x坐标
|
|
29
|
-
* @param y 圆中心y坐标
|
|
30
|
-
* @param radius 圆半径
|
|
31
|
-
* @param lineWidth 线宽 默认1
|
|
32
|
-
* @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
|
|
33
|
-
* @returns 绘制的圆ID
|
|
34
|
-
* @example
|
|
35
|
-
* draw.drawCircle(50, 50, 25);
|
|
36
|
-
*/
|
|
37
|
-
function drawCircle(
|
|
38
|
-
x: number,
|
|
39
|
-
y: number,
|
|
40
|
-
radius: number,
|
|
41
|
-
lineWidth?: number,
|
|
42
|
-
color?: string,
|
|
43
|
-
): string;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 绘制文本
|
|
47
|
-
* @param text 文本内容
|
|
48
|
-
* @param x 文本左上角x坐标
|
|
49
|
-
* @param y 文本左上角y坐标
|
|
50
|
-
* @param ex 文本右下角x坐标
|
|
51
|
-
* @param ey 文本右下角y坐标
|
|
52
|
-
* @param fontSize 字体大小 默认12
|
|
53
|
-
* @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
|
|
54
|
-
* @param bgColor 背景颜色 默认透明 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
|
|
55
|
-
* @returns 绘制的文本ID
|
|
56
|
-
* @example
|
|
57
|
-
* draw.drawText("Hello, World!", 0, 0, 100, 100);
|
|
58
|
-
*/
|
|
59
|
-
function drawText(
|
|
60
|
-
text: string,
|
|
61
|
-
x: number,
|
|
62
|
-
y: number,
|
|
63
|
-
ex: number,
|
|
64
|
-
ey: number,
|
|
65
|
-
fontSize?: number,
|
|
66
|
-
color?: string,
|
|
67
|
-
bgColor?: string,
|
|
68
|
-
): string;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* 清除绘制的内容
|
|
72
|
-
* @param id 绘制的内容ID , 不传清除所有绘制内容,传ID清除指定绘制内容
|
|
73
|
-
* @example
|
|
74
|
-
* draw.clear("rect1");
|
|
75
|
-
*/
|
|
76
|
-
function clear(id?: string): void;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 关闭绘制层并清除绘图模块
|
|
80
|
-
* @example
|
|
81
|
-
* draw.close();
|
|
82
|
-
*/
|
|
83
|
-
function close(): void;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* 显示绘制层
|
|
87
|
-
* @example
|
|
88
|
-
* draw.show();
|
|
89
|
-
*/
|
|
90
|
-
function show(): void;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* 隐藏绘制层
|
|
94
|
-
* @example
|
|
95
|
-
* draw.hide();
|
|
96
|
-
*/
|
|
97
|
-
function hide(): void;
|
|
98
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 绘图模块 包含绘制操作等功能
|
|
3
|
+
*/
|
|
4
|
+
declare namespace draw {
|
|
5
|
+
/**
|
|
6
|
+
* 绘制矩形
|
|
7
|
+
* @param x 矩形左上角x坐标
|
|
8
|
+
* @param y 矩形左上角y坐标
|
|
9
|
+
* @param ex 矩形右下角x坐标
|
|
10
|
+
* @param ey 矩形右下角y坐标
|
|
11
|
+
* @param lineWidth 线宽 默认1
|
|
12
|
+
* @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
|
|
13
|
+
* @returns 绘制的矩形ID
|
|
14
|
+
* @example
|
|
15
|
+
* draw.drawRect(0, 0, 100, 100);
|
|
16
|
+
*/
|
|
17
|
+
function drawRect(
|
|
18
|
+
x: number,
|
|
19
|
+
y: number,
|
|
20
|
+
ex: number,
|
|
21
|
+
ey: number,
|
|
22
|
+
lineWidth?: number,
|
|
23
|
+
color?: string,
|
|
24
|
+
): string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 绘制圆
|
|
28
|
+
* @param x 圆中心x坐标
|
|
29
|
+
* @param y 圆中心y坐标
|
|
30
|
+
* @param radius 圆半径
|
|
31
|
+
* @param lineWidth 线宽 默认1
|
|
32
|
+
* @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
|
|
33
|
+
* @returns 绘制的圆ID
|
|
34
|
+
* @example
|
|
35
|
+
* draw.drawCircle(50, 50, 25);
|
|
36
|
+
*/
|
|
37
|
+
function drawCircle(
|
|
38
|
+
x: number,
|
|
39
|
+
y: number,
|
|
40
|
+
radius: number,
|
|
41
|
+
lineWidth?: number,
|
|
42
|
+
color?: string,
|
|
43
|
+
): string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 绘制文本
|
|
47
|
+
* @param text 文本内容
|
|
48
|
+
* @param x 文本左上角x坐标
|
|
49
|
+
* @param y 文本左上角y坐标
|
|
50
|
+
* @param ex 文本右下角x坐标
|
|
51
|
+
* @param ey 文本右下角y坐标
|
|
52
|
+
* @param fontSize 字体大小 默认12
|
|
53
|
+
* @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
|
|
54
|
+
* @param bgColor 背景颜色 默认透明 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
|
|
55
|
+
* @returns 绘制的文本ID
|
|
56
|
+
* @example
|
|
57
|
+
* draw.drawText("Hello, World!", 0, 0, 100, 100);
|
|
58
|
+
*/
|
|
59
|
+
function drawText(
|
|
60
|
+
text: string,
|
|
61
|
+
x: number,
|
|
62
|
+
y: number,
|
|
63
|
+
ex: number,
|
|
64
|
+
ey: number,
|
|
65
|
+
fontSize?: number,
|
|
66
|
+
color?: string,
|
|
67
|
+
bgColor?: string,
|
|
68
|
+
): string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 清除绘制的内容
|
|
72
|
+
* @param id 绘制的内容ID , 不传清除所有绘制内容,传ID清除指定绘制内容
|
|
73
|
+
* @example
|
|
74
|
+
* draw.clear("rect1");
|
|
75
|
+
*/
|
|
76
|
+
function clear(id?: string): void;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 关闭绘制层并清除绘图模块
|
|
80
|
+
* @example
|
|
81
|
+
* draw.close();
|
|
82
|
+
*/
|
|
83
|
+
function close(): void;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 显示绘制层
|
|
87
|
+
* @example
|
|
88
|
+
* draw.show();
|
|
89
|
+
*/
|
|
90
|
+
function show(): void;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 隐藏绘制层
|
|
94
|
+
* @example
|
|
95
|
+
* draw.hide();
|
|
96
|
+
*/
|
|
97
|
+
function hide(): void;
|
|
98
|
+
}
|
package/types/global.d.ts
CHANGED
|
@@ -1,239 +1,243 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*/
|
|
4
|
-
declare const
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
declare const
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
declare const
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
declare const
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
declare const
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
declare const
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
declare const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
*
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
*
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
*
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
*
|
|
238
|
-
|
|
239
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 是否内置内置Agent
|
|
3
|
+
*/
|
|
4
|
+
declare const __isSupportBuiltAgent__: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* 是否是调试模式
|
|
7
|
+
*/
|
|
8
|
+
declare const __debug__: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 平台标识
|
|
11
|
+
*/
|
|
12
|
+
declare const __platform__: "ios" | "android";
|
|
13
|
+
/**
|
|
14
|
+
/**
|
|
15
|
+
* 应用版本
|
|
16
|
+
*/
|
|
17
|
+
declare const __appVersion__: string;
|
|
18
|
+
/**
|
|
19
|
+
* 应用构建号
|
|
20
|
+
*/
|
|
21
|
+
declare const __appBuildNumber__: number;
|
|
22
|
+
/**
|
|
23
|
+
* 应用名称
|
|
24
|
+
*/
|
|
25
|
+
declare const __appName__: string;
|
|
26
|
+
/**
|
|
27
|
+
* 应用 bundleId
|
|
28
|
+
*/
|
|
29
|
+
declare const __bundleId__: string;
|
|
30
|
+
/**
|
|
31
|
+
* 当前线程名称
|
|
32
|
+
*/
|
|
33
|
+
declare const __threadName__: string;
|
|
34
|
+
/**
|
|
35
|
+
* 脚本信息
|
|
36
|
+
*/
|
|
37
|
+
declare const __package__: {
|
|
38
|
+
/**
|
|
39
|
+
* 应用名称
|
|
40
|
+
*/
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* 应用包名
|
|
44
|
+
*/
|
|
45
|
+
package: string;
|
|
46
|
+
/**
|
|
47
|
+
* 应用版本
|
|
48
|
+
*/
|
|
49
|
+
appVersion: string;
|
|
50
|
+
/**
|
|
51
|
+
* 应用 Id
|
|
52
|
+
*/
|
|
53
|
+
appId: string;
|
|
54
|
+
/**
|
|
55
|
+
* 应用更新参数
|
|
56
|
+
*/
|
|
57
|
+
update: {
|
|
58
|
+
/**
|
|
59
|
+
* 应用更新地址
|
|
60
|
+
*/
|
|
61
|
+
url: string;
|
|
62
|
+
/**
|
|
63
|
+
* 应用更新超时时间
|
|
64
|
+
*/
|
|
65
|
+
timeout: number;
|
|
66
|
+
};
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
declare const sharedState: {
|
|
71
|
+
/**
|
|
72
|
+
* 设置共享状态
|
|
73
|
+
* @param key 状态键
|
|
74
|
+
* @param value 状态值
|
|
75
|
+
*/
|
|
76
|
+
set: (key: string, value: any) => void;
|
|
77
|
+
/**
|
|
78
|
+
* 获取共享状态
|
|
79
|
+
* @param key 状态键
|
|
80
|
+
* @returns 状态值
|
|
81
|
+
*/
|
|
82
|
+
get: (key: string) => any;
|
|
83
|
+
/**
|
|
84
|
+
* 批量操作共享状态
|
|
85
|
+
* @param block 批量操作代码块
|
|
86
|
+
*/
|
|
87
|
+
withBatch: (block: () => void) => void;
|
|
88
|
+
/**
|
|
89
|
+
* 清除所有共享状态
|
|
90
|
+
*/
|
|
91
|
+
clear: () => void;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 设置停止回调(仅主线程调用)
|
|
96
|
+
* @param callback 停止回调
|
|
97
|
+
* @description 脚本执行完成或异常停止时调用,exit 退出不会触发
|
|
98
|
+
* @example
|
|
99
|
+
* setStopCallback(() => {
|
|
100
|
+
* logi("脚本执行完成");
|
|
101
|
+
* });
|
|
102
|
+
*/
|
|
103
|
+
declare function setStopCallback(callback: () => void): void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 设置异常停止回调(仅主线程调用)
|
|
107
|
+
* @param callback 异常停止回调
|
|
108
|
+
* @description 脚本执行异常停止时调用
|
|
109
|
+
* @example
|
|
110
|
+
* setExceptionCallback(() => {
|
|
111
|
+
* loge("脚本执行异常");
|
|
112
|
+
* });
|
|
113
|
+
*/
|
|
114
|
+
declare function setExceptionCallback(callback: () => void): void;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 重启脚本(仅主线程调用)
|
|
118
|
+
* @param delay 延迟时间 毫秒
|
|
119
|
+
* @description 重启脚本会延迟指定时间后再重启,不要低于 2000 毫秒
|
|
120
|
+
* @example
|
|
121
|
+
* setExceptionCallback(() => {
|
|
122
|
+
* restartScript(2000);
|
|
123
|
+
* });
|
|
124
|
+
*/
|
|
125
|
+
declare function restartScript(delay: number): void;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 线程睡眠
|
|
129
|
+
* @param ms 毫秒
|
|
130
|
+
* @description 线程睡眠会阻塞当前线程,等待指定时间后继续执行
|
|
131
|
+
* @example
|
|
132
|
+
* sleep(1000);
|
|
133
|
+
*/
|
|
134
|
+
declare function sleep(ms: number): void | Promise<void>;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 退出脚本
|
|
138
|
+
* @param exitAll 是否退出所有线程 true 退出所有 false 退出当前线程,不传默认 false
|
|
139
|
+
* @description 退出脚本会终止所有线程的执行
|
|
140
|
+
* @example
|
|
141
|
+
* exit();
|
|
142
|
+
*/
|
|
143
|
+
declare function exit(exitAll?: boolean): void;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 获取当前时间戳
|
|
147
|
+
* @returns 时间戳
|
|
148
|
+
* @example
|
|
149
|
+
* const timestamp = time();
|
|
150
|
+
*/
|
|
151
|
+
declare function time(): number;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* 把 app 切换到前台 utils.takeMeToFront 的别名
|
|
155
|
+
* @returns 是否成功切换到前台
|
|
156
|
+
* @see utils.takeMeToFront
|
|
157
|
+
* @description 把 app 切换到前台
|
|
158
|
+
* @example
|
|
159
|
+
* takeMeToFront();
|
|
160
|
+
*/
|
|
161
|
+
declare function takeMeToFront(): boolean;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* 设置是否预加载节点(仅支持内置Agent)
|
|
165
|
+
* @param enable 是否预加载节点
|
|
166
|
+
* @description 设置是否预加载节点,默认 false
|
|
167
|
+
* @example
|
|
168
|
+
* setPreloadNode(true);
|
|
169
|
+
*/
|
|
170
|
+
declare function setPreloadNode(enable: boolean): void;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 打印调试日志 - 输出调试级别的日志
|
|
174
|
+
* 用于详细的程序执行信息、变量值和状态信息、函数调用跟踪
|
|
175
|
+
* @param args 日志消息内容
|
|
176
|
+
* @see logger.debug
|
|
177
|
+
* @example
|
|
178
|
+
* logd("程序开始执行");
|
|
179
|
+
* logd(`当前用户: ${username}`);
|
|
180
|
+
*/
|
|
181
|
+
declare function logd(...args: any[]): void;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* 打印信息日志 - 输出信息级别的日志
|
|
185
|
+
* 用于程序正常运行信息、重要操作的确认、状态变更通知
|
|
186
|
+
* @param args 日志消息内容
|
|
187
|
+
* @see logger.info
|
|
188
|
+
* @example
|
|
189
|
+
* logi("应用程序启动成功");
|
|
190
|
+
* logi("用户登录成功");
|
|
191
|
+
*/
|
|
192
|
+
declare function logi(...args: any[]): void;
|
|
193
|
+
declare function println(...args: any[]): void;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 打印警告日志 - 输出警告级别的日志
|
|
197
|
+
* 用于潜在的问题、不推荐的操作、性能警告、兼容性问题
|
|
198
|
+
* @param args 日志消息内容
|
|
199
|
+
* @see logger.warn
|
|
200
|
+
* @example
|
|
201
|
+
* logw("电池电量低于 20%");
|
|
202
|
+
* logw("网络连接不稳定");
|
|
203
|
+
*/
|
|
204
|
+
declare function logw(...args: any[]): void;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 打印错误日志 - 输出错误级别的日志
|
|
208
|
+
* 用于程序错误和异常、操作失败、系统错误、致命问题
|
|
209
|
+
* @param args 日志消息内容
|
|
210
|
+
* @see logger.error
|
|
211
|
+
* @example
|
|
212
|
+
* loge("网络请求失败");
|
|
213
|
+
* loge("文件读取错误");
|
|
214
|
+
*/
|
|
215
|
+
declare function loge(...args: any[]): void;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* 导入类 (仅安卓可用)
|
|
219
|
+
* @param className 类名
|
|
220
|
+
* @returns 类对象
|
|
221
|
+
* @description 导入类对象
|
|
222
|
+
* @example
|
|
223
|
+
* const clazz = importClass("com.example.TestClass");
|
|
224
|
+
*/
|
|
225
|
+
declare function importClass(className: string): any;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* 加载 dex 文件 (仅安卓可用)
|
|
229
|
+
* @param path dex 文件路径 支持apk文件
|
|
230
|
+
* @description 加载 dex 文件到内存中
|
|
231
|
+
* @example
|
|
232
|
+
* loadDex("test.dex");
|
|
233
|
+
*/
|
|
234
|
+
declare function loadDex(path: string): void;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* 获取当前上下文 (仅安卓可用)
|
|
238
|
+
* @returns 当前上下文
|
|
239
|
+
* @description 获取当前上下文
|
|
240
|
+
* @example
|
|
241
|
+
* const context = getContext();
|
|
242
|
+
*/
|
|
243
|
+
declare function getContext(): any;
|