5

I am looking for a way to view the types that TypeScript resolves the declared types to (ie. for Generics). I use VS Code, and oftentimes a Union or Intersection or other Generic results in the mouseover having information such as:

(property) Workspace: Pick<{
    __typename?: "a" | undefined;
} & {
    __typename?: "b" | undefined;
} & Pick<typeA, "id" | ... 4 more ... | "state"> & {
    ...;
}, "__typename" | ... 4 more ... | "state"> & Pick<...>

And I know that VS Code must have the full type information, because when I try to use the type incorrectly, I'll get an error like Property 'goo' does not exist on type '...'

I'm hoping there's either a way to do this with some sort of console.log(someUtilityFunction(type)) or some vscode setting or extension?

ehiller
  • 1,346
  • 17
  • 32
  • Does this answer your question? [How to get property info by using the Typescript language service](https://stackoverflow.com/questions/28692515/how-to-get-property-info-by-using-the-typescript-language-service) – JC Olivares Jan 18 '20 at 10:49
  • Does this answer your question? [How can I see the full expanded contract of a Typescript type?](https://stackoverflow.com/questions/57683303/how-can-i-see-the-full-expanded-contract-of-a-typescript-type) – superjos Jul 12 '23 at 14:00

0 Answers0