ms-types 0.8.4 → 0.8.6

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.8.4",
3
+ "version": "0.8.6",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/action.d.ts CHANGED
@@ -191,11 +191,13 @@ declare namespace action {
191
191
  function homeScreen(): boolean;
192
192
  /**
193
193
  * 按下按钮
194
- * @param button 按钮 home 按下home键 volumeup 按下音量上键 volumedown 按下音量下键
194
+ * @param button 按钮 home 按下home键 volumeup 按下音量上键 volumedown 按下音量下键 brightnessup 调高屏幕亮度 brightnessdown 调低屏幕亮度
195
195
  * @returns 按下按钮是否成功
196
196
  * @example action.pressButton("home")
197
197
  */
198
- function pressButton(button: "home" | "volumeup" | "volumedown"): boolean;
198
+ function pressButton(
199
+ button: "home" | "volumeup" | "volumedown" | "brightnessup" | "brightnessdown",
200
+ ): boolean;
199
201
 
200
202
  /**
201
203
  * 发送键盘组合键。
package/types/device.d.ts CHANGED
@@ -114,6 +114,13 @@ declare namespace device {
114
114
  * @example device.getScreenBrightness()
115
115
  */
116
116
  function getScreenBrightness(): number;
117
+ /**
118
+ * 设置屏幕亮度
119
+ * @param brightness 目标屏幕亮度,范围 0.0-1.0
120
+ * @returns 是否设置成功
121
+ * @example device.setScreenBrightness(0.5)
122
+ */
123
+ function setScreenBrightness(brightness: number): boolean;
117
124
  /**
118
125
  * 获取屏幕方向 PORTRAIT 竖屏 LANDSCAPE 横屏
119
126
  * @returns 设备方向
package/types/hid.d.ts CHANGED
@@ -303,7 +303,7 @@ declare namespace hid {
303
303
 
304
304
  /**
305
305
  * 按下按钮
306
- * @param button 按钮 home 按下home键 volumeup 按下音量上键 volumedown 按下音量下键 mute 按下静音键 playpause 按下播放/暂停键 next 按下下一首键 prev 按按下一首键 eject 显示隐藏键盘 globe 按下globe键 search 按下搜索键
306
+ * @param button 按钮 home 按下home键 volumeup 按下音量上键 volumedown 按下音量下键 mute 按下静音键 playpause 按下播放/暂停键 next 按下下一首键 prev 按下上一首键 eject 显示隐藏键盘 globe 按下globe键 search 按下搜索键 brightnessup 调高屏幕亮度 brightnessdown 调低屏幕亮度 power 电源/锁屏键 menu Home/Menu键 snapshot 系统截图键
307
307
  * @returns 按下按钮是否成功
308
308
  * @example action.pressButton("home")
309
309
  */
@@ -318,7 +318,12 @@ declare namespace hid {
318
318
  | "prev"
319
319
  | "eject"
320
320
  | "globe"
321
- | "search",
321
+ | "search"
322
+ | "brightnessup"
323
+ | "brightnessdown"
324
+ | "power"
325
+ | "menu"
326
+ | "snapshot",
322
327
  ): boolean;
323
328
 
324
329
  /**
@@ -307,7 +307,7 @@ declare namespace $HID {
307
307
 
308
308
  /**
309
309
  * 按下按钮
310
- * @param 按键 按钮 home 按下home键 volumeup 按下音量上键 volumedown 按下音量下键 mute 按下静音键 playpause 按下播放/暂停键 next 按下下一首键 prev 按按下一首键 eject 显示隐藏键盘 globe 按下globe键 search 按下搜索键
310
+ * @param 按键 按钮 home 按下home键 volumeup 按下音量上键 volumedown 按下音量下键 mute 按下静音键 playpause 按下播放/暂停键 next 按下下一首键 prev 按下上一首键 eject 显示隐藏键盘 globe 按下globe键 search 按下搜索键 brightnessup 调高屏幕亮度 brightnessdown 调低屏幕亮度 power 电源/锁屏键 menu Home/Menu键 snapshot 系统截图键
311
311
  * @returns 按下按钮是否成功
312
312
  * @example $动作.按键("home")
313
313
  */
@@ -322,7 +322,12 @@ declare namespace $HID {
322
322
  | "prev"
323
323
  | "eject"
324
324
  | "globe"
325
- | "search",
325
+ | "search"
326
+ | "brightnessup"
327
+ | "brightnessdown"
328
+ | "power"
329
+ | "menu"
330
+ | "snapshot",
326
331
  ): 布尔值;
327
332
 
328
333
  /**
@@ -193,11 +193,13 @@ declare namespace $动作 {
193
193
  function 回到主页(): 布尔值;
194
194
  /**
195
195
  * 按下按钮
196
- * @param 按键 按钮 home 按下home键 volumeup 按下音量上键 volumedown 按下音量下键
196
+ * @param 按键 按钮 home 按下home键 volumeup 按下音量上键 volumedown 按下音量下键 brightnessup 调高屏幕亮度 brightnessdown 调低屏幕亮度
197
197
  * @returns 按下按钮是否成功
198
198
  * @example $动作.按键("home")
199
199
  */
200
- function 按键(按键: "home" | "volumeup" | "volumedown"): 布尔值;
200
+ function 按键(
201
+ 按键: "home" | "volumeup" | "volumedown" | "brightnessup" | "brightnessdown",
202
+ ): 布尔值;
201
203
 
202
204
  /**
203
205
  * 发送键盘组合键。
@@ -115,6 +115,13 @@ declare namespace $设备 {
115
115
  * @example $设备.获取屏幕亮度()
116
116
  */
117
117
  function 获取屏幕亮度(): 数字;
118
+ /**
119
+ * 设置屏幕亮度
120
+ * @param 亮度 目标屏幕亮度,范围 0.0-1.0
121
+ * @returns 是否设置成功
122
+ * @example $设备.设置屏幕亮度(0.5)
123
+ */
124
+ function 设置屏幕亮度(亮度: 数字): 布尔值;
118
125
  /**
119
126
  * 获取屏幕方向 PORTRAIT 竖屏 LANDSCAPE 横屏
120
127
  * @returns 设备方向