title: Is there a way to add methods on the fly to a class using typescript?
body: <p>I am trying create some kind of mixin method that add methods to the prototype/class on the fly but I get errors such as </p>
  
  <blockquote>
    <p>The property 'greetName' does not exist on value of type 'Greeter'
    any</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>The property 'greetName' does not exist on value of type 'Greeter'
    any</p>
  </blockquote>
  
  <p>when I run the following code.</p>
  
  <pre><code>class Greeter {
      greeting: string;
      constructor (message: string) {
          this.greeting = message;
      }
      greet() {
          return "Hello, " + this.greeting;
      }
  }
  
  Greeter.prototype.greetName = function(name){
          return this.greet() + ' ' + name;
  }
  
  var greeter = new Greeter('Mr');
  
  window.alert(greeter.greetName('Name'));
  </code></pre>
  
  <p>It actually compiles to valid js and runs as expected.  Is there a way to do this with out compiler warnings/errors?  </p>