Raxol.Core.Buffer (Raxol v2.3.0)

View Source

Compatibility layer for legacy Raxol.Core.Buffer references.

This module exists to maintain backwards compatibility with plugins that reference the old apps/raxol_core modules.

Maps to Raxol.Terminal.Buffer operations where possible.

Summary

Functions

Clear buffer, resetting all cells to blank

Create blank buffer with lines structure for TerminalBridge compatibility

Get cell at coordinates

Resize buffer to new dimensions

Set cell at coordinates

Convert buffer to string

Write text at coordinates

Types

cell()

@type cell() :: %{char: String.t(), style: map()}

line()

@type line() :: %{cells: [cell()]}

t()

@type t() :: %{
  width: non_neg_integer(),
  height: non_neg_integer(),
  lines: [line()],
  cells: list()
}

Functions

clear(buffer)

Clear buffer, resetting all cells to blank

create_blank_buffer(width, height)

Create blank buffer with lines structure for TerminalBridge compatibility

get_cell(buffer, x, y)

Get cell at coordinates

resize(buffer, new_width, new_height)

Resize buffer to new dimensions

set_cell(buffer, x, y, char, style)

Set cell at coordinates

to_string(buffer)

Convert buffer to string

write_at(buffer, x, y, text)

Write text at coordinates

write_at(buffer, x, y, text, style)