react-markdown-table-ts 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +38 -24
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +38 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/utils.d.ts +3 -0
- package/dist/validation.d.ts +6 -0
- package/package.json +1 -1
package/dist/utils.d.ts
CHANGED
@@ -9,6 +9,9 @@ export declare function calculateColumnWidths(tableRows: readonly TableRow[], ma
|
|
9
9
|
type Alignment = 'left' | 'right' | 'center' | 'none';
|
10
10
|
export declare function formatMarkdownRow(columnCount: number, currentRow: TableRow, columnAlignments: readonly Alignment[], columnWidths?: readonly number[], useTabs?: boolean, canReplaceNewlines?: boolean, hasPadding?: boolean): string;
|
11
11
|
export declare function formatAlignmentRow(columnCount: number, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths?: readonly number[], useTabs?: boolean, hasPadding?: boolean): string;
|
12
|
+
export declare function formatHeaderAndAlignment(inputData: InputData, maxColumnCount: number, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths: number[] | undefined, useTabs: boolean, replaceNewlines: boolean, hasPadding: boolean): string;
|
13
|
+
export declare function formatBodyRows(inputData: InputData, maxColumnCount: number, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths: number[] | undefined, useTabs: boolean, replaceNewlines: boolean, hasPadding: boolean): string;
|
14
|
+
export declare function formatTableRows(inputData: InputData, maxColumnCount: number, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths: number[] | undefined, useTabs: boolean, replaceNewlines: boolean, hasPadding: boolean): string;
|
12
15
|
export declare function generateMarkdownTableString(inputData: InputData, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], canAdjustColumnWidths?: boolean, useTabs?: boolean, replaceNewlines?: boolean, hasPadding?: boolean): string;
|
13
16
|
/**
|
14
17
|
* Replaces newline characters in a string with <br> tags.
|
package/dist/validation.d.ts
CHANGED
@@ -5,6 +5,12 @@ import { MarkdownTableProps } from './types';
|
|
5
5
|
export declare class MarkdownTableError extends Error {
|
6
6
|
constructor(message: string);
|
7
7
|
}
|
8
|
+
/**
|
9
|
+
* Validates that the input data is a non-empty two-dimensional array.
|
10
|
+
* @param inputData - The data to validate
|
11
|
+
* @throws {MarkdownTableError} If validation fails
|
12
|
+
*/
|
13
|
+
export declare function validateInputData(inputData: unknown): void;
|
8
14
|
/**
|
9
15
|
* Validates the structure of the table data based on the `hasHeader` flag.
|
10
16
|
* Throws an error if validation fails.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-markdown-table-ts",
|
3
|
-
"version": "0.6.
|
3
|
+
"version": "0.6.4",
|
4
4
|
"description": "A React component that converts structured data into Markdown table syntax and displays it within a `<pre>` tag.",
|
5
5
|
"main": "dist/index.cjs.js",
|
6
6
|
"module": "dist/index.esm.js",
|