-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Optional index signature #7118
Comments
An index signature is a "constraint" on a type; i do not understand what an optional constraint means.. Can you elaborate on your case, and what you are trying to achieve here. In your example, all properties should be |
I currently get the error "Index signature is missing in type", what I want to constrain is that all values are |
If your use case isn't solved by #7029, please post some code so we can understand the scenario. Thanks! |
Oh, sorry. Didn't look for already fixed issues, just open :/ |
It should be possible to make the index signature optional like this:
export type Actions = {[type: string]?: Action}
If the index signature is not optional (as I'm required to type right now) I get errors when passing parameters with the Actions type as the index signature is missing in the passed object.
The text was updated successfully, but these errors were encountered: