skip to content
Alvin Lucillo

Aliasing types in typescript

/ 1 min read

There are libraries or code generation that generate schemas for us. For example, openapi spec generators. When generated objects are too verbose, it’s also practical to shorten them if they’re referenced multiple times in your codebase. You can do that by exporting the same object with a different name.

export type UserMgmtDetails = UserManagementAPIDetailsResponse;