import type { SyntaxStyler } from './syntax_styler.js'; /** * Reactive inputs for `create_range_highlighting`. All values are getters so the * helper can track the consuming component's reactive state across the call * boundary (the Svelte 5 getter-injection pattern). */ export interface RangeHighlightingOptions { /** The element whose first text node receives the highlight ranges. */ element: () => Element | undefined; /** * The text to tokenize. Must match the element's text node exactly (e.g. a * textarea backdrop includes its trailing newline here too). */ text: () => string; /** Language id; `null` disables highlighting. */ lang: () => string | null; /** The syntax styler whose registered languages back `lang` lookups. */ syntax_styler: () => SyntaxStyler; /** Extra gate — ranges are only applied when this returns true. Defaults to always-on. */ enabled?: () => boolean; /** Component name used in DEV warnings. */ dev_label: string; } /** Reactive outputs from `create_range_highlighting`. */ export interface RangeHighlighting { readonly highlighting_disabled: boolean; } /** * Wires up CSS Custom Highlight API range highlighting for a single element's * text node, shared by `CodeHighlight` and `CodeTextarea`. Creates a * `HighlightManager`, memoizes tokenization, applies/clears ranges in an effect, * emits DEV warnings for unsupported languages, and tears down on destroy. * * Must be called during component initialization (it uses `$effect`/`onDestroy`). */ export declare const create_range_highlighting: (options: RangeHighlightingOptions) => RangeHighlighting; //# sourceMappingURL=range_highlighting.svelte.d.ts.map