Syntax

TypeScript Extend an Interface Syntax

In TypeScript, extend an interface: builds an interface from another — interface Admin extends User { role: string; }

Quick Answer

Syntax
interface Admin extends User { role: string; }
TypeScriptSyntax

Extend an Interface

Code example
interface Admin extends User { role: string; }

Builds an interface from another.

Learn More

How to extend an interface in TypeScript

  1. Open your TypeScript file or editor.
  2. Copy the example, then replace its sample names and values for your code.

TypeScript Extend an Interface Syntax

Use interface Admin extends User { role: string; }.

Related Syntax References

Frequently asked questions

What is the TypeScript syntax for extend an interface?

Use this pattern: interface Admin extends User { role: string; }

Can I copy this TypeScript code example?

Yes. Use Copy code and adapt the example to your program.

Is this TypeScript syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify