问题描述
我刚开始使用angular 2玩游戏,并且我看到网络上可用的许多项目都有一个名为typings
的文件夹.深入研究该问题,我发现这与 https://www.npmjs.com/package/typings包装.我阅读了他们的文档,但我不明白为什么我们需要打字.您能否提供一些需要输入或帮助输入的示例.谢谢
I just started playing with angular 2, and I saw that many projects that are available on the web have a folder called typings
. Digging more into the problem I found that it has something to do with https://www.npmjs.com/package/typings package. I read their documentation but I didn't understand exactly why do we need typings. Can you provide some example where typings are needed or helpful.Thanks
推荐答案
AFAIK允许您使用JS库,就像它们具有类型注释一样,例如完全键入的TypeScript代码.如果为JS库提供了它们,您将获得适当的自动补全支持和棉绒检查,...
AFAIK this allows you to use JS libraries like they had type annotations like fully typed TypeScript code. If they are provided for a JS library you get proper autocompletion support and lint checks, ...
另请参见
- https://blog.mariusschulz.com/2014/05/19/using-typescripts-type-definition-files-to-get-tooling-support-for-plain-javascript
- 是否需要打字稿类型定义?
- 您如何产生一个.d.ts的"typings"来自现有JavaScript库的定义文件?
- https://blog.mariusschulz.com/2014/05/19/using-typescripts-type-definition-files-to-get-tooling-support-for-plain-javascript
- Are typescript type definitions required?
- How do you produce a .d.ts "typings" definition file from an existing JavaScript library?
这篇关于什么是打字稿打字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!