Coming from a C# background, I want to create a datatype that defines a function signature. In C#, this is a delegate
declared like this:
delegate v
Type definition for a callable expression (this is a draft ok, for humans... not a BNF or anything formal):
callableType: (paramsDef) => returnType
paramsDef: MULTIPLE paramDef SEPARATED BY ,
paramDef: EITHER paramName: paramType
OR optionalParamName?: paramTypeWhenDefined
OR ...manyParamName: eachParamType[]
Example:
var func = something as ((...x: any[]) => any);
Then you can:
var result = func("a", "b", 2);