I've defined an interface A like this:
interface A {
(): any;
b: any;
};
However, it's not easy to define a variable that is compatible with this interface.
I've tried with:
var a: A = function () { console.log('This is a function'); }
a.b = 'This is a field';
This snippet failed due to Property 'b' is missing in type '() => void'. I think it's reasonable, as there's no b field when defining a.
Then I tried with this one:
var a: A = <A> function () { console.log('This is a function'); }
a.b = 'This is a field';
This worked, but I have no idea what's this <A> function ... syntax is.
It'll be great if someone could help. I've searched every corner in the official document.
Thanks.