There are plenty of parametrized type aliases that are used in typescript and it can sometimes be difficult to determine what the actual type is below all the abstraction layers. Is there some way to normalize a concrete type remove all type aliases from it?
For example, if I have these types:
type Maybe<T> = T | null
type Num = number
type Base = {
a: Num
b: boolean
c: Maybe<{ x: Num }>
}
type Hello = Pick<Base, 'a' | 'c'>
I want some way to show that Hello
is the same as:
type Hello = {
a: number
c: { x: number } | null
}
I am also interested in if there is a way to do shallow normalization and convert Pick<Base, 'a' | 'c'>
into
type Hello = {
a: Num
c: Maybe<{ x: Num}>
}