Typing file collisions
The TypeScript compiler does not tolerate redefinition of a type. For
example,it throws an error if it’s given two definitions for the
Promise type.Double definitions are common. In fact,the typings tool deliberately
creates duplicate sets of typings (for reasons best explained
elsewhere). Look in the project structure for the typings folder where
we should find something like:
typings browser ambient es6-shim es6-shim.d.ts main ambient es6-shim es6-shim.d.ts browser.d.ts main.d.ts
The es6-shim typings are duplicated and the browser.d.ts and main.d.ts
have overlapping content.
如果我读了typings readme,它说:
If you’re building a front-end package it’s recommended you use typings/browser.d.ts. The browser typings are compiled by following the browser field overrides.
问题:
为什么typings tool故意创建重复的打字集?
为什么建议您使用typings / browser.d.ts作为前端软件包?
我的猜测是因为支持浏览器字段可以创建不同的类型?
如果是这样,什么是浏览器字段以及它改变打字的方式?