The new version of Visual Studio has good support for typescript, and we can add the typescript file directly to the project, and the IDE will automatically generate the JS file to the TS file's sibling directory while writing the typescript code (note that it only generates , you need to add them to the project manually).
However, using a class library that is already in the project, such as jquery, in typescript, you need to add a claim file (*.d.ts) to the project directory, otherwise IntelliSense will not work correctly.
In addition to writing your own declaration files, there are open source projects such as definitelytyped, which provide typescript declaration file downloads for various class libraries. In addition, there is a simple way to manage the project's declaration file through TSD, which briefly describes the installation and use of TSD (provided that node is already installed):
1. Installing TSD
Npm-g Install TSD
2. Navigate to the Scripts directory
CD d:\***\scripts
3. Initialize, a Tsd.json file and a typings directory will be created in the directory to hold the obtained claim file.
TSD Init
4. Get jquery
TSD Install jquery
As you can see, a jquery folder has been created automatically in the Typings directory, which is the declaration file.
5. More information on how to use TSD can be viewed through the following instructions:
TSD--help
Using Typescript in your project