title: TypeScript decorator declaration that implements an interface
body: <p>I've tried a few different ways to declare a decorator function in TypeScript such that the decorated class implements an interface. Something like this:</p>
  
  <pre><code>interface IValidatable {
      checkValidation: () =&gt; boolean;
  }
  
  function validated&lt;T&gt;(Class: {new():T}): {new():T &amp; IValidatable} {
      Class.prototype.checkValidation = () =&gt; true;
      return Class as {new():T &amp; IValidatable};
  }
  </code></pre>
  
  <p>Given the above, I was hoping that I could then do something like this:</p>
  
  <pre><code>@validated
  class Foo {
  
  }
  
  let f = new Foo();
  let isValid = f.checkValidation();
  </code></pre>
  
  <p>but the last line is flagged as an error ("Property 'checkValidation' does not exist on type 'Foo'.").</p>
  
  <p>The following <em>does</em> work in the sense that it does not generate an error:</p>
  
  <pre><code>let ValidatedFoo = validated(Foo);
  let vf = new ValidatedFoo();
  let isValid2 = vf.checkValidation();
  </code></pre>
  
  <p>Is there a way to formulate the decorator declaration such that the first usage example does not generate an error?</p>