How would you declare a callback array in TypeScript?
One callback is as follows:
var callback:(param:string)=>void = function(param:string) {};
So the callback array should look like this:
var callback:(param:string)=>void[] = [];
However, this creates ambiguity, because I can keep in mind an array of callbacks or one callback that returns an array of voids.
At TypeScript, she thinks it's an array of voids. So my next one though was to enclose it in parentheses:
var callback:((param:string)=>void)[] = [];
But that doesn't work either.
Any other ideas?
source share