1ch 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +280 -0
- package/dist/index.d.ts +639 -0
- package/dist/index.js +3283 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +55 -0
- package/package.json +52 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode, CSSProperties, RefObject } from 'react';
|
|
4
|
+
|
|
5
|
+
type Style = {
|
|
6
|
+
text: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
bg?: string;
|
|
9
|
+
bold?: boolean;
|
|
10
|
+
dim?: boolean;
|
|
11
|
+
inverted?: boolean;
|
|
12
|
+
blink?: boolean;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
noSelect?: boolean;
|
|
15
|
+
cell?: number;
|
|
16
|
+
};
|
|
17
|
+
type Segment = string | Style;
|
|
18
|
+
type Line = Segment[];
|
|
19
|
+
type Block = Line[];
|
|
20
|
+
type LayoutFn = (width: number) => Block;
|
|
21
|
+
type ThemeMode = "light" | "dark";
|
|
22
|
+
type ThemePreference = ThemeMode | "system";
|
|
23
|
+
type ThemePalette = {
|
|
24
|
+
black: string;
|
|
25
|
+
red: string;
|
|
26
|
+
green: string;
|
|
27
|
+
yellow: string;
|
|
28
|
+
blue: string;
|
|
29
|
+
magenta: string;
|
|
30
|
+
cyan: string;
|
|
31
|
+
white: string;
|
|
32
|
+
brightBlack: string;
|
|
33
|
+
brightWhite: string;
|
|
34
|
+
};
|
|
35
|
+
type ThemeSemantic = {
|
|
36
|
+
frameBg: string;
|
|
37
|
+
frameFg: string;
|
|
38
|
+
frameMuted: string;
|
|
39
|
+
border: string;
|
|
40
|
+
borderStrong: string;
|
|
41
|
+
inverseFg: string;
|
|
42
|
+
inverseBg: string;
|
|
43
|
+
info: string;
|
|
44
|
+
success: string;
|
|
45
|
+
warn: string;
|
|
46
|
+
danger: string;
|
|
47
|
+
};
|
|
48
|
+
type ThemeSyntax = {
|
|
49
|
+
default: string;
|
|
50
|
+
keyword: string;
|
|
51
|
+
string: string;
|
|
52
|
+
number: string;
|
|
53
|
+
comment: string;
|
|
54
|
+
punctuation: string;
|
|
55
|
+
function: string;
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
type ThemeMarkdown = {
|
|
59
|
+
headingMarker: string;
|
|
60
|
+
headingBoldMaxLevel: number;
|
|
61
|
+
headings: {
|
|
62
|
+
h1: string;
|
|
63
|
+
h2: string;
|
|
64
|
+
h3: string;
|
|
65
|
+
h4: string;
|
|
66
|
+
h5: string;
|
|
67
|
+
h6: string;
|
|
68
|
+
};
|
|
69
|
+
paragraph: string;
|
|
70
|
+
unorderedBullet: string;
|
|
71
|
+
orderedMarker: string;
|
|
72
|
+
tableHeader: string;
|
|
73
|
+
tableBorder: string;
|
|
74
|
+
quoteMarker: string;
|
|
75
|
+
quoteText: string;
|
|
76
|
+
separator: string;
|
|
77
|
+
codeText: string;
|
|
78
|
+
codeEmpty: string;
|
|
79
|
+
codeBorder: string;
|
|
80
|
+
};
|
|
81
|
+
type ThemeComponents = {
|
|
82
|
+
tabs: {
|
|
83
|
+
activeFg: string;
|
|
84
|
+
activeBg: string;
|
|
85
|
+
inactiveFg: string;
|
|
86
|
+
separator: string;
|
|
87
|
+
};
|
|
88
|
+
statusbar: {
|
|
89
|
+
fg: string;
|
|
90
|
+
bg: string;
|
|
91
|
+
};
|
|
92
|
+
badge: {
|
|
93
|
+
fg: string;
|
|
94
|
+
bg: string;
|
|
95
|
+
};
|
|
96
|
+
button: {
|
|
97
|
+
fg: string;
|
|
98
|
+
bg: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
type Theme = {
|
|
102
|
+
id: string;
|
|
103
|
+
label: string;
|
|
104
|
+
version: number;
|
|
105
|
+
mode: ThemeMode;
|
|
106
|
+
palette: ThemePalette;
|
|
107
|
+
semantic: ThemeSemantic;
|
|
108
|
+
syntax: ThemeSyntax;
|
|
109
|
+
markdown: ThemeMarkdown;
|
|
110
|
+
components: ThemeComponents;
|
|
111
|
+
black: string;
|
|
112
|
+
red: string;
|
|
113
|
+
green: string;
|
|
114
|
+
yellow: string;
|
|
115
|
+
blue: string;
|
|
116
|
+
magenta: string;
|
|
117
|
+
cyan: string;
|
|
118
|
+
white: string;
|
|
119
|
+
brightBlack: string;
|
|
120
|
+
brightWhite: string;
|
|
121
|
+
border: string;
|
|
122
|
+
bg: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare function isTableLine(line: Line): boolean;
|
|
126
|
+
declare function preserveTableTag(source: Line, target: Line): void;
|
|
127
|
+
|
|
128
|
+
declare function pad(s: string, w: number, right?: boolean): string;
|
|
129
|
+
declare function hl(n: number): string;
|
|
130
|
+
declare function bar(val: number, max: number, w: number): string;
|
|
131
|
+
declare function spark(data: number[], w: number): string;
|
|
132
|
+
declare function padLine(line: Line, w: number): Line;
|
|
133
|
+
|
|
134
|
+
declare function lines(content: Line[] | ((w: number) => Line[])): LayoutFn;
|
|
135
|
+
declare function box(content: LayoutFn, opts?: {
|
|
136
|
+
title?: string;
|
|
137
|
+
borderColor?: string;
|
|
138
|
+
}): LayoutFn;
|
|
139
|
+
declare function hstack(children: LayoutFn[], opts?: {
|
|
140
|
+
gap?: number;
|
|
141
|
+
widths?: number[];
|
|
142
|
+
}): LayoutFn;
|
|
143
|
+
declare function vstack(...children: LayoutFn[]): LayoutFn;
|
|
144
|
+
declare function separator(color?: string): LayoutFn;
|
|
145
|
+
declare function blank(): LayoutFn;
|
|
146
|
+
|
|
147
|
+
type Column<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
148
|
+
key: keyof T & string;
|
|
149
|
+
title?: string;
|
|
150
|
+
width?: number;
|
|
151
|
+
align?: "left" | "right";
|
|
152
|
+
headerColor?: string;
|
|
153
|
+
headerBold?: boolean;
|
|
154
|
+
color?: string | ((value: unknown, row: T) => string | undefined);
|
|
155
|
+
dim?: boolean | ((value: unknown, row: T) => boolean);
|
|
156
|
+
};
|
|
157
|
+
declare function table<T extends Record<string, unknown>>(columns: Column<T>[], data: T[], opts?: {
|
|
158
|
+
borderColor?: string;
|
|
159
|
+
fillWidth?: boolean;
|
|
160
|
+
headerColor?: string;
|
|
161
|
+
cellPadding?: number;
|
|
162
|
+
}): LayoutFn;
|
|
163
|
+
|
|
164
|
+
declare function statusbar(left: Segment[], right: Segment[], opts?: {
|
|
165
|
+
bg?: string;
|
|
166
|
+
color?: string;
|
|
167
|
+
theme?: Theme;
|
|
168
|
+
}): LayoutFn;
|
|
169
|
+
declare function tabs(names: string[], active: number, opts?: {
|
|
170
|
+
activeColor?: string;
|
|
171
|
+
activeBg?: string;
|
|
172
|
+
inactiveColor?: string;
|
|
173
|
+
separatorColor?: string;
|
|
174
|
+
onSelect?: (index: number) => void;
|
|
175
|
+
onClicks?: ((() => void) | undefined)[];
|
|
176
|
+
theme?: Theme;
|
|
177
|
+
}): LayoutFn;
|
|
178
|
+
declare function badge(label: string, opts?: {
|
|
179
|
+
color?: string;
|
|
180
|
+
bg?: string;
|
|
181
|
+
onClick?: () => void;
|
|
182
|
+
theme?: Theme;
|
|
183
|
+
}): Segment;
|
|
184
|
+
|
|
185
|
+
type JsonNode = {
|
|
186
|
+
type: "vstack";
|
|
187
|
+
children: JsonNode[];
|
|
188
|
+
} | {
|
|
189
|
+
type: "hstack";
|
|
190
|
+
gap?: number;
|
|
191
|
+
widths?: number[];
|
|
192
|
+
children: JsonNode[];
|
|
193
|
+
} | {
|
|
194
|
+
type: "box";
|
|
195
|
+
title?: string;
|
|
196
|
+
borderColor?: string;
|
|
197
|
+
children: JsonNode[];
|
|
198
|
+
} | {
|
|
199
|
+
type: "lines";
|
|
200
|
+
content: Line[];
|
|
201
|
+
} | {
|
|
202
|
+
type: "separator";
|
|
203
|
+
color?: string;
|
|
204
|
+
} | {
|
|
205
|
+
type: "blank";
|
|
206
|
+
} | {
|
|
207
|
+
type: "table";
|
|
208
|
+
columns: Column[];
|
|
209
|
+
data: Record<string, unknown>[];
|
|
210
|
+
borderColor?: string;
|
|
211
|
+
fillWidth?: boolean;
|
|
212
|
+
} | {
|
|
213
|
+
type: "statusbar";
|
|
214
|
+
left: Segment[];
|
|
215
|
+
right: Segment[];
|
|
216
|
+
bg?: string;
|
|
217
|
+
color?: string;
|
|
218
|
+
} | {
|
|
219
|
+
type: "tabs";
|
|
220
|
+
names: string[];
|
|
221
|
+
active: number;
|
|
222
|
+
activeColor?: string;
|
|
223
|
+
activeBg?: string;
|
|
224
|
+
inactiveColor?: string;
|
|
225
|
+
separatorColor?: string;
|
|
226
|
+
} | {
|
|
227
|
+
type: "bar";
|
|
228
|
+
value: number;
|
|
229
|
+
max: number;
|
|
230
|
+
color?: string;
|
|
231
|
+
label?: string;
|
|
232
|
+
} | {
|
|
233
|
+
type: "text";
|
|
234
|
+
segments: Segment[];
|
|
235
|
+
};
|
|
236
|
+
declare function fromJsonNode(node: JsonNode): LayoutFn;
|
|
237
|
+
|
|
238
|
+
type TreeNode = {
|
|
239
|
+
label: string;
|
|
240
|
+
children?: TreeNode[];
|
|
241
|
+
};
|
|
242
|
+
declare function tree(data: TreeNode[], opts?: {
|
|
243
|
+
color?: string;
|
|
244
|
+
branchColor?: string;
|
|
245
|
+
leafColor?: string;
|
|
246
|
+
}): LayoutFn;
|
|
247
|
+
declare function list(items: string[], opts?: {
|
|
248
|
+
ordered?: boolean;
|
|
249
|
+
bulletColor?: string;
|
|
250
|
+
color?: string;
|
|
251
|
+
}): LayoutFn;
|
|
252
|
+
|
|
253
|
+
type TokenType = "keyword" | "string" | "number" | "comment" | "punctuation" | "function" | "type" | "default";
|
|
254
|
+
type Token = {
|
|
255
|
+
text: string;
|
|
256
|
+
type: TokenType;
|
|
257
|
+
};
|
|
258
|
+
declare function tokenize(source: string, language?: string): Token[][];
|
|
259
|
+
|
|
260
|
+
declare function tokenColor(type: TokenType, theme: Theme): string;
|
|
261
|
+
declare function code(source: string, opts?: {
|
|
262
|
+
language?: string;
|
|
263
|
+
title?: string;
|
|
264
|
+
borderColor?: string;
|
|
265
|
+
theme?: Theme;
|
|
266
|
+
}): LayoutFn;
|
|
267
|
+
declare function diff(value: string, opts?: {
|
|
268
|
+
addColor?: string;
|
|
269
|
+
removeColor?: string;
|
|
270
|
+
metaColor?: string;
|
|
271
|
+
theme?: Theme;
|
|
272
|
+
}): LayoutFn;
|
|
273
|
+
|
|
274
|
+
type DocumentSource = {
|
|
275
|
+
format: "markdown";
|
|
276
|
+
value: string;
|
|
277
|
+
} | {
|
|
278
|
+
format: "json";
|
|
279
|
+
value: unknown;
|
|
280
|
+
} | {
|
|
281
|
+
format: "html";
|
|
282
|
+
value: string;
|
|
283
|
+
};
|
|
284
|
+
type MarkdownThemeOverrides = Partial<ThemeMarkdown>;
|
|
285
|
+
|
|
286
|
+
declare function fromMarkdown(markdown: string, opts?: {
|
|
287
|
+
theme?: Theme;
|
|
288
|
+
overrides?: MarkdownThemeOverrides;
|
|
289
|
+
}): LayoutFn;
|
|
290
|
+
|
|
291
|
+
declare function fromHtml(html: string, opts?: {
|
|
292
|
+
theme?: Theme;
|
|
293
|
+
overrides?: MarkdownThemeOverrides;
|
|
294
|
+
}): LayoutFn;
|
|
295
|
+
|
|
296
|
+
declare function fromJson(value: unknown, opts?: {
|
|
297
|
+
theme?: Theme;
|
|
298
|
+
title?: string;
|
|
299
|
+
}): LayoutFn;
|
|
300
|
+
|
|
301
|
+
declare function fromDocument(source: DocumentSource, opts?: {
|
|
302
|
+
theme?: Theme;
|
|
303
|
+
jsonTitle?: string;
|
|
304
|
+
markdownOverrides?: MarkdownThemeOverrides;
|
|
305
|
+
}): LayoutFn;
|
|
306
|
+
|
|
307
|
+
type ThemeModeTokens = {
|
|
308
|
+
palette: ThemePalette;
|
|
309
|
+
semantic: ThemeSemantic;
|
|
310
|
+
syntax: ThemeSyntax;
|
|
311
|
+
markdown: ThemeMarkdown;
|
|
312
|
+
components: ThemeComponents;
|
|
313
|
+
};
|
|
314
|
+
type ThemeSpec = {
|
|
315
|
+
id: string;
|
|
316
|
+
label: string;
|
|
317
|
+
version: number;
|
|
318
|
+
modes: Record<ThemeMode, ThemeModeTokens>;
|
|
319
|
+
};
|
|
320
|
+
type ThemeValidationIssue = {
|
|
321
|
+
path: string;
|
|
322
|
+
message: string;
|
|
323
|
+
};
|
|
324
|
+
type ThemeValidationResult = {
|
|
325
|
+
ok: boolean;
|
|
326
|
+
issues: ThemeValidationIssue[];
|
|
327
|
+
theme?: ThemeSpec;
|
|
328
|
+
};
|
|
329
|
+
declare const defaultThemeSpec: ThemeSpec;
|
|
330
|
+
declare const builtinThemes: {
|
|
331
|
+
readonly default: ThemeSpec;
|
|
332
|
+
};
|
|
333
|
+
declare function resolveThemeMode(preference: ThemePreference, systemMode?: ThemeMode): ThemeMode;
|
|
334
|
+
declare function resolveTheme(spec: ThemeSpec, preference?: ThemePreference, opts?: {
|
|
335
|
+
systemMode?: ThemeMode;
|
|
336
|
+
}): Theme;
|
|
337
|
+
declare const dark: Theme;
|
|
338
|
+
declare const light: Theme;
|
|
339
|
+
declare function themeToCssVars(theme: Theme): Record<string, string>;
|
|
340
|
+
declare function parseThemeSpec(json: string): ThemeValidationResult;
|
|
341
|
+
declare function validateThemeSpec(value: unknown): ThemeValidationResult;
|
|
342
|
+
|
|
343
|
+
type TermThemeContextValue = {
|
|
344
|
+
themeSpec: ThemeSpec;
|
|
345
|
+
modePreference: ThemePreference;
|
|
346
|
+
systemMode: ThemeMode;
|
|
347
|
+
theme: Theme;
|
|
348
|
+
setThemeSpec: (next: ThemeSpec) => void;
|
|
349
|
+
setModePreference: (next: ThemePreference) => void;
|
|
350
|
+
};
|
|
351
|
+
type TermThemeProviderProps = {
|
|
352
|
+
children: ReactNode;
|
|
353
|
+
initialTheme?: ThemeSpec;
|
|
354
|
+
initialMode?: ThemePreference;
|
|
355
|
+
};
|
|
356
|
+
declare function TermThemeProvider({ children, initialTheme, initialMode, }: TermThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
357
|
+
declare function useTermTheme(): TermThemeContextValue;
|
|
358
|
+
|
|
359
|
+
type TermUIProps = {
|
|
360
|
+
block?: Block;
|
|
361
|
+
children?: ReactNode;
|
|
362
|
+
width?: number;
|
|
363
|
+
theme?: Theme;
|
|
364
|
+
themeSpec?: ThemeSpec;
|
|
365
|
+
mode?: ThemePreference;
|
|
366
|
+
markdownOverrides?: MarkdownThemeOverrides;
|
|
367
|
+
className?: string;
|
|
368
|
+
style?: CSSProperties;
|
|
369
|
+
};
|
|
370
|
+
type TermDocumentProps = {
|
|
371
|
+
source: DocumentSource;
|
|
372
|
+
width?: number;
|
|
373
|
+
theme?: Theme;
|
|
374
|
+
themeSpec?: ThemeSpec;
|
|
375
|
+
mode?: ThemePreference;
|
|
376
|
+
jsonTitle?: string;
|
|
377
|
+
markdownOverrides?: MarkdownThemeOverrides;
|
|
378
|
+
className?: string;
|
|
379
|
+
style?: CSSProperties;
|
|
380
|
+
};
|
|
381
|
+
declare function TermUIBase({ block, children, width, theme, themeSpec, mode, markdownOverrides, className, style, }: TermUIProps): react_jsx_runtime.JSX.Element;
|
|
382
|
+
declare const TermUI: react.MemoExoticComponent<typeof TermUIBase>;
|
|
383
|
+
|
|
384
|
+
declare function TermDocument({ source, width, theme, themeSpec, mode, jsonTitle, markdownOverrides, className, style, }: TermDocumentProps): react_jsx_runtime.JSX.Element;
|
|
385
|
+
|
|
386
|
+
type BaseProps = {
|
|
387
|
+
children?: ReactNode;
|
|
388
|
+
};
|
|
389
|
+
type TVStackProps = BaseProps & {
|
|
390
|
+
gap?: number;
|
|
391
|
+
};
|
|
392
|
+
type THStackProps = BaseProps & {
|
|
393
|
+
gap?: number;
|
|
394
|
+
widths?: number[];
|
|
395
|
+
};
|
|
396
|
+
type TBoxProps = BaseProps & {
|
|
397
|
+
title?: string;
|
|
398
|
+
borderColor?: string;
|
|
399
|
+
gap?: number;
|
|
400
|
+
};
|
|
401
|
+
type TSeparatorProps = {
|
|
402
|
+
color?: string;
|
|
403
|
+
};
|
|
404
|
+
type TRawProps = {
|
|
405
|
+
text?: string;
|
|
406
|
+
color?: string;
|
|
407
|
+
bg?: string;
|
|
408
|
+
bold?: boolean;
|
|
409
|
+
dim?: boolean;
|
|
410
|
+
blink?: boolean;
|
|
411
|
+
inverted?: boolean;
|
|
412
|
+
onClick?: () => void;
|
|
413
|
+
children?: ReactNode;
|
|
414
|
+
};
|
|
415
|
+
type TTableProps<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
416
|
+
columns: Column<T>[];
|
|
417
|
+
data: T[];
|
|
418
|
+
borderColor?: string;
|
|
419
|
+
fillWidth?: boolean;
|
|
420
|
+
headerColor?: string;
|
|
421
|
+
cellPadding?: number;
|
|
422
|
+
};
|
|
423
|
+
type TTabProps = {
|
|
424
|
+
name: string;
|
|
425
|
+
children?: ReactNode;
|
|
426
|
+
};
|
|
427
|
+
type TTabsProps = {
|
|
428
|
+
active: number;
|
|
429
|
+
activeColor?: string;
|
|
430
|
+
activeBg?: string;
|
|
431
|
+
inactiveColor?: string;
|
|
432
|
+
separatorColor?: string;
|
|
433
|
+
onSelect?: (index: number) => void;
|
|
434
|
+
children?: ReactNode;
|
|
435
|
+
};
|
|
436
|
+
type TStatusbarProps = {
|
|
437
|
+
left: string | Segment[];
|
|
438
|
+
right: string | Segment[];
|
|
439
|
+
bg?: string;
|
|
440
|
+
color?: string;
|
|
441
|
+
};
|
|
442
|
+
type TMarkdownProps = {
|
|
443
|
+
value: string;
|
|
444
|
+
themeOverrides?: MarkdownThemeOverrides;
|
|
445
|
+
};
|
|
446
|
+
type TJsonProps = {
|
|
447
|
+
value: unknown;
|
|
448
|
+
title?: string;
|
|
449
|
+
};
|
|
450
|
+
type THtmlProps = {
|
|
451
|
+
value: string;
|
|
452
|
+
themeOverrides?: MarkdownThemeOverrides;
|
|
453
|
+
};
|
|
454
|
+
type TLineProps = {
|
|
455
|
+
children?: ReactNode;
|
|
456
|
+
};
|
|
457
|
+
type TSpanProps = {
|
|
458
|
+
text?: string;
|
|
459
|
+
children?: ReactNode;
|
|
460
|
+
color?: string;
|
|
461
|
+
bg?: string;
|
|
462
|
+
bold?: boolean;
|
|
463
|
+
dim?: boolean;
|
|
464
|
+
inverted?: boolean;
|
|
465
|
+
blink?: boolean;
|
|
466
|
+
};
|
|
467
|
+
type TLayoutProps = {
|
|
468
|
+
layout: LayoutFn;
|
|
469
|
+
};
|
|
470
|
+
type TTreeProps = {
|
|
471
|
+
data: TreeNode[];
|
|
472
|
+
color?: string;
|
|
473
|
+
branchColor?: string;
|
|
474
|
+
leafColor?: string;
|
|
475
|
+
};
|
|
476
|
+
type TCodeProps = {
|
|
477
|
+
code: string;
|
|
478
|
+
language?: string;
|
|
479
|
+
title?: string;
|
|
480
|
+
borderColor?: string;
|
|
481
|
+
};
|
|
482
|
+
type TDiffProps = {
|
|
483
|
+
value: string;
|
|
484
|
+
addColor?: string;
|
|
485
|
+
removeColor?: string;
|
|
486
|
+
metaColor?: string;
|
|
487
|
+
};
|
|
488
|
+
type TBarProps = {
|
|
489
|
+
label: string;
|
|
490
|
+
value: number;
|
|
491
|
+
max?: number;
|
|
492
|
+
color?: string;
|
|
493
|
+
};
|
|
494
|
+
type TSparkProps = {
|
|
495
|
+
data: number[];
|
|
496
|
+
color?: string;
|
|
497
|
+
};
|
|
498
|
+
type TListProps = {
|
|
499
|
+
items: string[];
|
|
500
|
+
ordered?: boolean;
|
|
501
|
+
bulletColor?: string;
|
|
502
|
+
color?: string;
|
|
503
|
+
};
|
|
504
|
+
type TButtonProps = {
|
|
505
|
+
label: string;
|
|
506
|
+
onClick?: () => void;
|
|
507
|
+
color?: string;
|
|
508
|
+
bg?: string;
|
|
509
|
+
};
|
|
510
|
+
type RenderTermOptions = {
|
|
511
|
+
theme?: Theme;
|
|
512
|
+
themeSpec?: ThemeSpec;
|
|
513
|
+
mode?: ThemePreference;
|
|
514
|
+
markdownOverrides?: MarkdownThemeOverrides;
|
|
515
|
+
};
|
|
516
|
+
declare function TVStack({ children, gap }: TVStackProps): react.ReactElement<{
|
|
517
|
+
gap: number | undefined;
|
|
518
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
519
|
+
declare function THStack({ children, gap, widths }: THStackProps): react.ReactElement<{
|
|
520
|
+
gap: number | undefined;
|
|
521
|
+
widths: number[] | undefined;
|
|
522
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
523
|
+
declare function TBox({ children, title, borderColor, gap }: TBoxProps): react.ReactElement<{
|
|
524
|
+
title: string | undefined;
|
|
525
|
+
borderColor: string | undefined;
|
|
526
|
+
gap: number | undefined;
|
|
527
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
528
|
+
declare function TSeparator({ color }: TSeparatorProps): react.ReactElement<{
|
|
529
|
+
color: string | undefined;
|
|
530
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
531
|
+
declare function TBlank(): react.DOMElement<{}, Element>;
|
|
532
|
+
declare function TRaw({ children, text, color, bg, bold, dim, blink, inverted, onClick }: TRawProps): react.DOMElement<{
|
|
533
|
+
text: string | undefined;
|
|
534
|
+
color: string | undefined;
|
|
535
|
+
bg: string | undefined;
|
|
536
|
+
bold: boolean | undefined;
|
|
537
|
+
dim: boolean | undefined;
|
|
538
|
+
blink: boolean | undefined;
|
|
539
|
+
inverted: boolean | undefined;
|
|
540
|
+
onClick: (() => void) | undefined;
|
|
541
|
+
}, Element>;
|
|
542
|
+
declare function TTable<T extends Record<string, unknown>>({ columns, data, borderColor, fillWidth, headerColor, cellPadding, }: TTableProps<T>): react.ReactElement<{
|
|
543
|
+
columns: Column<T>[];
|
|
544
|
+
data: T[];
|
|
545
|
+
borderColor: string | undefined;
|
|
546
|
+
fillWidth: boolean | undefined;
|
|
547
|
+
headerColor: string | undefined;
|
|
548
|
+
cellPadding: number | undefined;
|
|
549
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
550
|
+
declare function TTab({ name, children }: TTabProps): react.ReactElement<{
|
|
551
|
+
name: string;
|
|
552
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
553
|
+
declare function TTabs({ children, active, activeColor, activeBg, inactiveColor, separatorColor, onSelect, }: TTabsProps): react.ReactElement<{
|
|
554
|
+
active: number;
|
|
555
|
+
activeColor: string | undefined;
|
|
556
|
+
activeBg: string | undefined;
|
|
557
|
+
inactiveColor: string | undefined;
|
|
558
|
+
separatorColor: string | undefined;
|
|
559
|
+
onSelect: ((index: number) => void) | undefined;
|
|
560
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
561
|
+
declare function TStatusbar({ left, right, bg, color }: TStatusbarProps): react.ReactElement<{
|
|
562
|
+
left: string | Segment[];
|
|
563
|
+
right: string | Segment[];
|
|
564
|
+
bg: string | undefined;
|
|
565
|
+
color: string | undefined;
|
|
566
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
567
|
+
declare function TMarkdown({ value, themeOverrides }: TMarkdownProps): react.ReactElement<{
|
|
568
|
+
value: string;
|
|
569
|
+
themeOverrides: Partial<ThemeMarkdown> | undefined;
|
|
570
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
571
|
+
declare function TJson({ value, title }: TJsonProps): react.ReactElement<{
|
|
572
|
+
value: unknown;
|
|
573
|
+
title: string | undefined;
|
|
574
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
575
|
+
declare function THtml({ value, themeOverrides }: THtmlProps): react.ReactElement<{
|
|
576
|
+
value: string;
|
|
577
|
+
themeOverrides: Partial<ThemeMarkdown> | undefined;
|
|
578
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
579
|
+
declare function TLine({ children }: TLineProps): react.DOMElement<{}, Element>;
|
|
580
|
+
declare function TSpan({ children, text, color, bg, bold, dim, inverted, blink }: TSpanProps): react.ReactElement<{
|
|
581
|
+
text: string | undefined;
|
|
582
|
+
color: string | undefined;
|
|
583
|
+
bg: string | undefined;
|
|
584
|
+
bold: boolean | undefined;
|
|
585
|
+
dim: boolean | undefined;
|
|
586
|
+
inverted: boolean | undefined;
|
|
587
|
+
blink: boolean | undefined;
|
|
588
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
589
|
+
declare function TLayout({ layout }: TLayoutProps): react.ReactElement<{
|
|
590
|
+
layout: LayoutFn;
|
|
591
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
592
|
+
declare function TTree({ data, color, branchColor, leafColor }: TTreeProps): react.ReactElement<{
|
|
593
|
+
data: TreeNode[];
|
|
594
|
+
color: string | undefined;
|
|
595
|
+
branchColor: string | undefined;
|
|
596
|
+
leafColor: string | undefined;
|
|
597
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
598
|
+
declare function TCode({ code, language, title, borderColor }: TCodeProps): react.ReactElement<{
|
|
599
|
+
code: string;
|
|
600
|
+
language: string | undefined;
|
|
601
|
+
title: string | undefined;
|
|
602
|
+
borderColor: string | undefined;
|
|
603
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
604
|
+
declare function TDiff({ value, addColor, removeColor, metaColor }: TDiffProps): react.ReactElement<{
|
|
605
|
+
value: string;
|
|
606
|
+
addColor: string | undefined;
|
|
607
|
+
removeColor: string | undefined;
|
|
608
|
+
metaColor: string | undefined;
|
|
609
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
610
|
+
declare function TBar({ label, value, max, color }: TBarProps): react.ReactElement<{
|
|
611
|
+
label: string;
|
|
612
|
+
value: number;
|
|
613
|
+
max: number | undefined;
|
|
614
|
+
color: string | undefined;
|
|
615
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
616
|
+
declare function TSpark({ data, color }: TSparkProps): react.ReactElement<{
|
|
617
|
+
data: number[];
|
|
618
|
+
color: string | undefined;
|
|
619
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
620
|
+
declare function TList({ items, ordered, bulletColor, color }: TListProps): react.ReactElement<{
|
|
621
|
+
items: string[];
|
|
622
|
+
ordered: boolean | undefined;
|
|
623
|
+
bulletColor: string | undefined;
|
|
624
|
+
color: string | undefined;
|
|
625
|
+
}, string | react.JSXElementConstructor<any>>;
|
|
626
|
+
declare function TButton({ label, onClick, color, bg }: TButtonProps): react.DOMElement<{
|
|
627
|
+
label: string;
|
|
628
|
+
onClick: (() => void) | undefined;
|
|
629
|
+
color: string | undefined;
|
|
630
|
+
bg: string | undefined;
|
|
631
|
+
}, Element>;
|
|
632
|
+
declare function renderTermReact(tree: ReactNode, opts?: RenderTermOptions): LayoutFn;
|
|
633
|
+
|
|
634
|
+
declare function useSpinner(ms?: number): string;
|
|
635
|
+
declare function useTick(ms?: number): number;
|
|
636
|
+
declare function useTermWidth(ref: RefObject<HTMLElement | null>, fallback?: number): number;
|
|
637
|
+
declare function useStreamingText(text: string, lerp?: number): string;
|
|
638
|
+
|
|
639
|
+
export { type Block, type Column, type DocumentSource, type JsonNode, type LayoutFn, type Line, type MarkdownThemeOverrides, type RenderTermOptions, type Segment, type Style, TBar, type TBarProps, TBlank, TBox, type TBoxProps, TButton, type TButtonProps, TCode, type TCodeProps, TDiff, type TDiffProps, THStack, type THStackProps, THtml, type THtmlProps, TJson, type TJsonProps, TLayout, type TLayoutProps, TLine, type TLineProps, TList, type TListProps, TMarkdown, type TMarkdownProps, TRaw, type TRawProps, TSeparator, type TSeparatorProps, TSpan, type TSpanProps, TSpark, type TSparkProps, TStatusbar, type TStatusbarProps, TTab, type TTabProps, TTable, type TTableProps, TTabs, type TTabsProps, TTree, type TTreeProps, TVStack, type TVStackProps, TermDocument, type TermDocumentProps, type TermThemeContextValue, TermThemeProvider, type TermThemeProviderProps, TermUI, type TermUIProps, type Theme, type ThemeComponents, type ThemeMarkdown, type ThemeMode, type ThemeModeTokens, type ThemePalette, type ThemePreference, type ThemeSemantic, type ThemeSpec, type ThemeSyntax, type ThemeValidationIssue, type ThemeValidationResult, type Token, type TokenType, type TreeNode, badge, bar, blank, box, builtinThemes, code, dark, defaultThemeSpec, diff, fromDocument, fromHtml, fromJson, fromJsonNode, fromMarkdown, hl, hstack, isTableLine, light, lines, list, pad, padLine, parseThemeSpec, preserveTableTag, renderTermReact, resolveTheme, resolveThemeMode, separator, spark, statusbar, table, tabs, themeToCssVars, tokenColor, tokenize, tree, useSpinner, useStreamingText, useTermTheme, useTermWidth, useTick, validateThemeSpec, vstack };
|