ms-types 0.1.15 → 0.1.17
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/global.d.ts +10 -1
package/package.json
CHANGED
package/types/global.d.ts
CHANGED
|
@@ -58,6 +58,15 @@ declare const __package__: {
|
|
|
58
58
|
[key: string]: any;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* 设置异步模式 设置为异步模式后,方法所有同步API方法都会返回 Promise 异步执行
|
|
63
|
+
* @param asyncMode 是否异步模式
|
|
64
|
+
* @description 设置是否开启异步模式,默认 false
|
|
65
|
+
* @example
|
|
66
|
+
* setAsyncMode(true);
|
|
67
|
+
*/
|
|
68
|
+
declare function setAsyncMode(...args: any[]): void;
|
|
69
|
+
|
|
61
70
|
/**
|
|
62
71
|
* 设置停止回调(仅主线程调用)
|
|
63
72
|
* @param callback 停止回调
|
|
@@ -98,7 +107,7 @@ declare function restartScript(delay: number): void;
|
|
|
98
107
|
* @example
|
|
99
108
|
* sleep(1000);
|
|
100
109
|
*/
|
|
101
|
-
declare function sleep(ms: number): void
|
|
110
|
+
declare function sleep(ms: number): void | Promise<void>;
|
|
102
111
|
|
|
103
112
|
/**
|
|
104
113
|
* 退出脚本
|