/** Column alignment, as carried by {@link TableData.align}. */ export type Alignment = "left" | "center" | "right"; /** A single table cell value as carried in the fence body. */ export type TableCell = string | number | boolean | null; /** * Payload of a ```` ```table ```` fenced block. * * This is the on-the-wire shape: the fence body is exactly `JSON.stringify` of * this object. Producers should build a `TableData` and hand it to * {@link serializeTable} rather than assembling the fence by hand. * * Head strings are literal label text — no character is reserved, so a label * may begin or end with a colon. Alignment travels in {@link align}. */ export interface TableData { caption?: string; head?: string[]; /** * Per-column alignment, parallel to {@link head}. Omit it entirely for an * all-left table — missing entries are left-aligned — so the common case * costs nothing on the wire. */ align?: Alignment[]; body?: TableCell[][]; options?: Record; } /** * Validate an unknown value against {@link TableData}. * Returns an error message, or null when the value is a usable table. */ export declare function validateTableData(value: unknown): string | null; /** * Serialize a {@link TableData} to a complete fenced block, delimiters * included. This is the only supported way to produce a table fence. * * @example * ```ts * serializeTable({ head: ["Name", "Qty:"], body: [["Bolt", 4]] }); * ``` */ export declare function serializeTable(data: TableData): string; /** * Parse a table fence back to {@link TableData}. Accepts either a complete * fenced block or a bare JSON body, so it round-trips {@link serializeTable}. * * Throws `SyntaxError` on malformed JSON and `TypeError` on a well-formed * document with the wrong shape — useful as a guard when normalizing tables * from another markdown flavour. */ export declare function parseTable(fence: string): TableData; export declare const tableHandler: { render(raw: string): string; serialize(raw: string): string; }; //# sourceMappingURL=table.handler.d.ts.map