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";
Referencing model properties
You can reference model properties using the .
operator for identifiers.
alias PetName = Pet.name;