The Role of Interfaces in TypeScript
In my last post I talked about how classes and interfaces could be extended in the TypeScript language. By using TypeScript’s extends keyword you can easily create derived classes that inherit functionality from a base class. You can also use the extends keyword to extend existing interfaces and create new ones. In the previous post I showed an example of an ITruckOptions interface that extends IAutoOptions. An example of the interfaces is shown next: interface IAutoOptions { engine: IEngine; basePrice: number; state: string; make: string; model: string; year: number; } interface ITruckOptions extends IAutoOptions { bedLength: string; fourByFour: bool; } […]