-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
DocsThe issue relates to how you learn TypeScriptThe issue relates to how you learn TypeScript
Description
TypeScript Version: 2.0.3
It is very unclear how to effectively use the --lib compiler option. It appears there is a default set of libs that are included (i.e. when no --lib is specified). If any libs are specified with --lib, then it seems this default set gets replaced with the set you provide. I haven't been able to find any documentation on exactly what is in the default set.
Here's the issue I'm running into. I want to use the [default set] + es2015.collection. I've tried a number of things.
--lib es2015.collection OR --lib es6- Lots of errors because DOM isn't declared--lib es6,dom,scripthost,webworker- Several errors about duplicate signatures and declarations, e.g.
lib.dom.d.ts(2145,5): error TS2375: Build: Duplicate number index signature.
lib.dom.d.ts(3772,14): error TS2403: Build: Subsequent variable declarations must have the same type. Variable 'srcElement' must be of type 'any', but here has type 'Element'.[no --lib option]- Can't use ES6 sets/maps.
Expected behavior:
Either the set of libs you can import needs to be disjoint, or the compiler should be able to handle duplicate declarations in these files.
Metadata
Metadata
Assignees
Labels
DocsThe issue relates to how you learn TypeScriptThe issue relates to how you learn TypeScript