File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ interface TableOptions < T > {
2+ rows ?: T [ ] ;
3+ chars ?: {
4+ [ k in
5+ | 'top'
6+ | 'top-mid'
7+ | 'top-left'
8+ | 'top-right'
9+ | 'bottom'
10+ | 'bottom-mid'
11+ | 'bottom-left'
12+ | 'bottom-right'
13+ | 'left'
14+ | 'left-mid'
15+ | 'mid'
16+ | 'mid-mid'
17+ | 'right'
18+ | 'right-mid'
19+ | 'middle' ] ?: string ;
20+ } ;
21+ truncate ?: string ;
22+ colors ?: boolean ;
23+ colWidths ?: number [ ] ;
24+ colAligns ?: Array < 'left' | 'middle' | 'right' > ;
25+ style ?: {
26+ 'padding-left' ?: number ;
27+ 'padding-right' ?: number ;
28+ head ?: string [ ] ;
29+ border ?: string [ ] ;
30+ compact ?: boolean ;
31+ } ;
32+ head ?: string [ ] ;
33+ }
34+
35+ type HorizontalTableRow = string [ ] ;
36+ type VerticalTableRow = Record < string , string > ;
37+ type CrossTableRow = Record < string , string [ ] > ;
38+ type TableRow = HorizontalTableRow | VerticalTableRow | CrossTableRow ;
39+
40+ declare class Table < T extends TableRow > extends Array < T > {
41+ constructor ( options ?: T extends CrossTableRow ? never : TableOptions < T > ) ;
42+ constructor ( options : T extends CrossTableRow ? TableOptions < T > & { head : [ '' , ...string [ ] ] } : never ) ;
43+ render ( ) : string ;
44+ toString ( ) : string ;
45+ static readonly version : string ;
46+ }
47+
48+ export = Table ;
Original file line number Diff line number Diff line change 1717 "expresso" : " ~0.9" ,
1818 "should" : " ~0.6"
1919 },
20- "main" : " lib" ,
20+ "main" : " ./lib/index.js" ,
21+ "types" : " ./lib/main.d.ts" ,
2122 "files" : [" lib" ],
2223 "scripts" : {
2324 "test" : " make test"
You can’t perform that action at this time.
0 commit comments