dispatchEvent Causes error failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event' : <p>I am using Angular2 + TypeScript and when I try execute this code:</p>

<pre><code>var event = new Event('check');
window.dispatchEvent(event);
</code></pre>

<p>This code causing the next error:</p>

<blockquote>
  <p>failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.</p>
</blockquote>

<p>I have tried everything, and found out that this will work:</p>

<pre><code>var event = new CustomEvent('check');
</code></pre>

<p>Problem is that CustomEvent is not supported by any IE.</p>

<p>Another thing that works is:</p>

<pre><code>var event = new Event('CustomEvent');
event.initCustomEvent('check');
</code></pre>

<p>Problem is that InitCustomEvent is deprecated.</p>

<p>Is there anything I can do to avoid this type error? Maybe make an exception somewhere in typescript? Or use any code that is not deprecated and works for IE Edge?</p>
