Skip to content

Latest commit

 

History

History
139 lines (100 loc) · 4.28 KB

SingleLayout.md

File metadata and controls

139 lines (100 loc) · 4.28 KB

Classes

SingleLayout

Constants

CM : ConsoleManager

the instance of ConsoleManager (singleton)

pageTitle : string

The application title.

Interfaces

SingleLayoutOptions : Object

The type containing all the possible options for the SingleLayout.

SingleLayoutOptions : Object

The type containing all the possible options for the SingleLayout.

Kind: global interface
Properties

Name Type Description
[showTitle] boolean

If the title should be shown.

[boxed] boolean

If the layout should be boxed.

[boxColor] ForegroundColorName | HEX | RGB | ""

The color of the box taken from the chalk library.

[boxStyle] "bold"

If the border of the box should be bold.

[pageTitle] string

The title of the first page.

[fitHeight] boolean

If the height of the layout should be the same as the height of the screen.

SingleLayout

Kind: global class

new SingleLayout(page, options)

This class is a layout that has two pages.

single layout

Param Type Description
page PageBuilder

The first page.

options boolean

Layout options.

Example

const layout = new SingleLayout(page1, page2, true, 0)

singleLayout.setPage(page)

This function is used to overwrite the page content.

Kind: instance method of SingleLayout

Param Type Description
page PageBuilder

the page to be added

singleLayout.setTitle(title) ⇒ void

This function is used to set the title of the layout.

Kind: instance method of SingleLayout

Param Type Description
title string

the title to be set

Example

layout.setTitle("My Title")

singleLayout.setBorder(border)

This function is used to enable or disable the layout border.

Kind: instance method of SingleLayout

Param Type Description
border boolean

enable or disable the border

singleLayout.drawLine(line) ⇒ void

This function is used to draw a single line of the layout to the screen. It also trim the line if it is too long.

Kind: instance method of SingleLayout

Param Type Description
line Array.<StyledElement>

the line to be drawn

singleLayout.draw() ⇒ void

This function is used to draw the layout to the screen.

Kind: instance method of SingleLayout
Example

layout.draw()

CM : ConsoleManager

the instance of ConsoleManager (singleton)

Kind: global constant

pageTitle : string

The application title.

Kind: global constant