#When checking type in vscode, it doesn't give the actual type

11 messages · Page 1 of 1 (latest)

knotty shoal
#

When I hover over a type in vscode, sometimes I get the construction of the type as shown in the image instead of the actual object type that gets created in the end. How can I make it show the actual type instead?

upper vault
#

in this case typescript decided that expanding the alias was more "correct"

#

because the type system is structural, it doesn't matter. But there is no trick, aside from using an interface to forcing typescript to use the given type name

ebon yoke
olive sleet
#

You can force it to show with an expand type

#
type Expand<T> = T extends T ? { [K in keyof T]: T[K] } : never
earnest peak
#

that's not what they want

upper vault
upper vault