UNPKG

1.38 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/text-table`
3
4# Summary
5This package contains type definitions for text-table (https://github.com/substack/text-table).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/text-table.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/text-table/index.d.ts)
10````ts
11/**
12 * Generates borderless text table strings suitable for printing to stdout.
13 */
14declare function table(
15 /** An array of arrays containing strings, numbers, or other printable values. */
16 rows: Array<Array<{}>>,
17 /** A configuration object to customize table output. */
18 options?: table.Options,
19): string;
20
21declare namespace table {
22 interface Options {
23 /** Separator to use between columns, (default: ' '). */
24 hsep?: string | undefined;
25
26 /** An array of alignment types for each column, default ['l','l',...]. */
27 align?: Array<"l" | "r" | "c" | "." | null | undefined> | undefined;
28
29 /** A callback function to use when calculating the string length. */
30 stringLength?(str: string): number;
31 }
32}
33
34export = table;
35
36````
37
38### Additional Details
39 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
40 * Dependencies: none
41
42# Credits
43These definitions were written by [Saad Quadri](https://github.com/saadq).
44
\No newline at end of file