3import ViewManager from "../viewManager";
4
5export interface MouseToolCallback {
6 (event: MouseEvent): void; 7}
8export default class MouseTool {
9
Using a function type is suggested instead of an interface or object type literal with a single call signature.
// Example 1
interface Foo {
(): string;
}
// Example 2
function foo(bar: { (): number }): number {
return bar();
}
// Example 3
interface Foo extends Function {
(): void;
}
// Example 1
interface Foo {
(): void;
bar: number;
}
// Example 2
function foo(bar: { (): string; baz: number }): string {
return bar();
}
// Example 3
interface Foo {
bar: string;
}
interface Bar extends Foo {
(): void;
}