Basics

Challenges

Classes

Cookies

Debugging

Events

External Files

Flow Control

Forms

Functions

Html Elements

Installation

Interfaces

Keywords

Modules

Namespaces

Operators

Reference Files

String

Types

TypeScript - Interface Demo

This demonstrates the use of a Interface. In this example, we are using an Interface to define an Object Contract. The DisplaySpaceship method requires a SpaceshipConfiguration Type which is the interface. In this example, it is acting like a DTO.

Here's a video showing how an interface can be used to pass options:
https://www.youtube.com/watch?v=NeUrwZVi4IE

Tip: Interfaces cannot be instantiated.