We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I am using Omit it takes two parameters
Now when I try to do this I get no intellisense / autocompletion that hey these are the keys which are present in the Object type.
This can be reproduce in the this ts playground link
Screen shot for reference
type BetterOmit<T extends Record<any, any>, K extends keyof T> = { [P in T as P extends K ? never : P]: T[P] }
All we need to do is add extends clause to the second Param which will give intellisense.
I can add this to the repo but need suggestion or reasoning behind the current implementation
The text was updated successfully, but these errors were encountered:
See #30825, #54451, #53169
Sorry, something went wrong.
Omit isn't constrained on K (this is intentional), so there's no information to provide that hint from
K
This issue has been marked as "Not a Defect" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
This should be a bug. Please reopen and fix it. It makes no sense to have no intelisense on Omit.
https://github.com/microsoft/TypeScript/wiki/FAQ#add-a-key-constraint-to-omit
https://github.com/microsoft/TypeScript/wiki/FAQ#this-is-closed-but-should-be-open-or-vice-versa
No branches or pull requests
Acknowledgement
Comment
Description
When I am using Omit it takes two parameters
Now when I try to do this I get no intellisense / autocompletion that hey these are the keys which are present in the Object type.
Reproduction
This can be reproduce in the this ts playground link
Screen shot for reference
Solution
All we need to do is add extends clause to the second Param which will give intellisense.
I can add this to the repo but need suggestion or reasoning behind the current implementation
The text was updated successfully, but these errors were encountered: