title: tyepscript set type of 'this' on function decorator
body: <p>I have a decorator that create a proxy over properties and whenever that property is changed to something new, it will let you do some side effect to happen</p>
  <pre><code>class A{
     @OnChange&lt;number&gt;(function(changes){
       console.log(typeof this); //the type of `this` here is `A` but eslint nag that it's any
       this.print()
     })
     n=0;
     
     print(){
        console.log(this.n);
     }
  }
  
  const a1= new A();
  a1.n=2; // on calling this the `Print()` method will be called
  
  </code></pre>
  <p>playground: <a href="https://stackblitz.com/edit/typescript-ymasoh?file=index.ts" rel="nofollow noreferrer">https://stackblitz.com/edit/typescript-ymasoh?file=index.ts</a></p>
  <p>the eslint is whining about the type of <code>this</code> is <code>any</code>. I can't find any way to set the type of <code>this</code> in the decorator to current class.</p>
  <p>so I am looking for a way that could set the type of this, something like :</p>
  <pre><code>function OnChange&lt;T = any, U extend this&gt;(callback: (this: U, simpleChange?: SimpleChange&lt;T&gt;) =&gt; void) {
  </code></pre>
  <p>as a surprise I expected that an arrow function would solve the issue, but unfortuantely in this case an arrow function make the situation worth and typescript find <code>this</code> as <code>undefined</code></p>
  <h2>update</h2>
  <p>I created a bug for this in typescript repo
  <a href="https://github.com/microsoft/TypeScript/issues/47333" rel="nofollow noreferrer">https://github.com/microsoft/TypeScript/issues/47333</a>
  appreciate your like and thumbs up so ts team consider this as a bug</p>