Skip to content

@comfit/wasm / HighlightResult

Interface: HighlightResult

Defined in: types.ts:157

An owned snapshot, independent of document edits or registry disposal.

Properties

lineCount

readonly lineCount: number

Defined in: types.ts:159

Number of source lines, without exporting tokens from WASM.


lines

readonly lines: readonly Line[]

Defined in: types.ts:161

Exported on first access. Read before disposal. Cached lines remain usable afterward.

Methods

dispose()

dispose(): void

Defined in: types.ts:165

Release the WASM snapshot. Previously accessed lines remain usable. Repeated calls are harmless.

Returns

void


renderHtml()

renderHtml(options?): string

Defined in: types.ts:163

Render without parsing. Rainbow depths are fixed by document.highlight().

Parameters

options?

RenderHtmlOptions

Returns

string