These are chat archives for DefinitelyTyped/DefinitelyTyped

Feb 2016
John Cant
Feb 18 2016 11:52
Hi all, I wrote typescript definitions for protractor-helpers (DefinitelyTyped/DefinitelyTyped#8078 - Thankyou for merging, @vvakame ) . It's a node module that primarily extends other node modules, i.e. protractor and jasmine. I'm having trouble getting tsc to generate a require statement unless I refer to the module directly. Is there any way I can force from this in the typescript definition? There's an example in the PR.
Nathan Erickson
Feb 18 2016 18:34
Hey all, I was wondering if anyone as run into a duplicate identifier error when using es6-shim/es6-shim.d.ts with typescripts lib.es6.d.ts?
for now I have excluded the typings for es6-shim and just created my own for things like promises, because it seems there is a implementation difference
I was wondering if anyone has run into the conflict and came up with a better solution?
Daniel Rosenwasser
Feb 18 2016 20:57
@Luwdo why do you need ES6-shim if you're targetting ES6?
In any case we're trying to alleviate it in #6990.
@johncant TypeScript elides module imports unless an exported value is utilized as part of some expression. This is so that people can freely use imports for their value side without incurring the side effect
it's up to the importer to explicitly use a value, or to add an explicit import statement like
import "foo";
so in short, the answer is there isn't a way to say "this module always gets imported"
(and there probably shouldn't be because it would likely be misused)