Cringe.Painter (cringe v0.5.0)

Copy Markdown View Source

Stateful terminal frame painter.

The painter returns ANSI iodata for changed lines only after the first frame. It also owns runtime cursor visibility for frames that expose a cursor.

Summary

Types

t()

@type t() :: %Cringe.Painter{
  cursor: {pos_integer(), pos_integer()} | nil,
  cursor_visible?: boolean(),
  height: pos_integer(),
  previous: [String.t()],
  width: pos_integer()
}

Functions

new(width, height)

@spec new(pos_integer(), pos_integer()) :: t()

render(painter, frame)

@spec render(t(), Cringe.Document.t() | Cringe.Frame.t()) :: {IO.chardata(), t()}