@airpower/enum 0.0.6 → 0.0.8

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.
@@ -9,27 +9,17 @@ export declare class Enum<K extends EnumKey = number> implements IEnum<K> {
9
9
  /**
10
10
  * ### 枚举的值
11
11
  */
12
- key: K;
12
+ readonly key: K;
13
13
  /**
14
14
  * ### 枚举的描述
15
15
  */
16
- label?: string;
16
+ readonly label?: string;
17
17
  /**
18
18
  * ### 实例化创建一个枚举项目
19
19
  * @param key 枚举值
20
20
  * @param label 枚举描述
21
21
  */
22
22
  constructor(key: K, label?: string);
23
- /**
24
- * ### 创建一个只包含 `key` 的枚举
25
- * @param key `Key`
26
- */
27
- static key<K extends EnumKey = number, E extends Enum<K> = Enum<K>>(this: EnumConstructor<K, E>, key: K): E;
28
- /**
29
- * ### 创建一个 `key` 和 `label` 相同的字符串枚举
30
- * @param label 标签
31
- */
32
- static label<E extends Enum<string> = Enum<string>>(this: EnumConstructor<string, E>, label: string): E;
33
23
  /**
34
24
  * ### 查找一个枚举选项
35
25
  * @param key `Key`
package/dist/main.js CHANGED
@@ -21,20 +21,6 @@ class Enum {
21
21
  this.label = label;
22
22
  }
23
23
  }
24
- /**
25
- * ### 创建一个只包含 `key` 的枚举
26
- * @param key `Key`
27
- */
28
- static key(key) {
29
- return new this(key);
30
- }
31
- /**
32
- * ### 创建一个 `key` 和 `label` 相同的字符串枚举
33
- * @param label 标签
34
- */
35
- static label(label) {
36
- return new this(label, label);
37
- }
38
24
  /**
39
25
  * ### 查找一个枚举选项
40
26
  * @param key `Key`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airpower/enum",
3
3
  "type": "module",
4
- "version": "0.0.6",
4
+ "version": "0.0.8",
5
5
  "description": "AirPower-Enum 是一个基于 TypeScript 的封装的类似 Java 枚举类的枚举字典处理工具。",
6
6
  "author": {
7
7
  "name": "Hamm",