Options
All
  • Public
  • Public/Protected
  • All
Menu

Creates and has methods to update a Terminal DOM that contains lines.

Hierarchy

Index

Constructors

constructor

  • new DOMLineController(maxLines?: number, container?: HTMLDivElement): DOMLineController

Properties

code

code: HTMLElement

Code / Monospace, should be the direct child of the pre tag.

container

container: HTMLDivElement

The main DOM wrapper for all DOM elements. Nothing from the terminal should be outside of this element.

display

display: HTMLSpanElement

Span that contains the final display text of the terminal.

idNumber

idNumber: number

ID number for this instance of the TerminalDOM.

lines

lines: HTMLSpanElement[]

Span elements that hold the lines.

maxLines

maxLines: number

Maximum number of lines displayed, if -1 no cut off.

pre

pre: HTMLPreElement

Preformatted Text, should be the direct child of the container.

Static idCounter

idCounter: number = 0

Keeps track of number of ids that have been created.

Methods

addLine

  • addLine(lineText?: string): void

appendCurrentLine

  • appendCurrentLine(lineText: string): void

Protected checkForOverflow

  • checkForOverflow(): void

clear

  • clear(): void

Protected removeFirstChild

  • removeFirstChild(toRemove: number): void

removeFirstLine

  • removeFirstLine(): void

Protected setClasses

  • setClasses(): void

setCurrentLine

  • setCurrentLine(lineText: string): void

Protected setIDs

  • setIDs(): void

Static defaultContainer

  • defaultContainer(): HTMLDivElement

Static getID

  • getID(): number

Generated using TypeDoc