Relative Content

Tag Archive for typescriptvisual-studio-code

Type guard with generic types

I am implementing an API model that can return two possible types of outputs based on if the response was returned correctly or not.

In typescript, there is no autocompletion for intersection types in vscode

When I extend the interface type, I can get “Add mission properties”enter image description here
However, when I use intersection types, I don’t get “Add mission properties”.
enter image description here
What did I do wrong?
Thanks!
version information
Typescript:5.4.5
Vscode:1.89.1

How to see output of the typescript compile log in vscode

I want to print the output of the process that vscode’s default typescript compiles .ts files. Like I excute the command ‘node ./node_modules/typescript/lib/tsc.js –watch –extendedDiagnostics’ in terminal. And how should I configure vscode?