In my project it happens in multiple occasion that TypeScript show to me an uninterpreted type.
Example :
In the following code, hovering over Foo will give to me the following result :
interface FooParent {
fish: {
catfish: string;
}[];
}
type Foo = {
test: FooParent['fish'][0];
};
If I want to know about the type of FooParent['fish'][0], I have to interpret it myself.
I saw that it is possible to trick TypeScript using the infer keywork :
interface FooParent {
fish: {
catfish: string;
}[];
}
type Foo = {
test: FooParent['fish'][0] extends infer U ? { [P in keyof U]: U[P] } : never;
};
But it's unpredictable (Playground).
Do you know of any method allowing TypeScript to show to you the final type of the variable you are hovering on in a simple and reliable way ?


