<p dir="auto">I'm not sure if this issue belongs in this repository since it spans across a few different tools, but I'm grateful for any insights I can get here.</p>
<p dir="auto">I have a project set up to use Typescript 1.5.3 transpiling to AMD modules which are loaded via RequireJS. I'd like use SystemJS instead, but there's one small issue I can't seem to get around.  When using the es6 import syntax:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as $ from 'jquery';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">$</span> <span class="pl-k">from</span> <span class="pl-s">'jquery'</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I get the behavior I expect; that is, the global jQuery function is assigned to the variable <code class="notranslate">$</code>. However, using this same syntax with a SystemJS setup, I get a plain object with the static jQuery functions and properties, not a callable funciton. If I use the default import syntax:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import $ from jquery;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">$</span> <span class="pl-k">from</span> <span class="pl-s1">jquery</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I then see the expected behavior with SystemJS. I'm not actually sure which behavior is technically correct, but I'm fine with this change. However, the problem that I'm left with (and why I'm asking here) is that the definition file for jQuery does not provide the <code class="notranslate">export default</code> declaration. If I add the following to the definition:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare module 'jquery' {
    export = JQueryStatic;
    export default JQueryStatic;
}"><pre class="notranslate"><span class="pl-k">declare</span> module <span class="pl-s">'jquery'</span> <span class="pl-kos">{</span>
    <span class="pl-k">export</span> <span class="pl-c1">=</span> <span class="pl-smi">JQueryStatic</span><span class="pl-kos">;</span>
    <span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-smi">JQueryStatic</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I get the error: <code class="notranslate">error TS2309: An export assignment cannot be used in a module with other exported elements.</code> This error is choking my build system when processing typescript files independently, so I'm thinking if I can resolve this error, I can move forward with SystemJS as the module loader.</p>
<p dir="auto">So my question is, what is the best way to fix this problem? I'd also appreciate an explanation of why that declaration is invalid and which module loader is behaving correctly and why.</p>
<p dir="auto">I am using @types/sinon-chai 2.7.27.</p>
<p dir="auto">When i do the npm start i am getting following errors,</p>
<p dir="auto">[default] D:\node_modules@types\sinon\index.d.ts:19:19<br>
Duplicate identifier 'Sinon'.<br>
[default] D:\node_modules@types\sinon\index.d.ts<g-emoji class="g-emoji" alias="100" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4af.png">💯</g-emoji>21<br>
A parameter initializer is only allowed in a function or constructor<br>
entation.<br>
[default] D:\node_modules@types\sinon\index.d.ts<g-emoji class="g-emoji" alias="100" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4af.png">💯</g-emoji>29<br>
Cannot find name 'keyof'.<br>
[default] D:\node_modules@types\sinon\index.d.ts<g-emoji class="g-emoji" alias="100" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4af.png">💯</g-emoji>35<br>
'=' expected.<br>
[default] D:\node_modules@types\sinon\index.d.ts:156:21<br>
A parameter initializer is only allowed in a function or constructor<br>
entation.<br>
[default] D:\WBM_repo\wbm\node_modules@types\sinon\index.d.ts:156:29<br>
Cannot find name 'keyof'.<br>
[default] D:\node_modules@types\sinon\index.d.ts:156:35<br>
'=' expected.<br>
[default] D:\node_modules@types\sinon\index.d.ts:157:21<br>
A parameter initializer is only allowed in a function or constructor<br>
entation.<br>
[default] D:\node_modules@types\sinon\index.d.ts:157:29<br>
Cannot find name 'keyof'.<br>
[default] D:\node_modules@types\sinon\index.d.ts:157:35<br>
'=' expected.<br>
[default] D:\node_modules@types\sinon\index.d.ts:548:9<br>
A computed property name must be of type 'string', 'number', 'symbol'<br>
any'.<br>
[default] D:\node_modules@types\sinon\index.d.ts:548:10<br>
Cannot find name 'P'.<br>
[default] D:\node_modules@types\sinon\index.d.ts:548:15<br>
Cannot find name 'keyof'.<br>
[default] D:\node_modules@types\sinon\index.d.ts:548:21<br>
']' expected.<br>
[default] D:\node_modules@types\sinon\index.d.ts:548:21<br>
Cannot find name 'TType'.<br>
[default] D:\node_modules@types\sinon\index.d.ts:548:26<br>
';' expected.<br>
[default] D:\node_modules@types\sinon\index.d.ts:548:27<br>
Declaration or statement expected.<br>
[default] D:\node_modules@types\sinon\index.d.ts:548:29<br>
Cannot find name 'SinonStub'.<br>
[default] D:\node_modules@types\sinon\index.d.ts:550:1<br>
Declaration or statement expected.<br>
[default] D:\node_modules@types\sinon\index.d.ts:552:15<br>
Duplicate identifier 'Sinon'.<br>
[default] Checking finished with 20 errors</p>
<p dir="auto">Any help on how can i resolve above issues?</p>