@ceale/util 1.9.1 → 1.10.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.
@@ -1,21 +1,18 @@
1
1
  import type { CSSProperties } from "vue";
2
2
  import type { AtRules } from "csstype";
3
3
  export declare namespace css {
4
- const RuleValueSymbol: unique symbol;
5
4
  type RuleValue = string & {
6
- [RuleValueSymbol]: never;
5
+ RuleValue: never;
7
6
  };
8
- const RuleBlockValueSymbol: unique symbol;
9
7
  type RuleBlockValue = string & {
10
- [RuleBlockValueSymbol]: never;
8
+ RuleBlockValue: never;
11
9
  };
12
- const AtValueSymbol: unique symbol;
13
10
  type AtValue = string & {
14
- [AtValueSymbol]: never;
11
+ AtValue: never;
15
12
  };
16
13
  /**
17
14
  * 从一个样式对象,创建一个 CSS 规则字符串
18
- * @param styles 一个样式对象,使用 Vue 的 `CSSProperties` 类型,同时允许自定义属性
15
+ * @param rule 一个样式规则对象,使用 Vue 的 `CSSProperties` 类型,同时允许自定义属性
19
16
  * @returns 返回类型为`RuleValue`的字符串,可以传入`css.selector()`和`css.at()`
20
17
  *
21
18
  * @example
@@ -3,12 +3,10 @@
3
3
  * @param time 时长,单位为毫秒
4
4
  * @returns void
5
5
  * @alias sleepAsync
6
+ * 如果需要同步的等待方法,请使用`sleep`
6
7
  */
7
8
  export declare const wait: (time: number) => Promise<void>;
8
9
  /**
9
- * 异步地等待指定时间,基于Promise和setTimeout实现
10
- * @param time 时长,单位为毫秒
11
- * @returns void
12
10
  * @alias wait
13
11
  */
14
12
  export declare const sleepAsync: (time: number) => Promise<void>;
@@ -19,14 +17,10 @@ export declare const sleepAsync: (time: number) => Promise<void>;
19
17
  * @param time 时长,单位为毫秒
20
18
  * @returns void
21
19
  * @alias waitSync
20
+ * 如果需要异步的等待方法,请使用`wait`
22
21
  */
23
22
  export declare const sleep: (time: number) => void;
24
23
  /**
25
- * 同步地等待指定时间,基于while和Date.now实现
26
- *
27
- * **请慎用该方法,其可能导致cpu占用过高**
28
- * @param time 时长,单位为毫秒
29
- * @returns void
30
24
  * @alias sleep
31
25
  */
32
26
  export declare const waitSync: (time: number) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ceale/util",
3
3
  "author": "Ceale",
4
- "version": "1.9.1",
4
+ "version": "1.10.0",
5
5
  "module": "index.ts",
6
6
  "type": "module",
7
7
  "main": "dist/esm/index.js",