diff --git a/easy-table/easy-table-tests.ts b/easy-table/easy-table-tests.ts index 62bd78008..911031d90 100644 --- a/easy-table/easy-table-tests.ts +++ b/easy-table/easy-table-tests.ts @@ -8,7 +8,7 @@ let data = [ { id: 232323, desc: 'Yet another product', price: 555.55 } ]; -interface IData { +interface Data { id: number; desc: string; price: number; @@ -35,7 +35,7 @@ function currency(val: number, width?: number) { } function sample_2() { - Table.print(data, { + Table.print(data, { desc: { name: 'description' }, price: { printer: Table.number(2) } }); diff --git a/easy-table/easy-table.d.ts b/easy-table/easy-table.d.ts index 9995585fe..e06cfdd27 100644 --- a/easy-table/easy-table.d.ts +++ b/easy-table/easy-table.d.ts @@ -108,7 +108,7 @@ declare module "easy-table" * @param {IPrintColumnOptions} [opts] * @returns {String} */ - public printTransposed(opts?: IPrintColumnOptions): string; + public printTransposed(opts?: PrintColumnOptions): string; /** * Sort the table @@ -132,11 +132,11 @@ declare module "easy-table" * @param {Object} [opts] * @returns {Table} `this` */ - public total(col: string, opts?: ITotalOptions): EasyTable; + public total(col: string, opts?: TotalOptions): EasyTable; /** * Predefined helpers for totals */ - public static aggr: IAggregators; + public static aggr: Aggregators; /** * Print the array or object @@ -146,12 +146,12 @@ declare module "easy-table" * @param {Function} [cb] - Table post processing and formating * @returns {String} */ - public static print(obj: T | T[], format?: FormatFunction | IFormatObject, cb?: TablePostProcessing): string; + public static print(obj: T | T[], format?: FormatFunction | FormatObject, cb?: TablePostProcessing): string; /** * Same as `Table.print()` but yields the result to `console.log()` */ - public static log(obj: T | T[], format?: FormatFunction | IFormatObject, cb?: TablePostProcessing): void; + public static log(obj: T | T[], format?: FormatFunction | FormatObject, cb?: TablePostProcessing): void; /** * Same as `.toString()` but yields the result to `console.log()` */ @@ -164,7 +164,7 @@ declare module "easy-table" type FormatFunction = (obj: T, cell: (name: string, val: any) => void) => void; type TablePostProcessing = (result: EasyTable) => string; - interface IPrintColumnOptions { + interface PrintColumnOptions { /** * Column separation string */ @@ -175,7 +175,7 @@ declare module "easy-table" namePrinter?: CellPrinter; } - interface IAggregators { + interface Aggregators { /** * Create a printer which formats the value with `printer`, * adds the `prefix` to it and right aligns the whole thing @@ -195,7 +195,7 @@ declare module "easy-table" avg: any; } - interface ITotalOptions { + interface TotalOptions { /** * reduce(acc, val, idx, length) function to compute the total value */ @@ -210,11 +210,11 @@ declare module "easy-table" init?: T; } - interface IFormatObject { - [key: string]: IColumnFormat; + interface FormatObject { + [key: string]: ColumnFormat; } - interface IColumnFormat { + interface ColumnFormat { name?: string; printer?: CellPrinter }