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

Implement autocomplete for OverrideProperties #712

Merged

Conversation

henriqueinonhe
Copy link
Contributor

@henriqueinonhe henriqueinonhe commented Oct 15, 2023

Fixes #711

@@ -25,5 +25,9 @@ type Fizz = OverrideProperties<Foo, {b: number; c: number}>
*/
export type OverrideProperties<
TOriginal,
TOverride extends {[Key in keyof TOverride]: Key extends keyof TOriginal ? TOverride[Key] : never},
TOverride extends Partial<Record<keyof TOriginal, unknown>> & {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a short code comment about why we do this (to get autocomplete).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! Good call!

@sindresorhus sindresorhus merged commit fcdcfe9 into sindresorhus:main Oct 16, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Implement autocompletion for OverrideProperties
2 participants