title: Typescript and sql.js - how to tell Typescript it's there
body: <p>I might be approaching this completely incorrectly, so any advice is appreciated.  I'm currently trying to dig in deep to Typescript, and have decided to simultaneously use Sql.js (the JS version of SQLite) at the same time...</p>
  
  <p>My first instinct to use Sql.js was to search for a .d.ts set of bindings around Sql.js so that I could easily start using it with TS.  I've come up with no bindings so far (I don't think one exists yet), but figured I could just start "define"-ing in the stuff that I need from the library...</p>
  
  <p>Starting with one of the simple examples from the "sql.js" docs, you have something like this:</p>
  
  <pre><code>var sql = window.SQL;
  var db = new sql.Database();
  </code></pre>
  
  <p>Moving to the typescript side, I wanted to let TS know that after the sql.js library is included, the window object now has a property called SQL, which is essentially the hook to the rest of the library.  I figured I needed to do this because, of course, when I type "window." (window-dot) in Visual Studio in my TS file, the Intellisense presented doesn't know about the SQL property now hanging off of "window".  So... I dug around Stack, and concluded that I could solve this with a "declare" which I basically see as a way to tell TS just enough about the libraries that I don't have binding files for (.d.ts files).</p>
  
  <p>However, in doing this, I can't seem to construct the syntax for such a declaration.  I've tried:</p>
  
  <pre><code>declare var window.SQL : any;
  declare var window.SQL;
  declare var SQL = window.SQL;
  declare window.SQL;
  </code></pre>
  
  <p>None of these work, of course.</p>
  
  <p>So, the question is, how can I let TS know about new properties introduced by JS libraries on standard objects like "window", and the follow up question is, of course, is this even the right way to be approaching this?</p>
  
  <p>Thanks for any insight.</p>