Created
March 7, 2018 20:39
-
-
Save kourge/acdff64803ecc0cd9a780b1a4993f52d to your computer and use it in GitHub Desktop.
TypeScript: "pick" a subset out of an interface
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
interface Wide { | |
x: number; | |
y: number; | |
z: number; | |
} | |
type Narrow = Pick<Wide, 'x' | 'y'>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment