We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We can do this:
memberName: { [index: number]: string };
And then use enums as index signature parameters, since they are some kind of numbers:
this.memberName[EnumType.EnumMember] = "";
But the language does not allow defining the index signature parameters to be an enum type, like this:
memberName: { [index: EnumType]: string };
Which can be used the same way, and the compiler can check that the references are all using the EnumType, not an arbitrary number.
The text was updated successfully, but these errors were encountered:
See #2491
Sorry, something went wrong.
No branches or pull requests
We can do this:
And then use enums as index signature parameters, since they are some kind of numbers:
But the language does not allow defining the index signature parameters to be an enum type, like this:
Which can be used the same way, and the compiler can check that the references are all using the EnumType, not an arbitrary number.
The text was updated successfully, but these errors were encountered: