Use function types instead of interfaces with call signatures (prefer-function-type)
Rule Details
interface Foo {
(): string;
}function foo(bar: { (): number }): number {
return bar();
}interface Foo extends Function {
(): void;
}interface Foo {
(): void;
bar: number;
}function foo(bar: { (): string; baz: number }): string {
return bar();
}When Not To Use It
Further Reading
Last updated