> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Type Alias

A type alias in TypeScript is a declaration that assigns a custom identifier to a specific type structure. Rather than creating a distinct new type in the type system, it establishes a symbolic name that the TypeScript compiler resolves to the underlying type definition during static analysis.

```typescript theme={"dark"}
type Identifier = TypeExpression;
```

Type aliases can represent any valid TypeScript type expression. This includes primitives, complex object shapes, unions, intersections, tuples, and function signatures.

```typescript theme={"dark"}
// Primitive
type UUID = string;

// Object Shape
type Point = {
  x: number;
  y: number;
};

// Union
type State = "pending" | "resolved" | "rejected";

// Intersection
type SerializablePoint = Point & { toJSON(): string };

// Tuple
type Coordinates = [number, number, number];

// Function Signature
type Comparator = (a: number, b: number) => boolean;
```

## Generics

Type aliases fully support generic type parameters, allowing for the creation of parameterized, reusable type definitions. The generic parameters are passed inside angle brackets `<>` immediately following the alias identifier.

```typescript theme={"dark"}
type Result<T, E> = 
  | { success: true; data: T } 
  | { success: false; error: E };

type Dictionary<K extends string | number | symbol, V> = Record<K, V>;
```

## Recursion

Type aliases can be self-referential (recursive) to represent infinitely nested structures. The TypeScript compiler permits this as long as the recursive reference is deferred, typically by being nested within an object property or an array type.

```typescript theme={"dark"}
type JSONValue = 
  | string 
  | number 
  | boolean 
  | null 
  | JSONValue[] 
  | { [key: string]: JSONValue };
```

## Structural Constraints

A defining mechanical characteristic of a type alias is that it is closed upon declaration. Unlike interfaces, type aliases do not support declaration merging. Attempting to declare multiple type aliases with the exact same identifier within the same module scope will result in a `Duplicate identifier` compiler error.

```typescript theme={"dark"}
type Entity = { id: string };

// Compiler Error: Duplicate identifier 'Entity'.
// type Entity = { createdAt: Date }; 
```

Furthermore, when a type alias is used in an error message or IDE hover tooltip, TypeScript will often expand the alias to its underlying type structure, demonstrating that the alias is purely a developer-facing syntactic convenience rather than a nominal type boundary.

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor TypeScript Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
