hustcer/tabular/papergrid does not have a README file

    ANSIFmt

    pub(open) trait ANSIFmt {
    fn fmt_ansi_prefix(Self, StringBuilder) -> Unit
    fn fmt_ansi_suffix(Self, StringBuilder) -> Unit
    }

    Write ANSI style boundaries independently of the text being formatted.

    ANSIBuf

    pub(all) struct ANSIBuf {
    prefix : String
    suffix : String
    } derive(Eq,
    Debug
    )

    An ANSI prefix and suffix, kept separate from the visible cell text.
    impl ANSIFmt for ANSIBuf

    ANSIBuf::as_ansi_str

    fn ANSIBuf::as_ansi_str(self : ANSIBuf) -> ANSIStr

    ANSIBuf::default

    fn ANSIBuf::default() -> ANSIBuf

    ANSIBuf::empty

    fn ANSIBuf::empty() -> ANSIBuf

    ANSIBuf::equal

    fn ANSIBuf::equal(ANSIBuf, ANSIBuf) -> Bool

    ANSIBuf::fmt_ansi_prefix

    fn ANSIBuf::fmt_ansi_prefix(self : ANSIBuf, out : StringBuilder) -> Unit

    ANSIBuf::fmt_ansi_suffix

    fn ANSIBuf::fmt_ansi_suffix(self : ANSIBuf, out : StringBuilder) -> Unit

    ANSIBuf::from_ansi_str

    fn ANSIBuf::from_ansi_str(value : ANSIStr) -> ANSIBuf

    ANSIBuf::get_prefix

    fn ANSIBuf::get_prefix(self : ANSIBuf) -> String

    ANSIBuf::get_suffix

    fn ANSIBuf::get_suffix(self : ANSIBuf) -> String

    ANSIBuf::is_empty

    fn ANSIBuf::is_empty(self : ANSIBuf) -> Bool

    ANSIBuf::new

    fn ANSIBuf::new(prefix : String, suffix : String) -> ANSIBuf

    ANSIBuf::not_equal

    fn ANSIBuf::not_equal(x : ANSIBuf, y : ANSIBuf) -> Bool

    ANSIBuf::to_repr

    ANSIBuf::try_parse

    fn ANSIBuf::try_parse(text : String) -> Result[ANSIBuf, Unit]

    Extract the canonical style of the first text block, as in tabled. Empty input or input containing only control sequences has no text block.

    ANSIStr

    pub(all) struct ANSIStr {
    prefix : String
    suffix : String
    } derive(Eq,
    Debug
    )

    A pair of ANSI sequences with the borrowed-style API used by papergrid. MoonBit strings are shared immutable values, so no explicit lifetime is needed.
    impl ANSIFmt for ANSIStr

    ANSIStr::default

    fn ANSIStr::default() -> ANSIStr

    ANSIStr::empty

    fn ANSIStr::empty() -> ANSIStr

    ANSIStr::equal

    fn ANSIStr::equal(ANSIStr, ANSIStr) -> Bool

    ANSIStr::fmt_ansi_prefix

    fn ANSIStr::fmt_ansi_prefix(self : ANSIStr, out : StringBuilder) -> Unit

    ANSIStr::fmt_ansi_suffix

    fn ANSIStr::fmt_ansi_suffix(self : ANSIStr, out : StringBuilder) -> Unit

    ANSIStr::get_prefix

    fn ANSIStr::get_prefix(self : ANSIStr) -> String

    ANSIStr::get_suffix

    fn ANSIStr::get_suffix(self : ANSIStr) -> String

    ANSIStr::is_empty

    fn ANSIStr::is_empty(self : ANSIStr) -> Bool

    ANSIStr::new

    fn ANSIStr::new(prefix : String, suffix : String) -> ANSIStr

    ANSIStr::not_equal

    fn ANSIStr::not_equal(x : ANSIStr, y : ANSIStr) -> Bool

    ANSIStr::to_repr

    Borders

    pub struct Borders {
    top : Char?
    top_left : Char?
    top_right : Char?
    top_intersection : Char?
    bottom : Char?
    bottom_left : Char?
    bottom_right : Char?
    bottom_intersection : Char?
    horizontal : Char?
    vertical : Char?
    left : Char?
    right : Char?
    intersection : Char?
    left_intersection : Char?
    right_intersection : Char?
    }

    Borders::ascii

    fn Borders::ascii() -> Borders

    Borders::ascii_rounded

    fn Borders::ascii_rounded() -> Borders

    Borders::build_line

    fn Borders::build_line(_self : Borders, left : Char?, fill : Char?, intersection : Char?, right : Char?, widths : Array[Int]) -> String

    Borders::dots

    fn Borders::dots() -> Borders

    Borders::empty

    fn Borders::empty() -> Borders

    Borders::extended

    fn Borders::extended() -> Borders

    Borders::has_bottom

    fn Borders::has_bottom(self : Borders) -> Bool

    Borders::has_horizontal

    fn Borders::has_horizontal(self : Borders) -> Bool

    Borders::has_left

    fn Borders::has_left(self : Borders) -> Bool

    Borders::has_right

    fn Borders::has_right(self : Borders) -> Bool

    Borders::has_top

    fn Borders::has_top(self : Borders) -> Bool

    Borders::has_vertical

    fn Borders::has_vertical(self : Borders) -> Bool

    Borders::markdown

    fn Borders::markdown() -> Borders

    Borders::modern

    fn Borders::modern() -> Borders

    Borders::psql

    fn Borders::psql() -> Borders

    Borders::re_structured_text

    fn Borders::re_structured_text() -> Borders

    Borders::remove_bottom

    fn Borders::remove_bottom(self : Borders) -> Borders

    Borders::remove_left

    fn Borders::remove_left(self : Borders) -> Borders

    Borders::remove_right

    fn Borders::remove_right(self : Borders) -> Borders

    Borders::remove_top

    fn Borders::remove_top(self : Borders) -> Borders

    Borders::remove_vertical

    fn Borders::remove_vertical(self : Borders) -> Borders

    Borders::rounded

    fn Borders::rounded() -> Borders

    Borders::with_bottom

    fn Borders::with_bottom(self : Borders, ch : Char) -> Borders

    Borders::with_bottom_intersection

    fn Borders::with_bottom_intersection(self : Borders, ch : Char) -> Borders

    Borders::with_bottom_left

    fn Borders::with_bottom_left(self : Borders, ch : Char) -> Borders

    Borders::with_bottom_right

    fn Borders::with_bottom_right(self : Borders, ch : Char) -> Borders

    Borders::with_horizontal

    fn Borders::with_horizontal(self : Borders, ch : Char) -> Borders

    Borders::with_intersection

    fn Borders::with_intersection(self : Borders, ch : Char) -> Borders

    Borders::with_left

    fn Borders::with_left(self : Borders, ch : Char) -> Borders

    Borders::with_left_intersection

    fn Borders::with_left_intersection(self : Borders, ch : Char) -> Borders

    Borders::with_right

    fn Borders::with_right(self : Borders, ch : Char) -> Borders

    Borders::with_right_intersection

    fn Borders::with_right_intersection(self : Borders, ch : Char) -> Borders

    Borders::with_top

    fn Borders::with_top(self : Borders, ch : Char) -> Borders

    Borders::with_top_intersection

    fn Borders::with_top_intersection(self : Borders, ch : Char) -> Borders

    Borders::with_top_left

    fn Borders::with_top_left(self : Borders, ch : Char) -> Borders

    Borders::with_top_right

    fn Borders::with_top_right(self : Borders, ch : Char) -> Borders

    Borders::with_vertical

    fn Borders::with_vertical(self : Borders, ch : Char) -> Borders

    CellBorder

    pub(all) struct CellBorder {
    top : Char?
    bottom : Char?
    left : Char?
    right : Char?
    left_top_corner : Char?
    right_top_corner : Char?
    left_bottom_corner : Char?
    right_bottom_corner : Char?
    }

    CellBorder::empty

    fn CellBorder::empty() -> CellBorder

    CellBorder::filled

    fn CellBorder::filled(ch : Char) -> CellBorder

    Entity

    pub(all) enum Entity {
    Global
    Row(Int)
    Col(Int)
    Cell(Int, Int)
    } derive(Eq,
    Debug
    )

    A table region used by configuration and selection APIs.

    Entity::equal

    fn Entity::equal(Entity, Entity) -> Bool

    Entity::iter

    fn Entity::iter(self : Entity, row_count : Int, col_count : Int) -> Iter[(Int, Int)]

    Enumerate valid positions in row-major order within an entity.

    Entity::not_equal

    fn Entity::not_equal(x : Entity, y : Entity) -> Bool

    Entity::to_repr

    Formatting

    pub(all) struct Formatting {
    trim_horizontal : Bool
    trim_vertical : Bool
    align_lines : Bool
    } derive(Eq,
    Debug
    )

    Rendering-only whitespace and multiline alignment policy.

    Formatting::default

    fn Formatting::default() -> Formatting

    Formatting::equal

    fn Formatting::equal(Formatting, Formatting) -> Bool

    Formatting::new

    fn Formatting::new(trim_horizontal~ : Bool, trim_vertical~ : Bool, align_lines~ : Bool) -> Formatting

    Formatting::not_equal

    fn Formatting::not_equal(x : Formatting, y : Formatting) -> Bool

    HAlign

    pub enum HAlign {
    Left
    Right
    Center
    }

    HAlign::center

    fn HAlign::center() -> HAlign

    HAlign::left

    fn HAlign::left() -> HAlign

    HAlign::right

    fn HAlign::right() -> HAlign

    HeightMode

    pub enum HeightMode {
    None
    Increase(Int)
    Limit(Int)
    }

    HeightMode::increase

    fn HeightMode::increase(size : Int) -> HeightMode

    HeightMode::limit

    fn HeightMode::limit(size : Int) -> HeightMode

    HeightMode::none

    fn HeightMode::none() -> HeightMode

    HorizontalLine

    pub struct HorizontalLine {
    main : Char?
    left : Char?
    intersection : Char?
    right : Char?
    }

    HorizontalLine::filled

    fn HorizontalLine::filled(ch : Char) -> HorizontalLine

    HorizontalLine::from_chars

    fn HorizontalLine::from_chars(main : Char?, left : Char?, intersection : Char?, right : Char?) -> HorizontalLine

    HorizontalLine::full

    fn HorizontalLine::full(main : Char, left : Char, intersection : Char, right : Char) -> HorizontalLine

    HorizontalLine::new

    fn HorizontalLine::new(ch : Char) -> HorizontalLine

    HorizontalLine::with_intersection

    fn HorizontalLine::with_intersection(self : HorizontalLine, ch : Char) -> HorizontalLine

    HorizontalLine::with_left

    fn HorizontalLine::with_left(self : HorizontalLine, ch : Char) -> HorizontalLine

    HorizontalLine::with_right

    fn HorizontalLine::with_right(self : HorizontalLine, ch : Char) -> HorizontalLine

    HorizontalLines

    pub enum HorizontalLines {
    All
    HeaderOnly
    None
    }

    HorizontalLines::all

    HorizontalLines::header_only

    fn HorizontalLines::header_only() -> HorizontalLines

    HorizontalLines::none

    Indent

    pub(all) struct Indent {
    fill : Char
    size : Int
    } derive(Compare, Eq, Hash,
    Debug
    )

    A character repeated to occupy an inner or outer indent.
    impl Default for Indent

    Indent::compare

    fn Indent::compare(Indent, Indent) -> Int

    Indent::default

    fn Indent::default() -> Indent

    Indent::equal

    fn Indent::equal(Indent, Indent) -> Bool

    Indent::hash

    fn Indent::hash(self : Indent) -> Int

    Indent::hash_combine

    fn Indent::hash_combine(Indent, Hasher) -> Unit

    Indent::is_empty

    fn Indent::is_empty(self : Indent) -> Bool

    Indent::new

    fn Indent::new(size : Int, fill : Char) -> Indent

    Indent::not_equal

    fn Indent::not_equal(x : Indent, y : Indent) -> Bool

    Indent::op_ge

    fn Indent::op_ge(x : Indent, y : Indent) -> Bool

    Indent::op_gt

    fn Indent::op_gt(x : Indent, y : Indent) -> Bool

    Indent::op_le

    fn Indent::op_le(x : Indent, y : Indent) -> Bool

    Indent::op_lt

    fn Indent::op_lt(x : Indent, y : Indent) -> Bool

    Indent::spaced

    fn Indent::spaced(size : Int) -> Indent

    Indent::to_repr

    Indent::zero

    fn Indent::zero() -> Indent

    IterGrid

    pub struct IterGrid {
    records : IterRecords
    config : SpannedConfig
    dimension : IterGridDimension
    }

    IterGrid::new

    fn IterGrid::new(records : IterRecords, config : SpannedConfig, dimension : IterGridDimension) -> IterGrid

    IterGrid::to_string

    fn IterGrid::to_string(self : IterGrid) -> String

    IterGridDimension

    pub struct IterGridDimension {
    widths : Array[Int]
    heights : Array[Int]?
    }

    IterGridDimension::default

    IterGridDimension::estimate

    fn IterGridDimension::estimate(self : IterGridDimension, records : IterRecords, cfg : SpannedConfig) -> Unit

    IterGridDimension::measure_heights

    fn IterGridDimension::measure_heights(records : IterRecords, config : SpannedConfig, apply_modes? : Bool) -> Array[Int]

    Measure row heights using the upstream per-axis span rules. By default this counts raw text lines; apply_modes=true includes render-time width and height modes without changing those span rules or using cached dimensions.

    IterGridDimension::measure_rendered

    fn IterGridDimension::measure_rendered(records : IterRecords, config : SpannedConfig) -> (Array[Int], Array[Int])

    Measure the dimensions used by IterGrid, including render-time width and height modes. Explicit dimension overrides are applied by the caller. Unlike the static width/height helpers, this measures processed cell lines.

    test {
    let records = @papergrid.IterRecords::new([["abcdef"]])
    let config = @papergrid.SpannedConfig::default()
    config.set_width_mode(@papergrid.WidthMode::wrap(2))
    config.set_height_mode(@papergrid.HeightMode::increase(5))
    assert_eq(
    @papergrid.IterGridDimension::measure_rendered(records, config),
    ([2], [5]),
    )
    }

    IterGridDimension::measure_widths

    fn IterGridDimension::measure_widths(records : IterRecords, config : SpannedConfig) -> Array[Int]

    IterGridDimension::set_heights

    fn IterGridDimension::set_heights(self : IterGridDimension, heights : Array[Int]) -> Unit

    IterGridDimension::set_widths

    fn IterGridDimension::set_widths(self : IterGridDimension, widths : Array[Int]) -> Unit

    IterGridDimension::total_height

    fn IterGridDimension::total_height(records : IterRecords, config : SpannedConfig) -> Int

    IterGridDimension::total_width

    fn IterGridDimension::total_width(records : IterRecords, config : SpannedConfig) -> Int

    IterGridDimension::widths

    fn IterGridDimension::widths(self : IterGridDimension) -> Array[Int]

    IterRecords

    pub struct IterRecords {
    rows : Array[Array[String]]
    count_cols : Int
    }

    IterRecords::count_cols

    fn IterRecords::count_cols(self : IterRecords) -> Int

    IterRecords::count_rows

    fn IterRecords::count_rows(self : IterRecords) -> Int

    IterRecords::get_cell

    fn IterRecords::get_cell(self : IterRecords, row : Int, col : Int) -> String

    IterRecords::new

    fn IterRecords::new(rows : Array[Array[String]]) -> IterRecords

    IterRecords::rows

    fn IterRecords::rows(self : IterRecords) -> Array[Array[String]]

    Offset

    pub(all) enum Offset {
    Start(Int)
    End(Int)
    } derive(Compare, Eq, Hash,
    Debug
    )

    An offset from the start or end of an axis.

    Offset::compare

    fn Offset::compare(Offset, Offset) -> Int

    Offset::equal

    fn Offset::equal(Offset, Offset) -> Bool

    Offset::from_int

    fn Offset::from_int(value : Int) -> Offset

    Offset::hash

    fn Offset::hash(self : Offset) -> Int

    Offset::hash_combine

    fn Offset::hash_combine(Offset, Hasher) -> Unit

    Offset::not_equal

    fn Offset::not_equal(x : Offset, y : Offset) -> Bool

    Offset::op_ge

    fn Offset::op_ge(x : Offset, y : Offset) -> Bool

    Offset::op_gt

    fn Offset::op_gt(x : Offset, y : Offset) -> Bool

    Offset::op_le

    fn Offset::op_le(x : Offset, y : Offset) -> Bool

    Offset::op_lt

    fn Offset::op_lt(x : Offset, y : Offset) -> Bool

    Offset::to_repr

    PeekableGridDimension

    pub struct PeekableGridDimension {
    widths : Array[Int]
    heights : Array[Int]
    } derive(Eq,
    Debug
    )

    Dimensions computed using cached cell text widths and line counts.

    PeekableGridDimension::default

    PeekableGridDimension::dimensions

    fn PeekableGridDimension::dimensions(self : PeekableGridDimension) -> (Array[Int], Array[Int])

    PeekableGridDimension::equal

    PeekableGridDimension::estimate

    fn PeekableGridDimension::estimate(self : PeekableGridDimension, records : IterRecords, config : SpannedConfig) -> Unit

    PeekableGridDimension::get_height

    fn PeekableGridDimension::get_height(self : PeekableGridDimension, row : Int) -> Int

    PeekableGridDimension::get_width

    fn PeekableGridDimension::get_width(self : PeekableGridDimension, col : Int) -> Int

    PeekableGridDimension::measure

    fn PeekableGridDimension::measure(records : IterRecords, config : SpannedConfig) -> (Array[Int], Array[Int])

    PeekableGridDimension::measure_heights

    fn PeekableGridDimension::measure_heights(records : IterRecords, config : SpannedConfig) -> Array[Int]

    PeekableGridDimension::measure_widths

    fn PeekableGridDimension::measure_widths(records : IterRecords, config : SpannedConfig) -> Array[Int]

    PeekableGridDimension::not_equal

    Scope

    type Scope

    Sides

    pub(all) struct Sides[T] {
    left : T
    right : T
    top : T
    bottom : T
    } derive(Compare, Eq, Hash,
    Debug
    )

    Values associated with the left, right, top, and bottom of a box.
    impl Default for Sides[T]

    Sides::compare

    fn[T : Compare + Eq] Sides::compare(Sides[T], Sides[T]) -> Int

    Sides::default

    fn[T : Default] Sides::default() -> Sides[T]

    Sides::equal

    fn[T : Eq] Sides::equal(Sides[T], Sides[T]) -> Bool

    Sides::filled

    fn[T] Sides::filled(value : T) -> Sides[T]

    Sides::fold

    fn[T, U] Sides::fold(self : Sides[T], init : U, f : (U, T) -> U) -> U

    Sides::hash

    fn[T : Hash] Sides::hash(self : Sides[T]) -> Int

    Sides::hash_combine

    fn[T : Hash] Sides::hash_combine(Sides[T], Hasher) -> Unit

    Sides::is_empty

    fn[T] Sides::is_empty(self : Sides[T?]) -> Bool

    Sides::map

    fn[T, U] Sides::map(self : Sides[T], f : (T) -> U) -> Sides[U]

    Sides::new

    fn[T] Sides::new(left~ : T, right~ : T, top~ : T, bottom~ : T) -> Sides[T]

    Sides::not_equal

    fn[T : Eq] Sides::not_equal(x : Sides[T], y : Sides[T]) -> Bool

    Sides::op_ge

    fn[T : Compare + Eq] Sides::op_ge(x : Sides[T], y : Sides[T]) -> Bool

    Sides::op_gt

    fn[T : Compare + Eq] Sides::op_gt(x : Sides[T], y : Sides[T]) -> Bool

    Sides::op_le

    fn[T : Compare + Eq] Sides::op_le(x : Sides[T], y : Sides[T]) -> Bool

    Sides::op_lt

    fn[T : Compare + Eq] Sides::op_lt(x : Sides[T], y : Sides[T]) -> Bool

    SpannedConfig

    pub struct SpannedConfig {
    borders : Borders
    padding_left : Int
    padding_right : Int
    padding_top : Int
    padding_bottom : Int
    align : HAlign
    valign : VAlign
    width_mode : WidthMode
    height_mode : HeightMode
    horizontal_lines : HorizontalLines
    custom_horizontal_lines : Array[(Int, HorizontalLine)]
    width_rules : Array[(Scope, WidthMode)]
    height_rules : Array[(Scope, HeightMode)]
    align_rules : Array[(Scope, HAlign)]
    valign_rules : Array[(Scope, VAlign)]
    padding_rules : Array[(Scope, Int, Int, Int, Int)]
    col_spans : Array[(Int, Int, Int)]
    row_spans : Array[(Int, Int, Int)]
    span_sources : Array[(Int, Int, Int, Int)]
    border_horizontal : Array[(Int, Int, Char)]
    border_vertical : Array[(Int, Int, Char)]
    border_intersection : Array[(Int, Int, Char)]
    margin_top : Int
    margin_bottom : Int
    margin_left : Int
    margin_right : Int
    margin_fill_top : Char
    margin_fill_bottom : Char
    margin_fill_left : Char
    margin_fill_right : Char
    margin_offset_top : Int
    margin_offset_bottom : Int
    margin_offset_left : Int
    margin_offset_right : Int
    // private fields
    }

    SpannedConfig::align

    fn SpannedConfig::align(self : SpannedConfig) -> HAlign

    SpannedConfig::align_at

    fn SpannedConfig::align_at(self : SpannedConfig, row : Int, col : Int) -> HAlign

    SpannedConfig::borders

    fn SpannedConfig::borders(self : SpannedConfig) -> Borders

    SpannedConfig::clear_span_source

    fn SpannedConfig::clear_span_source(self : SpannedConfig, anchor_row : Int, anchor_col : Int) -> Unit

    SpannedConfig::clear_spans_and_overrides

    fn SpannedConfig::clear_spans_and_overrides(self : SpannedConfig) -> Unit

    Clear all spans and border override arrays. Used after operations like Split that completely reshape the table.

    SpannedConfig::clear_unused_span_source

    fn SpannedConfig::clear_unused_span_source(self : SpannedConfig, anchor_row : Int, anchor_col : Int) -> Unit

    SpannedConfig::col_span_at

    fn SpannedConfig::col_span_at(self : SpannedConfig, row : Int, col : Int) -> Int

    SpannedConfig::count_horizontal

    fn SpannedConfig::count_horizontal(self : SpannedConfig, rows : Int) -> Int

    SpannedConfig::count_vertical

    fn SpannedConfig::count_vertical(self : SpannedConfig, columns : Int) -> Int

    SpannedConfig::custom_horizontal_line

    fn SpannedConfig::custom_horizontal_line(self : SpannedConfig, row : Int) -> HorizontalLine?

    SpannedConfig::default

    fn SpannedConfig::default() -> SpannedConfig

    SpannedConfig::get_alignment_fill

    fn SpannedConfig::get_alignment_fill(self : SpannedConfig, row : Int, col : Int) -> Char

    SpannedConfig::get_alignment_fill_color

    fn SpannedConfig::get_alignment_fill_color(self : SpannedConfig, row : Int, col : Int) -> ANSIBuf?

    SpannedConfig::get_cell_border

    fn SpannedConfig::get_cell_border(self : SpannedConfig, row : Int, col : Int, count_rows : Int, count_cols : Int) -> CellBorder

    Get the effective cell border for a cell at (row, col) given table shape (count_rows, count_cols). Returns a CellBorder with the resolved border characters including overrides.

    SpannedConfig::get_col_span

    fn SpannedConfig::get_col_span(self : SpannedConfig, row : Int, col : Int) -> Int?

    SpannedConfig::get_color

    fn SpannedConfig::get_color(self : SpannedConfig, row : Int, col : Int) -> ANSIBuf?

    SpannedConfig::get_formatting

    fn SpannedConfig::get_formatting(self : SpannedConfig, row : Int, col : Int) -> Formatting

    SpannedConfig::get_margin

    fn SpannedConfig::get_margin(self : SpannedConfig) -> Sides[Indent]

    SpannedConfig::get_margin_color

    fn SpannedConfig::get_margin_color(self : SpannedConfig) -> Sides[ANSIBuf?]

    SpannedConfig::get_margin_offsets

    fn SpannedConfig::get_margin_offsets(self : SpannedConfig) -> Sides[Offset]

    SpannedConfig::get_padding

    fn SpannedConfig::get_padding(self : SpannedConfig, row : Int, col : Int) -> Sides[Indent]

    SpannedConfig::get_padding_color

    fn SpannedConfig::get_padding_color(self : SpannedConfig, row : Int, col : Int) -> Sides[ANSIBuf?]

    SpannedConfig::get_row_span

    fn SpannedConfig::get_row_span(self : SpannedConfig, row : Int, col : Int) -> Int?

    SpannedConfig::has_cell_borders

    fn SpannedConfig::has_cell_borders(self : SpannedConfig) -> Bool

    SpannedConfig::has_col_spans

    fn SpannedConfig::has_col_spans(self : SpannedConfig) -> Bool

    SpannedConfig::has_horizontal

    fn SpannedConfig::has_horizontal(self : SpannedConfig, row : Int, rows : Int) -> Bool

    SpannedConfig::has_left_border

    fn SpannedConfig::has_left_border(self : SpannedConfig, row : Int, col : Int, count_rows : Int, count_cols : Int) -> Bool

    Check if a cell has a "left" border (for border correction). Returns false if the cell is covered by a col span or both spans.

    SpannedConfig::has_margin

    fn SpannedConfig::has_margin(self : SpannedConfig) -> Bool

    SpannedConfig::has_row_spans

    fn SpannedConfig::has_row_spans(self : SpannedConfig) -> Bool

    SpannedConfig::has_top_border

    fn SpannedConfig::has_top_border(self : SpannedConfig, row : Int, col : Int, count_rows : Int, count_cols : Int) -> Bool

    Check if a cell has a "top" border (for border correction). Returns false if the cell is covered by a row span or both spans.

    SpannedConfig::has_vertical

    fn SpannedConfig::has_vertical(self : SpannedConfig, col : Int, columns : Int) -> Bool

    SpannedConfig::height_mode

    fn SpannedConfig::height_mode(self : SpannedConfig) -> HeightMode

    SpannedConfig::height_mode_at

    fn SpannedConfig::height_mode_at(self : SpannedConfig, row : Int, col : Int) -> HeightMode

    SpannedConfig::horizontal_lines

    fn SpannedConfig::horizontal_lines(self : SpannedConfig) -> HorizontalLines

    SpannedConfig::horizontal_override_at

    fn SpannedConfig::horizontal_override_at(self : SpannedConfig, row_boundary : Int, col : Int) -> Char?

    SpannedConfig::intersection_override_at

    fn SpannedConfig::intersection_override_at(self : SpannedConfig, row_boundary : Int, col_boundary : Int) -> Char?

    SpannedConfig::is_cell_covered_by_both_spans

    fn SpannedConfig::is_cell_covered_by_both_spans(self : SpannedConfig, row : Int, col : Int) -> Bool

    SpannedConfig::is_cell_covered_by_col_span

    fn SpannedConfig::is_cell_covered_by_col_span(self : SpannedConfig, row : Int, col : Int) -> Bool

    SpannedConfig::is_cell_covered_by_row_span

    fn SpannedConfig::is_cell_covered_by_row_span(self : SpannedConfig, row : Int, col : Int) -> Bool

    SpannedConfig::is_cell_visible

    fn SpannedConfig::is_cell_visible(self : SpannedConfig, row : Int, col : Int) -> Bool

    SpannedConfig::padding_at

    fn SpannedConfig::padding_at(self : SpannedConfig, row : Int, col : Int) -> (Int, Int, Int, Int)

    SpannedConfig::padding_bottom

    fn SpannedConfig::padding_bottom(self : SpannedConfig) -> Int

    SpannedConfig::padding_left

    fn SpannedConfig::padding_left(self : SpannedConfig) -> Int

    SpannedConfig::padding_right

    fn SpannedConfig::padding_right(self : SpannedConfig) -> Int

    SpannedConfig::padding_top

    fn SpannedConfig::padding_top(self : SpannedConfig) -> Int

    SpannedConfig::remap

    fn SpannedConfig::remap(self : SpannedConfig, row_map : Array[Int], col_map : Array[Int]) -> Unit

    SpannedConfig::row_span_at

    fn SpannedConfig::row_span_at(self : SpannedConfig, row : Int, col : Int) -> Int

    SpannedConfig::set_align

    fn SpannedConfig::set_align(self : SpannedConfig, align : HAlign) -> Unit

    SpannedConfig::set_align_for_all

    fn SpannedConfig::set_align_for_all(self : SpannedConfig, align : HAlign) -> Unit

    SpannedConfig::set_align_for_cell

    fn SpannedConfig::set_align_for_cell(self : SpannedConfig, row : Int, col : Int, align : HAlign) -> Unit

    SpannedConfig::set_align_for_cols

    fn SpannedConfig::set_align_for_cols(self : SpannedConfig, start : Int, end : Int, align : HAlign) -> Unit

    SpannedConfig::set_align_for_rows

    fn SpannedConfig::set_align_for_rows(self : SpannedConfig, start : Int, end : Int, align : HAlign) -> Unit

    SpannedConfig::set_alignment_fill

    fn SpannedConfig::set_alignment_fill(self : SpannedConfig, entity : Entity, fill : Char, color? : ANSIBuf) -> Unit

    SpannedConfig::set_borders

    fn SpannedConfig::set_borders(self : SpannedConfig, borders : Borders) -> Unit

    SpannedConfig::set_cell_border

    fn SpannedConfig::set_cell_border(self : SpannedConfig, row : Int, col : Int, border : CellBorder) -> Unit

    Set per-cell border overrides at the grid-position level. Each border component is stored at the actual grid position it affects.

    SpannedConfig::set_col_span

    fn SpannedConfig::set_col_span(self : SpannedConfig, row : Int, col : Int, span : Int) -> Unit

    SpannedConfig::set_color

    fn SpannedConfig::set_color(self : SpannedConfig, entity : Entity, color : ANSIBuf?) -> Unit

    SpannedConfig::set_custom_horizontal_lines

    fn SpannedConfig::set_custom_horizontal_lines(self : SpannedConfig, lines : Array[(Int, HorizontalLine)]) -> Unit

    SpannedConfig::set_formatting

    fn SpannedConfig::set_formatting(self : SpannedConfig, entity : Entity, formatting : Formatting) -> Unit

    SpannedConfig::set_height_mode

    fn SpannedConfig::set_height_mode(self : SpannedConfig, mode : HeightMode) -> Unit

    SpannedConfig::set_height_mode_for_all

    fn SpannedConfig::set_height_mode_for_all(self : SpannedConfig, mode : HeightMode) -> Unit

    SpannedConfig::set_height_mode_for_cell

    fn SpannedConfig::set_height_mode_for_cell(self : SpannedConfig, row : Int, col : Int, mode : HeightMode) -> Unit

    SpannedConfig::set_height_mode_for_cols

    fn SpannedConfig::set_height_mode_for_cols(self : SpannedConfig, start : Int, end : Int, mode : HeightMode) -> Unit

    SpannedConfig::set_height_mode_for_rows

    fn SpannedConfig::set_height_mode_for_rows(self : SpannedConfig, start : Int, end : Int, mode : HeightMode) -> Unit

    SpannedConfig::set_horizontal_lines

    fn SpannedConfig::set_horizontal_lines(self : SpannedConfig, mode : HorizontalLines) -> Unit

    SpannedConfig::set_line_alignment

    fn SpannedConfig::set_line_alignment(self : SpannedConfig, entity : Entity, enabled : Bool) -> Unit

    SpannedConfig::set_margin

    fn SpannedConfig::set_margin(self : SpannedConfig, top : Int, bottom : Int, left : Int, right : Int, fill_top : Char, fill_bottom : Char, fill_left : Char, fill_right : Char) -> Unit

    SpannedConfig::set_margin_color

    fn SpannedConfig::set_margin_color(self : SpannedConfig, colors : Sides[ANSIBuf?]) -> Unit

    SpannedConfig::set_margin_offset

    fn SpannedConfig::set_margin_offset(self : SpannedConfig, top : Int, bottom : Int, left : Int, right : Int) -> Unit

    SpannedConfig::set_margin_offsets

    fn SpannedConfig::set_margin_offsets(self : SpannedConfig, offsets : Sides[Offset]) -> Unit

    SpannedConfig::set_margin_sides

    fn SpannedConfig::set_margin_sides(self : SpannedConfig, margin : Sides[Indent]) -> Unit

    SpannedConfig::set_padding

    fn SpannedConfig::set_padding(self : SpannedConfig, left : Int, right : Int, top : Int, bottom : Int) -> Unit

    SpannedConfig::set_padding_color

    fn SpannedConfig::set_padding_color(self : SpannedConfig, entity : Entity, colors : Sides[ANSIBuf?]) -> Unit

    SpannedConfig::set_padding_for_all

    fn SpannedConfig::set_padding_for_all(self : SpannedConfig, left : Int, right : Int, top : Int, bottom : Int) -> Unit

    SpannedConfig::set_padding_for_cell

    fn SpannedConfig::set_padding_for_cell(self : SpannedConfig, row : Int, col : Int, left : Int, right : Int, top : Int, bottom : Int) -> Unit

    SpannedConfig::set_padding_for_cols

    fn SpannedConfig::set_padding_for_cols(self : SpannedConfig, start : Int, end : Int, left : Int, right : Int, top : Int, bottom : Int) -> Unit

    SpannedConfig::set_padding_for_rows

    fn SpannedConfig::set_padding_for_rows(self : SpannedConfig, start : Int, end : Int, left : Int, right : Int, top : Int, bottom : Int) -> Unit

    SpannedConfig::set_padding_sides

    fn SpannedConfig::set_padding_sides(self : SpannedConfig, entity : Entity, padding : Sides[Indent]) -> Unit

    Set all four padding sizes and fill characters for the selected entity.

    SpannedConfig::set_row_span

    fn SpannedConfig::set_row_span(self : SpannedConfig, row : Int, col : Int, span : Int) -> Unit

    SpannedConfig::set_span_source

    fn SpannedConfig::set_span_source(self : SpannedConfig, anchor_row : Int, anchor_col : Int, source_row : Int, source_col : Int) -> Unit

    SpannedConfig::set_trim_horizontal

    fn SpannedConfig::set_trim_horizontal(self : SpannedConfig, entity : Entity, enabled : Bool) -> Unit

    SpannedConfig::set_trim_vertical

    fn SpannedConfig::set_trim_vertical(self : SpannedConfig, entity : Entity, enabled : Bool) -> Unit

    SpannedConfig::set_valign

    fn SpannedConfig::set_valign(self : SpannedConfig, align : VAlign) -> Unit

    SpannedConfig::set_valign_for_all

    fn SpannedConfig::set_valign_for_all(self : SpannedConfig, align : VAlign) -> Unit

    SpannedConfig::set_valign_for_cell

    fn SpannedConfig::set_valign_for_cell(self : SpannedConfig, row : Int, col : Int, align : VAlign) -> Unit

    SpannedConfig::set_valign_for_cols

    fn SpannedConfig::set_valign_for_cols(self : SpannedConfig, start : Int, end : Int, align : VAlign) -> Unit

    SpannedConfig::set_valign_for_rows

    fn SpannedConfig::set_valign_for_rows(self : SpannedConfig, start : Int, end : Int, align : VAlign) -> Unit

    SpannedConfig::set_width_mode

    fn SpannedConfig::set_width_mode(self : SpannedConfig, mode : WidthMode) -> Unit

    SpannedConfig::set_width_mode_for_all

    fn SpannedConfig::set_width_mode_for_all(self : SpannedConfig, mode : WidthMode) -> Unit

    SpannedConfig::set_width_mode_for_cell

    fn SpannedConfig::set_width_mode_for_cell(self : SpannedConfig, row : Int, col : Int, mode : WidthMode) -> Unit

    SpannedConfig::set_width_mode_for_cols

    fn SpannedConfig::set_width_mode_for_cols(self : SpannedConfig, start : Int, end : Int, mode : WidthMode) -> Unit

    SpannedConfig::set_width_mode_for_rows

    fn SpannedConfig::set_width_mode_for_rows(self : SpannedConfig, start : Int, end : Int, mode : WidthMode) -> Unit

    SpannedConfig::shift_col_spans_right

    fn SpannedConfig::shift_col_spans_right(self : SpannedConfig, target_col : Int) -> Unit

    Shift all spans whose col >= target_col rightward by 1. Used when inserting a vertical panel col.

    SpannedConfig::shift_row_spans_down

    fn SpannedConfig::shift_row_spans_down(self : SpannedConfig, target_row : Int) -> Unit

    Shift all spans whose row >= target_row downward by 1. Used when inserting a horizontal panel row.

    SpannedConfig::span_anchor_for_source

    fn SpannedConfig::span_anchor_for_source(self : SpannedConfig, source_row : Int, source_col : Int) -> (Int, Int)?

    SpannedConfig::span_source_at

    fn SpannedConfig::span_source_at(self : SpannedConfig, anchor_row : Int, anchor_col : Int) -> (Int, Int)

    SpannedConfig::valign

    fn SpannedConfig::valign(self : SpannedConfig) -> VAlign

    SpannedConfig::valign_at

    fn SpannedConfig::valign_at(self : SpannedConfig, row : Int, col : Int) -> VAlign

    SpannedConfig::vertical_override_at

    fn SpannedConfig::vertical_override_at(self : SpannedConfig, row : Int, col_boundary : Int) -> Char?

    SpannedConfig::width_mode

    fn SpannedConfig::width_mode(self : SpannedConfig) -> WidthMode

    SpannedConfig::width_mode_at

    fn SpannedConfig::width_mode_at(self : SpannedConfig, row : Int, col : Int) -> WidthMode

    VAlign

    pub enum VAlign {
    Top
    Bottom
    Center
    }

    VAlign::bottom

    fn VAlign::bottom() -> VAlign

    VAlign::center

    fn VAlign::center() -> VAlign

    VAlign::top

    fn VAlign::top() -> VAlign

    WidthMode

    pub enum WidthMode {
    None
    Wrap(Int, String)
    Truncate(Int, String)
    }

    WidthMode::none

    fn WidthMode::none() -> WidthMode

    WidthMode::truncate

    fn WidthMode::truncate(width : Int, suffix : String) -> WidthMode

    WidthMode::wrap

    fn WidthMode::wrap(width : Int) -> WidthMode

    WidthMode::wrap_with

    fn WidthMode::wrap_with(width : Int, placeholder : String) -> WidthMode

    apply_height

    fn apply_height(lines : Array[String], mode : HeightMode) -> Array[String]

    apply_width

    fn apply_width(content : String, mode : WidthMode) -> Array[String]

    colorize_suffix

    fn colorize_suffix(text : String, suffix : String) -> String

    Apply the style of the final ANSI text block to an appended suffix.

    count_lines

    fn count_lines(text : String) -> Int

    count_tabs

    fn count_tabs(text : String) -> Int

    cut_str

    fn cut_str(text : String, width : Int) -> String

    Cut text at a terminal width, preserving ANSI styling and a single OSC8 link. A partially fitting wide character is replaced by U+FFFD.

    test {
    assert_eq(
    @papergrid.cut_str("\u001b[31m中文\u001b[39m", 3),
    "\u001b[31m中\u001b[39m�",
    )
    }

    get_char_width

    fn get_char_width(ch : Char) -> Int

    Return the width of one Unicode scalar. Control characters have width zero. Ambiguous-width characters are narrow, as in tabled's default width policy.

    get_line_width

    fn get_line_width(text : String) -> Int

    Measure a line excluding terminal control sequences, including OSC links.

    get_lines

    fn get_lines(text : String) -> Array[String]

    Split lines while closing and reopening active SGR styles at each boundary. Empty lines stay empty, and trailing newlines produce a final empty line.

    get_string_width

    fn get_string_width(text : String) -> Int

    Measure Unicode text using Unicode 17.0.0 width and presentation rules. This measures the string itself; use get_line_width to exclude ANSI codes.

    test {
    assert_eq(@papergrid.get_string_width("👩‍🔬"), 2)
    assert_eq(@papergrid.get_char_width('🏳'), 1)
    assert_eq(@papergrid.get_string_width("🏳️"), 2)
    }

    get_text_dimension

    fn get_text_dimension(text : String) -> (Int, Int)

    Return the number of logical lines and the maximum visible line width.

    get_text_width

    fn get_text_width(text : String) -> Int

    Measure the widest line in a string.

    processed_lines

    fn processed_lines(content : String, width_mode : WidthMode, height_mode : HeightMode) -> Array[String]

    replace_tab

    fn replace_tab(text : String, size : Int) -> String

    Replace literal tabs with spaces. The upstream four-space fast path replaces every tab; other sizes preserve a tab immediately preceded by a backslash.

    split_lines

    fn split_lines(content : String) -> Array[String]

    strip_ansi

    fn strip_ansi(text : String) -> String

    Return the visible parts of text, excluding terminal escape sequences.

    trim_ansi_whitespace

    fn trim_ansi_whitespace(text : String) -> String

    Trim visible whitespace while retaining the original terminal sequences.

    wrap_text

    fn wrap_text(text : String, width : Int, placeholder? : String, keep_words? : Bool) -> String

    Wrap text by visible width, closing and reopening ANSI styles per line. A single OSC8 hyperlink is repeated around every resulting line.

    test {
    assert_eq(@papergrid.wrap_text("ab中", 2), "ab\n中")
    }