Skip to main content
Module

x/tui/src/utils/mod.ts

🦕 Deno module for creating Terminal User Interfaces
Latest
import * as tui from "https://deno.land/x/tui@2.1.11/src/utils/mod.ts";

Classes

Creates array that automatically sorts elements using compareFn Additionally allows for removing elements

Variables

ANSI escape code to clear screen

ANSI escape code to disable mouse handling

ANSI escape code to enable mouse handling

ANSI escape code to hide terminal cursor

ANSI escape code to show terminal cursor

Regexp that allows for extracting unicode sequences that are supposed to represent single character

ANSI escape code to tell terminal to switch back to primary buffer

ANSI escape code to tell terminal to use secondary buffer

Functions

Returns capitalized string created from {text}

Return width of given character

Clamp {number} between {min} and {max}

Crops {text} to given {width}

Check whether {number} fits in <{min}, {max}> range

Check whether {column} and {row} fit in {rectangle} boundaries

Returns component that's the closest to top left corner of tui's canvas

Converts given text to array of strings which consist of sequences which represent a single character

Inserts {value} into {string} on given {index}

Returns whether component defines interact property

Get ANSI escape code for moving cursor to given location

Normalize {value} between 0 and 1

Check whether rectangle {a} is the same as rectangle {b}

Calculate intersection between two rectangles

Creates signal from input if it's not already a signal

Asynchronously sleep for {time} milliseconds

Strips string of all its styles

Returns real {text} width