react-markdown-table-ts 0.5.8 → 0.5.10

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/types.d.ts CHANGED
@@ -10,10 +10,6 @@ export interface InputData {
10
10
  inputDataHeader: string[];
11
11
  inputDataBody: readonly string[][];
12
12
  }
13
- /**
14
- * Represents column alignment options.
15
- */
16
- export type Alignment = 'left' | 'center' | 'right' | 'none';
17
13
  /**
18
14
  * Props for the MarkdownTable component.
19
15
  */
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { TableRow, InputData } from './types';
2
- type Alignment = 'left' | 'right' | 'center' | 'none';
3
2
  /**
4
3
  * Calculates the maximum width for each column based on the content.
5
4
  * @param tableRows - All rows (header and body) of the table.
@@ -7,40 +6,29 @@ type Alignment = 'left' | 'right' | 'center' | 'none';
7
6
  * @returns An array of maximum widths for each column.
8
7
  */
9
8
  export declare function calculateColumnWidths(tableRows: readonly TableRow[], maxColumnCount: number): number[];
9
+ type Alignment = 'left' | 'right' | 'center' | 'none';
10
+ export declare function formatMarkdownRow(columnCount: number, currentRow: TableRow, columnAlignments: readonly Alignment[], columnWidths?: readonly number[], useTabs?: boolean, canReplaceNewlines?: boolean, hasPadding?: boolean): string;
10
11
  /**
11
- * Formats a single row into a Markdown-formatted string.
12
- * @param params - Object containing formatting options and row data.
13
- * @returns The Markdown string for the row.
12
+ * Generates the alignment row for the Markdown table syntax.
13
+ * @param columnCount - The number of columns in the table.
14
+ * @param columnAlignments - Alignment settings for each column.
15
+ * @param columnWidths - Widths of each column.
16
+ * @param useTabs - Flag to use tabs between columns.
17
+ * @param hasPadding - Flag to add padding spaces around cell content.
18
+ * @returns The Markdown string for the alignment row.
14
19
  */
15
- export declare function formatMarkdownRow({ columnCount, currentRow, columnAlignments, columnWidths, useTabs, replaceNewlines, hasPadding, }: {
16
- columnCount: number;
17
- currentRow: TableRow;
18
- columnAlignments: readonly Alignment[];
19
- columnWidths?: readonly number[];
20
- useTabs?: boolean;
21
- replaceNewlines?: boolean;
22
- hasPadding?: boolean;
23
- }): string;
24
- export declare function formatAlignmentRow({ columnCount, columnAlignments, columnWidths, useTabs, hasPadding, }: {
25
- columnCount: number;
26
- columnAlignments: readonly Alignment[];
27
- columnWidths?: readonly number[];
28
- useTabs?: boolean;
29
- hasPadding?: boolean;
30
- }): string;
20
+ export declare function formatAlignmentRow(columnCount: number, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths?: readonly number[], useTabs?: boolean, hasPadding?: boolean): string;
31
21
  /**
32
22
  * Generates a complete Markdown table string from the provided data.
33
- * @param params - Object containing table data and formatting options.
23
+ * @param inputData - The table data including headers and rows.
24
+ * @param columnAlignments - Alignment settings for each column.
25
+ * @param canAdjustColumnWidths - Flag to adjust column widths based on content.
26
+ * @param useTabs - Flag to use tabs between columns.
27
+ * @param replaceNewlines - Flag to replace newlines with <br> tags.
28
+ * @param hasPadding - Flag to add padding spaces around cell content.
34
29
  * @returns The complete Markdown table string.
35
30
  */
36
- export declare function generateMarkdownTableString({ inputData, columnAlignments, canAdjustColumnWidths, useTabs, replaceNewlines, hasPadding, }: {
37
- inputData: InputData;
38
- columnAlignments: readonly Alignment[];
39
- canAdjustColumnWidths?: boolean;
40
- useTabs?: boolean;
41
- replaceNewlines?: boolean;
42
- hasPadding?: boolean;
43
- }): string;
31
+ export declare function generateMarkdownTableString(inputData: InputData, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], canAdjustColumnWidths?: boolean, useTabs?: boolean, replaceNewlines?: boolean, hasPadding?: boolean): string;
44
32
  /**
45
33
  * Replaces newline characters in a string with <br> tags.
46
34
  * @param cell - The cell content to process.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-markdown-table-ts",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
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",