title: Passing class method as parameter in Typescript
body: <p>I'm searching for a possibility to pass a class-method to a function which then can execute that function on an instance of that class.
  Something like that pseudocode: (note that this is an abstract example)</p>
  
  <pre><code>class Foo {
      public somefunc() {
          // do some
      }
      public anyfunc() {
          // do any
      }
  }
  
  function bar(obj: Foo ,func: "Foo.method") {  // "that's what im looking for"
      obj.func();
  }
  
  bar(new Foo(), Foo.somefunc);  // do some
  bar(new Foo(), Foo.anyfunc);  // do any
  </code></pre>
  
  <p>Is there a possiblity to do this?</p>
  
  <p>I know i could be doing something like that:</p>
  
  <pre><code>class Foo {
      static somefunc(fooObj: Foo) {
          // do some
      }
      static anyfunc(fooObj: Foo) {
          // do any
      }
  }
  
  interface func {
      (fooObj: Foo);
  }
  
  function bar(obj: Foo, fn: func) {
      fn(obj);
  }
  
  bar(new Foo(), Foo.somefunc);  // do some
  bar(new Foo(), Foo.anyfunc);  // do any
  </code></pre>
  
  <p>but that involves static functions which I don't want.</p>