<p dir="auto">foo.ts:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export const a = 1
export const b = 2"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span></pre></div>
<p dir="auto">bar.ts:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// error!
export * as foo from './foo'

// ok
import * as foo1 from './foo'
export const foo = foo1"><pre class="notranslate"><span class="pl-c">// error!</span>
<span class="pl-k">export</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">foo</span> <span class="pl-k">from</span> <span class="pl-s">'./foo'</span>

<span class="pl-c">// ok</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">foo1</span> <span class="pl-k">from</span> <span class="pl-s">'./foo'</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">foo1</span></pre></div>
<p dir="auto">The ES7 proposal is available at: <a href="https://github.com/leebyron/ecmascript-more-export-from">https://github.com/leebyron/ecmascript-more-export-from</a></p>
<p dir="auto">The additions include:</p>
<p dir="auto">reexporting default:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// proposed:
export v from &quot;mod&quot;;

// symmetric to:
import v from &quot;mod&quot;;
export {v};"><pre class="notranslate"><span class="pl-c">// proposed:</span>
<span class="pl-k">export</span> <span class="pl-s1">v</span> <span class="pl-k">from</span> <span class="pl-s">"mod"</span><span class="pl-kos">;</span>

<span class="pl-c">// symmetric to:</span>
<span class="pl-k">import</span> <span class="pl-s1">v</span> <span class="pl-k">from</span> <span class="pl-s">"mod"</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-kos">{</span><span class="pl-s1">v</span><span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">reexporting as sub-module:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// proposed:
export * as ns from &quot;mod&quot;;

// symmetric to:
import * as ns from &quot;mod&quot;;
export {ns};"><pre class="notranslate"><span class="pl-c">// proposed:</span>
<span class="pl-k">export</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">ns</span> <span class="pl-k">from</span> <span class="pl-s">"mod"</span><span class="pl-kos">;</span>

<span class="pl-c">// symmetric to:</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">ns</span> <span class="pl-k">from</span> <span class="pl-s">"mod"</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-kos">{</span><span class="pl-s1">ns</span><span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">also allowing combining</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// proposed
export v, {x, y as w} from &quot;mod&quot;
// symmetric to
import v, {x, y as w} from &quot;mod&quot;
As well as

// proposed
export v, * as ns from &quot;mod&quot;
// symmetric to
import v, * as ns from &quot;mod&quot;"><pre class="notranslate"><span class="pl-c">// proposed</span>
<span class="pl-s1">export</span> <span class="pl-s1">v</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>x<span class="pl-kos">,</span> y <span class="pl-s1">as</span> <span class="pl-s1">w</span><span class="pl-kos">}</span> <span class="pl-s1">from</span> <span class="pl-s">"mod"</span>
<span class="pl-c">// symmetric to</span>
<span class="pl-k">import</span> <span class="pl-s1">v</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s1">x</span><span class="pl-kos">,</span> <span class="pl-s1">y</span> <span class="pl-k">as</span> <span class="pl-s1">w</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"mod"</span>
<span class="pl-smi">As</span> <span class="pl-s1">well</span> <span class="pl-k">as</span>

<span class="pl-c">// proposed</span>
<span class="pl-smi">export</span> <span class="pl-s1">v</span><span class="pl-kos">,</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">ns</span> <span class="pl-s1">from</span> <span class="pl-s">"mod"</span>
<span class="pl-c">// symmetric to</span>
<span class="pl-k">import</span> <span class="pl-s1">v</span><span class="pl-kos">,</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">ns</span> <span class="pl-k">from</span> <span class="pl-s">"mod"</span></pre></div>