@revideo/2d / code / HighlightResult
Interface: HighlightResult
Defined in: 2d/src/lib/code/CodeHighlighter.ts:4
Describes the result of a highlight operation.
Properties
color
color:
string|null
Defined in: 2d/src/lib/code/CodeHighlighter.ts:8
The color of the code at the given index.
skipAhead
skipAhead:
number
Defined in: 2d/src/lib/code/CodeHighlighter.ts:21
The number of characters to skip ahead.
Remarks
This should be used to skip to the end of the currently highlighted token. The returned style will be used for the skipped characters, and they will be drawn as one continuous string keeping emojis and ligatures intact.
The returned value is the number of characters to skip ahead, not the index of the end of the token.