Created
February 12, 2019 16:37
-
-
Save webstrand/0a7be6a60c01c5e619b49fa430203aa6 to your computer and use it in GitHub Desktop.
Typescript: An array of keys of some object extending some type.
This file contains 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 KeyofSubset<T, U> = Array<({ [P in keyof T]: T[P] extends U ? P : never })[keyof T]>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment