diff --git a/types/easy-table/easy-table-tests.ts b/types/easy-table/easy-table-tests.ts index 8eba36ce6e..f5ee9efecd 100644 --- a/types/easy-table/easy-table-tests.ts +++ b/types/easy-table/easy-table-tests.ts @@ -83,11 +83,13 @@ function totalling() { function other_samples() { var t = new Table(); + var columns = Object.freeze(t.columns()); data.forEach(product => { t.cell('Product Id', product.id) t.cell('Description', product.desc) t.cell('Price, USD', product.price, Table.number(2)) + t.pushDelimeter(columns) t.newRow() }) diff --git a/types/easy-table/index.d.ts b/types/easy-table/index.d.ts index f75d74861b..0ee1863c4e 100644 --- a/types/easy-table/index.d.ts +++ b/types/easy-table/index.d.ts @@ -53,7 +53,7 @@ declare class EasyTable { * * @returns {Table} `this` */ - public newRow(): EasyTable; + public newRow(): this; /** * Write cell in the current row @@ -63,7 +63,7 @@ declare class EasyTable { * @param {Function} [printer] - Printer function to format the value * @returns {Table} `this` */ - public cell(col: string, val: T, printer?: CellPrinter): EasyTable; + public cell(col: string, val: T, printer?: CellPrinter): this; /** * Get list of columns in printing order @@ -92,7 +92,7 @@ declare class EasyTable { * @param {String[]} [cols] * @returns {Table} `this` */ - public pushDelimeter(cols?: string[]): EasyTable; + public pushDelimeter(cols?: ReadonlyArray): this; /** * Compute all totals and yield the results to `cb` @@ -115,14 +115,14 @@ declare class EasyTable { * @param {Function|string[]} [cmp] - Either compare function or a list of columns to sort on * @returns {Table} `this` */ - public sort(cmp?: string[]): EasyTable; + public sort(cmp?: ReadonlyArray): this; /** * Sort the table * * @param {Function|string[]} [cmp] - Either compare function or a list of columns to sort on * @returns {Table} `this` */ - public sort(cmp?: CompareFunction): EasyTable; + public sort(cmp?: CompareFunction): this; /** * Add a total for the column @@ -131,7 +131,7 @@ declare class EasyTable { * @param {Object} [opts] * @returns {Table} `this` */ - public total(col: string, opts?: TotalOptions): EasyTable; + public total(col: string, opts?: TotalOptions): this; /** * Predefined helpers for totals */