textui/demo.ts

12 lines
347 B
TypeScript
Raw Normal View History

2021-05-13 22:04:47 +00:00
#!/usr/bin/env -S deno run --allow-env --unstable
2021-05-11 21:20:33 +00:00
import { AnsiTerminalDisplay } from "./ansi.ts";
2021-05-13 22:04:47 +00:00
import { TextUI } from "./ui.ts";
2021-05-11 21:20:33 +00:00
const display = new AnsiTerminalDisplay();
const ui = new TextUI(display);
await ui.init();
2021-05-13 22:04:47 +00:00
ui.drawing.text("hello", { x: 10, y: 3 });
await ui.flush();
2021-05-11 21:20:33 +00:00
await new Promise((resolve) => setTimeout(resolve, 3000));