# `Macaw.Frame.Contract`
[🔗](https://github.com/dcoai/macaw_frame/blob/v0.1.0/lib/macaw/frame/contract.ex#L1)

What the Frame needs from macaw_component's contract and macaw's core, and which of it
has landed (spec/01 §9, spec/05 §9): one table, so every fallback is read in one place
and each switches on where its addition lands.

| Addition | Where | Present | Until it lands |
|---|---|---|---|
| `:variables` | `variables/1`, qualified parameters | yes (macaw_component 0.12) | — |
| `:reducer` | `reducer/3`, `reducer/4` in the slot's request | yes (0.12) | — |
| `:request` | `request/2`, a hook's request transition | yes (0.12) | — |
| `:clock` | `clock/2`, the easing clock | yes (0.12) | — |
| `:carry` | `init/3`, initialized from the value replaced | yes (0.12) | — |
| `:ratio` | `Context.ratio`, read by `budget/4` and `reducer/4` | yes (0.12) | — |
| `:motion` | `Context.motion` | yes (0.12) | — |
| `:ticks` | `tick_interval/1`, `tick/2` | yes (0.12) | — |
| `:measured_size` | a hook's `macaw:size` report | yes (0.12, `Client.reportSize`) | — |
| `:window_widened` | `window` taking a number range and a `:point` box (macaw#340) | no | a brush or zoom over a number `x` and a geographic view declare no `window` write; their events are mapped by a cell action |
| `:observation` | a hook's `observes` report carried to the host (macaw#167) | no | the hooks report nothing; the Frame still declares its observations |
| `:selection_fields` | the core handing `selection` in a cell's fields (macaw#340) | no | a Frame draws no selection it is not handed in fields; picking still writes it |

macaw_component 0.12 landed every addition of its own contract (macaw_component#54), so
the rows still absent are the core's (dco-tek/macaw/macaw#340, macaw#167). The ratio's
row means spec/05 §2.5's fallback, budgets at resolution 1, is no longer the Frame's:
`budget/4` and `reducer/4` read `context.ratio`, and only a host calling `budget/3`
reads ratio 1.

# `addition`

```elixir
@type addition() ::
  :variables
  | :reducer
  | :request
  | :clock
  | :carry
  | :ratio
  | :motion
  | :ticks
  | :measured_size
  | :window_widened
  | :observation
  | :selection_fields
```

An addition of spec/01 §9's table.

# `absent`

```elixir
@spec absent() :: [addition(), ...]
```

The additions still absent, each running on its stated fallback.

# `additions`

```elixir
@spec additions() :: [addition(), ...]
```

Every addition of spec/01 §9, those present first.

    iex> length(Macaw.Frame.Contract.additions())
    12

# `present?`

```elixir
@spec present?(term()) :: boolean()
```

Whether an addition has landed, so the Frame takes it rather than its fallback; `false`
for a name the table does not hold.

    iex> {Macaw.Frame.Contract.present?(:ratio), Macaw.Frame.Contract.present?(:window_widened)}
    {true, false}

---

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