title: Adding properties to a class via decorators in TypeScript
body: <p>On the TypeScript's Decorator reference page there is a code snipped that illustrates how to override the constructor with class decorator:</p>
  
  <pre><code>function classDecorator&lt;T extends {new(...args:any[]):{}}&gt;(constructor:T) {
      return class extends constructor {
          newProperty = "new property";
          hello = "override";
      }
  }
  
  @classDecorator
  class Greeter {
      property = "property";
      hello: string;
      constructor(m: string) {
          this.hello = m;
      }
  }
  
  console.log(new Greeter("world"));
  </code></pre>
  
  <p>and in logs: </p>
  
  <pre><code>class_1 {
    property: 'property',
    hello: 'override',
    newProperty: 'new property' }
  </code></pre>
  
  <p>So far so good. BUT trying to access <code>newProperty</code> by dot notation fails with:</p>
  
  <blockquote>
    <p>Property 'newProperty' does not exist on type 'Greeter'.ts(2339) </p>
  </blockquote>
  
  <p>error and it's not listed in hints in VS Code. One can access it by bracket notation but TS warns that </p>
  
  <blockquote>
    <p>Element implicitly has an 'any' type because type 'Greeter' has no index signature.ts(7017)</p>
  </blockquote>
  
  <p>Am I missing something? How to implement adding new properties via Decorators in type-safe way? I'd like to have normal compiler support just like with regular class members.</p>