Created
March 14, 2019 18:40
-
-
Save artakvg/923dab213123f38d323a7f5aa6558b94 to your computer and use it in GitHub Desktop.
some of parameters from original type - Typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Diff<T, U> = T extends U ? never : T; | |
type OptionalExceptFor<T, TRequired extends keyof T> = Partial<T> & Pick<T, TRequired>; | |
type RequiredExceptFor<T, TOptional extends keyof T> = Pick<T, Diff<keyof T, TOptional>> & Partial<T>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment