<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.9</p>
<p dir="auto"><strong>React Version:</strong></p>
<p dir="auto">15.0.0</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="import * as React from 'react';
import * as ReactDOM from 'react-dom';

let test = {a: 1, b: 2};

ReactDOM.render(
    &lt;div {...test} /&gt;,
    document.getElementById('app')
);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-smi">React</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-smi">ReactDOM</span> <span class="pl-k">from</span> <span class="pl-s">'react-dom'</span><span class="pl-kos">;</span>

<span class="pl-k">let</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-c1">a</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">b</span>: <span class="pl-c1">2</span><span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-smi">ReactDOM</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span>
    <span class="pl-kos">&lt;</span><span class="pl-smi">div</span><span class="pl-kos"></span> <span class="pl-kos">{</span>...<span class="pl-s1">test</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">,</span>
    <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">'app'</span><span class="pl-kos">)</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Actual behavior:</strong><br>
Browser console error "Uncaught TypeError: React.__spread is not a function".</p>
<p dir="auto">I have a file that will be evaluated by Nashorn. Nashorn has a global function called <code class="notranslate">print</code>. Therefore I declare it like so:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="declare var print: (_: string) =&gt; void;"><pre class="notranslate"><code class="notranslate">declare var print: (_: string) =&gt; void;
</code></pre></div>
<p dir="auto">When I compile, I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=".../node_modules/typescript/lib/lib.d.ts(16887,18): error TS2300: Duplicate identifier 'print'."><pre class="notranslate"><code class="notranslate">.../node_modules/typescript/lib/lib.d.ts(16887,18): error TS2300: Duplicate identifier 'print'.
</code></pre></div>
<p dir="auto">If I call tsc with the <code class="notranslate">--noLib</code> option, I instead get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'."><pre class="notranslate"><code class="notranslate">error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
</code></pre></div>
<p dir="auto">What are my options here? Importing Window from lib.d.ts is pointless since there is no window in Nashorn.</p>