Skip to content

Instantly share code, notes, and snippets.

@alaindet
Created January 6, 2026 08:08
Show Gist options
  • Select an option

  • Save alaindet/aac4eac4547950fa12c172d5db9ffb12 to your computer and use it in GitHub Desktop.

Select an option

Save alaindet/aac4eac4547950fa12c172d5db9ffb12 to your computer and use it in GitHub Desktop.
Prettify TypeScript types in code
/**
* https://www.youtube.com/watch?v=q5DFpyIN5Xs&t=180s
*
* This type helps resolve complex TypeScript types in simpler readable types
*
* - Take a layered complex type (extending multiple types, using generics, inheriting etc.)
* - Create a dummy type via Prettify (type Dummy = Prettify<ComplexType>)
* - Hover with the mouse on the dummy type to see the "resolved" type
*/
export type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment