# `Riddler.Screens.Registry`
[🔗](https://github.com/riddler/riddler-ex/blob/v0.4.0/lib/riddler/screens/registry.ex#L1)

The node types this version of the runtime knows, by the name a document
spells them with.

A document's `type` is an open string: the schema does not enumerate the
types, so a host may carry a document holding a type through a validator
older than that type without having it rejected on the way. This registry
is the other half of that rule. It does enumerate them, so a type it does
not know is refused here, loudly, naming the type and the node - never a
node quietly passed through as though the runtime had understood it.

The types are `heading`, `text`, `text_question`, `choice_question`,
`boolean_question`, `button` and `variant`.

    iex> Riddler.Screens.Registry.types()
    ["boolean_question", "button", "choice_question", "heading", "text", "text_question", "variant"]

    iex> Riddler.Screens.Registry.fetch("heading")
    {:ok, Riddler.Screens.Type.Heading}

    iex> Riddler.Screens.Registry.fetch("carousel")
    :error

# `fetch`

```elixir
@spec fetch(term()) :: {:ok, module()} | :error
```

The module implementing `type`, or `:error` when this version has no such
type.

# `types`

```elixir
@spec types() :: [String.t()]
```

Every type name this version knows, sorted.

---

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