/* tslint:disable */ /* eslint-disable */ /** * Configuration for highlighting. */ export class HighlightConfig { free(): void; [Symbol.dispose](): void; constructor(); /** * Set HTML format to class names: ``, etc. */ setHtmlFormatClassNames(): void; /** * Set HTML format to class names with custom prefix. */ setHtmlFormatClassNamesWithPrefix(prefix: string): void; /** * Set HTML format to custom elements (default): ``, ``, etc. */ setHtmlFormatCustomElements(): void; /** * Set HTML format to custom elements with custom prefix. */ setHtmlFormatCustomElementsWithPrefix(prefix: string): void; setMaxInjectionDepth(depth: number): void; } /** * Highlight source code, resolving injections recursively. * * This uses the shared `AsyncHighlighter` from `arborium_highlight`, * ensuring the same injection handling logic as Rust native. */ export function highlight(language: string, source: string): Promise; /** * Highlight into flat, non-overlapping tokens for editor integrations. * * Returns a JS array of `{ start, end, tag }` where `start`/`end` are byte * offsets into `source` and `tag` is the resolved theme tag (e.g. "keyword"). * Unlike `highlight`, this returns token ranges rather than HTML, so editors * (Monaco, CodeMirror) can apply highlighting as semantic tokens/decorations. */ export function highlightSpans(language: string, source: string): Promise; /** * Highlight with custom configuration. */ export function highlightWithConfig(language: string, source: string, config: HighlightConfig): Promise; /** * Check if a language is available for highlighting. */ export function isLanguageAvailable(language: string): boolean; export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { readonly memory: WebAssembly.Memory; readonly __wbg_highlightconfig_free: (a: number, b: number) => void; readonly highlight: (a: number, b: number, c: number, d: number) => any; readonly highlightSpans: (a: number, b: number, c: number, d: number) => any; readonly highlightWithConfig: (a: number, b: number, c: number, d: number, e: number) => any; readonly highlightconfig_new: () => number; readonly highlightconfig_setHtmlFormatClassNames: (a: number) => void; readonly highlightconfig_setHtmlFormatClassNamesWithPrefix: (a: number, b: number, c: number) => void; readonly highlightconfig_setHtmlFormatCustomElements: (a: number) => void; readonly highlightconfig_setHtmlFormatCustomElementsWithPrefix: (a: number, b: number, c: number) => void; readonly highlightconfig_setMaxInjectionDepth: (a: number, b: number) => void; readonly isLanguageAvailable: (a: number, b: number) => number; readonly wasm_bindgen__closure__destroy__he61548434aa5127f: (a: number, b: number) => void; readonly wasm_bindgen__convert__closures_____invoke__head8c4aa031454d5: (a: number, b: number, c: any) => [number, number]; readonly wasm_bindgen__convert__closures_____invoke__h2917e8429fb6c6bc: (a: number, b: number, c: any, d: any) => void; readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_exn_store: (a: number) => void; readonly __externref_table_alloc: () => number; readonly __wbindgen_externrefs: WebAssembly.Table; readonly __externref_table_dealloc: (a: number) => void; readonly __wbindgen_start: () => void; } export type SyncInitInput = BufferSource | WebAssembly.Module; /** * Instantiates the given `module`, which can either be bytes or * a precompiled `WebAssembly.Module`. * * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. * * @returns {InitOutput} */ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; /** * If `module_or_path` is {RequestInfo} or {URL}, makes a request and * for everything else, calls `WebAssembly.instantiate` directly. * * @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. * * @returns {Promise} */ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise;