-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
microsoft/TypeScript-Handbook
#963Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
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:
enum Kind {
none,
bob
}
interface SomeJsonData {
kind: keyof Kind;
insteadOfKind: "none" | "bob";
}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.
amsakanna
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code