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

# Data Types

> Primitive, object, array, tuple, enum, union, variant, and schema reference types.

Superwire types describe `input`, `secrets`, schema fields, tool contracts, and agent outputs.

## Primitives

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
string
number
float
boolean
null
```

`object` is also available as a broad object type when you do not want to define fixed fields.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
object
```

## Objects

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
{
    title: string
    score: number
}
```

Inline object fields use commas:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
{ title: string, score: number }
```

## Arrays

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
[string]
[number]
[schema.participant]
```

Fixed-length arrays use a semicolon:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
[string; 3]
```

## Tuples

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
(string, number)
(string, number, [string; 3])
```

## Unions and nullable types

Use `|` when a value may be one of multiple types:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
string | number
schema.contact.email | schema.contact.phone
```

Use `maybe` as nullable shorthand:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
maybe string
```

`maybe string` is equivalent to `string | null`.

## Enums

Inline enum variants use commas:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
enum { draft, ready, published }
```

Multiline enum variants do not require commas:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
enum {
    draft
    ready
    published
}
```

## Schema references

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
schema participant {
    name: string
    role: string
}

schema article {
    title: string
    author: schema.participant
}
```

## Variants

Use `variant` for tagged unions where each case has its own object shape.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
schema event_payload {
    payload: variant type {
        user_created {
            user_id: string
        }

        "user.deleted" {
            user_id: string
            reason: maybe string
        }
    }
}
```

You can also define a root-level variant directly on a schema:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
schema api_event {
    variant type {
        created {
            id: string
        }

        deleted {
            id: string
        }
    }
}
```
