title: typescript export type and module value
body: <p>I want to export a type with the same name as a value. Here's an example module:</p>
  <pre class="lang-js prettyprint-override"><code>// foo.ts
  
  export type Foo = string;
  
  export function create(): Foo {
    // ...
  }
  </code></pre>
  <p>What's the reason that this pattern works:</p>
  <pre class="lang-js prettyprint-override"><code>// index.ts
  import * as _Foo from &quot;./foo&quot;;
  export const Foo = _Foo;
  export type Foo = _Foo.Foo;
  </code></pre>
  <p>But these patterns don't?</p>
  <pre class="lang-js prettyprint-override"><code>// No compiler error but value is not exported
  export type Foo = import(&quot;./foo&quot;).Foo;
  export * as Foo from &quot;./foo&quot;;
  
  // Duplicate identifier error
  import type { Foo } from &quot;./foo&quot;;
  import * as Foo from &quot;./foo&quot;;
  export { Foo };
  
  // Individual declarations in merged declaration 'Foo' must be all exported or all local. [2395]
  import * as Foo from &quot;./foo&quot;;
  export { Foo };
  export type Foo = Foo.Foo;
  </code></pre>