util-helpers 4.23.1 → 5.0.0
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/dist/util-helpers.js +844 -961
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/VERSION.js +1 -1
- package/esm/compressImage.js +2 -2
- package/esm/formatBankCard.js +3 -5
- package/esm/formatMobile.js +4 -6
- package/esm/getImageInfo.js +16 -43
- package/esm/index.js +0 -8
- package/esm/isBusinessLicense.js +1 -2
- package/esm/isSocialCreditCode.js +1 -3
- package/esm/loadImage.js +20 -45
- package/esm/loadImageWithBlob.js +19 -46
- package/lib/VERSION.js +1 -1
- package/lib/compressImage.js +2 -2
- package/lib/formatBankCard.js +3 -5
- package/lib/formatMobile.js +4 -6
- package/lib/getImageInfo.js +15 -42
- package/lib/index.js +1 -9
- package/lib/isBusinessLicense.js +1 -2
- package/lib/isSocialCreditCode.js +1 -3
- package/lib/loadImage.js +18 -43
- package/lib/loadImageWithBlob.js +18 -45
- package/package.json +1 -1
- package/types/compressImage.d.ts +2 -4
- package/types/formatBankCard.d.ts +1 -3
- package/types/formatMobile.d.ts +0 -2
- package/types/getImageInfo.d.ts +10 -12
- package/types/index.d.ts +0 -8
- package/types/isBusinessLicense.d.ts +0 -2
- package/types/isSocialCreditCode.d.ts +0 -2
- package/types/loadImage.d.ts +1 -12
- package/types/loadImageWithBlob.d.ts +6 -10
- package/esm/blobToDataURL.js +0 -7
- package/esm/isPromiseLike.js +0 -7
- package/esm/normalizeString.js +0 -7
- package/esm/waitTime.js +0 -8
- package/lib/blobToDataURL.js +0 -9
- package/lib/isPromiseLike.js +0 -9
- package/lib/normalizeString.js +0 -9
- package/lib/waitTime.js +0 -10
- package/types/blobToDataURL.d.ts +0 -29
- package/types/isPromiseLike.d.ts +0 -19
- package/types/normalizeString.d.ts +0 -26
- package/types/utils/Cache.d.ts +0 -14
- package/types/waitTime.d.ts +0 -24
package/lib/loadImageWithBlob.js
CHANGED
|
@@ -2,52 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
var native = require('./utils/native.js');
|
|
4
4
|
var getFileBlob = require('./getFileBlob.js');
|
|
5
|
-
var AsyncMemo = require('./AsyncMemo.js');
|
|
6
|
-
var ut2 = require('ut2');
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
native.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
return asyncMemo
|
|
27
|
-
.run(function () {
|
|
28
|
-
return new Promise(function (resolve, reject) {
|
|
29
|
-
getFileBlob(img, ajaxOptions)
|
|
30
|
-
.then(function (blob) {
|
|
31
|
-
var url = native.createObjectURL(blob);
|
|
32
|
-
var image = new Image();
|
|
33
|
-
image.onload = function () {
|
|
34
|
-
var data = { blob: blob, image: image };
|
|
35
|
-
resolve({
|
|
36
|
-
data: data,
|
|
37
|
-
r: _cacheOptions.autoRevokeOnDel
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
image.onerror = function (err) {
|
|
41
|
-
native.revokeObjectURL(url);
|
|
42
|
-
console.error("[loadImageWithBlob] The image load failed, '".concat(img, "'."));
|
|
43
|
-
reject(err);
|
|
44
|
-
};
|
|
45
|
-
image.src = url;
|
|
46
|
-
})
|
|
47
|
-
.catch(reject);
|
|
48
|
-
});
|
|
49
|
-
}, _cacheOptions.useCache && _cacheOptions.cacheKey ? _cacheOptions.cacheKey : undefined)
|
|
50
|
-
.then(function (res) { return res.data; });
|
|
6
|
+
function loadImageWithBlob(img, ajaxOptions) {
|
|
7
|
+
return new Promise(function (resolve, reject) {
|
|
8
|
+
getFileBlob(img, ajaxOptions)
|
|
9
|
+
.then(function (blob) {
|
|
10
|
+
var url = native.createObjectURL(blob);
|
|
11
|
+
var image = new Image();
|
|
12
|
+
image.onload = function () {
|
|
13
|
+
resolve({ blob: blob, image: image });
|
|
14
|
+
};
|
|
15
|
+
image.onerror = function (err) {
|
|
16
|
+
native.revokeObjectURL(url);
|
|
17
|
+
console.error("[loadImageWithBlob] The image load failed, '".concat(img, "'."));
|
|
18
|
+
reject(err);
|
|
19
|
+
};
|
|
20
|
+
image.src = url;
|
|
21
|
+
})
|
|
22
|
+
.catch(reject);
|
|
23
|
+
});
|
|
51
24
|
}
|
|
52
25
|
|
|
53
26
|
module.exports = loadImageWithBlob;
|
package/package.json
CHANGED
package/types/compressImage.d.ts
CHANGED
|
@@ -19,8 +19,7 @@ type Options = {
|
|
|
19
19
|
beforeCompress?: (imageWithBlob: Pick<Info, 'image' | 'blob'>, options: Options) => void;
|
|
20
20
|
beforeDraw?: (info: Info, options: Options) => void;
|
|
21
21
|
afterDraw?: (info: Info, options: Options) => void;
|
|
22
|
-
|
|
23
|
-
ajaxOptions?: Parameters<typeof loadImageWithBlob>[2];
|
|
22
|
+
ajaxOptions?: Parameters<typeof loadImageWithBlob>[1];
|
|
24
23
|
};
|
|
25
24
|
interface CompressImage {
|
|
26
25
|
(img: string | Blob, options: Omit<Options, 'format'> & {
|
|
@@ -54,8 +53,7 @@ interface CompressImage {
|
|
|
54
53
|
* @param {function} [options.beforeCompress] 图片加载完成,画布创建之前调用
|
|
55
54
|
* @param {function} [options.beforeDraw] 图片载入画布之前调用
|
|
56
55
|
* @param {function} [options.afterDraw] 图片载入画布之后调用
|
|
57
|
-
* @param {
|
|
58
|
-
* @param {AjaxOptions} [options.ajaxOptions] ajax 请求配置项,当传入的图片为字符串时才会触发请求。
|
|
56
|
+
* @param {AjaxOptions} [options.ajaxOptions] ajax 请求配置项,当传入图片地址时才会触发ajax请求。
|
|
59
57
|
* @returns {Promise<Blob | string>} blob 对象 或 data url 图片
|
|
60
58
|
* @example
|
|
61
59
|
*
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
type Options = {
|
|
2
|
-
/** @deprecated */
|
|
3
|
-
char?: string;
|
|
4
2
|
spaceMark?: string;
|
|
5
3
|
length?: number;
|
|
6
4
|
};
|
|
@@ -26,7 +24,7 @@ type Options = {
|
|
|
26
24
|
* // 脱敏银行卡
|
|
27
25
|
* formatBankCard('6228********890'); // 6228 **** **** 890
|
|
28
26
|
*
|
|
29
|
-
* //
|
|
27
|
+
* // 自定义间隔符
|
|
30
28
|
* formatBankCard('6228480402564890', {spaceMark: '-'}); // 6228-4804-0256-4890
|
|
31
29
|
*
|
|
32
30
|
*/
|
package/types/formatMobile.d.ts
CHANGED
package/types/getImageInfo.d.ts
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import loadImageWithBlob from './loadImageWithBlob';
|
|
2
|
-
type Result = {
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
contrast: string;
|
|
6
|
-
measure: string;
|
|
7
|
-
size: string;
|
|
8
|
-
bytes: number;
|
|
9
|
-
image: HTMLImageElement;
|
|
10
|
-
blob: Blob;
|
|
11
|
-
};
|
|
12
2
|
/**
|
|
13
3
|
* @typedef {Object} ImageInfo 图片信息
|
|
14
4
|
* @property {number} width 宽度
|
|
@@ -29,7 +19,6 @@ type Result = {
|
|
|
29
19
|
* @alias module:Other.getImageInfo
|
|
30
20
|
* @since 4.20.0
|
|
31
21
|
* @param {string | Blob} img 图片地址或 blob 对象
|
|
32
|
-
* @param {boolean | CacheOptions} [cacheOptions=true] 是否使用缓存。开启后,自动缓存最近上一次成功的结果,当图片地址或 blob 对象一致时,直接返回该缓存。避免连续请求同一个图片资源,重复加载。当缓存下一次成功加载的图片时,会自动释放上一次缓存的图片,也可以通过 `autoRevokeOnDel` 设置不释放缓存。
|
|
33
22
|
* @param {AjaxOptions} [ajaxOptions] ajax 请求配置项,当传入的图片为字符串时才会触发请求。
|
|
34
23
|
* @returns {Promise<ImageInfo>} 图片信息
|
|
35
24
|
* @example
|
|
@@ -47,5 +36,14 @@ type Result = {
|
|
|
47
36
|
* });
|
|
48
37
|
*
|
|
49
38
|
*/
|
|
50
|
-
declare function getImageInfo(img: string | Blob,
|
|
39
|
+
declare function getImageInfo(img: string | Blob, ajaxOptions?: Parameters<typeof loadImageWithBlob>[1]): Promise<{
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
contrast: string;
|
|
43
|
+
measure: string;
|
|
44
|
+
size: string;
|
|
45
|
+
bytes: number;
|
|
46
|
+
image: HTMLImageElement;
|
|
47
|
+
blob: Blob;
|
|
48
|
+
}>;
|
|
51
49
|
export default getImageInfo;
|
package/types/index.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ export { default as isIPv6 } from './isIPv6';
|
|
|
22
22
|
export { default as isUrl } from './isUrl';
|
|
23
23
|
export { default as isBusinessLicense } from './isBusinessLicense';
|
|
24
24
|
export { default as validatePassword } from './validatePassword';
|
|
25
|
-
export { default as isPromiseLike } from './isPromiseLike';
|
|
26
25
|
export { default as isHMCard } from './isHMCard';
|
|
27
26
|
export { default as isTWCard } from './isTWCard';
|
|
28
27
|
export { default as isSwiftCode } from './isSwiftCode';
|
|
@@ -39,11 +38,9 @@ export { default as replaceChar } from './replaceChar';
|
|
|
39
38
|
export { default as numberToChinese } from './numberToChinese';
|
|
40
39
|
export { default as bytesToSize } from './bytesToSize';
|
|
41
40
|
export { default as parseIdCard } from './parseIdCard';
|
|
42
|
-
export { default as blobToDataURL } from './blobToDataURL';
|
|
43
41
|
export { default as fileReader } from './fileReader';
|
|
44
42
|
export { default as dataURLToBlob } from './dataURLToBlob';
|
|
45
43
|
export { default as setDataURLPrefix } from './setDataURLPrefix';
|
|
46
|
-
export { default as normalizeString } from './normalizeString';
|
|
47
44
|
export { default as safeDate } from './safeDate';
|
|
48
45
|
export { default as formatMobile } from './formatMobile';
|
|
49
46
|
export { default as padZero } from './padZero';
|
|
@@ -111,7 +108,6 @@ export { default as loadImageWithBlob } from './loadImageWithBlob';
|
|
|
111
108
|
export { default as loadScript } from './loadScript';
|
|
112
109
|
export { default as randomString } from './randomString';
|
|
113
110
|
export { default as strlen } from './strlen';
|
|
114
|
-
export { default as waitTime } from './waitTime';
|
|
115
111
|
/**
|
|
116
112
|
* 树结构数据查询、过滤、转换等处理方法
|
|
117
113
|
*
|
|
@@ -135,8 +131,4 @@ export { default as findTreeSelect } from './findTreeSelect';
|
|
|
135
131
|
export { setDisableWarning } from './utils/config';
|
|
136
132
|
import VERSION from './VERSION';
|
|
137
133
|
export { VERSION };
|
|
138
|
-
/**
|
|
139
|
-
* @deprecated 即将废弃,请使用 `VERSION`
|
|
140
|
-
*/
|
|
141
|
-
export declare const version: string;
|
|
142
134
|
export { default as AsyncMemo } from './AsyncMemo';
|
package/types/loadImage.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} CacheOptions 缓存配置
|
|
3
|
-
* @property {boolean} [useCache=true] 是否使用缓存
|
|
4
|
-
* @property {boolean} [autoRevokeOnDel=true] 删除时自动释放缓存
|
|
5
|
-
* @property {string} [cacheKey] 缓存键
|
|
6
|
-
*/
|
|
7
1
|
/**
|
|
8
2
|
* 加载图片。
|
|
9
3
|
*
|
|
@@ -13,7 +7,6 @@
|
|
|
13
7
|
* @alias module:Other.loadImage
|
|
14
8
|
* @since 4.20.0
|
|
15
9
|
* @param {string | Blob} img 图片地址或 blob 对象
|
|
16
|
-
* @param {boolean | CacheOptions} [cacheOptions=true] 是否使用缓存。开启后,自动缓存最近上一次成功的结果,当图片地址或 blob 对象一致时,直接返回该缓存。避免连续请求同一个图片资源,重复加载。当缓存下一次成功加载的图片时,会自动释放上一次缓存的图片,也可以通过 `autoRevokeOnDel` 设置不释放缓存。
|
|
17
10
|
* @returns {Promise<HTMLImageElement>} HTML图片元素
|
|
18
11
|
* @example
|
|
19
12
|
*
|
|
@@ -30,9 +23,5 @@
|
|
|
30
23
|
* });
|
|
31
24
|
*
|
|
32
25
|
*/
|
|
33
|
-
declare function loadImage(img: string | Blob
|
|
34
|
-
useCache?: boolean;
|
|
35
|
-
cacheKey?: string;
|
|
36
|
-
autoRevokeOnDel?: boolean;
|
|
37
|
-
}): Promise<HTMLImageElement>;
|
|
26
|
+
declare function loadImage(img: string | Blob): Promise<HTMLImageElement>;
|
|
38
27
|
export default loadImage;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import getFileBlob from './getFileBlob';
|
|
2
|
-
type Result = {
|
|
3
|
-
image: HTMLImageElement;
|
|
4
|
-
blob: Blob;
|
|
5
|
-
};
|
|
6
2
|
/**
|
|
7
3
|
* @typedef {Object} ImageWithBlob HTML图片元素和 blob 对象
|
|
8
4
|
* @property {HTMLImageElement} image HTML图片元素
|
|
@@ -11,13 +7,14 @@ type Result = {
|
|
|
11
7
|
/**
|
|
12
8
|
* 加载图片,返回图片元素和 blob 对象。
|
|
13
9
|
*
|
|
10
|
+
* 如果传入图片地址,将通过 ajax 请求转为 blob 格式。
|
|
11
|
+
*
|
|
14
12
|
* <em style="font-weight: bold;">注意:该方法仅适用于浏览器端。</em>
|
|
15
13
|
*
|
|
16
14
|
* @method
|
|
17
15
|
* @alias module:Other.loadImageWithBlob
|
|
18
16
|
* @since 4.20.0
|
|
19
17
|
* @param {string | Blob} img 图片地址或 blob 对象
|
|
20
|
-
* @param {boolean | CacheOptions} [cacheOptions=true] 是否使用缓存。开启后,自动缓存最近上一次成功的结果,当图片地址或 blob 对象一致时,直接返回该缓存。避免连续请求同一个图片资源,重复加载。当缓存下一次成功加载的图片时,会自动释放上一次缓存的图片,也可以通过 `autoRevokeOnDel` 设置不释放缓存。
|
|
21
18
|
* @param {AjaxOptions} [ajaxOptions] ajax 请求配置项,当传入的图片为字符串时才会触发请求。
|
|
22
19
|
* @returns {Promise<ImageWithBlob>} HTML图片元素和 blob 对象
|
|
23
20
|
* @example
|
|
@@ -35,9 +32,8 @@ type Result = {
|
|
|
35
32
|
* });
|
|
36
33
|
*
|
|
37
34
|
*/
|
|
38
|
-
declare function loadImageWithBlob(img: string | Blob,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, ajaxOptions?: Parameters<typeof getFileBlob>[1]): Promise<Result>;
|
|
35
|
+
declare function loadImageWithBlob(img: string | Blob, ajaxOptions?: Parameters<typeof getFileBlob>[1]): Promise<{
|
|
36
|
+
image: HTMLImageElement;
|
|
37
|
+
blob: Blob;
|
|
38
|
+
}>;
|
|
43
39
|
export default loadImageWithBlob;
|
package/esm/blobToDataURL.js
DELETED
package/esm/isPromiseLike.js
DELETED
package/esm/normalizeString.js
DELETED
package/esm/waitTime.js
DELETED
package/lib/blobToDataURL.js
DELETED
package/lib/isPromiseLike.js
DELETED
package/lib/normalizeString.js
DELETED
package/lib/waitTime.js
DELETED
package/types/blobToDataURL.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 将 Blob 或 File 对象转成 data:URL 格式的 Base64 字符串
|
|
3
|
-
*
|
|
4
|
-
* <em style="font-weight: bold;">注意:该方法仅适用于浏览器端。</em>
|
|
5
|
-
*
|
|
6
|
-
* @ignore
|
|
7
|
-
* @static
|
|
8
|
-
* @alias module:Processor.blobToDataURL
|
|
9
|
-
* @since 4.1.0
|
|
10
|
-
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/FileReader/readAsDataURL FileReader.readAsDataURL()}
|
|
11
|
-
* @deprecated 请使用 `fileReader` 方法
|
|
12
|
-
* @param {Blob} blob Blob 或 File 对象
|
|
13
|
-
* @returns {Promise<string>} data:URL 格式的 Base64 字符串。
|
|
14
|
-
* @example
|
|
15
|
-
* const aFileParts = ['<a id="a"><b id="b">hey!</b></a>']; // 一个包含DOMString的数组
|
|
16
|
-
* const htmlBlob = new Blob(aFileParts, { type: 'text/html' }); // 得到 blob
|
|
17
|
-
*
|
|
18
|
-
* blobToDataURL(htmlBlob).then(data=>{
|
|
19
|
-
* console.log(data); // data:text/html;base64,PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* const textBlob = new Blob(aFileParts, { type: 'text/plain' });
|
|
23
|
-
*
|
|
24
|
-
* blobToDataURL(textBlob).then(data=>{
|
|
25
|
-
* console.log(data); // data:text/plain;base64,PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=
|
|
26
|
-
* });
|
|
27
|
-
*/
|
|
28
|
-
declare function blobToDataURL(blob: Blob): Promise<string>;
|
|
29
|
-
export default blobToDataURL;
|
package/types/isPromiseLike.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 检测值是否类似Promise对象
|
|
3
|
-
*
|
|
4
|
-
* @ignore
|
|
5
|
-
* @static
|
|
6
|
-
* @alias module:Validator.isPromiseLike
|
|
7
|
-
* @since 3.8.0
|
|
8
|
-
* @deprecated 即将废弃,请使用 `import { isPromiseLike } 'ut2'`
|
|
9
|
-
* @param {*} obj 要检测的值
|
|
10
|
-
* @returns {boolean} 是否类似Promise对象
|
|
11
|
-
* @example
|
|
12
|
-
*
|
|
13
|
-
* isPromiseLike([]); // false
|
|
14
|
-
* isPromiseLike({ then: () => { } }); // true
|
|
15
|
-
* isPromiseLike(Promise.resolve()); // true
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
declare function isPromiseLike(obj: any): boolean;
|
|
19
|
-
export default isPromiseLike;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 规整化字符串。如果值为 undefined 或 null 将转为空字符串,如果值不是字符串类型将转为字符串。
|
|
3
|
-
*
|
|
4
|
-
* @ignore
|
|
5
|
-
* @static
|
|
6
|
-
* @alias module:Processor.normalizeString
|
|
7
|
-
* @since 4.3.0
|
|
8
|
-
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String#string_instances String}
|
|
9
|
-
* @deprecated 即将废弃,请使用 `import { toString } 'ut2'`
|
|
10
|
-
* @param {*} value 待处理的值
|
|
11
|
-
* @returns {string} 规整化的值
|
|
12
|
-
* @example
|
|
13
|
-
*
|
|
14
|
-
* normalizeString(); // ''
|
|
15
|
-
* normalizeString(undefined); // ''
|
|
16
|
-
* normalizeString(void 0); // ''
|
|
17
|
-
* normalizeString(null); // ''
|
|
18
|
-
*
|
|
19
|
-
* normalizeString(true); // 'true'
|
|
20
|
-
* normalizeString(NaN); // 'NaN'
|
|
21
|
-
* normalizeString(1); // '1'
|
|
22
|
-
* normalizeString('a'); // 'a'
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
declare function normalizeString(value: any): string;
|
|
26
|
-
export default normalizeString;
|
package/types/utils/Cache.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Emitter from 'emitter-pro';
|
|
2
|
-
type Options = {
|
|
3
|
-
max: number;
|
|
4
|
-
};
|
|
5
|
-
declare class Cache<V = any, K = any> extends Emitter<(v: V, k: K) => void> {
|
|
6
|
-
private data;
|
|
7
|
-
private options;
|
|
8
|
-
constructor(options?: Options);
|
|
9
|
-
has(k: K): boolean;
|
|
10
|
-
get(k: K): V | undefined;
|
|
11
|
-
private checkLimit;
|
|
12
|
-
set(k: K, v: V): void;
|
|
13
|
-
}
|
|
14
|
-
export default Cache;
|
package/types/waitTime.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 等待时间返回 Promise 。常用于异步方法中延时。
|
|
3
|
-
*
|
|
4
|
-
* @ignore
|
|
5
|
-
* @static
|
|
6
|
-
* @alias module:Other.waitTime
|
|
7
|
-
* @since 4.2.0
|
|
8
|
-
* @deprecated 即将废弃,请使用 `import { sleep } from 'ut2'`
|
|
9
|
-
* @param {number} [time=1000] 延时时间,单位毫秒
|
|
10
|
-
* @returns {Promise<void>}
|
|
11
|
-
* @example
|
|
12
|
-
*
|
|
13
|
-
* const test = async ()=>{
|
|
14
|
-
* await waitTime();
|
|
15
|
-
* // do something
|
|
16
|
-
* }
|
|
17
|
-
*
|
|
18
|
-
* waitTime(500).then(()=>{
|
|
19
|
-
* // do something
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
declare function waitTime(time?: number): Promise<void>;
|
|
24
|
-
export default waitTime;
|