microsoft/typespec

Public

mirrored fromhttps://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
064161d8277a88b3facccca58df87aa332bf9187

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/language-basics/alias.md

16lines · modepreview

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

# Alias

Aliases can be defined for types. This can be helpful to reuse a complex expression.

Alias is only a syntax helper, and it has no representation in the type graph. This means that aliases cannot be decorated. Use [`model is`](./models.md) to provide an alternate name for a model.

Alias can be defined using the `alias` keyword

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