1+ import type { BuiltInLocaleKeys , EnumInit , EnumKey , EnumValue , ValueTypeFromSingleInit } from './types' ;
2+
13export type {
24 EnumInit ,
35 EnumItemInit ,
@@ -19,3 +21,33 @@ export type { IEnum, EnumInterface } from './enum';
1921
2022export { KEYS , ITEMS , VALUES , ENUM_ITEM , ENUM_ITEMS , ENUM_COLLECTION , defaultLocalize } from './utils' ;
2123export { Enum } from './enum' ;
24+
25+ declare global {
26+ /**
27+ * **EN:** Global extension of the enumeration, which can be used to add global extension methods
28+ *
29+ * **CN:** 枚举的全局扩展,可以用来添加全局扩展方法
30+ */
31+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
32+ // @ts -ignore: TS2428: All declarations of 'EnumExtension' must have identical type parameters
33+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
34+ interface EnumExtension <
35+ T extends EnumInit < K , V > ,
36+ K extends EnumKey < T > = EnumKey < T > ,
37+ V extends EnumValue = ValueTypeFromSingleInit < T [ K ] , K > ,
38+ > { }
39+ /**
40+ * **EN:** Enum global localization extension
41+ *
42+ * **CN:** 枚举本地化的全局扩展
43+ */
44+ interface EnumLocaleExtends {
45+ /**
46+ * **EN:** Key values of the localized text of the enumeration, which can be used to enhance the
47+ * intelligent prompt of the editor
48+ *
49+ * **CN:** 枚举本地化文本的Key值,可以用来增强编辑器的智能提示
50+ */
51+ LocaleKeys : BuiltInLocaleKeys ;
52+ }
53+ }
0 commit comments