@toolcog/util/tty
Toolcog utilities
Interfaces
Style
Properties
bgBlack
readonlybgBlack:Stylized
Defined in
packages/framework/util/tty/src/style.ts:87
bgBlue
readonlybgBlue:Stylized
Defined in
packages/framework/util/tty/src/style.ts:91
bgBlueBright
readonlybgBlueBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:100
bgCyan
readonlybgCyan:Stylized
Defined in
packages/framework/util/tty/src/style.ts:93
bgCyanBright
readonlybgCyanBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:102
bgGray
readonlybgGray:Stylized
Defined in
packages/framework/util/tty/src/style.ts:95
bgGreen
readonlybgGreen:Stylized
Defined in
packages/framework/util/tty/src/style.ts:89
bgGreenBright
readonlybgGreenBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:98
bgMagenta
readonlybgMagenta:Stylized
Defined in
packages/framework/util/tty/src/style.ts:92
bgMagentaBright
readonlybgMagentaBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:101
bgRed
readonlybgRed:Stylized
Defined in
packages/framework/util/tty/src/style.ts:88
bgRedBright
readonlybgRedBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:97
bgWhite
readonlybgWhite:Stylized
Defined in
packages/framework/util/tty/src/style.ts:94
bgWhiteBright
readonlybgWhiteBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:103
bgYellow
readonlybgYellow:Stylized
Defined in
packages/framework/util/tty/src/style.ts:90
bgYellowBright
readonlybgYellowBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:99
black
readonlyblack:Stylized
Defined in
packages/framework/util/tty/src/style.ts:69
blue
readonlyblue:Stylized
Defined in
packages/framework/util/tty/src/style.ts:73
blueBright
readonlyblueBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:82
bold
readonlybold:Stylized
Defined in
packages/framework/util/tty/src/style.ts:60
cyan
readonlycyan:Stylized
Defined in
packages/framework/util/tty/src/style.ts:75
cyanBright
readonlycyanBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:84
dim
readonlydim:Stylized
Defined in
packages/framework/util/tty/src/style.ts:61
gray
readonlygray:Stylized
Defined in
packages/framework/util/tty/src/style.ts:77
green
readonlygreen:Stylized
Defined in
packages/framework/util/tty/src/style.ts:71
greenBright
readonlygreenBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:80
hidden
readonlyhidden:Stylized
Defined in
packages/framework/util/tty/src/style.ts:66
inverse
readonlyinverse:Stylized
Defined in
packages/framework/util/tty/src/style.ts:65
italic
readonlyitalic:Stylized
Defined in
packages/framework/util/tty/src/style.ts:62
magenta
readonlymagenta:Stylized
Defined in
packages/framework/util/tty/src/style.ts:74
magentaBright
readonlymagentaBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:83
overline
readonlyoverline:Stylized
Defined in
packages/framework/util/tty/src/style.ts:64
red
readonlyred:Stylized
Defined in
packages/framework/util/tty/src/style.ts:70
redBright
readonlyredBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:79
reset
readonlyreset:Stylized
Defined in
packages/framework/util/tty/src/style.ts:59
strikethrough
readonlystrikethrough:Stylized
Defined in
packages/framework/util/tty/src/style.ts:67
underline
readonlyunderline:Stylized
Defined in
packages/framework/util/tty/src/style.ts:63
white
readonlywhite:Stylized
Defined in
packages/framework/util/tty/src/style.ts:76
whiteBright
readonlywhiteBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:85
yellow
readonlyyellow:Stylized
Defined in
packages/framework/util/tty/src/style.ts:72
yellowBright
readonlyyellowBright:Stylized
Defined in
packages/framework/util/tty/src/style.ts:81
Styled()
Extends
Styled(
text):string
Parameters
• text: string
Returns
string
Defined in
packages/framework/util/tty/src/style.ts:5
Properties
close
readonlyclose:string
Defined in
packages/framework/util/tty/src/style.ts:10
closeCode
readonlycloseCode:number
Defined in
packages/framework/util/tty/src/style.ts:7
open
readonlyopen:string
Defined in
packages/framework/util/tty/src/style.ts:9
openCode
readonlyopenCode:number
Defined in
packages/framework/util/tty/src/style.ts:6
Stylized()
Extended by
Stylized(
text):string
Parameters
• text: string
Returns
string
Defined in
packages/framework/util/tty/src/style.ts:2
WrapState
Properties
closeCode?
optionalcloseCode:number
Defined in
packages/framework/util/tty/src/wrap.ts:105
openCode?
optionalopenCode:number
Defined in
packages/framework/util/tty/src/wrap.ts:104
url?
optionalurl:string
Defined in
packages/framework/util/tty/src/wrap.ts:106
Variables
ansiRegex
constansiRegex:RegExp
Defined in
packages/framework/util/tty/src/ansi.ts:2
beep
constbeep:string="\x07"
Defined in
packages/framework/util/tty/src/ansi.ts:65
clearScreen
constclearScreen:string="\x1Bc"
Defined in
packages/framework/util/tty/src/ansi.ts:63
cursorGetPosition
constcursorGetPosition:string="\x1B[6n"
Defined in
packages/framework/util/tty/src/ansi.ts:37
cursorHide
constcursorHide:string="\x1B[?25l"
Defined in
packages/framework/util/tty/src/ansi.ts:40
cursorLeft
constcursorLeft:string="\x1B[G"
Defined in
packages/framework/util/tty/src/ansi.ts:36
cursorNextLine
constcursorNextLine:string="\x1B[E"
Defined in
packages/framework/util/tty/src/ansi.ts:38
cursorPrevLine
constcursorPrevLine:string="\x1B[F"
Defined in
packages/framework/util/tty/src/ansi.ts:39
cursorShow
constcursorShow:string="\x1B[?25h"
Defined in
packages/framework/util/tty/src/ansi.ts:41
eraseDown
consteraseDown:string="\x1B[J"
Defined in
packages/framework/util/tty/src/ansi.ts:57
eraseEndLine
consteraseEndLine:string="\x1B[K"
Defined in
packages/framework/util/tty/src/ansi.ts:54
eraseLine
consteraseLine:string="\x1B[2K"
Defined in
packages/framework/util/tty/src/ansi.ts:56
eraseScreen
consteraseScreen:string="\x1B[2J"
Defined in
packages/framework/util/tty/src/ansi.ts:59
eraseStartLine
consteraseStartLine:string="\x1B[1K"
Defined in
packages/framework/util/tty/src/ansi.ts:55
eraseUp
consteraseUp:string="\x1B[1J"
Defined in
packages/framework/util/tty/src/ansi.ts:58
scrollDown
constscrollDown:string="\x1B[T"
Defined in
packages/framework/util/tty/src/ansi.ts:61
scrollUp
constscrollUp:string="\x1B[S"
Defined in
packages/framework/util/tty/src/ansi.ts:60
style
style:
object
Type declaration
bgBlack
readonlybgBlack:Styled
bgBlue
readonlybgBlue:Styled
bgBlueBright
readonlybgBlueBright:Styled
bgCyan
readonlybgCyan:Styled
bgCyanBright
readonlybgCyanBright:Styled
bgGray
readonlybgGray:Styled
bgGreen
readonlybgGreen:Styled
bgGreenBright
readonlybgGreenBright:Styled
bgMagenta
readonlybgMagenta:Styled
bgMagentaBright
readonlybgMagentaBright:Styled
bgRed
readonlybgRed:Styled
bgRedBright
readonlybgRedBright:Styled
bgWhite
readonlybgWhite:Styled
bgWhiteBright
readonlybgWhiteBright:Styled
bgYellow
readonlybgYellow:Styled
bgYellowBright
readonlybgYellowBright:Styled
black
readonlyblack:Styled
blue
readonlyblue:Styled
blueBright
readonlyblueBright:Styled
bold
readonlybold:Styled
cyan
readonlycyan:Styled
cyanBright
readonlycyanBright:Styled
dim
readonlydim:Styled
gray
readonlygray:Styled
green
readonlygreen:Styled
greenBright
readonlygreenBright:Styled
hidden
readonlyhidden:Styled
inverse
readonlyinverse:Styled
italic
readonlyitalic:Styled
magenta
readonlymagenta:Styled
magentaBright
readonlymagentaBright:Styled
overline
readonlyoverline:Styled
red
readonlyred:Styled
redBright
readonlyredBright:Styled
reset
readonlyreset:Styled
strikethrough
readonlystrikethrough:Styled
underline
readonlyunderline:Styled
white
readonlywhite:Styled
whiteBright
readonlywhiteBright:Styled
yellow
readonlyyellow:Styled
yellowBright
readonlyyellowBright:Styled
Defined in
packages/framework/util/tty/src/style.ts:106
unstyle
constunstyle:object
Type declaration
bgBlack
readonlybgBlack:Stylized=unstyled
bgBlue
readonlybgBlue:Stylized=unstyled
bgBlueBright
readonlybgBlueBright:Stylized=unstyled
bgCyan
readonlybgCyan:Stylized=unstyled
bgCyanBright
readonlybgCyanBright:Stylized=unstyled
bgGray
readonlybgGray:Stylized=unstyled
bgGreen
readonlybgGreen:Stylized=unstyled
bgGreenBright
readonlybgGreenBright:Stylized=unstyled
bgMagenta
readonlybgMagenta:Stylized=unstyled
bgMagentaBright
readonlybgMagentaBright:Stylized=unstyled
bgRed
readonlybgRed:Stylized=unstyled
bgRedBright
readonlybgRedBright:Stylized=unstyled
bgWhite
readonlybgWhite:Stylized=unstyled
bgWhiteBright
readonlybgWhiteBright:Stylized=unstyled
bgYellow
readonlybgYellow:Stylized=unstyled
bgYellowBright
readonlybgYellowBright:Stylized=unstyled
black
readonlyblack:Stylized=unstyled
blue
readonlyblue:Stylized=unstyled
blueBright
readonlyblueBright:Stylized=unstyled
bold
readonlybold:Stylized=unstyled
cyan
readonlycyan:Stylized=unstyled
cyanBright
readonlycyanBright:Stylized=unstyled
dim
readonlydim:Stylized=unstyled
gray
readonlygray:Stylized=unstyled
green
readonlygreen:Stylized=unstyled
greenBright
readonlygreenBright:Stylized=unstyled
hidden
readonlyhidden:Stylized=unstyled
inverse
readonlyinverse:Stylized=unstyled
italic
readonlyitalic:Stylized=unstyled
magenta
readonlymagenta:Stylized=unstyled
magentaBright
readonlymagentaBright:Stylized=unstyled
overline
readonlyoverline:Stylized=unstyled
red
readonlyred:Stylized=unstyled
redBright
readonlyredBright:Stylized=unstyled
reset
readonlyreset:Stylized=unstyled
strikethrough
readonlystrikethrough:Stylized=unstyled
underline
readonlyunderline:Stylized=unstyled
white
readonlywhite:Stylized=unstyled
whiteBright
readonlywhiteBright:Stylized=unstyled
yellow
readonlyyellow:Stylized=unstyled
yellowBright
readonlyyellowBright:Stylized=unstyled
Defined in
packages/framework/util/tty/src/style.ts:160
Functions
cursorBackward()
cursorBackward(
count):string
Parameters
• count: number = 1
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:34
cursorDown()
cursorDown(
count):string
Parameters
• count: number = 1
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:32
cursorForward()
cursorForward(
count):string
Parameters
• count: number = 1
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:33
cursorMove()
cursorMove(
x,y?):string
Parameters
• x: number
• y?: number
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:14
cursorTo()
cursorTo(
x,y?):string
Parameters
• x: number
• y?: number
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:7
cursorUp()
cursorUp(
count):string
Parameters
• count: number = 1
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:31
ellipsize()
ellipsize(
text,maxWidth,direction?,ellipsis?):string
Parameters
• text: string
• maxWidth: number
• direction?: number
• ellipsis?: string = "..."
Returns
string
Defined in
packages/framework/util/tty/src/ellipsize.ts:100
ellipsizeEnd()
ellipsizeEnd(
text,maxWidth,ellipsis):string
Parameters
• text: string
• maxWidth: number
• ellipsis: string = "..."
Returns
string
Defined in
packages/framework/util/tty/src/ellipsize.ts:52
ellipsizeStart()
ellipsizeStart(
text,maxWidth,ellipsis):string
Parameters
• text: string
• maxWidth: number
• ellipsis: string = "..."
Returns
string
Defined in
packages/framework/util/tty/src/ellipsize.ts:4
eraseLines()
eraseLines(
count):string
Parameters
• count: number
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:43
getCharacterWidth()
getCharacterWidth(
codePoint,character?):number
Parameters
• codePoint: number
• character?: string
Returns
number
Defined in
packages/framework/util/tty/src/width.ts:3
getStringWidth()
getStringWidth(
text):number
Parameters
• text: string
Returns
number
Defined in
packages/framework/util/tty/src/width.ts:221
link()
link(
text,url):string
Parameters
• text: string
• url: string
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:67
stripAnsi()
stripAnsi(
text):string
Parameters
• text: string
Returns
string
Defined in
packages/framework/util/tty/src/ansi.ts:5
stylize()
stylize(
enabled):Style
Parameters
• enabled: boolean | () => boolean
Returns
Defined in
packages/framework/util/tty/src/style.ts:212
wrapLine()
wrapLine(
input,maxWidth,eol,state):string
Parameters
• input: string
• maxWidth: number
• eol: string
• state: WrapState = {}
Returns
string
Defined in
packages/framework/util/tty/src/wrap.ts:109
wrapLines()
wrapLines(
input,maxWidth):string[]
Parameters
• input: string
• maxWidth: number
Returns
string[]
Defined in
packages/framework/util/tty/src/wrap.ts:242
wrapText()
wrapText(
input,maxWidth):string
Parameters
• input: string
• maxWidth: number
Returns
string