/** * Render a markdown heading. * * @example * * ```js * md.heading("Hello, World!", 1); * // => "\n# Hello, World!\n" * ``` * @param text Heading title * @param level Heading level * @returns Rendered markdown string * * @group render_utils */ declare function heading(text: string, level: 1 | 2 | 3 | 4 | 5 | 6 | (number & {})): string; /** * * Render a markdown link. * * @example * * ```js * md.link("https://www.google.com", "Google"); * // => "[Google](https://www.google.com)" * ``` * * ```js * md.link("https://www.google.com", "Google", { external: true }); * // => "Google" * ``` * * @param url Link URL - will be # if not provided or empty * @param title Link title - will be same as `url` if not provided or empty * @param opts Additional options for link * @param opts.title Link title * @param opts.external If true, render link as HTML anchor tag * @returns Rendered markdown string * * @group render_utils */ declare function link(url: string | URL, text?: string, opts?: { title?: string; external?: boolean; }): string; /** * Render a markdown image. * * @example * * ```js * md.image("https://cataas.com/cat", "Cute Cat"); * // => "![Cute Cat](https://cataas.com/cat)" * ``` * * @param url Image URL * @param text Image text * @param opts Additional options for image * @param opts.title Image title * @returns Rendered markdown string * * @group render_utils */ declare function image(url: string, text?: string, opts?: { title?: string; }): string; /** * * Format a string as a code block. * * @example * * ```js * md.codeBlock('console.log("Hello, World!");', "js"); * // => "```js\nconsole.log("Hello, World!");\n```" * ``` * * @param code Text to be formattted as code block * @param lang Language identifier * @param opts Additional options for code block * @param opts.ext File extension * @returns Rendered markdown string * * @group render_utils */ declare function codeBlock(code: string, lang?: string, opts?: { ext?: string; }): string; /** * Render a markdown table. * * @example * * ```js * md.table({ * columns: ["Breed", "Origin", "Size", "Temperament"], * rows: [ * ["Abyssinian", "Egypt", "Medium", "Active"], * ["Aegean", "Greece", "Medium", "Active"], * ["American Bobtail", "United States", "Medium", "Active"], * ["Applehead Siamese", "Thailand", "Medium", "Active"], * ], * }); * ``` * * @param table Table object * @param table.rows Table rows * @param table.columns Table columns * @returns Rendered markdown string * * @group render_utils */ declare function table(table: { rows: string[][]; columns: string[]; }): string; /** * Render a markdown bold text. * * @example * * ```js * md.bold("Hello, World!"); * // => "**Hello, World!**" * ``` * * @param text Text to be formatted as bold * @returns Rendered markdown string * * @group render_utils */ declare function bold(text: string): string; /** * Render a markdown italic text. * * @example * * ```js * md.italic("Hello, World!"); * // => "_Hello, World!_" * ``` * * @param text Text to be formatted as italic * @returns Rendered markdown string * * @group render_utils */ declare function italic(text: string): string; /** * Render a markdown bold and italic text. * * @example * * ```js * md.boldAndItalic("Hello, World!"); * // => "***Hello, World!***" * ``` * * @param text Text to be formatted as bold and italic * @returns Rendered markdown string * * @group render_utils */ declare function boldAndItalic(text: string): string; /** * Render a markdown blockquote text with > in front of a paragraph * * @example * * ```js * md.blockquote("Hello, World!"); * // => "> Hello, World!" * ``` * * @param text Text to be formatted as blockquote * @returns Rendered markdown string * * @group render_utils */ declare function blockquote(text: string): string; /** * Render a markdown strikethrough text. * * @example * * ```js * md.strikethrough("Hello, World!"); * // => "~~Hello, World!~~" * ``` * * @param text Text to be formatted as strikethrough * @returns Rendered markdown string * * @group render_utils */ declare function strikethrough(text: string): string; /** * Render a markdown horizontal rule. * * @example * * ```js * md.hr(); * // => "---" * ``` * * @param length Length of the horizontal rule * @returns Rendered markdown string * * @group render_utils */ declare function hr(length: number): string; /** * Render a markdown ordered or unordered list. * * @example * * ```js * md.list(["Item 1", "Item 2", "Item 3"]); * // => "- Item 1\n- Item 2\n- Item 3" * ``` * * ```js * md.list(["Item 1", "Item 2", "Item 3"], { ordered: true }); * // => "1. Item 1\n2. Item 2\n3. Item 3" * ``` * * @param items List of items * @param opts Additional options for list * @param opts.ordered If true, render an ordered list * @param opts.char Custom character for list * @returns Rendered markdown string * * @group render_utils */ declare function list(items: string[], opts?: { ordered?: boolean; char?: string; }): string; declare const render_blockquote: typeof blockquote; declare const render_bold: typeof bold; declare const render_boldAndItalic: typeof boldAndItalic; declare const render_codeBlock: typeof codeBlock; declare const render_heading: typeof heading; declare const render_hr: typeof hr; declare const render_image: typeof image; declare const render_italic: typeof italic; declare const render_link: typeof link; declare const render_list: typeof list; declare const render_strikethrough: typeof strikethrough; declare const render_table: typeof table; declare namespace render { export { render_blockquote as blockquote, render_bold as bold, render_boldAndItalic as boldAndItalic, render_codeBlock as codeBlock, render_heading as heading, render_hr as hr, render_image as image, render_italic as italic, render_link as link, render_list as list, render_strikethrough as strikethrough, render_table as table }; } export { blockquote, bold, boldAndItalic, codeBlock, heading, hr, image, italic, link, list, render as md, strikethrough, table };