import { Options } from 'markdown-it'; import { Options as Options$1 } from 'mdast-util-from-markdown'; import { Options as Options$2 } from 'md4w'; type Type = "blockquote" | "img" | "strong" | "code" | "del" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "em" | "a" | "p" | "ul" | "ol" | "li" | "br" | "hr" | "table" | "thead" | "tbody" | "tr" | "th" | "td"; type Node = { type: Type; children?: (Node | string)[]; props?: Record; }; type ParsedTree = (Node | string)[]; interface Parsed { tree: ParsedTree; } interface Parser { parse: (markdown: string) => Parsed; } /** * * Create parser with [markdown-it](https://github.com/markdown-it/markdown-it). * * **WARNING**: The returned tree structure is unstable. * * @example * * ```ts * import { initMarkdownItParser } from "mdbox/parser"; * const parser = await initMarkdownItParser(); * const { tree } = parser.parse("# Hello, *world*!"); * ``` * * @group parsing_utils */ declare function initMarkdownItParser(options?: Options): Promise; /** * * Create parser with [mdast-util-from-markdown](https://github.com/syntax-tree/mdast-util-from-markdown). * * **WARNING**: The returned tree structure is unstable. * * @example * * ```ts * import { initMdAstParser } from "mdbox/parser"; * const parser = await initMdAstParser(); * const { tree } = parser.parse("# Hello, *world*!"); * ``` * * @group parsing_utils */ declare function initMdAstParser(opts?: Options$1): Promise; /** * * Create parser with [md4w](https://github.com/ije/md4w). * * **WARNING**: The returned tree structure is unstable. * * @example * * ```ts * import { initMd4wParser } from "mdbox/parser"; * const parser = await initMd4wParser(); * const { tree } = parser.parse("# Hello, *world*!"); * ``` * * @group parsing_utils */ declare function initMd4wParser(opts?: Options$2): Promise; export { type Node, type Parsed, type ParsedTree, type Parser, type Type, initMarkdownItParser, initMd4wParser, initMdAstParser };