title: How do I get typescript to stop complaining about functions it doesn't know about?
body: <p>I'm using Typescript for a web app that needs to use the JavaScript full screen API. The full screen API isn't officially supported yet, so you have to use vendor prefixes. Here's my code, based on the sample from <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode#Toggling_fullscreen_mode" rel="noreferrer">MDN</a>:</p>
  <pre><code>function toggleFullScreen(element: JQuery) {
      var fs = element[0];
      if (!document.fullscreenElement &amp;&amp;    // alternative standard method
          !document.mozFullScreenElement &amp;&amp; !document.webkitFullscreenElement &amp;&amp; !document.msFullscreenElement) {  // current working methods
          if (fs.requestFullscreen) {
              fs.requestFullscreen();
          } else if (fs.msRequestFullscreen) {
              fs.msRequestFullscreen();
          } else if (fs.mozRequestFullScreen) {
              fs.mozRequestFullScreen();
          } else if (fs.webkitRequestFullscreen) {
              fs.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
          }
      } else {
          if (document.exitFullscreen) {
              document.exitFullscreen();
          } else if (document.msExitFullscreen) {
              document.msExitFullscreen();
          } else if (document.mozCancelFullScreen) {
              document.mozCancelFullScreen();
          } else if (document.webkitExitFullscreen) {
              document.webkitExitFullscreen();
          }
      }
  }
  </code></pre>
  <p>However in my IDE (Visual Studio, but this would happen anywhere), I get errors like:</p>
  <pre><code>The property 'fullscreenElement' does not exist on value of type 'Document'.
  The property 'mozFullScreenElement' does not exist on value of type 'Document'.
  The property 'webkitFullscreenElement' does not exist on value of type 'Document'.  
  </code></pre>
  <p>Of course TypeScript can't know that these functions exist, but nor do I want to re-declare document as <code>any</code> just to get rid of these errors, because then I'll lose all the other type hints.</p>
  <p>What is the solution here? How do I get TypeScript to stop complaining but keep as many type annotations as I can?</p>