import type { TypstParser } from '@myriaddreamin/typst-ts-parser'; /** * The initilization function that must be called before using the {@link hljsTypst} function. */ export declare function initHljs(): Promise; /** * Options for the `hljsTypst` function. * @param handleCodeBlocks - Whether to handle code blocks. * Defaults to true. * If set to false, code blocks will be rendered as plain code blocks. * If set to true, a default handler will be used. * If set to a function, the function will be used as the handler. * * When the `hljsTypst` has a code block handler, the code block will be called with the code block content and the emitter. * * If the handler return false, the code block will be still rendered as plain code blocks. * * @param codeBlockDefaultLanguage - The default language for code blocks. * Defaults to undefined. */ export interface TypstHljsOptions { handleCodeBlocks?: boolean | ((code: string, emitter: any) => boolean); codeBlockDefaultLanguage?: string; } /** * A function that constructs a language definition for hljs * @param options options for the hljsTypst function. * @returns a language definition for hljs. * See {@link TypstHljsOptions} for more details. * * @example * * Default usage: * ```ts * hljs.registerLanguage('typst', window.hljsTypst()); * ``` * * @example * * Don't handle code blocks: * ```ts * hljs.registerLanguage('typst', window.hljsTypst({ * handleCodeBlocks: false, * })); * * @example * * Handle code blocks with a custom function: * ```ts * hljs.registerLanguage('typst', window.hljsTypst({ * handleCodeBlocks: (code, emitter) => { * return false; * }); * })); * ``` * * @example * * Set the default language for code blocks: * ```ts * hljs.registerLanguage('typst', window.hljsTypst({ * codeBlockDefaultLanguage: 'rust', * })); * ``` */ export declare function hljsTypst(options?: TypstHljsOptions): (hljs: any) => { case_insensitive: boolean; keywords: string[]; contains: never[]; __emitTokens: (code: string, emitter: any) => void; }; //# sourceMappingURL=hljs.d.mts.map