Is there a way in TypeScript to indicate that the return is the type of a parameter, without explicitly declaring the type (e.g. in a generic parameter)? Sort of like indicating that it's a type identity function.
For example:
function foo(bar) {
// ...do crazy stuff to bar...
return bar;
}
var aString = foo('baz'); // aString is of string type
var aNumber = foo(6); // aNumber is of number type