xonecas.io
70160
Ce

cel-tui / files

cel-tui / packages / core / src / index.ts

1.8 KB
1/**
2 * @module @cel-tui/core
3 *
4 * Core framework package. Provides the four primitives ({@link VStack},
5 * {@link HStack}, {@link Text}, {@link TextInput}), the framework
6 * entrypoint ({@link cel}), and measurement helpers such as
7 * {@link measureContentHeight}.
8 *
9 * All types are re-exported from `@cel-tui/types`.
10 *
11 * @example
12 * ```ts
13 * import { cel, VStack, HStack, Text, TextInput, ProcessTerminal } from "@cel-tui/core";
14 *
15 * let name = "";
16 *
17 * cel.init(new ProcessTerminal());
18 * cel.viewport(() =>
19 *   VStack({ height: "100%" }, [
20 *     Text("What is your name?", { bold: true }),
21 *     TextInput({
22 *       value: name,
23 *       onChange: (v) => { name = v; cel.render(); },
24 *     }),
25 *   ])
26 * );
27 * ```
28 */
29
30export type {
31  Color,
32  ContainerNode,
33  ContainerProps,
34  CursorStyle,
35  FocusChangeEvent,
36  FocusChangeHandler,
37  FocusChangeReason,
38  KeyEvent,
39  KeyEventType,
40  KeyModifiers,
41  KeyPressHandler,
42  KittyKeyboardOptions,
43  Node,
44  ScrollbarPartStyle,
45  ScrollbarStyle,
46  ScrollHandler,
47  SizeValue,
48  StateKey,
49  StyleProps,
50  TextInputBaseProps,
51  TextInputNode,
52  TextInputProps,
53  TextNode,
54  TextProps,
55  Theme,
56  ThemeValue,
57} from "@cel-tui/types";
58export { type Cel, type CelInitOptions, cel, type RenderFn } from "./cel.js";
59export { type Cell, CellBuffer, EMPTY_CELL } from "./cell-buffer.js";
60export {
61  defaultTheme,
62  type EmitOptions,
63  emitBuffer,
64  type TerminalCursorState,
65} from "./emitter.js";
66export { measureContentHeight } from "./layout.js";
67export { HStack, VStack } from "./primitives/stacks.js";
68export { Text } from "./primitives/text.js";
69export { TextInput } from "./primitives/text-input.js";
70export {
71  MockTerminal,
72  ProcessTerminal,
73  type Terminal,
74  type TerminalStartOptions,
75} from "./terminal.js";
76export { extractAnsiCode, visibleWidth } from "./width.js";