title: Using TypeScript with PhoneGap/Cordova Plugins
body: <p>I'm running into a bit of a roadblock as I would like to start using the <a href="https://github.com/phonegap/phonegap-plugins/tree/master/iOS/GoogleAnalytics" rel="nofollow">Google Analytics Cordova plugin</a> but I'm composing all of my javascript assets in TypeScript. Here is a good example of the specific problem I'm having:</p>
  
  <pre><code>window.plugins.googleAnalyticsPlugin.startTrackerWithAccountID("UA-xxxxxxx-x");
  </code></pre>
  
  <p>TypeScript balks at <code>window.plugins</code>, throwing the compilation error:</p>
  
  <blockquote>
    <p>The property 'plugins' does not exist on value of type 'Window'.</p>
  </blockquote>
  
  <p>And that makes complete sense. However, I can't get around this by using a <code>declare var window;</code> statement, as that creates a duplicate identifier for window. </p>