console-table-printer 2.14.4 → 2.14.6
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.
|
@@ -8,7 +8,7 @@ export default class Table {
|
|
|
8
8
|
addColumn(column: string | ColumnOptionsRaw): this;
|
|
9
9
|
addColumns(columns: string[] | ColumnOptionsRaw[]): this;
|
|
10
10
|
addRow(text: Dictionary, rowOptions?: RowOptionsRaw): this;
|
|
11
|
-
addRows(toBeInsertedRows:
|
|
11
|
+
addRows(toBeInsertedRows: Dictionary[], rowOptions?: RowOptionsRaw): this;
|
|
12
12
|
printTable(): void;
|
|
13
13
|
render(): string;
|
|
14
14
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Dictionary } from '../models/common';
|
|
1
2
|
import { ComplexOptions } from '../models/external-table';
|
|
2
3
|
import TableInternal from './internal-table';
|
|
3
4
|
export declare const renderTable: (table: TableInternal) => string;
|
|
4
|
-
export declare const renderSimpleTable: (rows:
|
|
5
|
-
export declare const printSimpleTable: (rows:
|
|
5
|
+
export declare const renderSimpleTable: (rows: Dictionary[], tableOptions?: ComplexOptions) => string;
|
|
6
|
+
export declare const printSimpleTable: (rows: Dictionary[], tableOptions?: ComplexOptions) => void;
|
|
@@ -12,7 +12,7 @@ declare class TableInternal {
|
|
|
12
12
|
sortFunction: RowSortFunction;
|
|
13
13
|
enabledColumns: string[];
|
|
14
14
|
disabledColumns: string[];
|
|
15
|
-
computedColumns:
|
|
15
|
+
computedColumns: ComputedColumn[];
|
|
16
16
|
rowSeparator: boolean;
|
|
17
17
|
colorMap: ColorMap;
|
|
18
18
|
charLength: CharLengthDict;
|
|
@@ -2,6 +2,7 @@ import { ColorMap } from '../utils/colored-console-line';
|
|
|
2
2
|
import { ALIGNMENT, CharLengthDict, COLOR, Dictionary } from './common';
|
|
3
3
|
import { TableStyleDetails } from './internal-table';
|
|
4
4
|
export { ALIGNMENT, COLOR };
|
|
5
|
+
export type CellValue = string | number | undefined;
|
|
5
6
|
/**
|
|
6
7
|
* Configuration options for a table column
|
|
7
8
|
*/
|
|
@@ -29,7 +30,7 @@ export interface ComputedColumn extends ColumnOptionsRaw {
|
|
|
29
30
|
* @param array - The complete array of row data
|
|
30
31
|
* @returns The computed value for this column
|
|
31
32
|
*/
|
|
32
|
-
function: (arg0:
|
|
33
|
+
function: (arg0: Dictionary, index: number, array: Dictionary[]) => CellValue;
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* Function type for sorting table rows
|
|
@@ -37,13 +38,13 @@ export interface ComputedColumn extends ColumnOptionsRaw {
|
|
|
37
38
|
* @param row2 - Second row to compare
|
|
38
39
|
* @returns Negative number if row1 should come before row2, positive if row2 should come before row1, 0 if equal
|
|
39
40
|
*/
|
|
40
|
-
export type RowSortFunction = (row1:
|
|
41
|
+
export type RowSortFunction = (row1: Dictionary, row2: Dictionary) => number;
|
|
41
42
|
/**
|
|
42
43
|
* Function type for filtering table rows
|
|
43
44
|
* @param row - The row data to evaluate
|
|
44
45
|
* @returns True if the row should be included, false if it should be filtered out
|
|
45
46
|
*/
|
|
46
|
-
export type RowFilterFunction = (row:
|
|
47
|
+
export type RowFilterFunction = (row: Dictionary) => boolean;
|
|
47
48
|
/**
|
|
48
49
|
* Default styling options applied to all columns unless overridden
|
|
49
50
|
*/
|