Is there a valid typescript type for an SVG document embedded as an HTML object?
<p>I am embedding an SVG object in HTML as follows:</p>



<pre class="lang-html prettyprint-override"><code>&lt;object id='mapObject' type="image/svg+xml" data="assets/maps/drawing.svg"&gt;
&lt;/object&gt;
</code></pre>

<p>Then, I want to reach it from my typescript classes (from Ionic 2, but that should be indifferent):</p>

<pre><code>let map = document.getElementById("mapObject");
let svgDoc = map.contentDocument;  // Get the inner SVG DOM
</code></pre>

<p>This works on browser, but typescript complains about it:</p>

<blockquote>
  <p>typescript Property 'contentDocument' does not exist on type 'HTMLElement'</p>
</blockquote>

<p>And worse, it doesn't work in the device, because the compiler refuses to generate code for it.</p>

<p>My temporary hack/solution is casting as follows:</p>

<pre><code>let svgDoc = (&lt;HTMLIFrameElement&gt;map).contentDocument;  // Get the inner SVG DOM
</code></pre>

<p>This works in the device, because HTMLIFrameElement has the contentDocument property, but it seems to me that typescript should have an specific type for this. However I've been unable to find it.</p>

<p>Anyone?</p>