Skip to content

Instantly share code, notes, and snippets.

@tomfa
Created May 16, 2025 18:06
Show Gist options
  • Save tomfa/4b5c081fe28a7e87acf6fc32691b4710 to your computer and use it in GitHub Desktop.
Save tomfa/4b5c081fe28a7e87acf6fc32691b4710 to your computer and use it in GitHub Desktop.
Prettify Typescript Props
// 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