I\'m struggling to figure out if it\'s possible in TypeScript to declare a statically typed array of functions.
For example, I can do this:
foo: (data:st
If you wish declare an array of callable function in TypeScript, you can declare a type:
type Bar = ( (data: string) => void );
And then use it:
const foo: Bar[] = []; const fooFn = (data: string) => console.log(data); foo.push(fooFn); foo.forEach((fooFn: Bar) => fooFn("Something");