style(table): Use official indent from .editorconfig

This commit is contained in:
Denis Malinochkin 2017-12-07 19:26:47 +03:00
parent b13b82c214
commit 7e9a1c9323
2 changed files with 29 additions and 29 deletions

View File

@ -6,41 +6,41 @@
export type borderType = 'honeywell' | 'norc' | 'ramac' | 'void';
export interface ColumnConfig {
alignment?: string;
width?: number;
truncate?: number;
paddingLeft?: string;
paddingRight?: string;
alignment?: string;
width?: number;
truncate?: number;
paddingLeft?: string;
paddingRight?: string;
}
export interface JoinStruct {
topBody?: string;
topJoin?: string;
topLeft?: string;
topRight?: string;
topBody?: string;
topJoin?: string;
topLeft?: string;
topRight?: string;
bottomBody?: string;
bottomJoin?: string;
bottomLeft?: string;
bottomRight?: string;
bottomBody?: string;
bottomJoin?: string;
bottomLeft?: string;
bottomRight?: string;
bodyLeft?: string;
bodyRight?: string;
bodyJoin?: string;
bodyLeft?: string;
bodyRight?: string;
bodyJoin?: string;
joinBody?: string;
joinLeft?: string;
joinRight?: string;
joinJoin?: string;
joinBody?: string;
joinLeft?: string;
joinRight?: string;
joinJoin?: string;
}
export interface TableUserConfig {
columns?: {
[index: number]: ColumnConfig
};
drawJoin?(index: number, size: number): boolean;
border?: JoinStruct;
columnDefault?: ColumnConfig;
columns?: {
[index: number]: ColumnConfig
};
drawJoin?(index: number, size: number): boolean;
border?: JoinStruct;
columnDefault?: ColumnConfig;
}
export function table(data: any[], userConfig?: TableUserConfig): string;

View File

@ -3,9 +3,9 @@ import * as table from 'table';
const border: table.JoinStruct = table.getBorderCharacters('norc');
const data = [
['first name', 'last name'],
['jane', 'doe'],
['john', 'doe']
['first name', 'last name'],
['jane', 'doe'],
['john', 'doe']
];
const config: table.TableUserConfig = { border };