title: Typescript support for polymer v3
body: <p>I am currently testing polymer 3 preview to see how to integrate it into our team workflow.</p>
  
  <p>The recommended way to declare an element in v3 is:</p>
  
  <pre><code>import { PolymerElement } from '@polymer/polymer/polymer-element.js';
  ...
  class MyElement extends PolymerElement {
    ...
  }
  </code></pre>
  
  <p>See: <a href="https://www.polymer-project.org/blog/2018-03-23-polymer-3-latest-preview.html" rel="nofollow noreferrer">https://www.polymer-project.org/blog/2018-03-23-polymer-3-latest-preview.html</a></p>
  
  <p>This works well with typescript for basic things, but it does not understand that the class <strong>MyElement</strong> extends <strong>HTMLElement</strong>. So if I try to use <strong>this.dispatchEvent(...)</strong> in my code, the compilation will fail.</p>
  
  <p>I tried to set a <strong>.d.ts</strong> to try to teach typescript but I could not get it to work. All those were pretty much unsuccessful.</p>
  
  <p>1) Direct typing:</p>
  
  <pre><code>class PolymerElement extends HTMLElement{}
  </code></pre>
  
  <p>2) Typing the module:</p>
  
  <pre><code>declare module "polymer-element" {
      export class PolymerElement extends HTMLElement {}
  }
  </code></pre>
  
  <p>And a few more variations but it never seem to be picked out by the transpiler.
  Any idas ?</p>