Last active
November 2, 2022 14:15
-
-
Save DimitryDushkin/7bf7741810492e8d8fa088740360eca1 to your computer and use it in GitHub Desktop.
$Values from Flow in 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 $Values<O extends object> = O[keyof O]; | |
const obj = { | |
RU: 'ru', | |
EN: 'en', | |
} as const; | |
type vals = $Values<typeof obj>; // vals === 'ru' | 'en'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome! thank you Dimitry