/** Strip the opening and closing ``` fences from a code block, * returning just the body. Handles both ``` and ~~~ markers. */ export declare function stripCodeFence(raw: string): string; /** Detect the info-string from the opening fence. Returns an * empty string when the block has no fence or the language * isn't one of our registered ones (so callers can fall back * to a plain `
`). */
export declare function codeLang(raw: string): string;
/** Run highlight.js on a code body and return sanitized HTML.
 *  Falls back to an escaped plain-text version when the language
 *  isn't registered — never throws.  `body` should already be
 *  fence-stripped (see `stripCodeFence`). */
export declare function highlightCode(body: string, lang: string): string;
/** Split a pipe-delimited table into rows of cells, dropping the
 *  alignment separator row.  Each inner array is the cells of one
 *  row.  The first row is conventionally the header. */
export declare function tableRows(raw: string): string[][];
/** Re-join a 2-D cell array into pipe-delimited markdown.  Used
 *  when the user edits a table in CSV/textarea form and we need
 *  to push it back into `richContent.raw`. */
export declare function rowsToTable(rows: string[][]): string;
/** Sort a 2-D cell array in place around a chosen column.  The
 *  first row is the header and stays pinned at the top.
 *  Direction is `'asc'` | `'desc'`.  When every value in the
 *  column parses as a finite number the sort is numeric,
 *  otherwise lexical (locale-aware).  Stable across equal keys.
 *  Doesn't mutate the input. */
export type SortDir = 'asc' | 'desc';
export declare function sortTable(rows: string[][], col: number, dir: SortDir): string[][];