简体   繁体   English

TypeScript d.ts和.js一致性

[英]TypeScript d.ts and .js consistency

Using these definitions: https://github.com/borisyankov/DefinitelyTyped 使用这些定义: https : //github.com/borisyankov/DefinitelyTyped

So, say, I use angularJS 1.3.14, how to know for sure that there is proper definition for that particular angular version? 因此,例如,我使用angularJS 1.3.14,如何确定该特定角度版本的定义正确?

Or how to know for sure that DefinitelyTyped *.d.ts file is consistent to its *.js one? 还是如何确定DefinitelyTyped * .d.ts文件与其* .js文件一致?

Or If I use older version of AangularJS, how to find proper ts file? 或者,如果我使用旧版本的AangularJS,如何找到合适的ts文件?

How do I know it is a proper definition? 我怎么知道这是一个正确的定义?

You use it and see if you come across a bug. 您使用它,看看是否遇到错误。 Definitely Typed is open source and accepts issues and contributions so it is easy to remedy any errors in the definitions. 绝对类型是开源的,接受问题和贡献,因此很容易纠正定义中的任何错误。

In the case of Angular, the large community will typically result in fewer errors in the definitions as many people are already using them. 在Angular的情况下,大型社区通常会导致较少的定义错误,因为已有许多人使用它们。

How do I know the .d.ts is consistent to its .js one? 我怎么知道.d.ts.js一致?

This is largely the same as above. 这与上面基本相同。 This is a community endeavour, so there are many people updating type definitions to keep them correct. 这是社区的一项工作,因此有很多人在更新类型定义以使其正确。 If you find a problem it is usually simple to solve (the type definition itself usually looks a lot like the API documentation for a library). 如果发现问题,通常很容易解决(类型定义本身通常看起来很像库的API文档)。

If I use an older version of Angular, how do I find the .d.ts file. 如果我使用旧版本的Angular,如何找到.d.ts文件。

You can see the history on GitHub, for example the angular.d.ts history . 您可以在GitHub上查看历史记录,例如angular.d.ts history

You can usually see when the commits go in to update the library versions here. 通常,您可以在此处查看何时提交提交以更新库版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM