How do you define an array of callback functions in TypeScript?
Here's how a single callback function looks like:
var callback:(param:string)=>void = function(param:string) {};
To declare an array of callbacks, you might try this:
var callback:(param:string)=>void[] = [];
However, this can cause confusion as it could be interpreted as an array of callbacks or a single callback that returns an array of voids.
When tested in the TypeScript playground, it is treated as an array of voids. One possible solution might be to use parentheses:
var callback:((param:string)=>void)[] = [];
Unfortunately, this approach doesn't seem to work either.
Do you have any other suggestions?