TypeScript Call Signatures (original) (raw)

Last Updated : 11 Sep, 2025

TypeScript call signatures define the parameter types and return types for function-like objects, enabling the creation of callable entities with additional properties.

**Syntax:

type MyCallableObject = {
(parameter1: Type1, parameter2: Type2): ReturnType;
propertyName: PropertyType;
};

**Parameters:

**Greeting Function Using Call Signature

Call signatures allow us to define a function type that is both callable like a function and can also have additional properties. This is useful when you want a function to carry extra information along with its callable behavior.

Now let’s understand with the help of an example:

TypeScript ``

type GreetingFunction = { (name: string): string; description: string; };

const greet: GreetingFunction = (name: string) => { return Hello, ${name}!; };

greet.description = "A function to greet users";

console.log(greet("Alice"));
console.log(greet.description);

``

**Output:

Hello, Alice!
A function to greet users

**In this example:

Calculator Using Call Signature

A call signature can define functions with parameters while also attaching descriptive properties****.**

Now let’s understand with the help of an example:

TypeScript ``

type Calculator = { (a: number, b: number): number; operation: string;
};

const add: Calculator = (a: number, b: number) => a + b; add.operation = "Addition";

const multiply: Calculator = (a: number, b: number) => a * b; multiply.operation = "Multiplication";

console.log(${add.operation}: ${add(5, 3)});
console.log(${multiply.operation}: ${multiply(5, 3)});

``

**Output:

Addition: 8
Multiplication: 15

**In this example: