-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyof Enum #14106
Comments
Just to clarify, I think that the question is "Why do I get a bunch of string literals named after methods on numbers instead of An enum declaration actually declares two types:
So if you're looking for |
This can have credit if:
But, are really expecting this to append when you write keyof Enum ? As I undertant, one part of your argumentation go again js (no Kind type in js). If you really expect number prototype enumeration when you write that: keyof King... Sorry sir, I think you think weard |
This post tell me: |
@DanielRosenwasser Your answer was very helpful! However, I get an error using a Is there a workaround for this problem or do I need to submit a feature request? |
Hi,
I ve seen a post over this particular suggestion, but I did not understant why (in typescript, not in js)
why this kind of behavior is not expected on keyof over enum:
Just saying that because it was my first reflex trying keyof over enums out of Partial or Readonly's.
Enum are not part of ecmascript (as I know) so keyof applyed to typescript should have a typescript specific behavior.
I also did not expect keyof returns number values, but if it does, still make more sense than current behavior.
Cheers.
The text was updated successfully, but these errors were encountered: