Home > Web Front-end > JS Tutorial > Detailed explanation of the steps to obtain the TypeScript declaration file .d.ts

Detailed explanation of the steps to obtain the TypeScript declaration file .d.ts

php中世界最好的语言
Release: 2018-05-14 14:21:14
Original
3422 people have browsed it

This time I will give you a detailed explanation of the steps to obtain the TypeScript declaration file .d.ts, and what are the precautions for obtaining the TypeScript declaration file .d.ts. The following is a practical case, let's take a look.

1. TypeScript declaration file is like C/C using .h file. When using TypeScript to call other class libraries that have been written, IntelliSense intelligent prompts can be provided.

2. Use the npm command to obtain the .d.ts file

install -save @types/<a href="//m.sbmmt.com/wiki/1495.html" target="_blank">jquery</a> -g

After running, four files will be generated in the type/jquery directory: index.d.ts, lincense, package.json, readme.md, where index.d.ts is the declaration file of jquery.

3. npm requires Nodejs environment, InstallationThe steps are as follows

1. Download windows installation from https://nodejs.org/en/ Package

2. Install Node, js

3. After the installation is completed, open the cmd command line tool of windows and enter

npm -v

Display the version number, indicating successful installation

4. Set the global path to "d:\nodejs\node_global"

npm config set prefix "d:\nodejs\node_global"
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting content, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Detailed explanation of the steps to implement full-screen scrolling plug-in in ES6

##vue vue-router vuex operation permissions

The above is the detailed content of Detailed explanation of the steps to obtain the TypeScript declaration file .d.ts. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template