Skip to content

Aliases

Aliases are a convenient way to define shorthand for types, especially when dealing with complex expressions. They simplify the syntax but donโ€™t have a representation in the type graph. As a result, you canโ€™t decorate aliases. If you need to give an alternate name to a model, use model is.

You can define an alias using the alias keyword.

alias Options = "one" | "two";