- CM :
ConsoleManager the instance of ConsoleManager (singleton)
- pageTitle :
string The application title.
- SingleLayoutOptions :
Object The type containing all the possible options for the SingleLayout.
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. |
Kind: global class
- SingleLayout
- new SingleLayout(page, options)
- .setPage(page)
- .setTitle(title) ⇒
void - .setBorder(border)
- .drawLine(line) ⇒
void - .draw() ⇒
void
This class is a layout that has two pages.
| Param | Type | Description |
|---|---|---|
| page | PageBuilder |
The first page. |
| options | boolean |
Layout options. |
Example
const layout = new SingleLayout(page1, page2, true, 0)This function is used to overwrite the page content.
Kind: instance method of SingleLayout
| Param | Type | Description |
|---|---|---|
| page | PageBuilder |
the page to be added |
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")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 |
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 |
This function is used to draw the layout to the screen.
Kind: instance method of SingleLayout
Example
layout.draw()the instance of ConsoleManager (singleton)
The application title.
Kind: global constant
