<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.10 / nightly (1.9.0-dev.20160515)</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// file ThingA.ts
export class ThingA { } 

// file ThingB.ts
export class ThingB { }

// file Things.ts (re-export)
export {ThingA} from &quot;./ThingA&quot;;
export {ThingB} from &quot;./ThingB&quot;;

// file Test.ts (uses re-exported classes)
import * as things from &quot;./Things&quot;;

export class Test {
    public method = (input: things.ThingA)  =&gt; { };
}

// compile
tsc Test.ts --declaration --outDir compiled
"><pre class="notranslate"><span class="pl-c">// file ThingA.ts</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">ThingA</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> 

<span class="pl-c">// file ThingB.ts</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">ThingB</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>

<span class="pl-c">// file Things.ts (re-export)</span>
<span class="pl-k">export</span> <span class="pl-kos">{</span><span class="pl-smi">ThingA</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./ThingA"</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-kos">{</span><span class="pl-smi">ThingB</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./ThingB"</span><span class="pl-kos">;</span>

<span class="pl-c">// file Test.ts (uses re-exported classes)</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">things</span> <span class="pl-k">from</span> <span class="pl-s">"./Things"</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">Test</span> <span class="pl-kos">{</span>
    <span class="pl-k">public</span> <span class="pl-c1">method</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">input</span>: <span class="pl-s1">things</span><span class="pl-kos">.</span><span class="pl-smi">ThingA</span><span class="pl-kos">)</span>  <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">// compile</span>
<span class="pl-s1">tsc</span> <span class="pl-smi">Test</span><span class="pl-kos">.</span><span class="pl-c1">ts</span> <span class="pl-c1">--</span><span class="pl-kos"></span><span class="pl-s1">declaration</span> <span class="pl-c1">--</span><span class="pl-s1">outDir</span> <span class="pl-s1">compiled</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong><br>
No errors<br>
<strong>Actual behavior:</strong></p>
<blockquote>
<p dir="auto">Test.ts(5,5): error TS4029: Public property 'method' of exported class has or is using name 'ThingA' from external module ".../ThingA" but cannot be named.</p>
</blockquote>
<p dir="auto">It seems declaration file can't be generated due to the <code class="notranslate">things.ThingA</code> reference, but in a similar case without re-exporting it works fine (I will give an example of this in the next post).</p>
<p dir="auto">If I change the import statement in Test.ts to this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {ThingA,ThingB} from &quot;./Things&quot;;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-smi">ThingA</span><span class="pl-kos">,</span><span class="pl-smi">ThingB</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./Things"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">(instead of <code class="notranslate">import * as things</code>) and further use <code class="notranslate">ThingA</code> directly, there are no errors, but this defeats the purpose of re-exporting.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface A {
  p: number
}
interface B {
  p: string
}
type C = A &amp; B; // suggest an error here
var c: C;
c.p = 1; // because it's impossible assign a number or
c.p = &quot;x&quot;;  // a string to that property."><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
  <span class="pl-c1">p</span>: <span class="pl-smi">number</span>
<span class="pl-kos">}</span>
<span class="pl-k">interface</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span>
  <span class="pl-c1">p</span>: <span class="pl-smi">string</span>
<span class="pl-kos">}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">A</span> <span class="pl-c1">&amp;</span> <span class="pl-smi">B</span><span class="pl-kos">;</span> <span class="pl-c">// suggest an error here</span>
<span class="pl-k">var</span> <span class="pl-s1">c</span>: <span class="pl-smi">C</span><span class="pl-kos">;</span>
<span class="pl-s1">c</span><span class="pl-kos">.</span><span class="pl-c1">p</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// because it's impossible assign a number or</span>
<span class="pl-s1">c</span><span class="pl-kos">.</span><span class="pl-c1">p</span> <span class="pl-c1">=</span> <span class="pl-s">"x"</span><span class="pl-kos">;</span>  <span class="pl-c">// a string to that property.</span></pre></div>