ms-types 0.7.5 → 0.7.7
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
CHANGED
package/types/action.d.ts
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
* 动作模块 包含点击、滑动、长按滑动、返回首页等动作
|
|
3
3
|
*/
|
|
4
4
|
declare namespace action {
|
|
5
|
+
/**
|
|
6
|
+
* W3C Actions 请求体
|
|
7
|
+
*/
|
|
8
|
+
interface W3CActionsJson {
|
|
9
|
+
actions: Record<string, any>[];
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
|
|
5
13
|
/**
|
|
6
14
|
* 设置动作抖动值 点击、滑动等动作会在像素范围-5到5随机偏移
|
|
7
15
|
* @param value 抖动值
|
|
@@ -178,6 +186,14 @@ declare namespace action {
|
|
|
178
186
|
*/
|
|
179
187
|
function pressButton(button: "home" | "volumeup" | "volumedown"): boolean;
|
|
180
188
|
|
|
189
|
+
/**
|
|
190
|
+
* 执行 W3C Actions JSON
|
|
191
|
+
* @param json W3C Actions 请求体,例如 { actions: [...] }
|
|
192
|
+
* @returns 执行是否成功
|
|
193
|
+
* @example action.w3cActions({ actions: [{ type: "pointer", id: "finger1", parameters: { pointerType: "touch" }, actions: [] }] })
|
|
194
|
+
*/
|
|
195
|
+
function w3cActions(json: W3CActionsJson): boolean;
|
|
196
|
+
|
|
181
197
|
/**
|
|
182
198
|
* 创建 ActionBuilder 构建器,支持链式调用构建复杂的多点触控动作
|
|
183
199
|
* @returns ActionBuilder 实例
|
package/types/system.d.ts
CHANGED
|
@@ -78,6 +78,16 @@ declare namespace system {
|
|
|
78
78
|
* }
|
|
79
79
|
*/
|
|
80
80
|
function getInstalledAppList(): InstalledAppInfo[];
|
|
81
|
+
/**
|
|
82
|
+
* 打开 App 切换器
|
|
83
|
+
* @returns 是否打开成功
|
|
84
|
+
* @example
|
|
85
|
+
* const opened = system.recent()
|
|
86
|
+
* if (opened) {
|
|
87
|
+
* logi("打开成功")
|
|
88
|
+
* }
|
|
89
|
+
*/
|
|
90
|
+
function recent(): boolean;
|
|
81
91
|
/**
|
|
82
92
|
* 获取系统是否锁屏
|
|
83
93
|
* @returns 是否锁屏
|
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
* 动作模块 包含点击、滑动、长按滑动、返回首页等动作
|
|
5
5
|
*/
|
|
6
6
|
declare namespace $动作 {
|
|
7
|
+
/**
|
|
8
|
+
* W3C Actions 请求体
|
|
9
|
+
*/
|
|
10
|
+
interface W3C动作JSON {
|
|
11
|
+
actions: 数组<字典<任意类型>>;
|
|
12
|
+
[key: 字符串]: 任意类型;
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
/**
|
|
8
16
|
* 设置动作抖动值 点击、滑动等动作会在像素范围-5到5随机偏移
|
|
9
17
|
* @param value 抖动值
|
|
@@ -180,6 +188,14 @@ declare namespace $动作 {
|
|
|
180
188
|
*/
|
|
181
189
|
function 按键(按键: "home" | "volumeup" | "volumedown"): 布尔值;
|
|
182
190
|
|
|
191
|
+
/**
|
|
192
|
+
* 执行 W3C Actions JSON
|
|
193
|
+
* @param json W3C Actions 请求体,例如 { actions: [...] }
|
|
194
|
+
* @returns 执行是否成功
|
|
195
|
+
* @example $动作.执行W3C动作({ actions: [{ type: "pointer", id: "finger1", parameters: { pointerType: "touch" }, actions: [] }] })
|
|
196
|
+
*/
|
|
197
|
+
function 执行W3C动作(json: W3C动作JSON): 布尔值;
|
|
198
|
+
|
|
183
199
|
/**
|
|
184
200
|
* 创建 动作构建器,支持链式调用构建复杂的多点触控动作
|
|
185
201
|
* @returns 动作构建器 实例
|
|
@@ -78,6 +78,16 @@ declare namespace $系统 {
|
|
|
78
78
|
* }
|
|
79
79
|
*/
|
|
80
80
|
function 获取安装的应用列表(): 安装应用信息[];
|
|
81
|
+
/**
|
|
82
|
+
* 打开 App 切换器
|
|
83
|
+
* @returns 是否打开成功
|
|
84
|
+
* @example
|
|
85
|
+
* const 是否打开成功 = $系统.最近应用()
|
|
86
|
+
* if (是否打开成功) {
|
|
87
|
+
* $打印信息日志("打开成功")
|
|
88
|
+
* }
|
|
89
|
+
*/
|
|
90
|
+
function 最近应用(): 布尔值;
|
|
81
91
|
/**
|
|
82
92
|
* 获取系统是否锁屏
|
|
83
93
|
* @returns 是否锁屏
|