- CM :
ConsoleManager the instance of ConsoleManager (singleton)
- pageTitle :
string The application title.
- LayoutOptions :
Object The type containing all the possible options for the layout.
The type containing all the possible options for the layout.
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. |
| [type] | "single" | "double" | "triple" | "quad" |
The type of the layout. |
| [changeFocusKey] | string |
The key that should be pressed to change the focus. |
| [direction] | "horizontal" | "vertical" |
The direction of the layout. |
| [pageTitles] | Array.<string> |
The title of the first page. |
| [pageRatio] | Array.<number> |
The ratio of the pages. (in horizontal direction) |
| [fitHeight] | boolean |
If the height of the pages should be the same. |
Kind: global class
This class is a layout that has two pages.
| Param | Type | Description |
|---|---|---|
| pages | Array.<PageBuilder> |
The pages that should be shown. |
| options | boolean |
Layout options. |
Example
const layout = new LayoutManager([page1, page2], pageOptions);This function is used to update the layout pages.
Kind: instance method of LayoutManager
| Param | Type | Description |
|---|---|---|
| pages | Array.<PageBuilder> |
The pages that should be shown. |
Example
layout.updatePages([page1, page2])Example
layout.updatePages([page1, page2, page3])This function is used to overwrite the page content.
Kind: instance method of LayoutManager
| Param | Type | Description |
|---|---|---|
| page | PageBuilder |
the page to be added |
| index | number |
the index of the page |
This function is used to update the page title.
Kind: instance method of LayoutManager
| Param | Type | Description |
|---|---|---|
| title | string |
The title of the page. |
| index | number |
The index of the page. |
Example
layout.setTitle("Page Title", 1)This function is used to update the page titles.
Kind: instance method of LayoutManager
| Param | Type | Description |
|---|---|---|
| titles | Array.<string> |
The titles of the pages. |
Example
layout.setTitles(["Page Title 1", "Page Title 2"])This function is used to enable or disable the layout border.
Kind: instance method of LayoutManager
| Param | Type | Description |
|---|---|---|
| border | boolean |
enable or disable the border |
This function is used to choose the page to be highlighted.
Kind: instance method of LayoutManager
| Param | Type | Description |
|---|---|---|
| selected | 0 | 1 | 2 | 3 |
0 for page1, 1 for page2 |
This function is used to get the selected page.
Kind: instance method of LayoutManager
Returns: 0 | 1 | 2 | 3 -
0 for page1, 1 for page2, 2 for page3, 3 for page4
This function is used to get switch the selected page. If the layout is a single layout, it will do nothing.
Kind: instance method of LayoutManager
This function is used to decrease the row ratio between the pages in the selected row. This is propagated to the layout instance.
Kind: instance method of LayoutManager
| Param | Type | Description |
|---|---|---|
| quantity | quantity |
The amount of aspect ratio to be decreased. |
Example
layout.decreaseRowRatio(0.01)This function is used to increase the row ratio between the pages in the selected row. This is propagated to the layout instance.
Kind: instance method of LayoutManager
| Param | Type | Description |
|---|---|---|
| quantity | quantity |
The amount of aspect ratio to be increased. |
Example
layout.increaseRowRatio(0.01)This function is used to draw the layout to the screen.
Kind: instance method of LayoutManager
Example
layout.draw()the instance of ConsoleManager (singleton)
The application title.
Kind: global constant
