microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
4ddf43ae0dffb11cf982bebe006f37d5524bee69

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docs/language-basics/alias.md

14lines · modepreview

---
id: aliases
title: Aliases
---

# 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`](./models.md).

You can define an alias using the `alias` keyword.

```typespec
alias Options = "one" | "two";
```