ms-types 0.1.17 → 0.1.19
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/types/action.d.ts +1 -1
- package/types/device.d.ts +1 -1
- package/types/global.d.ts +3 -2
- package/types/node.d.ts +9 -0
- package/types/zh//345/205/250/345/261/200/346/250/241/345/235/227.d.ts +11 -1
- package/types/zh//345/212/250/344/275/234/346/250/241/345/235/227.d.ts +1 -1
- package/types/zh//350/212/202/347/202/271/346/250/241/345/235/227.d.ts +9 -0
- package/types/zh//350/256/276/345/244/207/346/250/241/345/235/227.d.ts +1 -1
package/package.json
CHANGED
package/types/action.d.ts
CHANGED
package/types/device.d.ts
CHANGED
|
@@ -101,5 +101,5 @@ declare namespace device {
|
|
|
101
101
|
* @param intensity 强度 0.0-1.0
|
|
102
102
|
* @example device.vibrate(1000, 0.5)
|
|
103
103
|
*/
|
|
104
|
-
function vibrate(duration: number, intensity: number): void
|
|
104
|
+
function vibrate(duration: number, intensity: number): void | Promise<void>;
|
|
105
105
|
}
|
package/types/global.d.ts
CHANGED
|
@@ -59,13 +59,14 @@ declare const __package__: {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* 设置异步模式
|
|
62
|
+
* 设置异步模式 设置为异步模式后,方法定义的返回值有 `Promise` 的 `API` 方法都会返回 Promise 异步执行
|
|
63
|
+
* 必须写在 main 方法第一行
|
|
63
64
|
* @param asyncMode 是否异步模式
|
|
64
65
|
* @description 设置是否开启异步模式,默认 false
|
|
65
66
|
* @example
|
|
66
67
|
* setAsyncMode(true);
|
|
67
68
|
*/
|
|
68
|
-
declare function setAsyncMode(
|
|
69
|
+
declare function setAsyncMode(asyncMode: boolean): void;
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
72
|
* 设置停止回调(仅主线程调用)
|
package/types/node.d.ts
CHANGED
|
@@ -156,6 +156,15 @@ declare class NodeSelector {
|
|
|
156
156
|
* @returns 节点信息
|
|
157
157
|
*/
|
|
158
158
|
getOneNodeInfo(timeout?: number): NodeInfo | null;
|
|
159
|
+
/**
|
|
160
|
+
* 加载节点数据
|
|
161
|
+
* @param timeout 超时时间,单位毫秒 默认为 5000 毫秒
|
|
162
|
+
*/
|
|
163
|
+
loadNode(timeout?: number): NodeSelector;
|
|
164
|
+
/**
|
|
165
|
+
* 清除所有选择条件
|
|
166
|
+
*/
|
|
167
|
+
clearSelector(): NodeSelector;
|
|
159
168
|
/**
|
|
160
169
|
* 获取节点xpath
|
|
161
170
|
* @param path xpath路径
|
|
@@ -58,6 +58,16 @@ declare const $脚本配置: {
|
|
|
58
58
|
[key: 字符串]: 任意类型;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* 设置异步模式 设置为异步模式后,方法定义的返回值有 `Promise` 的 `API` 方法都会返回 Promise 异步执行
|
|
63
|
+
* 必须写在 main 方法第一行
|
|
64
|
+
* @param 异步模式 是否异步模式
|
|
65
|
+
* @description 设置是否开启异步模式,默认 false
|
|
66
|
+
* @example
|
|
67
|
+
* $设置异步模式(true);
|
|
68
|
+
*/
|
|
69
|
+
declare function $设置异步模式(异步模式: 布尔值): 无返回值;
|
|
70
|
+
|
|
61
71
|
/**
|
|
62
72
|
* 设置停止回调(仅主线程调用)
|
|
63
73
|
* @param callback 停止回调
|
|
@@ -96,7 +106,7 @@ declare const $重启脚本: (延迟时间: 数字) => 无返回值;
|
|
|
96
106
|
* @example
|
|
97
107
|
* $延时(1000);
|
|
98
108
|
*/
|
|
99
|
-
declare const $延时: (毫秒: 数字) =>
|
|
109
|
+
declare const $延时: (毫秒: 数字) => 无返回值 | Promise<无返回值>;
|
|
100
110
|
|
|
101
111
|
/**
|
|
102
112
|
* 退出脚本
|
|
@@ -157,6 +157,15 @@ declare class $节点选择器 {
|
|
|
157
157
|
* @returns 节点信息
|
|
158
158
|
*/
|
|
159
159
|
获取一个节点(超时时间?: 数字): $节点信息 | null;
|
|
160
|
+
/**
|
|
161
|
+
* 加载节点数据
|
|
162
|
+
* @param 超时时间,单位毫秒 默认为 5000 毫秒
|
|
163
|
+
*/
|
|
164
|
+
加载节点数据(超时时间?: 数字): $节点选择器;
|
|
165
|
+
/**
|
|
166
|
+
* 清除所有选择条件
|
|
167
|
+
*/
|
|
168
|
+
清除所有选择条件(): $节点选择器;
|
|
160
169
|
/**
|
|
161
170
|
* 获取节点xpath
|
|
162
171
|
* @param xpath 节点xpath路径
|