Skip to content

stylesToArray

stylesToArray(styles, text): TextStyleArray

Defined in: src/util/misc/textStyles.ts:48

Returns the array form of a text object’s inline styles property with styles grouped in ranges rather than per character. This format is less verbose, and is better suited for storage so it is used in serialization (not during runtime).

Parameters

styles

TextStyle

per character styles for a text object

text

string

the text string that the styles are applied to

Returns

TextStyleArray