# `Kinda.CodeGen.TypeSpecRef`
[🔗](https://github.com/beaver-lodge/kinda/blob/main/lib/codegen/type_spec_ref.ex#L1)

A small embedded DSL describing typespecs in declaration manifests.

Typespecs are plain terms: builtins (`:term`, `:integer`, ...), remote
module types, lists, maps, tuples and unions. `to_quoted/1` lowers them into
quoted Elixir typespecs, and `to_manifest/1` / `from_manifest/1` round-trip
them through the JSON-compatible manifest format.

# `builtin`

```elixir
@type builtin() :: :term | :integer | :float | :boolean | :binary | :atom | :ok
```

# `map_key`

```elixir
@type map_key() :: atom() | String.t()
```

# `t`

```elixir
@type t() ::
  builtin()
  | {:remote, module(), atom()}
  | {:list, t()}
  | {:map, [{map_key(), t()}]}
  | {:tuple, [t()]}
  | {:union, [t()]}
```

# `atom`

```elixir
@spec atom() :: :atom
```

# `binary`

```elixir
@spec binary() :: :binary
```

# `boolean`

```elixir
@spec boolean() :: :boolean
```

# `float`

```elixir
@spec float() :: :float
```

# `from_manifest`

```elixir
@spec from_manifest(map()) :: t()
```

# `integer`

```elixir
@spec integer() :: :integer
```

# `list`

```elixir
@spec list(t()) :: {:list, t()}
```

# `map`

```elixir
@spec map([{map_key(), t()}]) :: {:map, [{map_key(), t()}]}
```

# `ok`

```elixir
@spec ok() :: :ok
```

# `remote`

```elixir
@spec remote(module(), atom()) :: {:remote, module(), atom()}
```

# `term`

```elixir
@spec term() :: :term
```

# `to_manifest`

```elixir
@spec to_manifest(t()) :: map()
```

# `to_quoted`

```elixir
@spec to_quoted(t()) :: Macro.t()
```

# `tuple`

```elixir
@spec tuple([t()]) :: {:tuple, [t()]}
```

# `union`

```elixir
@spec union([t()]) :: {:union, [t()]}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
