Type Aliases
Type Aliases allow you to declare references to any type – advanced or primitive. Aliases make our code easier to read by allowing us to be less verbose. Aliases allow you, the developer, to declare your type once and reuse it throughout your application. This makes working with complex types easier and your code more readable and maintainable.
Let's say, for example, we are working on a social networking application and we needed to provide an administrator user type for users to manage the pages they created. Additionally, we also need to define a site administrator user. On a base level, they are both admins, and therefore the types would have some commonality between them. With a type alias, we could create an admin type as shown in Figure 6.1, with common properties an admin user would possess and build upon that admin when creating our site admin and user admin types. Aliases allow you to mask the complexity of your code, which will make it easier...