When an interface follows this pattern:
interface Callable {
(): any
}
it's said that anything that implements this interface is callable or has a call signature. It's a fancy way to describe functions and methods. There are other variations of that notation:
interface GenericCallable<T> {
(): T
}
interface Newable {
new (): any
}
interface GenericNewable<T> {
new (): T
}
where the ones with the new keyword are newable, which means they are called using the new keyword (like classes).
You can also have an interface which is callable and newable at the same time. The Date object built into the standard library is one of them:
interface DateConstructor {
new(): Date;
(): string;
}
Long story short, interfaces can also describe functions and GenericIdentityFn is an example of such an interface.