type (alias)
Gives a name to a type.
Syntax
type Name = type;
Description
You give a short name to a type with type — ideal for union types and complex types. Similar to interface but more flexible.
Example
Loading editor…
Expected output
A1
When to use?
Naming union types and repeating type patterns.