WebStorm IDE上的DefinitelyTyped(TypeScript类型定义)的intellisense和代码已完成 [英] intellisense and code complete for DefinitelyTyped (TypeScript type definitions) on WebStorm IDE
问题描述
如何让WebStorm IDE为我下载的库提供代码完成。
How can I get WebStorm IDE to give me code completion for libraries that I've downloaded.
正如您所见 angularjs-DefinitelyTyped
已经下载了 jQuery-DefinitelyTyped
。
As you can see angularjs-DefinitelyTyped
and jQuery-DefinitelyTyped
have been downloaded.
现在我相信我必须在我的网站中引用定义文件。 ts文件。
Now I believe that I have to reference the definition file in my .ts files.
但是,WebStorm在哪里保存定义文件,以便我可以在我的代码中引用它们?
But, where WebStorm saves the definition files so I can reference them in my code?
谢谢!
推荐答案
该对话框用于 JavaScript 范围,而不是 TypeScript 范围(例如,参见mocha demo < a href =http://youtu.be/4mKiGkokyx8?t=1m19s> http://youtu.be/4mKiGkokyx8?t=1m19s )。也就是说,Webstorm正在使用TypeScript定义来为JavaScript提供智能。
That dialog is for JavaScript scope, not TypeScript scope (e.g. see mocha demo http://youtu.be/4mKiGkokyx8?t=1m19s). That is, Webstorm is using TypeScript definitions to give intellisence for JavaScript.
对于TypeScript本身,您需要手动将定义包含在项目中( https://github.com/borisyankov/DefinitelyTyped/blob/master/angularjs/angular.d.ts )并像往常一样引用它们。
For TypeScript itself you need to include the definitions into your project manually (https://github.com/borisyankov/DefinitelyTyped/blob/master/angularjs/angular.d.ts) and reference them like you always have.
这篇关于WebStorm IDE上的DefinitelyTyped(TypeScript类型定义)的intellisense和代码已完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!