Ansi.ts overview
Since v1.0.0
Exports Grouped by Category
- colors
- bgBlack
- bgBlackBright
- bgBlue
- bgBlueBright
- bgCyan
- bgCyanBright
- bgGreen
- bgGreenBright
- bgMagenta
- bgMagentaBright
- bgRed
- bgRedBright
- bgWhite
- bgWhiteBright
- bgYellow
- bgYellowBright
- black
- blackBright
- blue
- blueBright
- cyan
- cyanBright
- green
- greenBright
- magenta
- magentaBright
- red
- redBright
- white
- whiteBright
- yellow
- yellowBright
- commands
- constructors
- destructors
- model
- symbol
- utils
colors
bgBlack
Signature
declare const bgBlack: Ansi
Since v1.0.0
bgBlackBright
Signature
declare const bgBlackBright: Ansi
Since v1.0.0
bgBlue
Signature
declare const bgBlue: Ansi
Since v1.0.0
bgBlueBright
Signature
declare const bgBlueBright: Ansi
Since v1.0.0
bgCyan
Signature
declare const bgCyan: Ansi
Since v1.0.0
bgCyanBright
Signature
declare const bgCyanBright: Ansi
Since v1.0.0
bgGreen
Signature
declare const bgGreen: Ansi
Since v1.0.0
bgGreenBright
Signature
declare const bgGreenBright: Ansi
Since v1.0.0
bgMagenta
Signature
declare const bgMagenta: Ansi
Since v1.0.0
bgMagentaBright
Signature
declare const bgMagentaBright: Ansi
Since v1.0.0
bgRed
Signature
declare const bgRed: Ansi
Since v1.0.0
bgRedBright
Signature
declare const bgRedBright: Ansi
Since v1.0.0
bgWhite
Signature
declare const bgWhite: Ansi
Since v1.0.0
bgWhiteBright
Signature
declare const bgWhiteBright: Ansi
Since v1.0.0
bgYellow
Signature
declare const bgYellow: Ansi
Since v1.0.0
bgYellowBright
Signature
declare const bgYellowBright: Ansi
Since v1.0.0
black
Signature
declare const black: Ansi
Since v1.0.0
blackBright
Signature
declare const blackBright: Ansi
Since v1.0.0
blue
Signature
declare const blue: Ansi
Since v1.0.0
blueBright
Signature
declare const blueBright: Ansi
Since v1.0.0
cyan
Signature
declare const cyan: Ansi
Since v1.0.0
cyanBright
Signature
declare const cyanBright: Ansi
Since v1.0.0
green
Signature
declare const green: Ansi
Since v1.0.0
greenBright
Signature
declare const greenBright: Ansi
Since v1.0.0
magenta
Signature
declare const magenta: Ansi
Since v1.0.0
magentaBright
Signature
declare const magentaBright: Ansi
Since v1.0.0
red
Signature
declare const red: Ansi
Since v1.0.0
redBright
Signature
declare const redBright: Ansi
Since v1.0.0
white
Signature
declare const white: Ansi
Since v1.0.0
whiteBright
Signature
declare const whiteBright: Ansi
Since v1.0.0
yellow
Signature
declare const yellow: Ansi
Since v1.0.0
yellowBright
Signature
declare const yellowBright: Ansi
Since v1.0.0
commands
beep
Play a beeping sound.
Signature
declare const beep: Ansi
Since v1.0.0
cursorBackward
Moves the cursor backward by the specified number of columns
(default 1
) relative to the current cursor position.
If the cursor is already at the edge of the screen, this has no effect.
Signature
declare const cursorBackward: (columns?: number) => Ansi
Since v1.0.0
cursorDown
Moves the cursor down by the specified number of lines
(default 1
) relative to the current cursor position.
If the cursor is already at the edge of the screen, this has no effect.
Signature
declare const cursorDown: (lines?: number) => Ansi
Since v1.0.0
cursorForward
Moves the cursor forward by the specified number of columns
(default 1
) relative to the current cursor position.
If the cursor is already at the edge of the screen, this has no effect.
Signature
declare const cursorForward: (columns?: number) => Ansi
Since v1.0.0
cursorHide
Hides the cursor.
Signature
declare const cursorHide: Ansi
Since v1.0.0
cursorLeft
Moves the cursor to the first column of the current row.
Signature
declare const cursorLeft: Ansi
Since v1.0.0
cursorMove
Move the cursor position the specified number of rows
and columns
relative to the current cursor position.
If the cursor is already at the edge of the screen in either direction, then additional movement will have no effect.
Signature
declare const cursorMove: (column: number, row?: number) => Ansi
Since v1.0.0
cursorNextLine
Moves cursor to beginning of the line the specified number of rows down (default 1
).
Signature
declare const cursorNextLine: (rows?: number) => Ansi
Since v1.0.0
cursorPrevLine
Moves cursor to beginning of the line the specified number of rows up (default 1
).
Signature
declare const cursorPrevLine: (rows?: number) => Ansi
Since v1.0.0
cursorRestorePosition
Restores the cursor position, encoding shift state and formatting attributes from the previous save, if any, otherwise resets these all to their defaults.
Signature
declare const cursorRestorePosition: Ansi
Since v1.0.0
cursorSavePosition
Saves the cursor position, encoding shift state and formatting attributes.
Signature
declare const cursorSavePosition: Ansi
Since v1.0.0
cursorShow
Shows the cursor.
Signature
declare const cursorShow: Ansi
Since v1.0.0
cursorTo
Moves the cursor to the specified row
and column
.
Though the ANSI Control Sequence for Cursor Position is 1
-based, this method takes row and column values starting from 0
and adjusts them to 1
- based values.
Signature
declare const cursorTo: (column: number, row?: number) => Ansi
Since v1.0.0
cursorUp
Moves the cursor up by the specified number of lines
(default 1
) relative to the current cursor position.
If the cursor is already at the edge of the screen, this has no effect.
Signature
declare const cursorUp: (lines?: number) => Ansi
Since v1.0.0
eraseDown
Clears from the current cursor position to the end of the screen.
The current cursor position does not change.
Signature
declare const eraseDown: Ansi
Since v1.0.0
eraseEndLine
Clears from the current cursor position to the end of the current line.
The current cursor position does not change.
Signature
declare const eraseEndLine: Ansi
Since v1.0.0
eraseLine
Clears the current line.
The current cursor position does not change.
Signature
declare const eraseLine: Ansi
Since v1.0.0
eraseLines
Erase from the current cursor position up the specified amount of rows.
Signature
declare const eraseLines: (rows: number) => Ansi
Since v1.0.0
eraseScreen
Clears the entire screen and move the cursor to the upper left.
Signature
declare const eraseScreen: Ansi
Since v1.0.0
eraseStartLine
Clears from the current cursor position to the start of the current line.
The current cursor position does not change.
Signature
declare const eraseStartLine: Ansi
Since v1.0.0
eraseUp
Clears from the current cursor position to the beginning of the screen.
The current cursor position does not change.
Signature
declare const eraseUp: Ansi
Since v1.0.0
constructors
bgColor
Signature
declare const bgColor: (color: Color) => Ansi
Since v1.0.0
bgColorBright
Signature
declare const bgColorBright: (color: Color) => Ansi
Since v1.0.0
bold
Signature
declare const bold: Ansi
Since v1.0.0
brightColor
Signature
declare const brightColor: (color: Color) => Ansi
Since v1.0.0
color
Signature
declare const color: (color: Color) => Ansi
Since v1.0.0
italicized
Signature
declare const italicized: Ansi
Since v1.0.0
strikethrough
Signature
declare const strikethrough: Ansi
Since v1.0.0
underlined
Signature
declare const underlined: Ansi
Since v1.0.0
destructors
stringify
Signature
declare const stringify: (self: Ansi) => string
Since v1.0.0
model
Ansi (interface)
Signature
export interface Ansi extends Ansi.Proto {}
Since v1.0.0
symbol
AnsiTypeId
Signature
declare const AnsiTypeId: unique symbol
Since v1.0.0
AnsiTypeId (type alias)
Signature
type AnsiTypeId = typeof AnsiTypeId
Since v1.0.0
utils
Ansi (namespace)
Since v1.0.0
Proto (interface)
Signature
export interface Proto {
readonly [AnsiTypeId]: AnsiTypeId
}
Since v1.0.0
combine
Signature
declare const combine: { (that: Ansi): (self: Ansi) => Ansi; (self: Ansi, that: Ansi): Ansi }
Since v1.0.0