Skip to content
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

Suggestion: Index signatures that exclude certain names #36782

Closed
5 tasks done
amcasey opened this issue Feb 13, 2020 · 3 comments
Closed
5 tasks done

Suggestion: Index signatures that exclude certain names #36782

amcasey opened this issue Feb 13, 2020 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@amcasey
Copy link
Member

amcasey commented Feb 13, 2020

Search Terms

index signatures, else, negation

Suggestion

Most immediately inspired by https://github.com/mui-org/material-ui/blob/01b8b09fd6a28d6092ad0b192305ebe8e11c97ea/packages/material-ui-styles/src/withStyles/withStyles.d.ts#L38. The goal is to say that "this type contains all the properties of the base type and for any other property name a CreateCSSProperties will be returned".

I can imagine implementing this as either an "anything else" signature or as an explicit/computed list of excluded names (the added flexibility of which may or may not be desirable).

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@amcasey
Copy link
Member Author

amcasey commented Feb 13, 2020

I've previously discussed this with @RyanCavanaugh

@jcalz
Copy link
Contributor

jcalz commented Feb 14, 2020

Duplicate of #17867

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Feb 21, 2020
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants