/** * Markdown Table Formatter * * Formats data into well-formed Markdown table strings. * * Features: * - Auto column width calculation with padding * - Column alignment (left, center, right, none) * - Proper escaping of pipe characters and backslashes * - Compact mode (disable column-width alignment) for minimal output * - Configurable column definitions * - Multiline cell content (newlines converted to `
`) * * @example * ```ts * // Simple array data with headers * formatMarkdown(["Name", "Age"], [["Alice", "30"], ["Bob", "25"]]); * // | Name | Age | * // | ----- | --- | * // | Alice | 30 | * // | Bob | 25 | * * // With alignment * formatMarkdown(["Left", "Center", "Right"], data, { * alignment: "left", * columns: [ * { header: "Left", alignment: "left" }, * { header: "Center", alignment: "center" }, * { header: "Right", alignment: "right" } * ] * }); * ``` */ import type { MarkdownFormatOptions } from "../types.js"; /** * Format data as a Markdown table string. * * @param headers - Column header strings * @param rows - Data rows (each row is an array of cell values) * @param options - Formatting options * @returns Formatted Markdown table string * * @example * ```ts * formatMarkdown( * ["Name", "Age", "City"], * [ * ["Alice", 30, "New York"], * ["Bob", 25, "London"] * ] * ); * ``` */ export declare function formatMarkdown(headers: string[], rows: unknown[][], options?: MarkdownFormatOptions): string;