Created
May 16, 2025 18:06
-
-
Save tomfa/4b5c081fe28a7e87acf6fc32691b4710 to your computer and use it in GitHub Desktop.
Prettify Typescript Props
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
// Util type to simplify how types are rendered in editor | |
// https://www.youtube.com/watch?v=lraHlXpuhKs&t=420s | |
type Prettify<T> = { | |
[K in keyof T]: T[K]; | |
}; | |
type ComplexType = { a: boolean } & Omit<{ b: number, c: number}, 'c'>; | |
type FlattenedType = Prettify<ComplexType> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment