import type { LexedSyntax } from './lexer.js'; export type HighlightMode = 'auto' | 'ranges' | 'html'; /** * Checks for CSS Highlights API support. */ export declare const supports_css_highlight_api: () => boolean; /** * Manages CSS Custom Highlight API ranges for a single element's text node. * Tracks ranges per element and only removes its own ranges when clearing, * cooperating with other managers that share the global `CSS.highlights` registry. * * **Experimental** — limited browser support. Use `Code.svelte` for production * block code; this powers the experimental `CodeHighlight` and `CodeTextarea`. * * @example * ```ts * const manager = new HighlightManager(); * manager.highlight_from_lexed(element, syntax_styler_global.lex(text, 'ts')); * ``` */ export declare class HighlightManager { #private; /** * This manager's ranges, keyed by prefixed highlight name (e.g. `token_keyword`). * A single range object may be shared across several names (a token type plus * its aliases), since one range can belong to multiple `Highlight` sets. */ element_ranges: Map>; constructor(); /** * Highlights `element`'s text node from a lexed event stream. Ranges come * straight from event offsets — no position reconstruction. Clears this * manager's previous ranges first. * * A missing text node is a no-op. Offsets past the text node's length are * clamped (a DOM/source mismatch is the caller's concern, not a throw here). */ highlight_from_lexed(element: Element, lexed: LexedSyntax): void; /** * Clears only this manager's ranges from the shared highlights. Defensive: * a highlight may already be gone (e.g. another manager removed the last * range, or HMR reset the registry), which is a valid state, not an error. */ clear_element_ranges(): void; destroy(): void; } //# sourceMappingURL=highlight_manager.d.ts.map