highlight_manager.ts

Declarations
#

3 declarations

view source

HighlightManager
#

highlight_manager.ts view source

Manages CSS Custom Highlight API ranges for a single element. Tracks ranges per element and only removes its own ranges when clearing.

Experimental — limited browser support. Use Code.svelte for production.

examples

const manager = new HighlightManager(); manager.highlight_from_syntax_tokens(element, tokens);

element_ranges

type Map<string, Array<Range>>

constructor

type new (): HighlightManager

highlight_from_syntax_tokens

Highlights from a SyntaxTokenStream produced by tokenize_syntax.

type (element: Element, tokens: SyntaxTokenStream): void

element
type Element
tokens
returns void

clear_element_ranges

Clears only this element's ranges from highlights.

type (): void

returns void

destroy

type (): void

returns void

HighlightMode
#

supports_css_highlight_api
#

Depends on
#

Imported by
#