Comparing version 1.0.1 to 1.0.2
@@ -0,1 +1,7 @@ | ||
## 1.0.2 | ||
2023-07-31 | ||
- 🆕 Added `rawType` accessor | ||
## 1.0.1 | ||
@@ -2,0 +8,0 @@ |
@@ -48,2 +48,3 @@ import type { BooleanFirstOptionConfig, IEnumValues, ObjectFirstOptionConfig, OptionsConfig, EnumInit, EnumKey, EnumOption, EnumValue, ValueTypeFromSingleInit, ColumnFilterItem } from './types'; | ||
get keyType(): K; | ||
get rawType(): T[K]; | ||
} |
@@ -96,2 +96,5 @@ import { KEYS, VALUES } from './index'; | ||
} | ||
get rawType() { | ||
return this.values.rawType; | ||
} | ||
} | ||
@@ -98,0 +101,0 @@ function parseEnumItem(init, key) { |
@@ -43,2 +43,6 @@ import type { EnumItemClass } from './enum-item'; | ||
get keyType(): K; | ||
/** | ||
* @deprecated Stub方法,不支持直接调用 | ||
*/ | ||
get rawType(): T[K]; | ||
} |
@@ -112,4 +112,10 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { | ||
} | ||
/** | ||
* @deprecated Stub方法,不支持直接调用 | ||
*/ | ||
get rawType() { | ||
throw new Error('枚举的rawType属性仅允许用来声明ts类型,不能在运行时访问! 在ts类型中请配合`typeof`运算符使用,例如: typeof Week.rawType'); | ||
} | ||
} | ||
_EnumValuesArray_raw = new WeakMap(), _EnumValuesArray_optionsConfigDefaults = new WeakMap(); | ||
//# sourceMappingURL=enum-values.js.map |
@@ -151,2 +151,6 @@ import type { KEYS, VALUES } from './index'; | ||
keyType: K; | ||
/** | ||
* 枚举项原始初始化对象的类型,如果在枚举项上增加了自定义字段的话,可以用这种方式获取到。 | ||
*/ | ||
rawType: T[K]; | ||
} | ||
@@ -153,0 +157,0 @@ export declare type EnumInit<K extends keyof any = string, V extends EnumValue = EnumValue> = NumberEnumInit<K> | StringEnumInit<K> | StandardEnumInit<K, V> | ValueOnlyEnumInit<K, V> | LabelOnlyEnumInit<K> | CompactEnumInit<K> | OmitEnumInit<K>; |
@@ -48,2 +48,3 @@ import type { BooleanFirstOptionConfig, IEnumValues, ObjectFirstOptionConfig, OptionsConfig, EnumInit, EnumKey, EnumOption, EnumValue, ValueTypeFromSingleInit, ColumnFilterItem } from './types'; | ||
get keyType(): K; | ||
get rawType(): T[K]; | ||
} |
@@ -99,2 +99,5 @@ "use strict"; | ||
} | ||
get rawType() { | ||
return this.values.rawType; | ||
} | ||
} | ||
@@ -101,0 +104,0 @@ exports.EnumCollectionClass = EnumCollectionClass; |
@@ -43,2 +43,6 @@ import type { EnumItemClass } from './enum-item'; | ||
get keyType(): K; | ||
/** | ||
* @deprecated Stub方法,不支持直接调用 | ||
*/ | ||
get rawType(): T[K]; | ||
} |
@@ -115,2 +115,8 @@ "use strict"; | ||
} | ||
/** | ||
* @deprecated Stub方法,不支持直接调用 | ||
*/ | ||
get rawType() { | ||
throw new Error('枚举的rawType属性仅允许用来声明ts类型,不能在运行时访问! 在ts类型中请配合`typeof`运算符使用,例如: typeof Week.rawType'); | ||
} | ||
} | ||
@@ -117,0 +123,0 @@ exports.EnumValuesArray = EnumValuesArray; |
@@ -151,2 +151,6 @@ import type { KEYS, VALUES } from './index'; | ||
keyType: K; | ||
/** | ||
* 枚举项原始初始化对象的类型,如果在枚举项上增加了自定义字段的话,可以用这种方式获取到。 | ||
*/ | ||
rawType: T[K]; | ||
} | ||
@@ -153,0 +157,0 @@ export declare type EnumInit<K extends keyof any = string, V extends EnumValue = EnumValue> = NumberEnumInit<K> | StringEnumInit<K> | StandardEnumInit<K, V> | ValueOnlyEnumInit<K, V> | LabelOnlyEnumInit<K> | CompactEnumInit<K> | OmitEnumInit<K>; |
{ | ||
"name": "enum-plus", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A powerful enum library, like typescript enum but more than that", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
88010
1701