Working on a graph visualization task, I found the following interface in the d3.js typings (upstream link here):
export interface Force<NodeDatum extends SimulationNodeDatum, LinkDatum extends SimulationLinkDatum<NodeDatum> | undefined> {
(alpha: number): void; // <- ???
initialize?(nodes: NodeDatum[]): void;
}
This (alpha: number): void;
seems to me a little bit uncommon. My intuition from different OOP languages says as if it would be some like a C++ functor. But I couldn't find the correct syntax to implement it.
What is it?
How can I implement this interface?
How can I call this method?