# `ExRatatui.CellSession.Snapshot`
[🔗](https://github.com/mcass19/ex_ratatui/blob/v0.10.0/lib/ex_ratatui/cell_session/snapshot.ex#L1)

Full-buffer snapshot returned by `ExRatatui.CellSession.take_cells/1`.

Carries the dimensions of the buffer plus every cell, in row-major
order — `cells` has length `width * height`. Use this when you need
the complete picture: initial paint after a fresh client connects,
one-off screenshot, regression test fixture.

For streaming updates use `ExRatatui.CellSession.take_cells_diff/1`
instead, which returns the same `Cell` shape inside an
`ExRatatui.CellSession.Diff` payload but only includes cells that
changed since the last diff call.

## Fields

  * `:width` — terminal width in cells
  * `:height` — terminal height in cells
  * `:cells` — list of `t:ExRatatui.CellSession.Cell.t/0` in
    row-major order: `(0,0), (1,0), ..., (W-1,0), (0,1), ...`

## Examples

    iex> %ExRatatui.CellSession.Snapshot{}
    %ExRatatui.CellSession.Snapshot{width: 0, height: 0, cells: []}

# `t`

```elixir
@type t() :: %ExRatatui.CellSession.Snapshot{
  cells: [ExRatatui.CellSession.Cell.t()],
  height: non_neg_integer(),
  width: non_neg_integer()
}
```

# `from_native`

```elixir
@spec from_native(%{
  width: non_neg_integer(),
  height: non_neg_integer(),
  cells: [tuple()]
}) :: t()
```

Builds a `t:t/0` from the raw `%{width, height, cells}` map the NIF
returns. Each tuple in `cells` is converted via
`ExRatatui.CellSession.Cell.from_tuple/1`.

---

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