On http://www.typescriptlang.org/Handbook#interfaces website Hybrid Types are explained. As these are extremely helpful for creating typings to JS - I wonder if it\'s possib
I think the more updated version is this:
interface Counter {
(start: number): string;
interval: number;
reset(): void;
}
function getCounter(): Counter {
return (() => {
var result: any = (start: number) => "Start!";
result.result = 10;
result.reset = () => {}
//Converts the temporary variable to the interface type.
return result;
})();
}