0Pricing
TypeScript Academy · Lesson

Implementing Interfaces with Classes

Enforce class structure with the implements keyword.

Welcome

The `implements` keyword ensures a class fulfills an interface contract. TypeScript verifies the class provides all required properties and methods.

Basic implements

Use `implements InterfaceName` after the class name. TypeScript errors if any required member is missing.
interface Printable {
  print(): void;
}
class Document implements Printable {
  print() { console.log('Printing...'); }
}

All lessons in this course

  1. TypeScript Classes and Constructors
  2. public, private, and protected Modifiers
  3. readonly Properties and Parameter Properties
  4. Implementing Interfaces with Classes
← Back to TypeScript Academy