1 | import * as React from "react";
|
2 |
|
3 | export interface RenderOptions {
|
4 | |
5 |
|
6 |
|
7 |
|
8 |
|
9 | readonly stdout?: NodeJS.WriteStream;
|
10 | |
11 |
|
12 |
|
13 |
|
14 |
|
15 | readonly stdin?: NodeJS.ReadStream;
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 | readonly exitOnCtrlC?: boolean;
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 | readonly debug?: boolean;
|
28 | }
|
29 |
|
30 | export type Instance = {
|
31 | |
32 |
|
33 |
|
34 | rerender: <Props>(tree: React.ReactElement<Props>) => void;
|
35 | |
36 |
|
37 |
|
38 | unmount: Unmount;
|
39 | |
40 |
|
41 |
|
42 | waitUntilExit: Promise<void>;
|
43 | };
|
44 |
|
45 | export type Unmount = () => void;
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | export function render<Props>(
|
51 | tree: React.ReactElement<Props>,
|
52 | options?: NodeJS.WriteStream | RenderOptions
|
53 | ): Instance;
|
54 |
|
55 | export interface ColorProps {
|
56 | readonly hex?: string;
|
57 | readonly hsl?: [number, number, number];
|
58 | readonly hsv?: [number, number, number];
|
59 | readonly hwb?: [number, number, number];
|
60 | readonly rgb?: [number, number, number];
|
61 | readonly keyword?: string;
|
62 | readonly bgHex?: string;
|
63 | readonly bgHsl?: [number, number, number];
|
64 | readonly bgHsv?: [number, number, number];
|
65 | readonly bgHwb?: [number, number, number];
|
66 | readonly bgRgb?: [number, number, number];
|
67 | readonly bgKeyword?: string;
|
68 |
|
69 | readonly reset?: boolean;
|
70 | readonly bold?: boolean;
|
71 | readonly dim?: boolean;
|
72 | readonly italic?: boolean;
|
73 | readonly underline?: boolean;
|
74 | readonly inverse?: boolean;
|
75 | readonly hidden?: boolean;
|
76 | readonly strikethrough?: boolean;
|
77 |
|
78 | readonly visible?: boolean;
|
79 |
|
80 | readonly black?: boolean;
|
81 | readonly red?: boolean;
|
82 | readonly green?: boolean;
|
83 | readonly yellow?: boolean;
|
84 | readonly blue?: boolean;
|
85 | readonly magenta?: boolean;
|
86 | readonly cyan?: boolean;
|
87 | readonly white?: boolean;
|
88 | readonly gray?: boolean;
|
89 | readonly grey?: boolean;
|
90 | readonly blackBright?: boolean;
|
91 | readonly redBright?: boolean;
|
92 | readonly greenBright?: boolean;
|
93 | readonly yellowBright?: boolean;
|
94 | readonly blueBright?: boolean;
|
95 | readonly magentaBright?: boolean;
|
96 | readonly cyanBright?: boolean;
|
97 | readonly whiteBright?: boolean;
|
98 |
|
99 | readonly bgBlack?: boolean;
|
100 | readonly bgRed?: boolean;
|
101 | readonly bgGreen?: boolean;
|
102 | readonly bgYellow?: boolean;
|
103 | readonly bgBlue?: boolean;
|
104 | readonly bgMagenta?: boolean;
|
105 | readonly bgCyan?: boolean;
|
106 | readonly bgWhite?: boolean;
|
107 | readonly bgBlackBright?: boolean;
|
108 | readonly bgRedBright?: boolean;
|
109 | readonly bgGreenBright?: boolean;
|
110 | readonly bgYellowBright?: boolean;
|
111 | readonly bgBlueBright?: boolean;
|
112 | readonly bgMagentaBright?: boolean;
|
113 | readonly bgCyanBright?: boolean;
|
114 | readonly bgWhiteBright?: boolean;
|
115 | }
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | export const Color: React.FC<ColorProps>;
|
121 |
|
122 | export interface BoxProps {
|
123 | readonly width?: number;
|
124 | readonly height?: number;
|
125 | readonly paddingTop?: number;
|
126 | readonly paddingBottom?: number;
|
127 | readonly paddingLeft?: number;
|
128 | readonly paddingRight?: number;
|
129 | readonly paddingX?: number;
|
130 | readonly paddingY?: number;
|
131 | readonly padding?: number;
|
132 | readonly marginTop?: number;
|
133 | readonly marginBottom?: number;
|
134 | readonly marginLeft?: number;
|
135 | readonly marginRight?: number;
|
136 | readonly marginX?: number;
|
137 | readonly marginY?: number;
|
138 | readonly margin?: number;
|
139 | readonly flexGrow?: number;
|
140 | readonly flexShrink?: number;
|
141 | readonly flexDirection?: "row" | "row-reverse" | "column" | "column-reverse";
|
142 | readonly alignItems?: "flex-start" | "center" | "flex-end";
|
143 | readonly justifyContent?:
|
144 | | "flex-start"
|
145 | | "center"
|
146 | | "flex-end"
|
147 | | "space-between"
|
148 | | "space-around";
|
149 | }
|
150 |
|
151 |
|
152 |
|
153 |
|
154 | export const Box: React.ComponentClass<BoxProps>;
|
155 |
|
156 | export interface TextProps {
|
157 | readonly bold?: boolean;
|
158 | readonly italic?: boolean;
|
159 | readonly underline?: boolean;
|
160 | readonly strikethrough?: boolean;
|
161 | }
|
162 |
|
163 |
|
164 |
|
165 |
|
166 | export const Text: React.FC<TextProps>;
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 | export const Static: React.FC<{children: React.ReactNodeArray}>;
|
174 |
|
175 |
|
176 |
|
177 |
|
178 | export const AppContext: React.Context<{
|
179 | |
180 |
|
181 |
|
182 | readonly exit: () => void;
|
183 | }>;
|
184 |
|
185 |
|
186 |
|
187 |
|
188 | export const StdinContext: React.Context<{
|
189 | |
190 |
|
191 |
|
192 | readonly stdin: NodeJS.ReadStream;
|
193 | |
194 |
|
195 |
|
196 | readonly setRawMode: NodeJS.ReadStream["setRawMode"];
|
197 | }>;
|
198 |
|
199 |
|
200 |
|
201 |
|
202 | export const StdoutContext: React.Context<{
|
203 | |
204 |
|
205 |
|
206 | readonly stdout: NodeJS.WriteStream;
|
207 | }>;
|