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

Declare Omit Type #29254

Closed
wants to merge 3 commits into from
Closed

Declare Omit Type #29254

wants to merge 3 commits into from

Conversation

VincentLanglet
Copy link

@VincentLanglet VincentLanglet commented Jan 4, 2019

The Omit type is really usefull and seems to be defined by a lot of typescript users in their project.
But I don't see it in typescript lib.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@VincentLanglet
Copy link
Author

Hello, any feedback about this PR ? 😃

@alitaheri
Copy link

Yeah, I include this in my global .d.ts file for every project. Would be nice to have it in the main lib 👍

@ckknight
Copy link

Yes, I'd much prefer for Omit<T, K> to be part of TypeScript itself rather than having to self-define.

@VincentLanglet
Copy link
Author

@DanielRosenwasser @RyanCavanaugh Hi ! What is the futur of this PR ?

  • We didn't want to conflict with other Omits that had different behavior - and it would conflict with a global.
  • You're going to run into global scope problems anyway.
  • But you might not, so why are you intentionally breaking people?
    All Omit I saw actually are doing the same. And if it's not the case :
  • Others will rename their Omit type.
  • You can call it WhatEverYouWant

This argument doesn't prevented you to create other generic type.
But it will just help 95% of people.

  • But there are at least 2 different versions of Omit that are duplicated over DefinitelyTyped

All I see are 50 duplicate of the same type Omit, or previous declaration without Exclude, but doing the same thing. And you say it, it's duplicated ; let's stop this.

  • Also, this uses Exclude on a generic, so maybe you want to wait for negated types?

What is this ?

@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src'. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src'.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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.

None yet

5 participants