Extending Interface

suggest change

Suppose we have an interface:

interface IPerson {
    name: string;
    age: number;

    breath(): void;
}

And we want to create more specific interface that has the same properties of the person, we can do it using the extends keyword:

interface IManager extends IPerson {
    managerId: number;

    managePeople(people: IPerson[]): void;
}

In addition it is possible to extend multiple interfaces.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents