Style
Defined in: src/render/style.ts:36
An immutable per-cell visual style. Build one and pass it to ScreenBuffer.setCell.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Style(
props?):Style
Defined in: src/render/style.ts:60
Parameters
Section titled “Parameters”props?
Section titled “props?”StyleProps = {}
Returns
Section titled “Returns”Style
Properties
Section titled “Properties”background?
Section titled “background?”
readonlyoptionalbackground?:string
Defined in: src/render/style.ts:40
Background color.
readonlybold:boolean
Defined in: src/render/style.ts:42
Bold/bright.
color?
Section titled “color?”
readonlyoptionalcolor?:string
Defined in: src/render/style.ts:38
Foreground color.
readonlydim:boolean
Defined in: src/render/style.ts:54
Reduced intensity.
italic
Section titled “italic”
readonlyitalic:boolean
Defined in: src/render/style.ts:44
Italic.
readonlyoptionallink?:string
Defined in: src/render/style.ts:58
Hyperlink target.
reverse
Section titled “reverse”
readonlyreverse:boolean
Defined in: src/render/style.ts:52
Foreground/background swapped.
strikethrough
Section titled “strikethrough”
readonlystrikethrough:boolean
Defined in: src/render/style.ts:56
Struck-through.
underline
Section titled “underline”
readonlyunderline:boolean
Defined in: src/render/style.ts:46
Underlined.
underlineColor?
Section titled “underlineColor?”
readonlyoptionalunderlineColor?:string
Defined in: src/render/style.ts:50
Underline color (independent of foreground).
underlineStyle?
Section titled “underlineStyle?”
readonlyoptionalunderlineStyle?:UnderlineStyle
Defined in: src/render/style.ts:48
Underline shape.
DEFAULT
Section titled “DEFAULT”
readonlystaticDEFAULT:Style
Defined in: src/render/style.ts:75
The empty style (terminal defaults).
Methods
Section titled “Methods”equals()
Section titled “equals()”equals(
other):boolean
Defined in: src/render/style.ts:78
True if every attribute matches.
Parameters
Section titled “Parameters”Style
Returns
Section titled “Returns”boolean
matchesProps()
Section titled “matchesProps()”matchesProps(
props):boolean
Defined in: src/render/style.ts:104
Whether this style’s resolved fields equal props as the constructor would
normalise them — booleans coerced (!!), underline implied by
underlineStyle. Lets StyleCache match a request against a cached
instance without allocating a throwaway Style to compare.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
merge()
Section titled “merge()”merge(
other):Style
Defined in: src/render/style.ts:121
Return a new Style with other’s defined attributes layered over this one.
Parameters
Section titled “Parameters”StyleProps | Style
Returns
Section titled “Returns”Style