ms-types 0.9.40 → 0.9.42

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.9.40",
3
+ "version": "0.9.42",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -18,6 +18,6 @@
18
18
  "devDependencies": {
19
19
  "vitepress": "^1.6.4",
20
20
  "vitepress-theme-teek": "^1.6.2",
21
- "wrangler": "^4.125.0"
21
+ "wrangler": "^4.128.0"
22
22
  }
23
23
  }
package/types/hid.d.ts CHANGED
@@ -93,7 +93,7 @@ declare namespace hid {
93
93
  function getDeviceVersion(): string;
94
94
 
95
95
  /**
96
- * 复位坐标到左上角 只有相对鼠标需要
96
+ * 复位坐标到左下角 只有相对鼠标需要
97
97
  * @returns 操作是否成功
98
98
  */
99
99
  function resetPosition(): boolean;
@@ -104,6 +104,13 @@ declare namespace hid {
104
104
  */
105
105
  function restartDevice(): boolean;
106
106
 
107
+ /**
108
+ * 开关充电。当前连接的 HID 不支持时返回 false。
109
+ * @param on true 打开充电,false 关闭充电
110
+ * @returns 是否成功发送
111
+ */
112
+ function setCharging(on: boolean): boolean;
113
+
107
114
  /**
108
115
  * 设置动作抖动值
109
116
  * @param value 抖动值
package/types/lua/hid.lua CHANGED
@@ -77,7 +77,7 @@ function _HID.mouseUp() return true end
77
77
  --- @return boolean 成功
78
78
  function _HID.click(x, y, duration, jitter) return true end
79
79
 
80
- --- 复位坐标到左上角(仅相对鼠标模式需要)
80
+ --- 复位坐标到左下角(仅相对鼠标模式需要)
81
81
  --- @return boolean 成功
82
82
  function _HID.resetPosition() return true end
83
83
 
@@ -122,6 +122,11 @@ function _HID.getDeviceVersion() return '' end
122
122
  --- @return boolean 成功
123
123
  function _HID.restartDevice() return true end
124
124
 
125
+ --- 开关充电。当前连接的 HID 不支持时返回 false。
126
+ --- @param on boolean true 打开充电,false 关闭充电
127
+ --- @return boolean 成功
128
+ function _HID.setCharging(on) return true end
129
+
125
130
  --- 随机点击
126
131
  --- @param x1 integer
127
132
  --- @param y1 integer
package/types/ui.d.ts CHANGED
@@ -69,6 +69,12 @@ declare namespace ms {
69
69
  */
70
70
  function setAllConfig(config: Record<string, any>): Promise<boolean>;
71
71
 
72
+ /**
73
+ * 获取设备ID
74
+ * @returns 设备的唯一标识符(IDFV)。卸载重装 APP 后会改变,更新 APP 后不会改变。
75
+ */
76
+ function getDeviceID(): Promise<string>;
77
+
72
78
  /**
73
79
  * 获取服务器设备ID
74
80
  * @returns 服务器设备ID
@@ -95,7 +95,7 @@ declare namespace $HID {
95
95
  function 获取设备版本(): 字符串;
96
96
 
97
97
  /**
98
- * 复位坐标到左上角 只有相对鼠标需要
98
+ * 复位坐标到左下角 只有相对鼠标需要
99
99
  * @returns 操作是否成功
100
100
  */
101
101
  function 复位坐标(): 布尔值;
@@ -106,6 +106,13 @@ declare namespace $HID {
106
106
  */
107
107
  function 重启设备(): 布尔值;
108
108
 
109
+ /**
110
+ * 开关充电。当前连接的 HID 不支持时返回 false。
111
+ * @param 打开 true 打开充电,false 关闭充电
112
+ * @returns 是否成功发送
113
+ */
114
+ function 设置充电(打开: 布尔值): 布尔值;
115
+
109
116
  /**
110
117
  * 设置动作抖动值
111
118
  * @param 抖动值