ms-types 0.1.16 → 0.1.18
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/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/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
|
@@ -60,12 +60,13 @@ declare const __package__: {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* 设置异步模式 设置为异步模式后,方法所有同步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
|
* 设置停止回调(仅主线程调用)
|
|
@@ -107,7 +108,7 @@ declare function restartScript(delay: number): void;
|
|
|
107
108
|
* @example
|
|
108
109
|
* sleep(1000);
|
|
109
110
|
*/
|
|
110
|
-
declare function sleep(ms: number): void
|
|
111
|
+
declare function sleep(ms: number): void | Promise<void>;
|
|
111
112
|
|
|
112
113
|
/**
|
|
113
114
|
* 退出脚本
|
|
@@ -58,6 +58,16 @@ declare const $脚本配置: {
|
|
|
58
58
|
[key: 字符串]: 任意类型;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* 设置异步模式 设置为异步模式后,方法所有同步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
|
* 退出脚本
|