Skip to main content

@webda/workoutReadme | API


Class: Terminal

Constructors

new Terminal(wo, level, format, tty)

new Terminal(wo, level?, format?, tty?): Terminal

Parameters

wo: WorkerOutput

level?: WorkerLogLevel

format?: string

tty?: boolean= process.stdout.isTTY

Returns

Terminal

Source

src/terminal/terminal.ts:51

Properties

_refresh?

_refresh?: Timeout

Source

src/terminal/terminal.ts:48


format?

format?: string

Source

src/terminal/terminal.ts:32


hasProgress

hasProgress: boolean = false

Source

src/terminal/terminal.ts:29


height

height: number = process.stdout.rows

Source

src/terminal/terminal.ts:23


history

history: string[] = []

Source

src/terminal/terminal.ts:25


historySize

historySize: number = 2000

Source

src/terminal/terminal.ts:26


inputValid

inputValid: boolean = true

Source

src/terminal/terminal.ts:37


inputValue

inputValue: string = ""

Source

src/terminal/terminal.ts:34


inputs

inputs: WorkerInput[] = []

Source

src/terminal/terminal.ts:33


level

level: WorkerLogLevel

Source

src/terminal/terminal.ts:28


listener

listener: (msg) => void

Contains the WorkerOutput listener

Parameters

msg: WorkerMessage

Returns

void

Source

src/terminal/terminal.ts:47


logo: string[] = []

Source

src/terminal/terminal.ts:42


logoWidth

logoWidth: number = 0

Source

src/terminal/terminal.ts:43


progressChar

progressChar: number = 0

Source

src/terminal/terminal.ts:38


progressChars

progressChars: string[]

Source

src/terminal/terminal.ts:39


progresses

progresses: Object = {}

Index signature

[key: string]: WorkerProgress

Source

src/terminal/terminal.ts:30


reset

reset: boolean = false

Source

src/terminal/terminal.ts:36


rl?

rl?: Interface

Source

src/terminal/terminal.ts:35


scrollY

scrollY: number = -1

Source

src/terminal/terminal.ts:27


title

title: string = ""

Source

src/terminal/terminal.ts:31


tty

tty: boolean

Source

src/terminal/terminal.ts:21


width

width: number = process.stdout.columns

Source

src/terminal/terminal.ts:24


wo

wo: WorkerOutput

Source

src/terminal/terminal.ts:22


refreshSpeed

static refreshSpeed: number = 300

Source

src/terminal/terminal.ts:49

Methods

clearScreen()

clearScreen(): void

Returns

void

Source

src/terminal/terminal.ts:459


close()

close(): void

Returns

void

Source

src/terminal/terminal.ts:181


displayBar()

displayBar(ratio, barlen): string

Parameters

ratio: number

barlen: number

Returns

string

Source

src/terminal/terminal.ts:302


displayFooter()

displayFooter(): string

Returns

string

Source

src/terminal/terminal.ts:349


displayHistory()

displayHistory(lines, complete): string

Parameters

lines: number

complete: boolean= true

Returns

string

Source

src/terminal/terminal.ts:396


displayProgress()

displayProgress(p): string

Parameters

p: WorkerProgress

Returns

string

Source

src/terminal/terminal.ts:331


displayScreen()

displayScreen(): Promise<void>

Returns

Promise<void>

Source

src/terminal/terminal.ts:436


displayString()

displayString(str, limit): string

Parameters

str: string

limit: number= undefined

Returns

string

Source

src/terminal/terminal.ts:288


displayTitle()

displayTitle(): string

Returns

string

Source

src/terminal/terminal.ts:323


getBar()

getBar(size, complete): string

Parameters

size: number

complete: boolean

Returns

string

Source

src/terminal/terminal.ts:315


getFooterSize()

getFooterSize(): number

Returns

number

Source

src/terminal/terminal.ts:252


getLogo(): string[]

Retrieve current logo

Usefull to add some versions

Returns

string[]

Source

src/terminal/terminal.ts:392


getTrueLength()

getTrueLength(str): number

Parameters

str: string

Returns

number

Source

src/terminal/terminal.ts:298


handleTitleMessage()

handleTitleMessage(msg): void

Parameters

msg: WorkerMessage

Returns

void

Source

src/terminal/terminal.ts:225


log()

log(groups, level, ...args): void

Parameters

groups: any[]

level: WorkerLogLevel

• ...args: any[]

Returns

void

Source

src/terminal/terminal.ts:231


onData()

onData(data): void

Parameters

data: string | Buffer

Returns

void

Source

src/terminal/terminal.ts:97


pushHistory()

pushHistory(line): void

Parameters

line: string

Returns

void

Source

src/terminal/terminal.ts:191


resetTerm()

resetTerm(): void

Returns

void

Source

src/terminal/terminal.ts:172


resize()

resize(): void

Returns

void

Source

src/terminal/terminal.ts:140


router()

router(msg): Promise<void>

Parameters

msg: WorkerMessage

Returns

Promise<void>

Source

src/terminal/terminal.ts:198


scrollDown()

scrollDown(increment): void

Parameters

increment: number

Returns

void

Source

src/terminal/terminal.ts:158


scrollUp()

scrollUp(increment): void

Parameters

increment: number

Returns

void

Source

src/terminal/terminal.ts:148


setLogo(logo): void

Set the logo to display

How to create logo:

Parameters

logo: string[]

to display

Returns

void

Source

src/terminal/terminal.ts:377


setTitle()

setTitle(title): void

Parameters

title: string= ""

Returns

void

Source

src/terminal/terminal.ts:168


stripColorString()

stripColorString(str, limit): string

Parameters

str: string

limit: number= -1

Returns

string

Source

src/terminal/terminal.ts:263