Creates a ANSI string.
The base style
The starting column for text wrapping
Whether the string should be left- or right-aligned
The wrapping width relative to the indentation level
Whether the string should be left- or right-aligned
Optional
hookThe hooked string for line-wise wrapping.
The starting column for text wrapping
The number of lines in the string. Always positive.
Whether the first word should be merged with the previous word.
Whether the last word should be merged with the next word.
The wrapping width relative to the indentation level
Readonly
wordsThe list of words (including line feeds).
The length of the longest line in the string
The number of words in the string (including line feeds)
The length of the longest word in the string
Appends text that may contain styles.
The text to be appended (may be a plain string or another ANSI string)
Whether to split the text if it is a plain string (defaults to false
)
The ANSI string instance
Appends line breaks.
The number of line breaks to insert (non-positive values are ignored)
The ANSI string instance
Closes with text.
The text to insert (should contain no styles)
The ANSI string instance
Formats a phrase with a set of arguments.
The phrase text
The formatting flags
The phrase arguments
The ANSI string instance
Opens with text.
The text to insert (should contain no styles)
The ANSI string instance
Prepends text to the word at a specific position.
The text to prepend (should contain no styles)
The position of the previously added word
The ANSI string instance
Splits a phrase into words and appends them.
The phrase text
Optional
format: FormattingCallback<string>An optional callback to process placeholders
The ANSI string instance
The string without line feeds or control sequences.
Appends a value.
The value to be formatted
The formatting flags
The ANSI string instance
Appends text with a style.
The text to insert
The style to be applied
The ANSI string instance
Wraps the words to fit in a terminal width.
The resulting list
The current terminal column
The desired terminal width (or zero or NaN
to avoid wrapping)
Whether styles should be emitted
Whether spaces should be emitted instead of move sequences
Whether this string is the head of a chain for line-wise wrapping
The updated terminal column
Implements concatenation of strings that can be printed on a terminal.