mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
@types/cli-table2 fixed header types
Though it is not currently documented, `head` prop accepts `Cell[]`, not `string[]`. I've made PR to cli-table2 regarding this (https://github.com/jamestalmage/cli-table2/pull/53), but typings should be fixed whether it is megred or not
This commit is contained in:
@@ -230,3 +230,24 @@ table26.push(
|
||||
// feel free to use colors in your content strings, column widths will be calculated correctly
|
||||
const table27 = new Table({ colWidths: [5], style: { head: [], border: [] } }) as Table.HorizontalTable;
|
||||
table27.push([/*colors.red(*/'hello'/*)*/]);
|
||||
|
||||
// Header as text
|
||||
const table28 = new Table({ head: ["Top Header 1", "Top Header 2"] }) as Table.HorizontalTable;
|
||||
table28.push(
|
||||
['Value Row 1 Col 1', 'Value Row 1 Col 2'],
|
||||
['Value Row 2 Col 1', 'Value Row 2 Col 2']
|
||||
);
|
||||
|
||||
// Header as Cells
|
||||
const table29 = new Table({ head: [{content: "Top Header 1"}, {content: "Top Header 2"}] }) as Table.HorizontalTable;
|
||||
table29.push(
|
||||
['Value Row 1 Col 1', 'Value Row 1 Col 2'],
|
||||
['Value Row 2 Col 1', 'Value Row 2 Col 2']
|
||||
);
|
||||
|
||||
// ColSpan in header
|
||||
const table30 = new Table({ head: [{content: "Top Header 1", colSpan: 2}, {content: "Top Header 3"}] }) as Table.HorizontalTable;
|
||||
table30.push(
|
||||
['Value Row 1 Col 1', 'Value Row 1 Col 2', 'Value Row 1 Col 3'],
|
||||
['Value Row 2 Col 1', 'Value Row 2 Col 2', 'Value Row 2 Col 3']
|
||||
);
|
||||
|
||||
Vendored
+1
-1
@@ -31,7 +31,7 @@ declare namespace CliTable2 {
|
||||
rowHeights: Array<number | null>;
|
||||
colAligns: HorizontalAlignment[];
|
||||
rowAligns: VerticalAlignment[];
|
||||
head: string[];
|
||||
head: Cell[];
|
||||
wordWrap: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user