gespenst API - v0.1.0
    Preparing search index...

    Interface IBufferCell

    Represents a single cell in the terminal's buffer.

    interface IBufferCell {
        getBgColor(): number;
        getBgColorMode(): number;
        getChars(): string;
        getCode(): number;
        getFgColor(): number;
        getFgColorMode(): number;
        getWidth(): number;
        isAttributeDefault(): boolean;
        isBgDefault(): boolean;
        isBgPalette(): boolean;
        isBgRGB(): boolean;
        isBlink(): number;
        isBold(): number;
        isDim(): number;
        isFgDefault(): boolean;
        isFgPalette(): boolean;
        isFgRGB(): boolean;
        isInverse(): number;
        isInvisible(): number;
        isItalic(): number;
        isOverline(): number;
        isStrikethrough(): number;
        isUnderline(): number;
    }
    Index
    • Gets a cell's background color number, this differs depending on what the color mode of the cell is:

      • Default: This should be 0, representing the default background color (CSI 49 m).
      • Palette: This is a number from 0 to 255 of ANSI colors (CSI 4(0-7) m, CSI 10(0-7) m, CSI 48 ; 5 ; 0-255 m).
      • RGB: A hex value representing a 'true color': 0xRRGGBB (CSI 4 8 ; 2 ; Pi ; Pr ; Pg ; Pb)

      Returns number

    • Gets the number representation of the background color mode, this can be used to perform quick comparisons of 2 cells to see if they're the same. Use isBgRGB, isBgPalette and isBgDefault to check what color mode a cell is.

      Returns number

    • The character(s) within the cell. Examples of what this can contain:

      • A normal width character
      • A wide character (eg. CJK)
      • An emoji

      Returns string

    • Gets the UTF32 codepoint of single characters, if content is a combined string it returns the codepoint of the last character in the string.

      Returns number

    • Gets a cell's foreground color number, this differs depending on what the color mode of the cell is:

      • Default: This should be 0, representing the default foreground color (CSI 39 m).
      • Palette: This is a number from 0 to 255 of ANSI colors (CSI 3(0-7) m, CSI 9(0-7) m, CSI 38 ; 5 ; 0-255 m).
      • RGB: A hex value representing a 'true color': 0xRRGGBB. (CSI 3 8 ; 2 ; Pi ; Pr ; Pg ; Pb)

      Returns number

    • Gets the number representation of the foreground color mode, this can be used to perform quick comparisons of 2 cells to see if they're the same. Use isFgRGB, isFgPalette and isFgDefault to check what color mode a cell is.

      Returns number

    • The width of the character. Some examples:

      • 1 for most cells.
      • 2 for wide character like CJK glyphs.
      • 0 for cells immediately following cells with a width of 2.

      Returns number

    • Whether the cell has the default attribute (no color or style).

      Returns boolean

    • Whether the cell is using the default background color mode.

      Returns boolean

    • Whether the cell is using the palette background color mode.

      Returns boolean

    • Whether the cell is using the RGB background color mode.

      Returns boolean

    • Whether the cell has the blink attribute (CSI 5 m).

      Returns number

    • Whether the cell has the bold attribute (CSI 1 m).

      Returns number

    • Whether the cell has the dim attribute (CSI 2 m).

      Returns number

    • Whether the cell is using the default foreground color mode.

      Returns boolean

    • Whether the cell is using the palette foreground color mode.

      Returns boolean

    • Whether the cell is using the RGB foreground color mode.

      Returns boolean

    • Whether the cell has the inverse attribute (CSI 7 m).

      Returns number

    • Whether the cell has the invisible attribute (CSI 8 m).

      Returns number

    • Whether the cell has the italic attribute (CSI 3 m).

      Returns number

    • Whether the cell has the overline attribute (CSI 53 m).

      Returns number

    • Whether the cell has the strikethrough attribute (CSI 9 m).

      Returns number

    • Whether the cell has the underline attribute (CSI 4 m).

      Returns number