An object for any miscellanous user data.
An object for any miscellanous user data.
Get's the child element implementing the current label of this node.
Calculated absolute bottom offset.
Calculated absolute left offset.
Calculated absolute right offset.
Calculated absolute top offset.
Border foreground and background, must be numbers (-1 for default).
Border attributes.
Border object.
Calculated relative bottom offset.
The offset of the top of the scroll content.
The offset of the chosen item/line.
Array of node's children.
An object for any miscellanous user data.
Whether the element is draggable. Set to true to allow dragging.
Calculated height.
Render index (document order index) of the last render call.
Calculated relative left offset.
Name of the element. Useful for form submission.
Current element padding
Parent node. If null it means the element is not attached to any screen or program, or the node is a Screen.
Calculated relative bottom offset.
Calculated relative right offset.
Calculated relative left offset.
Calculated relative right offset.
Calculated relative top offset.
Parent screen.
Calculated relative top offset.
Type of the node (e.g. box).
Unique identifier for Node instances. @internal
Calculated width.
Converts {red-fg}foo{/red-fg}
to \x1b[31mfoo\x1b[39m
. @internal.
Append a node to this node's children.
Ask a question. callback will yield the result.
Clear a line from the box's content from the visible top.
Clear a line from the box's content.
Cleans the rectangle of this element on the screen. Useful for subclasses before rendering. @internal
Delete a line at the bottom of the box.
Delete a line from the box's content.
Delete a line at the top of the box.
Same as the detach() method, except this will automatically call free() and unbind any screen events to prevent memory leaks. for use with onScreenEvent(), removeScreenEvent(), and free().
Remove node from its parent.
Disable dragging of the element.
Emit event for element, and recursively emit same event for all descendants. If s
is provided it will call [[iter]] on self first.
Enable dragging of the element.
Enable key and mouse events. Calls bot enableMouse and enableKeys.
Enable keypress events for the element (automatically called when a form of on('keypress') is bound).
Enable mouse events for the element (automatically called when a form of on('mouse') is bound).
Focus element.
Visit each node's descendants, with [[iter]] function, parents first. If s
is provided it will call [[iter]] on self first.
Free up the element. Automatically unbind all events that may have been bound to the screen object. This prevents memory leaks. For use with onScreenEvent(), removeScreenEvent(), and destroy().
Get user property with a potential default value.
Get a line from the box's content from the visible top.
Return content, slightly different from el.content. Assume the above formatting.
Get a line from the box's content.
An array containing the content lines.
An array containing the lines as they are displayed on the screen.
Get the current scroll index in lines.
Get the actual height of the scrolling area.
Get the current scroll index in percentage.
Similar to getContent, but return content with tags and escape codes removed.
Hide element and triggers hide event
Insert a node to this node's children at index i.
Insert a line at the bottom of the box.
Insert a line into the box's content.
Insert a line at the top of the box.
Bind a keypress listener for a specific key.
Received when the element is scrolled.
Same as el.on('screen', ...) except this will automatically keep track of which listeners are bound to the screen object. For use with removeScreenEvent(), free(), and destroy().
Bind a keypress listener for a specific key once.
Pop a line off the bottom of the content.
Prepend a node to this node's children.
Push a line onto the bottom of the content.
Remove child node from node.
Remove the hover label completely.
Remove the label completely.
Same asel.removeListener('screen', ...) except this will automatically keep track of which listeners are bound to the screen object. For use with onScreenEvent(), free(), and destroy().
Write content and children to the screen buffer.
Reset the scroll index to its initial state.
calculates the value for style
(could be substyle like style.bar) to paint in the screen according to
the rest of the properties and optionally bg and fg.
Take an SGR screenshot of the screen within the region. Returns a string containing only characters and SGR codes. Can be displayed by simply echoing it in a terminal.
Take an SGR screenshot of the whole screen. Returns a string containing only characters and SGR codes. Can be displayed by simply echoing it in a terminal.
Scroll the content by a relative offset.
Scroll the content to an absolute index.
Set user property to value.
Put the element in back of its siblings.
Set a line in the box's content from the visible top.
Set the content. Note: When text is input, it will be stripped of all non-SGR escape codes, tabs will be replaced with 8 spaces, and tags will be replaced with SGR codes (if enabled).
Put the element in front of its siblings. Uses setIndex
text/options - Set a hover text box to follow the cursor. Similar to the "title" DOM attribute in the browser. Example options: {text:'foo'}
Change this element's index in its parent's children array. This will change the rendering order. If all elements are positioned by their selves then this could be similar to CSS z-index property. But if you are using a layout or relaying somhow in the children order then it will change the position of this element and its siblings.
text/options - Set the label text for the top-left corner. Example options: {text:'foo',side:'left'}
Set a line in the box's content.
Same as scrollTo.
Set the current scroll index in percentage (0-100).
Similar to setContent, but ignore tags and remove escape codes.
Shift a line off the top of the content.
Show element.
Get a string's displayed width, taking into account double-width, surrogate pairs, combining characters, tags, and SGR escape codes.
Toggle hidden/shown.
Remove a keypress listener for a specific key.
Unshift a line onto the top of the content.
Generated using TypeDoc
A question box containing okay and cancel buttons (automatically hidden).