Skip to main content
Module

x/tui/mod.ts>Tui

🦕 Deno module for creating Terminal User Interfaces
Go to Latest
class Tui
Re-export
import { Tui } from "https://deno.land/x/tui@1.0.0/mod.ts";

Main object of Tui that contains everything keeping it running

Constructors

new
Tui(unnamed 0: TuiOptions)

Properties

canvas: Canvas
components: SortedArray<Component>
stdin: Stdin
stdout: Stdout
style: Style
updateRate: number

Methods

render(): AsyncGenerator<{ type: "render"; timing: Timing; }>

Async generator that dispatches "render" event

run(): AsyncGenerator<{ type: "render"; timing: Timing; } | { type: "update"; }>

Async generator that handles "update" and "render" events

  • on "update" event it renders background using tui.style. Then it calls draw() on every component in tui.components
update(): AsyncGenerator<{ type: "update"; }>

Async generator that dispatches "update" event