Skip to content

Commit

Permalink
Create Color type
Browse files Browse the repository at this point in the history
  • Loading branch information
Caesarovich committed Jul 17, 2024
1 parent e36bc3e commit c002be6
Showing 1 changed file with 24 additions and 59 deletions.
83 changes: 24 additions & 59 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ type Boxes = {
readonly none: BoxStyle;
} & CLIBoxes;

type Color = LiteralUnion<
| 'black'
| 'red'
| 'green'
| 'yellow'
| 'blue'
| 'magenta'
| 'cyan'
| 'white'
| 'gray'
| 'grey'
| 'blackBright'
| 'redBright'
| 'greenBright'
| 'yellowBright'
| 'blueBright'
| 'magentaBright'
| 'cyanBright'
| 'whiteBright',
string
>;
/**
Characters used for custom border.
Expand Down Expand Up @@ -55,27 +76,7 @@ export type Options = {
/**
Color of the box border.
*/
readonly borderColor?: LiteralUnion<
| 'black'
| 'red'
| 'green'
| 'yellow'
| 'blue'
| 'magenta'
| 'cyan'
| 'white'
| 'gray'
| 'grey'
| 'blackBright'
| 'redBright'
| 'greenBright'
| 'yellowBright'
| 'blueBright'
| 'magentaBright'
| 'cyanBright'
| 'whiteBright',
string
>;
readonly borderColor?: Color;

/**
Style of the box border.
Expand Down Expand Up @@ -115,48 +116,12 @@ export type Options = {
/**
Color of the background.
*/
readonly backgroundColor?: LiteralUnion<
| 'black'
| 'red'
| 'green'
| 'yellow'
| 'blue'
| 'magenta'
| 'cyan'
| 'white'
| 'blackBright'
| 'redBright'
| 'greenBright'
| 'yellowBright'
| 'blueBright'
| 'magentaBright'
| 'cyanBright'
| 'whiteBright',
string
>;
readonly backgroundColor?: Color;

/**
Color of the background of the border.
*/
readonly borderBackgroundColor?: LiteralUnion<
| 'black'
| 'red'
| 'green'
| 'yellow'
| 'blue'
| 'magenta'
| 'cyan'
| 'white'
| 'blackBright'
| 'redBright'
| 'greenBright'
| 'yellowBright'
| 'blueBright'
| 'magentaBright'
| 'cyanBright'
| 'whiteBright',
string
>;
readonly borderBackgroundColor?: Color;

/**
Align the text in the box based on the widest line.
Expand Down

0 comments on commit c002be6

Please sign in to comment.