TypeScript allows You to declare types in a model which can then be reused throughout the rest of the application. The biggest feature that TypeScript brings developers is the ability add explicit types to Javascript variables.
For example, if we have a variable called name that should only be a string, we can tell TypeScript to throw an error should name ever be set to anything other than a string (like an integer, object, etc):
let name: string;
A simple example of this is a User Interface that defines a name variable that’s a string and an age variable that must be a number:
export interface User {
name: string = 'Angular';
age: number = 0;
}