Options
All
  • Public
  • Public/Protected
  • All
Menu

Wrapper for one cell in the terminal. It is used for converting abstract configuration of the cell to the real control sequence.

since

2.0.0

Hierarchy

  • Cell

Implements

Index

Constructors

constructor

  • Create Cell instance which are able to convert itself to ASCII control sequence.

    Parameters

    • char: string

      Char that you want to wrap with control sequence

    • Optional options: Partial<ICellOptions>

    Returns Cell

Properties

char

char: string = " "

isModified

isModified: boolean = false

x

x: number = 0

y

y: number = 0

Methods

getBackground

getChar

  • getChar(): string
  • Returns current character in the cell.

    Returns string

getDisplay

getForeground

getX

  • getX(): number

getY

  • getY(): number

reset

  • Reset all display settings for the cell. It resets char, background, foreground and display mode.

    Returns Cell

resetBackground

  • resetBackground(): Cell

resetDisplay

  • resetDisplay(): Cell

resetForeground

  • resetForeground(): Cell

setBackground

  • setBackground(r: number, g: number, b: number): Cell
  • Set a new background for the cell.

    Parameters

    • r: number
    • g: number
    • b: number

    Returns Cell

setChar

  • setChar(char: string): Cell
  • Updates the cell with the newly specified character.

    Parameters

    • char: string

      Char to update in the cell

    Returns Cell

setDisplay

  • Updates display characteristics of the cell.

    Parameters

    • display: Partial<IDisplayOptions>

      Options for the display characteristics of the character in cell

    Returns Cell

setForeground

  • setForeground(r: number, g: number, b: number): Cell
  • Set a new foreground for the cell.

    Parameters

    • r: number
    • g: number
    • b: number

    Returns Cell

setX

  • setX(x: number): Cell
  • Set X coordinate.

    Parameters

    • x: number

      X coordinate of the cell

    Returns Cell

setY

  • setY(y: number): Cell
  • Set Y coordinate.

    Parameters

    • y: number

      Y coordinate of the cell

    Returns Cell

toString

  • toString(): string
  • Convert cell to VT100 control sequence.

    Returns string

Static create

Object literals

background

background: object

b

b: number = -1

g

g: number = -1

r

r: number = -1

display

display: object

blink

blink: false = false

bold

bold: false = false

dim

dim: false = false

hidden

hidden: false = false

reverse

reverse: false = false

underlined

underlined: false = false

foreground

foreground: object

b

b: number = -1

g

g: number = -1

r

r: number = -1

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Static method

Generated using TypeDoc