[Typescript] What is a Function Type ? Function Types and Interfaces - Are They Related ?
Function Type:
type messageFn = (name: string) => string; function sayHello(name: string): string { return `hello ${name}` } const sayHello: messageFn = sayHello;
Interface:
interface messageFn { (name: string): string }