These ads are fully equivalent.
The only difference is that the second form cannot be used to overload functions:
interface Example {
myFunction(s: string): void;
myFunction(s: number): void;
}
interface Example {
myFunction: (s: string) => void;
myFunction: (s: number) => void;
}
source
share