Object Types
In TypeScript, object types describe the shape of an object. They specify the names and types of the object’s properties, as well as whether those properties are required or optional.
In TypeScript, you can define object types in two primary ways:
Interface which defines the shape of an object by specifying the names, types, and optionality of its properties.
Type alias, similar to an interface, defines the shape of an object. However, it can also create a new custom type that is based on an existing type or a combination of existing types. This includes defining union types, intersection types, and other complex types.
It also possible to define a type anonymously: