title: TypeScript: Type of the current class as a type variable
body: <p>I want to declare a function in TypeScript that returns the type of the current instance's type, e.g. in a fluent API that returns <code>this</code>.</p>
  
  <p>Is there a type variable for "this type"? (I would rather not use the ugly Java way of <code>X&lt;T extends X&lt;T&gt;&gt;</code>.)</p>