-
-
Notifications
You must be signed in to change notification settings - Fork 58
/
index.test-d.ts
40 lines (37 loc) · 1.44 KB
/
index.test-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
37
38
39
40
import {expectType} from 'tsd';
import boxen, {type Spacing, type CustomBorderStyle} from './index.js';
const border: CustomBorderStyle = {
topLeft: ' ',
topRight: ' ',
bottomLeft: ' ',
bottomRight: ' ',
top: ' ',
bottom: ' ',
left: ' ',
right: ' ',
};
const spacing: Spacing = {
top: 1,
right: 0,
bottom: 1,
left: 0,
};
expectType<string>(boxen('unicorns'));
expectType<string>(boxen('unicorns', {title: 'title'}));
expectType<string>(boxen('unicorns', {title: 'title', titleAlignment: 'center'}));
expectType<string>(boxen('unicorns', {borderColor: 'green'}));
expectType<string>(boxen('unicorns', {borderColor: '#ff0000'}));
expectType<string>(boxen('unicorns', {borderStyle: 'double'}));
expectType<string>(boxen('unicorns', {borderStyle: border}));
expectType<string>(boxen('unicorns', {dimBorder: true}));
expectType<string>(boxen('unicorns', {padding: 3}));
expectType<string>(boxen('unicorns', {padding: spacing}));
expectType<string>(boxen('unicorns', {margin: 3}));
expectType<string>(boxen('unicorns', {margin: spacing}));
expectType<string>(boxen('unicorns', {float: 'center'}));
expectType<string>(boxen('unicorns', {backgroundColor: 'green'}));
expectType<string>(boxen('unicorns', {backgroundColor: '#ff0000'}));
expectType<string>(boxen('unicorns', {textAlignment: 'right'}));
expectType<string>(boxen('unicorns', {width: 20}));
expectType<string>(boxen('unicorns', {height: 5}));
expectType<string>(boxen('unicorns', {fullscreen: true}));