site/node_modules/micromark-extension-math/lib/html.d.ts
2024-10-14 08:09:33 +02:00

24 lines
876 B
TypeScript

/**
* Create an extension for `micromark` to support math when serializing to
* HTML.
*
* > 👉 **Note**: this uses KaTeX to render math.
*
* @param {Options | null | undefined} [options={}]
* Configuration (default: `{}`).
* @returns {HtmlExtension}
* Extension for `micromark` that can be passed in `htmlExtensions`, to
* support math when serializing to HTML.
*/
export function mathHtml(options?: Options | null | undefined): HtmlExtension
export type KatexOptions = import('katex').KatexOptions
export type HtmlExtension = import('micromark-util-types').HtmlExtension
/**
* Configuration for HTML output.
*
* > 👉 **Note**: passed to `katex.renderToString`.
* > `displayMode` is overwritten by this plugin, to `false` for math in
* > text (inline), and `true` for math in flow (block).
*/
export type Options = Omit<KatexOptions, 'displayMode'>