# `Expresso.Overlay.Check`
[🔗](https://github.com/rellen/expresso/blob/main/lib/expresso/overlay/check.ex#L1)

The checks of the overlay steps of one slide

`slide/1` does the work of the verifier, and it is a pure function on an
`Expresso.Slide` struct that `Expresso.Overlay.Expand.slide/1` expanded. It
reads the `steps` field of each element and of each `on` entity.

`docs/overlays.md` gives the conditions.

# `slide`

```elixir
@spec slide(Expresso.Slide.t()) :: :ok | {:error, String.t()}
```

Give an error for a slide that breaks a rule of the overlays

The function reports the first of these conditions:

- A `pause` entity is inside an element.
- A step number is less than 1.
- An `on` entity has a step at which its element does not show.
- An `on` entity with `move_to` is not in a part, or it also sets `x` or
  `y`.
- An `on` entity with `copy_to` is not in a part of a diagram.
- A child element has a step at which its nearest ancestor with steps does
  not show.
- A group of the `highlight` option of a chart has a step at which the chart
  does not show.
- A frame of a chart starts at a step at which the chart does not show.

An element without an `at` option shows at each step of its parent.
Therefore its nearest ancestor with steps limits the steps of its
descendants and of its `on` entities. An element without such an ancestor
shows at each step, and the function accepts each step for it. The
transformer reports a step that is more than the maximum, because the
expansion needs the maximum.

---

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