Interface is a skeleton something should conform to. In general, interfaces are skeletons for classes. But need to explicitly mention that class implements the interface. Whether the class conforms to the interface is checked at compile-time. But since, in JavaScript almost everything is an object. Interface is a skeleton for an object. Since class is also an object, and everything is covered. Unlike in other languages, interface can be used with any object at the compile-time, and checked if it conforms with the interface.
Interfaces
RELATED
PROGRAMMING LANGUAGES / 03 MINData-TypesThe primitive, non-primitive, and special types in TypeScript, plus the built-in utility types and when to use arrow vs regular functions.PROGRAMMING LANGUAGES / 01 MINType Aliastype is a keyword used to create a type alias, which is a name given to a type expression. They support primitives, objects, arrays, tuples, unions, intersections and conditional types.PROGRAMMING LANGUAGES / 01 MINType AnnotationsType annotation can be done by specifying type after a : (colon).