-安装typings
npm install -g typings
-安装语法插件(在项目根目录下运行)
typings installdt~node --global
其中”dt~”为使用DefinitelyTyped类型定义的意思,vscode可以识别这种定义。
之后可以看到在项目目录下出来了新的文件夹“typings”
类似地,可以使用以上的方法,实现其他模块的自动补全。
typings install dt~express --global
typings install dt~lodash --global
git有比较全的模块,地址:https://github.com/DefinitelyTyped/DefinitelyTyped
网友评论