massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / dist / src / types / api.d.ts
1 export declare type DrawLinePredicate = (index: number, size: number) => boolean;
2 export declare type DrawVerticalLine = DrawLinePredicate;
3 export declare type DrawHorizontalLine = DrawLinePredicate;
4 export declare type BorderUserConfig = {
5     readonly topLeft?: string;
6     readonly topRight?: string;
7     readonly topBody?: string;
8     readonly topJoin?: string;
9     readonly bottomLeft?: string;
10     readonly bottomRight?: string;
11     readonly bottomBody?: string;
12     readonly bottomJoin?: string;
13     readonly joinLeft?: string;
14     readonly joinRight?: string;
15     readonly joinBody?: string;
16     readonly joinJoin?: string;
17     readonly headerJoin?: string;
18     readonly bodyRight?: string;
19     readonly bodyLeft?: string;
20     readonly bodyJoin?: string;
21 };
22 export declare type BorderConfig = Required<BorderUserConfig>;
23 export declare type Alignment = 'center' | 'justify' | 'left' | 'right';
24 export declare type VerticalAlignment = 'bottom' | 'middle' | 'top';
25 export declare type ColumnUserConfig = {
26     /**
27      * Cell content horizontal alignment (default: left)
28      */
29     readonly alignment?: Alignment;
30     /**
31      * Cell content vertical alignment (default: top)
32      */
33     readonly verticalAlignment?: VerticalAlignment;
34     /**
35      * Column width (default: auto calculation based on the cell content)
36      */
37     readonly width?: number;
38     /**
39      * Number of characters are which the content will be truncated (default: Infinity)
40      */
41     readonly truncate?: number;
42     /**
43      * Cell content padding width left (default: 1)
44      */
45     readonly paddingLeft?: number;
46     /**
47      * Cell content padding width right (default: 1)
48      */
49     readonly paddingRight?: number;
50     /**
51      * If true, the text is broken at the nearest space or one of the special characters: "\|/_.,;-"
52      */
53     readonly wrapWord?: boolean;
54 };
55 export declare type HeaderUserConfig = Omit<ColumnUserConfig, 'verticalAlignment' | 'width'> & {
56     readonly content: string;
57 };
58 export declare type BaseUserConfig = {
59     /**
60      * Custom border
61      */
62     readonly border?: BorderUserConfig;
63     /**
64      * Default values for all columns. Column specific settings overwrite the default values.
65      */
66     readonly columnDefault?: ColumnUserConfig;
67     /**
68      * Column specific configuration.
69      */
70     readonly columns?: Indexable<ColumnUserConfig>;
71     /**
72      * Used to tell whether to draw a vertical line.
73      * This callback is called for each non-content line of the table.
74      * The default behavior is to always return true.
75      */
76     readonly drawVerticalLine?: DrawVerticalLine;
77 };
78 export declare type TableUserConfig = BaseUserConfig & {
79     /**
80      * The header configuration
81      */
82     readonly header?: HeaderUserConfig;
83     /**
84      * Used to tell whether to draw a horizontal line.
85      * This callback is called for each non-content line of the table.
86      * The default behavior is to always return true.
87      */
88     readonly drawHorizontalLine?: DrawHorizontalLine;
89     /**
90      * Horizontal lines inside the table are not drawn.
91      */
92     readonly singleLine?: boolean;
93 };
94 export declare type StreamUserConfig = BaseUserConfig & {
95     /**
96      * The number of columns
97      */
98     readonly columnCount: number;
99     /**
100      * Default values for all columns. Column specific settings overwrite the default values.
101      */
102     readonly columnDefault: ColumnUserConfig & {
103         /**
104          * The default width for each column
105          */
106         readonly width: number;
107     };
108 };
109 export declare type WritableStream = {
110     readonly write: (rows: string[]) => void;
111 };
112 export declare type Indexable<T> = {
113     readonly [index: number]: T;
114 };