Why would you create this construct in TypeScript?
var sayFirstNumber: (firstNumber: number) => void;
sayFirstNumber = function (first: number) {
console.log(first);
}
The only reason to do that is if you want to later re-assign sayFirstNumber to other implementations. Otherwise you wouldn't need to create a variable like that, you just do:
function(first: number):void {
console.log(first);
}
In your example the arrow construct is just defining the type of sayFirstNumber. The => indicates that that var sayFirstNumber will expect to be set to some type of function. The left hand side of the => represents the parameters that the function should contain. The right hand side of the => represent the return type that the function should return.