We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4209a52 commit cfe9c77Copy full SHA for cfe9c77
src/index.ts
@@ -3,7 +3,7 @@ export function Enum<
3
T extends { [_: string]: V },
4
V extends string
5
>(definition: T): T;
6
-export function Enum(...values: any[]): any {
+export function Enum(...values: any[]): object {
7
if (typeof values[0] === "string") {
8
const result: any = {};
9
for (const value of values) {
@@ -15,4 +15,4 @@ export function Enum(...values: any[]): any {
15
}
16
17
18
-export type Enum<T> = T[keyof T];
+export type Enum<T extends object> = T[keyof T];
0 commit comments