textui/demo.ts

15 lines
392 B
TypeScript
Executable file

#!./run
import { AnsiTerminalDisplay } from "./ansi.ts";
import { TextUI } from "./ui.ts";
const display = new AnsiTerminalDisplay();
const ui = new TextUI(display);
await ui.init([
{ r: 0, g: 0, b: 0 },
{ r: 1, g: 1, b: 1 },
{ r: 0, g: 1, b: 1 },
]);
ui.drawing.color(2, 0).text("hello", { x: 10, y: 3 });
await ui.flush();
await new Promise((resolve) => setTimeout(resolve, 3000));