1 | import { FC, ReactNode } from 'react';
|
2 | import { ForegroundColor } from 'chalk';
|
3 | import { Styles } from '../styles';
|
4 | import { LiteralUnion } from 'type-fest';
|
5 | export interface Props {
|
6 | /**
|
7 | * Change text color. Ink uses chalk under the hood, so all its functionality is supported.
|
8 | */
|
9 | readonly color?: LiteralUnion<typeof ForegroundColor, string>;
|
10 | /**
|
11 | * Same as `color`, but for background.
|
12 | */
|
13 | readonly backgroundColor?: LiteralUnion<typeof ForegroundColor, string>;
|
14 | /**
|
15 | * Dim the color (emit a small amount of light).
|
16 | */
|
17 | readonly dimColor?: boolean;
|
18 | /**
|
19 | * Make the text bold.
|
20 | */
|
21 | readonly bold?: boolean;
|
22 | /**
|
23 | * Make the text italic.
|
24 | */
|
25 | readonly italic?: boolean;
|
26 | /**
|
27 | * Make the text underlined.
|
28 | */
|
29 | readonly underline?: boolean;
|
30 | /**
|
31 | * Make the text crossed with a line.
|
32 | */
|
33 | readonly strikethrough?: boolean;
|
34 | /**
|
35 | * Inverse background and foreground colors.
|
36 | */
|
37 | readonly inverse?: boolean;
|
38 | /**
|
39 | * This property tells Ink to wrap or truncate text if its width is larger than container.
|
40 | * If `wrap` is passed (by default), Ink will wrap text and split it into multiple lines.
|
41 | * If `truncate-*` is passed, Ink will truncate text instead, which will result in one line of text with the rest cut off.
|
42 | */
|
43 | readonly wrap?: Styles['textWrap'];
|
44 | readonly children?: ReactNode;
|
45 | }
|
46 | /**
|
47 | * This component can display text, and change its style to make it colorful, bold, underline, italic or strikethrough.
|
48 | */
|
49 | declare const Text: FC<Props>;
|
50 | export default Text;
|