ms-types 0.7.8 → 0.8.1
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ms-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"vitepress": "^1.6.4",
|
|
20
|
-
"vitepress-theme-teek": "^1.
|
|
20
|
+
"vitepress-theme-teek": "^1.6.0",
|
|
21
21
|
"wrangler": "^4.92.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/types/action.d.ts
CHANGED
|
@@ -159,6 +159,17 @@ declare namespace action {
|
|
|
159
159
|
* @example action.input("123456")
|
|
160
160
|
*/
|
|
161
161
|
function input(text: string): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* 输入基础文本。
|
|
164
|
+
*
|
|
165
|
+
* 不使用剪切板或 IME,而是把文本字符数组一次性传给 Action 模块的 sendKey。
|
|
166
|
+
* 仅支持可映射为 USB HID Keyboard/Keypad usage 的 ASCII 字符,不支持中文。
|
|
167
|
+
*
|
|
168
|
+
* @param text 文本内容
|
|
169
|
+
* @returns 输入是否成功
|
|
170
|
+
* @example action.inputSimple("hello_123")
|
|
171
|
+
*/
|
|
172
|
+
function inputSimple(text: string): boolean;
|
|
162
173
|
/**
|
|
163
174
|
* 删除文本
|
|
164
175
|
* @param count 删除数量 默认为1
|
|
@@ -186,6 +197,21 @@ declare namespace action {
|
|
|
186
197
|
*/
|
|
187
198
|
function pressButton(button: "home" | "volumeup" | "volumedown"): boolean;
|
|
188
199
|
|
|
200
|
+
/**
|
|
201
|
+
* 发送键盘组合键。
|
|
202
|
+
*
|
|
203
|
+
* Action 模块最终发送标准 USB HID Keyboard/Keypad usage。
|
|
204
|
+
* 参数可以直接传标准 usage 数字,也可以传单个 ASCII 字符、按键名称字符串,
|
|
205
|
+
* 或现有 hidKey 常量;hidKey 常量会按兼容规则转换为标准 usage。
|
|
206
|
+
*
|
|
207
|
+
* @param key 要发送的按键数组
|
|
208
|
+
* @returns 发送是否成功
|
|
209
|
+
* @example action.sendKey(["COMMAND", "c"])
|
|
210
|
+
* @example action.sendKey([0xe3, 0x06])
|
|
211
|
+
* @example action.sendKey([hidKey.COMMAND, "v"])
|
|
212
|
+
*/
|
|
213
|
+
function sendKey(key: Array<number | string>): boolean;
|
|
214
|
+
|
|
189
215
|
/**
|
|
190
216
|
* 执行 W3C Actions JSON
|
|
191
217
|
* @param json W3C Actions 请求体,例如 { actions: [...] }
|
package/types/global.d.ts
CHANGED
|
@@ -147,15 +147,6 @@ declare function time(): number;
|
|
|
147
147
|
*/
|
|
148
148
|
declare function takeMeToFront(): boolean;
|
|
149
149
|
|
|
150
|
-
/**
|
|
151
|
-
* 设置是否预加载节点(仅支持内置Agent)
|
|
152
|
-
* @param enable 是否预加载节点
|
|
153
|
-
* @description 设置是否预加载节点,默认 false
|
|
154
|
-
* @example
|
|
155
|
-
* setPreloadNode(true);
|
|
156
|
-
*/
|
|
157
|
-
declare function setPreloadNode(enable: boolean): void;
|
|
158
|
-
|
|
159
150
|
/**
|
|
160
151
|
* 打印调试日志 - 输出调试级别的日志
|
|
161
152
|
* 用于详细的程序执行信息、变量值和状态信息、函数调用跟踪
|
|
@@ -143,15 +143,6 @@ declare function $获取当前时间戳(): 数字;
|
|
|
143
143
|
*/
|
|
144
144
|
declare function $APP切入前台(): 无返回值;
|
|
145
145
|
|
|
146
|
-
/**
|
|
147
|
-
* 设置是否预加载节点(仅支持内置Agent)
|
|
148
|
-
* @param enable 是否预加载节点
|
|
149
|
-
* @description 设置是否预加载节点,默认 false
|
|
150
|
-
* @example
|
|
151
|
-
* $设置预加载节点(true);
|
|
152
|
-
*/
|
|
153
|
-
declare function $设置预加载节点(enable: 布尔值): 无返回值;
|
|
154
|
-
|
|
155
146
|
/**
|
|
156
147
|
* 打印调试日志 - 输出调试级别的日志
|
|
157
148
|
* 用于详细的程序执行信息、变量值和状态信息、函数调用跟踪
|
|
@@ -156,11 +156,22 @@ declare namespace $动作 {
|
|
|
156
156
|
): 布尔值;
|
|
157
157
|
/**
|
|
158
158
|
* 输入文本
|
|
159
|
-
* @param
|
|
159
|
+
* @param 文本 文本内容
|
|
160
160
|
* @returns 输入文本是否成功
|
|
161
161
|
* @example $动作.输入文本("123456")
|
|
162
162
|
*/
|
|
163
163
|
function 输入文本(文本: 字符串): 布尔值;
|
|
164
|
+
/**
|
|
165
|
+
* 输入基础文本。
|
|
166
|
+
*
|
|
167
|
+
* 不使用剪切板或 IME,而是把文本字符数组一次性传给动作模块的 发送按键。
|
|
168
|
+
* 仅支持可映射为 USB HID Keyboard/Keypad usage 的 ASCII 字符,不支持中文。
|
|
169
|
+
*
|
|
170
|
+
* @param 文本 文本内容
|
|
171
|
+
* @returns 输入是否成功
|
|
172
|
+
* @example $动作.输入简易文本("hello_123")
|
|
173
|
+
*/
|
|
174
|
+
function 输入简易文本(文本: 字符串): 布尔值;
|
|
164
175
|
/**
|
|
165
176
|
* 删除文本
|
|
166
177
|
* @param 删除数量 默认为1
|
|
@@ -188,6 +199,20 @@ declare namespace $动作 {
|
|
|
188
199
|
*/
|
|
189
200
|
function 按键(按键: "home" | "volumeup" | "volumedown"): 布尔值;
|
|
190
201
|
|
|
202
|
+
/**
|
|
203
|
+
* 发送键盘组合键。
|
|
204
|
+
*
|
|
205
|
+
* 动作模块最终发送标准 USB HID Keyboard/Keypad usage。
|
|
206
|
+
* 参数可以直接传标准 usage 数字,也可以传单个 ASCII 字符、按键名称字符串,
|
|
207
|
+
* 或现有 hidKey 常量;hidKey 常量会按兼容规则转换为标准 usage。
|
|
208
|
+
*
|
|
209
|
+
* @param 按键 要发送的按键数组
|
|
210
|
+
* @returns 发送是否成功
|
|
211
|
+
* @example $动作.发送按键(["COMMAND", "c"])
|
|
212
|
+
* @example $动作.发送按键([0xe3, 0x06])
|
|
213
|
+
*/
|
|
214
|
+
function 发送按键(按键: 数组<数字 | 字符串>): 布尔值;
|
|
215
|
+
|
|
191
216
|
/**
|
|
192
217
|
* 执行 W3C Actions JSON
|
|
193
218
|
* @param json W3C Actions 请求体,例如 { actions: [...] }
|