typescript - 什么是 typescript 类型?

标签 typescript angular

我刚开始玩 angular 2,我看到网上的许多项目都有一个名为 typings 的文件夹。深入研究这个问题,我发现它与 https://www.npmjs.com/package/typings 有关。包裹。我阅读了他们的文档,但我不明白为什么我们需要打字。你能提供一些需要打字或有帮助的例子吗? 谢谢

最佳答案

据我所知,这允许您使用 JS 库,就像它们具有类型注释一样,例如完全类型化的 TypeScript 代码。如果它们是为 JS 库提供的,您将获得适当的自动完成支持和 lint 检查,...

另见

关于typescript - 什么是 typescript 类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34590168/

相关文章:

TypeScript 编译器 (tsc) 无法识别导入别名

TypeScript 条件返回类型 : works for one condition but not for two

javascript - Typemoq 和 Angular-cli 不能一起工作

Angular 5 Material Table 用具有不同参数类型的函数替换 filterPredicate

javascript - React Navigation v5 如何使用 typescript 在选项卡之间导航

reactjs - 与 Typescript : Argument of type 'never[]' is not assignable to parameter of type 'StateProperties | (() => StateProperties)' react

javascript - 未调用 Typescript 方法

javascript - Dropbox 下载文件 API 停止工作并出现 400 错误

angular - 为什么不会调用 ngOnChanges 钩子(Hook)?

angular - styleUrls 在 Angular 2 中不起作用