TypeScript type prettier
September 2024
TypeScript helper from Matt Pocock to reveal type details.
type ThemeMode = {
mode: "light" | "dark";
};
type ThemeColor = {
color: string;
};
type Theme = ThemeMode & ThemeColor;
For Theme type above, hover over it in VS Code, it does not actually drill into the actual type details.
With the following helper
type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
VS Code shows type details.