Function Signature

A function signature defines the shape or structure of a function in TypeScript. It specifies the parameter list, the return type, and optionally the this type of a function. A function signature can be also expressed with a function type.

Example:

1
2
3
4
5
type MyFunctionSignature = (a: number, b: number) => number;

const add: MyFunctionSignature = (a, b) => {
return a + b;
};