Interface is a TypeScript concept and there is no alternate version in JavaScript; hence, when we write an interface, it does not get transpiled into JavaScript. Interfaces play an important role in TypeScript of providing us with a contract that can be enforced in a class. In TypeScript, interfaces allow us to create our own custom types and provide compile-time checks to make sure the types are used correctly.
An interface is a collection of properties and methods but with no implementation. Its basic purpose is to provide the shape of an object. This means that we can have an interface that defines a couple of properties and a method that accepts one parameter. This interface will not specify how this method is implemented, just the method signature. The implementation will be the responsibility of the class implementing this interface.