With the following structure:
node_modules/a/default.d.ts containing a typing and a function
node_modules/a/package.json containing a typings field to default.d.ts
src/default.ts' re-exporting everything from a and exporting new functions
src/newFunctions.ts using the src/default.ts
You get "exported variable has or is using name from external module" errors when using an object:
import * as b from './default';
// Bug: This does the same thing, but in an object. It should still compile fine, but it doesn't.
export let wrap = {
findPersonById: function(id: number): b.IPerson {
return b.findPersonById(id);
}
}
However, when you don't use an object the functionality works as expected:
import * as b from './default';
// OK: Expected behavior. Since `b` exports everything from `a`, exporting `b.IPerson` is fine.
export function wrapFindPersonById(id: number): b.IPerson {
return b.findPersonById(123);
}
Using 1.8.0-dev.20151204. Full repo https://github.com/Deathspike/typescript-reference-bug-example/
With the following structure:
node_modules/a/default.d.tscontaining a typing and a functionnode_modules/a/package.jsoncontaining atypingsfield todefault.d.tssrc/default.ts' re-exporting everything fromaand exporting new functionssrc/newFunctions.tsusing thesrc/default.tsYou get "exported variable has or is using name from external module" errors when using an object:
However, when you don't use an object the functionality works as expected:
Using
1.8.0-dev.20151204. Full repo https://github.com/Deathspike/typescript-reference-bug-example/