UNPKG

1.73 kBTypeScriptView Raw
1declare namespace cliBoxes {
2 /**
3 Style of the box border.
4 */
5 interface BoxStyle {
6 readonly topLeft: string;
7 readonly top: string;
8 readonly topRight: string;
9 readonly right: string;
10 readonly bottomRight: string;
11 readonly bottom: string;
12 readonly bottomLeft: string;
13 readonly left: string;
14 }
15
16 /**
17 All box styles.
18 */
19 interface Boxes {
20 /**
21 @example
22 ```
23 ┌────┐
24 │ │
25 └────┘
26 ```
27 */
28 readonly single: BoxStyle;
29
30 /**
31 @example
32 ```
33 ╔════╗
34 ║ ║
35 ╚════╝
36 ```
37 */
38 readonly double: BoxStyle;
39
40 /**
41 @example
42 ```
43 ╭────╮
44 │ │
45 ╰────╯
46 ```
47 */
48 readonly round: BoxStyle;
49
50 /**
51 @example
52 ```
53 ┏━━━━┓
54 ┃ ┃
55 ┗━━━━┛
56 ```
57 */
58 readonly bold: BoxStyle;
59
60 /**
61 @example
62 ```
63 ╓────╖
64 ║ ║
65 ╙────╜
66 ```
67 */
68 readonly singleDouble: BoxStyle;
69
70 /**
71 @example
72 ```
73 ╒════╕
74 │ │
75 ╘════╛
76 ```
77 */
78 readonly doubleSingle: BoxStyle;
79
80 /**
81 @example
82 ```
83 +----+
84 | |
85 +----+
86 ```
87 */
88 readonly classic: BoxStyle;
89
90 /**
91 @example
92 ```
93 ↘↓↓↓↓↙
94 → ←
95 ↗↑↑↑↑↖
96 ```
97 */
98 readonly arrow: BoxStyle;
99 }
100}
101
102/**
103Boxes for use in the terminal.
104
105@example
106```
107import cliBoxes = require('cli-boxes');
108
109console.log(cliBoxes.single);
110// {
111// topLeft: '┌',
112// top: '─',
113// topRight: '┐',
114// right: '│',
115// bottomRight: '┘',
116// bottom: '─',
117// bottomLeft: '└',
118// left: '│'
119// }
120```
121*/
122declare const cliBoxes: cliBoxes.Boxes & {
123 // TODO: Remove this for the next major release
124 default: typeof cliBoxes;
125};
126
127export = cliBoxes;