-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Add Omit<T,K> and Diff<T,U> to lib.d.ts #19569
Comments
Awesome type operators... even if it doesn't get included thanks for the ideas. |
Oh, maybe I should have made it clear. These are not mine, I found them buried deep in a conversation once but I managed to find them again here: #12215 (comment) It also have this great type which I had totally forgotten as it's hard to find that specific comment via Google. type Overwrite<T, U> = { [P in Diff<keyof T, keyof U>]: T[P] } & U; |
As i noted in the |
@mhegazy Without any doubt it will be a great solution, but if it won't go in the foreseen TS version, then Required can be a nice workaround meanwhile. |
See #21316. |
@ahejlsberg Conditional types would be awesome and solve many problems but this issue is just about integrating types already writeable (and already written in many |
@Pajn Understood. The link was merely to point out there's now a better way to implement these types. |
Ah, yes that's possible. I just wanted to be clear that I don't think this issue should be closed by #21316. I don't want to sound negative though, I'm super excited by conditional types in itself! |
As spread and rest types is taking time I usually have to copy these types in projects. They solve the primary use case for spread/rest types and works today. I think they should fit right in next to Pick and Partial.
And even when (if?) spread and rest types is merged these would still arguably have some value.
The text was updated successfully, but these errors were encountered: