Google News
logo
TypeScript - Interview Questions
What are Interfaces in TypeScript?
The interface is a structure that defines the contract in your application. It defines the syntax for classes to follow. It contains only the declaration of the members and it is the responsibility of the deriving class to define the members. The TypeScript compiler uses interface for type-checking and checks whether the object has a specific structure or not.
 
Syntax :
interface interface_name {
// variables' declaration
// methods' declaration
}
Advertisement