API Reference drafter v#0.3.2

Copy Markdown View Source

Modules

Entry point of the Drafter terminal UI framework.

Behaviour for handling application action return values.

Per-session registry for Drafter.ActionHandler modules.

GenServer that manages timed property animations for widgets.

Declarative API for building a Drafter terminal application.

Registry of running application loops, keyed by session.

Drives a Drafter app to an in-memory cell grid instead of a terminal.

A terminal driver that holds a screen size and discards everything written to it.

Named character lookup for TUI rendering.

Terminal display width of text, in columns.

Drafter's own width tables, and the default Drafter.CharacterWidth.

Read and write the user's clipboard.

Color representation and parsing for terminal styling.

Holds one session's screen as rows of styled cells and writes changed rows to its terminal.

Unicode box drawing characters, and functions that assemble them into lines, boxes and borders.

Coordinate-based drawing surface for terminal primitives.

The fundamental rendering unit: a string of text with a single style applied.

A horizontal line of Drafter.Draw.Segment structs representing one terminal row.

The event vocabulary: the tagged tuples an application and a widget receive.

Routes an event to widgets related to a given widget in the hierarchy.

Fans events out from the terminal driver to the processes that want them.

Rich event struct with DOM-like three-phase dispatch and propagation control.

Dispatches events to registered callback functions, in registration levels.

Normalises what a widget's handle_event/2 returned into the triple the router uses.

Number formatting that produces strings suitable for the digits widget.

Composites independently rendered layers into a single list of strips.

Pure layout calculation for the component tree.

Runs a program on a pseudoterminal and hands its byte stream to the caller.

Process-dictionary cache for incremental rendering.

A bounded circular buffer backed by an integer-keyed map.

Behaviour for pluggable application runtime backends.

The Drafter application event loop.

Default LiveView-style runtime backend.

Converts an application's :refresh_rate setting into a frame interval.

Elm-style reducer runtime backend.

Rendering pipeline for Drafter applications.

Runtime backend for shared multi-user sessions (e.g. an SSH chat served to many clients).

Behaviour and data structure for screens in a TUI application.

Scroll offset and viewport calculations for list-like widgets.

Start SSH and Telnet servers for hosting TUI applications over the network.

Resolves the per-session services a process is operating on behalf of.

Per-session GenServer that holds the active rendering skin and notifies the running application on change.

Color and style utilities for widget rendering.

Parses a CSS-like stylesheet into a Drafter.Style.Stylesheet.

Resolves a widget's final style: stylesheet cascade, then inline overrides, then theme colour lookup.

A parsed CSS-like selector, and the rules for matching one against a widget.

An ordered list of {selectors, style} rules, and the cascade that resolves them.

Loads and caches the stylesheet an app renders against.

The built-in stylesheet every app starts from.

Parses Tree-sitter-style captures into structured highlight, fold, symbol, and textobject data.

Owns the framework's shared ETS tables.

Decodes terminal input bytes into events and builds terminal output sequences.

Owns the local terminal: raw mode, alternate screen, mouse reporting, input decoding.

Carries partially-received terminal input across reads.

Asks the connected terminal which graphics protocol it supports.

Forwards SIGWINCH to the terminal driver.

Terminal and pseudoterminal control through the termios_nif native library.

Headless testing of Drafter applications under ExUnit.

Manages the lifecycle of a headless TUI app instance for testing.

Unicode-aware text layout for terminal rendering.

Theme definition and built-in theme library for TUI applications.

GenServer that holds the active theme and notifies the running application on change.

Input validation for TUI widgets.

Numeric helpers shared across Drafter widgets for data visualization.

Largest Triangle Three Buckets downsampling algorithm.

Behaviour for a Drafter widget: a component that owns state, draws itself into a rect, and handles events.

Draws a titled border around a region; children render inside the border.

Renders a horizontal breadcrumb trail with keyboard and mouse navigation.

A clickable button widget that triggers a callback when pressed or activated via keyboard.

A monthly calendar grid widget with date selection and keyboard navigation.

Wraps atom event names or functions into closures for widget callback wiring.

Renders a bordered panel with an optional title and text content lines.

Renders time-series and financial data as interactive charts with multiple styles.

Renders chart data as terminal graphics via the frozen french_curve library.

A boolean toggle widget that renders an X mark inside a box next to an optional label.

Renders a scrollable, syntax-highlighted code viewer with keyboard and drag navigation.

Renders an expandable section with a title row and collapsible content.

Holds and arranges child widgets using vertical, horizontal, or stack layouts.

Buffered data ingestion channel for a single widget.

A full-featured tabular data widget with column headers, sorting, row selection, and scrolling.

Renders text as large characters, drawn with box outlines or with pixels packed into braille, quadrant, or half-block cells.

The glyph shapes behind the rasterised fonts in Drafter.Widget.Digits.Font.

Reads FIGlet fonts (.flf) into the glyph maps Drafter.Widget.Digits.Font serves.

Draws Drafter.Widget.Digits text as a transmitted terminal image.

Rasterises Drafter.Widget.Digits.Bitmap glyphs into terminal cells.

A live file-system tree widget that reads directories lazily as nodes are expanded.

Turns an event tuple into the right callback on a widget module.

A modal file picker screen for selecting files or directories.

Renders a single-row key-binding bar, typically anchored to the bottom of a screen.

A semi-circular gauge chart rendered using Unicode braille characters.

Arranges child widgets in a uniform column grid, wrapping into multiple rows.

Renders a single-row application header bar with a centred title and optional live clock.

Renders a single line or multi-line string of styled text.

An inline hyperlink widget that opens a URL in the system browser when activated.

Renders an animated spinner with an optional label.

Renders a scrollable plain-text log panel that accepts streamed line output.

Renders a subset of Markdown to the terminal with themed styling.

A single-line text input that enforces a character-by-character format mask.

Renders a horizontal or vertical meter with threshold-based color zones.

A scrollable, single-selection list widget with keyboard, mouse, and scroll wheel navigation.

Renders a circular pie chart using Unicode block and braille characters.

Renders a coloured placeholder block useful during development and layout design.

Renders an Elixir term with syntax-highlighted pretty-printing.

Renders a horizontal progress bar with optional percentage, value, and ETA display.

A mutually exclusive radio button group where exactly one option can be selected at a time.

Renders a scrollable log panel where each line can carry per-line style metadata.

Renders a horizontal or vertical divider line, optionally with an embedded title.

Tracks the scroll position of a viewport and renders its scrollbars.

A scrollable list widget that supports single or multiple item selection with checkbox-style indicators.

A draggable value slider: a track, a fill up to the current value, a thumb, and an optional label and value readout.

Draws Drafter.Widget.Slider through the french_curve rasteriser.

Renders a compact sparkline chart using Unicode block characters.

Renders a resizable divider between two panes in a split layout.

An animated toggle switch widget with on/off states.

Renders a bordered tabbed panel where each tab displays independent content.

A multi-line text editor widget with cursor navigation, scrolling, and optional syntax highlighting.

A single-line text input widget with cursor navigation, text selection, and clipboard support.

Behaviour for composable widget traits.

Trait that provides render timestamp for animation frames.

Trait that adds expand/collapse capability.

Trait that adds drag-and-drop capability.

Trait that adds text editing capability.

Trait that makes a widget focusable.

Runs the trait event pipeline for a widget.

Trait that adds resize capability via drag handles.

Trait that adds scrolling capability to a widget.

Trait that adds item selection capability.

A hierarchical tree widget that renders nested nodes with expand/collapse controls.

The mounted widget tree of a running application.

Routes an event through a widget hierarchy and collects the actions it produced.

Macro for packaging and registering collections of Drafter widgets.

Maps widget ids to their server processes, scoped to the owning session.

Reads and writes a widget's primary value by the shape of its state.