@@ -5,26 +5,44 @@ import { ENUM_ITEM } from './utils';
55/**
66 * Enum item class
77 *
8- * @template V General type of value
9- * @template K General type of key
10- * @template T Initialize object of enum item
8+ * @template V General type for item value
9+ * @template K General type for item key
10+ * @template T General type for item initialization object
1111 */
1212export class EnumItemClass <
1313 T extends EnumItemInit < V > ,
1414 // eslint-disable-next-line @typescript-eslint/no-explicit-any
1515 K extends EnumKey < any > = string ,
1616 V extends EnumValue = ValueTypeFromSingleInit < T , K > ,
1717> {
18- /** Enum item value */
18+ /**
19+ * **EN:** The value of the enum item
20+ *
21+ * **CN:** 枚举项的值
22+ */
1923 readonly value : V ;
2024
21- /** Enum item label (or called display name) */
25+ /**
26+ * **EN:** The label of the enum item (also known as display name)
27+ *
28+ * **CN:** 枚举项的标签(亦称显示名称)
29+ */
2230 readonly label : string ;
2331
24- /** Enum item key */
32+ /**
33+ * **EN:** The key of the enum item, which is the key in the initialization object when creating
34+ * the enum collection.
35+ *
36+ * **CN:** 枚举项的键,即创建枚举集合时初始化对象中的键
37+ */
2538 readonly key : K ;
2639
27- /** Original initialization object */
40+ /**
41+ * **EN:** The original initialization object of the enum item, which is the sub-object of a
42+ * single enum item when creating the enum collection.
43+ *
44+ * **CN:** 枚举项的原始初始化对象,即创建枚举集合时单个枚举项的子对象
45+ */
2846 readonly raw : T ;
2947 /**
3048 * **EN:** A boolean value indicates that this is an enum item instance.
0 commit comments