-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolumnify.d.ts
36 lines (33 loc) · 1.32 KB
/
columnify.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Type definitions for columnify 1.5
// Project: https://github.com/timoxley/columnify
// Definitions by: Gary King <https://github.com/garyking>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
declare function columnify(data: Record<string, any> | any[], options?: columnify.GlobalOptions): string;
declare namespace columnify {
interface Options {
align?: 'left' | 'center' | 'centre' | 'right' | undefined;
dataTransform?: ((data: string) => string) | undefined;
headingTransform?: ((data: string) => string) | undefined;
minWidth?: number | undefined;
maxWidth?: number | undefined;
paddingChr?: string | undefined;
preserveNewLines?: boolean | undefined;
showHeaders?: boolean | undefined;
truncateMarker?: string | undefined;
truncate?: boolean | undefined;
}
interface GlobalOptions extends Options {
columns?: string[] | undefined;
columnSplitter?: string | undefined;
config?: {
[columnName: string]: Options;
} | undefined;
maxLineWidth?: 'auto' | number | undefined;
truncate?: boolean | undefined;
widths?: {
[columnName: string]: Pick<Options, 'minWidth' | 'maxWidth'>;
} | undefined;
}
}
export = columnify;