Skip to content

Commit 916c97f

Browse files
committed
fix: extension.d.ts was missing in output, the second try
1 parent bc343ce commit 916c97f

File tree

4 files changed

+43
-34
lines changed

4 files changed

+43
-34
lines changed

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,25 @@
22

33
# enum-plus Changelog
44

5+
## 2.4.2
6+
7+
2025-7-8
8+
9+
### Bug Fixes
10+
11+
- 🐞 Fix the issue where `lib/extension.d.ts` was missing, which caused all enum types to default to `any`.
12+
513
## 2.4.1
614

715
2025-7-7
816

917
### Bug Fixes
1018

11-
- 🐞 Fix the issue where `lib/extension.d.ts` was missing, which caused all enum types to default to any.
19+
- 🐞 Fix `lib/extension.d.ts` missing issue, but failed. Please use `v2.4.2` instead.
1220

1321
## 2.4.0
1422

15-
> ⚠️ This version has a critical issue, please use `v2.4.1` instead.
23+
> ⚠️ This version has a critical issue, please use `v2.4.2` instead.
1624
1725
2025-7-6
1826

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "enum-plus",
3-
"version": "2.4.1",
3+
"version": "2.4.2",
44
"description": "A drop-in replacement for native enum. Like native enum but much better!",
55
"keywords": [
66
"enum",

src/extension.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/index.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { BuiltInLocaleKeys, EnumInit, EnumKey, EnumValue, ValueTypeFromSingleInit } from './types';
2+
13
export type {
24
EnumInit,
35
EnumItemInit,
@@ -19,3 +21,33 @@ export type { IEnum, EnumInterface } from './enum';
1921

2022
export { KEYS, ITEMS, VALUES, ENUM_ITEM, ENUM_ITEMS, ENUM_COLLECTION, defaultLocalize } from './utils';
2123
export { 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

Comments
 (0)