class Tui
implements TuiImplementation
import { Tui } from "https://deno.land/x/tui@1.3.4/src/tui.ts";
Main object of Tui that contains everything keeping it running
Constructors
new
Tui(options: TuiOptions)Properties
Methods
dispatch(): void
Emits "dispatch" event on signals and keystrokes that should terminate an application
- SIGBREAK
- SIGTERM (not windows)
- SIGINT
- CTRL+C (windows)
remove(): void
It does several things:
- Disables all event listeners
- Calls
Component.remove
on every component inTui.components
- Stops
Tui.render()
andTui.update()
viaTui.#dispatches
- Writes ANSI sequences to stdout which shows back cursor and returns to using primary terminal buffer
render(): () => void
Redirects "frame" event from {Canvas} to "render" event in {Tui} Returns function that stops {Canvas.render}
run(): void
It does several things:
- Writes ANSI sequences to stdout to use secondary terminal buffer, hide cursor and clear screen
- Calls
Tui.update()
andTui.render()
- On "update" event it renders background using
Tui.style
and callsComponent.draw()
on every component inTui.components
update(): () => void
Generates "update" events in {Tui} Returns function that stops it