import type { ParserOptions, RendererOptions } from 'comark'; export { renderHtmlFromDocument } from './render.ts'; /** * Creates a reusable parse+render function with pre-configured options. * The underlying parser is initialized once and reused on every call. * * @param options - Parse and render options * @returns An async function `(markdown) => Promise` that returns HTML * * @example * ```typescript * import { createHtmlRenderer } from '@comark/html' * import shiki from '@comark/html/plugins/shiki' * * const renderHtml = createHtmlRenderer({ * plugins: [shiki()], * components: { * alert: async ([, attrs, ...children], { render }) => * `
${await render(children)}
` * } * }) * * const html = await renderHtml('# Hello\n\n**Bold** text.') * ``` */ export declare function createHtmlRenderer(options?: ParserOptions & RendererOptions): (markdown: string) => Promise; /** * Parse markdown and render it to an HTML string. * * @param markdown - The markdown content to parse and render * @param options - Optional parse and render options * @returns A Promise resolving to the HTML string * * @example * ```typescript * import { renderHtml } from '@comark/html' * * const html = await renderHtml('# Hello\n\nThis is **bold** and _italic_.') * document.body.innerHTML = html * ``` */ export declare function renderHtml(markdown: string, options?: ParserOptions & RendererOptions): Promise;