@termuijs/widgets 0.1.5 → 0.1.6

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/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _termuijs_core from '@termuijs/core';
2
2
  import { Style, Rect, EventEmitter, KeyEvent, MouseEvent, LayoutNode, Screen, Color } from '@termuijs/core';
3
+ import { SpringConfig, SpringPresetName } from '@termuijs/motion';
3
4
 
4
5
  /**
5
6
  * Event map for widgets.
@@ -12,9 +13,25 @@ interface WidgetEvents {
12
13
  mount: void;
13
14
  unmount: void;
14
15
  }
16
+ /** Reset the widget ID counter (for testing only). */
17
+ declare function _resetWidgetIdCounter(): void;
15
18
  /**
16
19
  * Base class for all TermUI widgets.
17
20
  *
21
+ * CONSTRUCTOR SIGNATURE CONVENTION:
22
+ * - Simple display widgets: (content?, style?: Partial<Style>, opts?: SpecificOptions)
23
+ * - Data widgets: (data, style?: Partial<Style>, opts?: SpecificOptions)
24
+ * - Compound UI widgets: (options: SpecificOptions, style?: Partial<Style>)
25
+ *
26
+ * FOCUSABLE PATTERN:
27
+ * Set `focusable = true` as a class field initializer, OR in the constructor
28
+ * body after calling `super()`. Do NOT set it inside `_renderSelf()`.
29
+ *
30
+ * STYLE MERGE PATTERN:
31
+ * All widgets should call `super(mergeStyles(defaultStyle(), { ...defaults }, style))`
32
+ * to produce consistent base styles. For widgets that accept `style` as the
33
+ * second parameter, pass it directly through to `super()`.
34
+ *
18
35
  * Provides:
19
36
  * - Unique ID generation
20
37
  * - Style management and merging
@@ -37,6 +54,8 @@ declare abstract class Widget {
37
54
  protected _rect: Rect;
38
55
  /** Reference to the layout node (set during getLayoutNode) */
39
56
  private _layoutNode;
57
+ /** Error from last render call, null if no error */
58
+ protected _renderError: Error | null;
40
59
  /** Whether this widget can receive focus */
41
60
  focusable: boolean;
42
61
  /** Tab index for focus ordering */
@@ -50,7 +69,13 @@ declare abstract class Widget {
50
69
  * Newly created widgets start dirty.
51
70
  */
52
71
  protected _dirty: boolean;
72
+ /** Enable animated layout transitions for size/position changes */
73
+ layoutTransition: Partial<SpringConfig> | SpringPresetName | boolean;
74
+ private _layoutCancel;
75
+ private _targetRect;
53
76
  constructor(style?: Partial<Style>);
77
+ /** Check if this widget is currently active (focused) */
78
+ isActive(): boolean;
54
79
  /** Get the current style */
55
80
  get style(): Style;
56
81
  /** Update the style (merge with existing) */
@@ -63,6 +88,12 @@ declare abstract class Widget {
63
88
  removeChild(child: Widget): void;
64
89
  /** Remove all children */
65
90
  clearChildren(): void;
91
+ /**
92
+ * Destroy this widget and all its descendants.
93
+ * Cleans up event handlers, removes parent references, and clears children.
94
+ * Fiber-level cleanup is handled by the reconciler's _pruneInstancesForWidget.
95
+ */
96
+ destroy(): void;
66
97
  /** Get all children */
67
98
  get children(): ReadonlyArray<Widget>;
68
99
  /**
@@ -90,6 +121,7 @@ declare abstract class Widget {
90
121
  * Update the computed rect from layout results.
91
122
  */
92
123
  updateRect(rect: Rect): void;
124
+ private _applyRect;
93
125
  /**
94
126
  * Mark this widget as needing re-render.
95
127
  * Propagates up to parent so the render loop can detect changes.
@@ -97,10 +129,13 @@ declare abstract class Widget {
97
129
  markDirty(): void;
98
130
  /**
99
131
  * Clear the dirty flag after rendering.
132
+ * Widgets with a render error stay dirty so they are retried on the next frame.
100
133
  */
101
134
  clearDirty(): void;
102
135
  /** Check if this widget (or any child) needs re-rendering */
103
136
  get isDirty(): boolean;
137
+ /** Get the last render error, if any */
138
+ get renderError(): Error | null;
104
139
  /**
105
140
  * Render the border around this widget, including focus ring if focused.
106
141
  */
@@ -130,6 +165,8 @@ declare abstract class Widget {
130
165
  */
131
166
  declare class Box extends Widget {
132
167
  constructor(style?: Partial<Style>);
168
+ /** Check if this Box has no children */
169
+ isEmpty(): boolean;
133
170
  protected _renderSelf(screen: Screen): void;
134
171
  }
135
172
 
@@ -156,6 +193,7 @@ declare class Text extends Widget {
156
193
  setContent(content: string): void;
157
194
  /** Get current text content */
158
195
  getContent(): string;
196
+ toString(): string;
159
197
  /** Set vertical scroll offset (lines to skip). */
160
198
  setScrollY(offset: number): void;
161
199
  /** Set horizontal scroll offset (columns to skip). */
@@ -170,6 +208,8 @@ interface LogViewOptions {
170
208
  highlight?: Record<string, Color>;
171
209
  /** Auto-scroll to bottom */
172
210
  autoScroll?: boolean;
211
+ /** Maximum lines to retain (0 = unlimited) */
212
+ maxLines?: number;
173
213
  }
174
214
  /**
175
215
  * LogView — scrollable, highlighted log output.
@@ -181,6 +221,7 @@ declare class LogView extends Widget {
181
221
  private _scrollOffset;
182
222
  private _highlight;
183
223
  private _autoScroll;
224
+ private _maxLines;
184
225
  constructor(style?: Partial<Style>, opts?: LogViewOptions);
185
226
  setLines(lines: string[]): void;
186
227
  appendLine(line: string): void;
@@ -191,19 +232,31 @@ declare class LogView extends Widget {
191
232
  private _getLineColor;
192
233
  }
193
234
 
194
- interface TreeNode {
235
+ type ProgressBarStyle = 'blocks' | 'line' | 'dots';
236
+ interface ProgressStringProps {
237
+ value: number;
238
+ width?: number;
239
+ style?: ProgressBarStyle;
240
+ color?: string;
241
+ showPercent?: boolean;
242
+ }
243
+ declare const ProgressString: {
244
+ render({ value, width, style, color, showPercent }: ProgressStringProps): string;
245
+ };
246
+
247
+ interface TreeNode$1 {
195
248
  label: string;
196
- children?: TreeNode[];
249
+ children?: TreeNode$1[];
197
250
  expanded?: boolean;
198
251
  data?: unknown;
199
252
  }
200
253
  interface TreeOptions {
201
- nodes: TreeNode[];
202
- onSelect?: (node: TreeNode, path: number[]) => void;
254
+ nodes: TreeNode$1[];
255
+ onSelect?: (node: TreeNode$1, path: number[]) => void;
203
256
  indent?: number;
204
257
  }
205
- interface VisibleEntry {
206
- node: TreeNode;
258
+ interface VisibleEntry$1 {
259
+ node: TreeNode$1;
207
260
  depth: number;
208
261
  path: number[];
209
262
  }
@@ -212,7 +265,7 @@ interface VisibleEntry {
212
265
  *
213
266
  * Supports:
214
267
  * - Expand/collapse of parent nodes
215
- * - Keyboard navigation (ArrowUp/Down/Left/Right, j/k/h/l, Home/End)
268
+ * - Keyboard navigation (up/down/left/right, j/k/h/l, home/end)
216
269
  * - Enter/Space to toggle or select
217
270
  * - onSelect callback for leaf nodes
218
271
  * - Unicode and ASCII fallback symbols
@@ -224,11 +277,11 @@ declare class Tree extends Widget {
224
277
  protected _indent: number;
225
278
  protected _selectedIndex: number;
226
279
  protected _scrollOffset: number;
227
- protected _visibleNodes: VisibleEntry[];
280
+ protected _visibleNodes: VisibleEntry$1[];
228
281
  constructor(options: TreeOptions, style?: Partial<Style>);
229
282
  get selectedIndex(): number;
230
- get selectedNode(): TreeNode | undefined;
231
- setNodes(nodes: TreeNode[]): void;
283
+ get selectedNode(): TreeNode$1 | undefined;
284
+ setNodes(nodes: TreeNode$1[]): void;
232
285
  /** Move cursor up one visible row */
233
286
  movePrev(): void;
234
287
  /** Move cursor down one visible row */
@@ -267,7 +320,7 @@ interface JSONViewOptions {
267
320
  /** The JSON value to display */
268
321
  data: unknown;
269
322
  /** Callback when a leaf node is selected */
270
- onSelect?: (node: TreeNode, path: number[]) => void;
323
+ onSelect?: (node: TreeNode$1, path: number[]) => void;
271
324
  /** Spaces per indent level (default: 2) */
272
325
  indent?: number;
273
326
  }
@@ -275,7 +328,7 @@ interface JSONViewOptions {
275
328
  * Convert any JSON-compatible value to a TreeNode, optionally prefixed
276
329
  * by `key` (the property name or array index in the parent container).
277
330
  */
278
- declare function jsonToTree(value: unknown, key?: string): TreeNode;
331
+ declare function jsonToTree(value: unknown, key?: string): TreeNode$1;
279
332
  /**
280
333
  * JSONView — a syntax-colored, collapsible JSON viewer.
281
334
  *
@@ -456,6 +509,86 @@ declare class ToolApproval extends ToolCall {
456
509
  handleKey(key: string): void;
457
510
  }
458
511
 
512
+ /**
513
+ * A raw Canvas widget providing a HTML5-like 2D drawing context for custom rendering.
514
+ * Mapped to Braille characters for 2x4 sub-cell pixel resolution.
515
+ */
516
+ declare class Canvas extends Widget {
517
+ private _pixels;
518
+ private _canvasWidth;
519
+ private _canvasHeight;
520
+ private _color;
521
+ constructor(style?: Partial<Style>);
522
+ /**
523
+ * Sets the active drawing color. If not set, the foreground color from style is used.
524
+ */
525
+ setColor(color: Color): void;
526
+ /**
527
+ * Clears the entire canvas.
528
+ */
529
+ clear(): void;
530
+ /**
531
+ * Sets a single sub-cell pixel.
532
+ */
533
+ setPixel(x: number, y: number, value?: boolean): void;
534
+ /**
535
+ * Fills a rectangle with the current drawing state.
536
+ */
537
+ fillRect(x: number, y: number, w: number, h: number): void;
538
+ /**
539
+ * Draws an unfilled circle.
540
+ */
541
+ drawCircle(cx: number, cy: number, r: number): void;
542
+ /**
543
+ * Draws a line from (x0, y0) to (x1, y1).
544
+ */
545
+ lineTo(x0: number, y0: number, x1: number, y1: number): void;
546
+ protected _renderSelf(screen: Screen): void;
547
+ }
548
+
549
+ interface RatingOptions {
550
+ value?: number;
551
+ max?: number;
552
+ showLabel?: boolean;
553
+ }
554
+ /**
555
+ * Rating - displays a star rating with optional textual feedback.
556
+ */
557
+ declare class Rating extends Widget {
558
+ private _value;
559
+ private _max;
560
+ private _showLabel;
561
+ constructor(style?: Partial<Style>, opts?: RatingOptions);
562
+ getValue(): number;
563
+ getMax(): number;
564
+ setValue(value: number): void;
565
+ protected _renderSelf(screen: Screen): void;
566
+ }
567
+
568
+ interface PtyOptions {
569
+ /** The command to spawn */
570
+ command?: string;
571
+ /** Arguments to the command */
572
+ args?: string[];
573
+ }
574
+ /**
575
+ * Pty — Terminal Multiplexer widget.
576
+ * Spawns a child process and renders its output inside the TermUI screen.
577
+ */
578
+ declare class Pty extends Widget {
579
+ private _process;
580
+ private _lines;
581
+ private _autoScroll;
582
+ constructor(style?: Partial<Style>, opts?: PtyOptions);
583
+ private _handleOutput;
584
+ handleKey(event: KeyEvent): boolean;
585
+ protected _renderSelf(screen: Screen): void;
586
+ /**
587
+ * Terminate the spawned process
588
+ */
589
+ destroy(): void;
590
+ }
591
+
459
592
  interface ScrollRange {
460
593
  start: number;
461
594
  end: number;
@@ -478,11 +611,46 @@ declare function computeRange(scrollOffset: number, viewportItems: number, itemC
478
611
  */
479
612
  declare function computeVariableRange(scrollPx: number, viewportPx: number, sizes: number[], overscan?: number): ScrollRange;
480
613
 
481
- interface ListItem {
614
+ /**
615
+ * External state object for List widget.
616
+ * It owns the items, selected index and scroll offset.
617
+ * The hook returns the same mutable object that can be passed to <List state={s} />.
618
+ */
619
+ interface ListState {
620
+ /** The items displayed by the list */
621
+ items: ListItem$1[];
622
+ /** Index of the currently selected item */
623
+ selectedIndex: number;
624
+ /** Scroll offset (first visible item index) */
625
+ scrollOffset: number;
626
+ /** Update items */
627
+ setItems(items: ListItem$1[]): void;
628
+ /** Move selection up */
629
+ selectPrev(): void;
630
+ /** Move selection down */
631
+ selectNext(): void;
632
+ /** Confirm current selection (optional hook) */
633
+ confirm(): void;
634
+ }
635
+ /** Hook that creates a fresh ListState. */
636
+ declare function useListState(initial: {
637
+ items: ListItem$1[];
638
+ }): ListState;
639
+
640
+ interface ListItem$1 {
482
641
  label: string;
483
642
  value: string;
484
643
  disabled?: boolean;
485
644
  }
645
+ interface ListProps {
646
+ items?: ListItem$1[];
647
+ style?: Partial<Style>;
648
+ onSelect?: (item: ListItem$1, index: number) => void;
649
+ /** External state object – if provided, List reads/writes selection through it */
650
+ state?: ListState;
651
+ /** Called whenever selection or scroll changes */
652
+ onStateChange?: (state: ListState) => void;
653
+ }
486
654
  /**
487
655
  * List — a scrollable, selectable list of items.
488
656
  *
@@ -491,74 +659,30 @@ interface ListItem {
491
659
  * - Scrolling when items exceed visible height
492
660
  * - Custom item styling
493
661
  * - Disabled items
662
+ * - External state via `state` prop and `useListState` hook
494
663
  */
495
664
  declare class List extends Widget {
496
665
  private _items;
497
666
  private _selectedIndex;
498
667
  private _scrollOffset;
499
668
  private _onSelect?;
500
- constructor(items: ListItem[], style?: Partial<Style>, onSelect?: (item: ListItem, index: number) => void);
669
+ private _state?;
670
+ private _onStateChange?;
671
+ constructor(itemsOrProps: ListItem$1[] | ListProps, style?: Partial<Style>, onSelect?: (item: ListItem$1, index: number) => void);
501
672
  get selectedIndex(): number;
502
- get selectedItem(): ListItem | undefined;
503
- setItems(items: ListItem[]): void;
673
+ get selectedItem(): ListItem$1 | undefined;
674
+ setItems(items: ListItem$1[]): void;
504
675
  /** Move selection up */
505
676
  selectPrev(): void;
506
677
  /** Move selection down */
507
678
  selectNext(): void;
508
679
  /** Confirm the current selection */
509
680
  confirm(): void;
681
+ private _pushState;
510
682
  protected _renderSelf(screen: Screen): void;
511
683
  private _clampScroll;
512
684
  }
513
685
 
514
- /**
515
- * TextInput — a single-line text input field.
516
- *
517
- * Supports:
518
- * - Cursor movement (left/right/Home/End)
519
- * - Character insertion and deletion
520
- * - Placeholder text
521
- * - Password masking
522
- * - Max length constraint
523
- */
524
- declare class TextInput extends Widget {
525
- private _value;
526
- private _cursorPos;
527
- private _placeholder;
528
- private _mask;
529
- private _maxLength;
530
- private _onChange?;
531
- private _onSubmit?;
532
- constructor(style?: Partial<Style>, options?: {
533
- placeholder?: string;
534
- mask?: string;
535
- maxLength?: number;
536
- onChange?: (value: string) => void;
537
- onSubmit?: (value: string) => void;
538
- });
539
- get value(): string;
540
- set value(v: string);
541
- /**
542
- * Handle a typed character.
543
- */
544
- insertChar(char: string): void;
545
- /**
546
- * Delete the character before the cursor.
547
- */
548
- deleteBack(): void;
549
- /**
550
- * Delete the character after the cursor.
551
- */
552
- deleteForward(): void;
553
- moveCursorLeft(): void;
554
- moveCursorRight(): void;
555
- moveCursorHome(): void;
556
- moveCursorEnd(): void;
557
- submit(): void;
558
- clear(): void;
559
- protected _renderSelf(screen: Screen): void;
560
- }
561
-
562
686
  interface VirtualListOptions {
563
687
  /** Total number of items (the full dataset size) */
564
688
  totalItems: number;
@@ -668,6 +792,8 @@ declare class CommandPalette extends Widget {
668
792
  open(): void;
669
793
  /** Current query string. */
670
794
  getQuery(): string;
795
+ /** Compute a fuzzy-match score for a single text against a query. */
796
+ private _fuzzyScore;
671
797
  /** Filter commands based on current query (case-insensitive substring). */
672
798
  private _filter;
673
799
  private _executeSelected;
@@ -677,747 +803,2753 @@ declare class CommandPalette extends Widget {
677
803
  protected _renderSelf(screen: Screen): void;
678
804
  }
679
805
 
680
- interface TableColumn {
681
- /** Column header label */
682
- header: string;
683
- /** Key to pull data from row objects */
684
- key: string;
685
- /** Fixed width (chars). If omitted, auto-distributes. */
686
- width?: number;
687
- /** Text alignment within the column */
688
- align?: 'left' | 'center' | 'right';
689
- }
690
- type TableRow = Record<string, string | number>;
691
- interface TableOptions {
692
- /** Whether to show the header row */
693
- showHeader?: boolean;
694
- /** Color for the header row */
695
- headerColor?: Color;
696
- /** Whether rows are zebra-striped */
697
- stripe?: boolean;
698
- /** Stripe color */
699
- stripeColor?: Color;
700
- /** Column separator character */
701
- separator?: string;
806
+ type ButtonVariant = 'default' | 'primary' | 'danger' | 'ghost';
807
+ interface ButtonOptions {
808
+ variant?: ButtonVariant;
809
+ disabled?: boolean;
810
+ onPress?: () => void;
811
+ color?: Color;
702
812
  }
703
813
  /**
704
- * Tablerenders tabular data with columns, headers, and optional zebra-striping.
814
+ * Buttona pressable button with a label and visual variants.
705
815
  *
706
- * Supports:
707
- * - Auto-width column distribution
708
- * - Fixed and percentage widths
709
- * - Header styling
710
- * - Zebra striping
711
- * - Text alignment per column
712
- * - Truncation for overflow
816
+ * Renders a button with different visual styles based on variant.
817
+ * Handles key events for activation when not disabled.
713
818
  */
714
- declare class Table extends Widget {
715
- private _columns;
716
- private _rows;
717
- private _showHeader;
718
- private _headerColor;
719
- private _stripe;
720
- private _stripeColor;
721
- private _separator;
722
- constructor(columns: TableColumn[], rows: TableRow[], style?: Partial<Style>, options?: TableOptions);
723
- setRows(rows: TableRow[]): void;
819
+ declare class Button extends Widget {
820
+ private _label;
821
+ private _variant;
822
+ private _disabled;
823
+ private _onPress?;
824
+ private _color?;
825
+ constructor(label: string, style?: Partial<Style>, opts?: ButtonOptions);
826
+ setLabel(label: string): void;
827
+ setDisabled(disabled: boolean): void;
828
+ handleKey(event: KeyEvent): void;
724
829
  protected _renderSelf(screen: Screen): void;
725
- private _computeColumnWidths;
726
- private _alignText;
727
830
  }
728
831
 
729
- interface GaugeOptions {
730
- /** Color of the filled portion */
832
+ interface SliderOptions {
833
+ min?: number;
834
+ max?: number;
835
+ step?: number;
731
836
  color?: Color;
732
- /** Show percentage label */
733
- showLabel?: boolean;
837
+ showValue?: boolean;
734
838
  }
735
- /**
736
- * Gauge — a self-contained metric display with label, bar, and value.
737
- *
738
- * Example:
739
- * CPU ████████░░░░ 65%
740
- */
741
- declare class Gauge extends Widget {
839
+ declare class Slider extends Widget {
742
840
  private _label;
743
841
  private _value;
842
+ private _min;
843
+ private _max;
844
+ private _step;
744
845
  private _color;
745
- private _showLabel;
746
- constructor(label: string, style?: Partial<Style>, opts?: GaugeOptions);
747
- setValue(value: number): void;
846
+ private _showValue;
847
+ constructor(label: string, style?: Partial<Style>, opts?: SliderOptions);
748
848
  getValue(): number;
849
+ setValue(value: number): void;
749
850
  setLabel(label: string): void;
851
+ handleKey(event: KeyEvent): void;
750
852
  protected _renderSelf(screen: Screen): void;
751
853
  }
752
854
 
753
- interface SparklineOptions {
754
- /** Color of the sparkline */
855
+ interface RangeInputOptions {
856
+ min?: number;
857
+ max?: number;
858
+ step?: number;
755
859
  color?: Color;
756
- /** Show min/max labels */
757
- showRange?: boolean;
860
+ showValue?: boolean;
861
+ onChange?: (low: number, high: number) => void;
758
862
  }
759
- /**
760
- * Sparkline — a compact inline chart showing a data trend.
761
- *
762
- * Example:
763
- * Latency ▂▃▅▇▅▃▂▁▃▅█▅▃
764
- */
765
- declare class Sparkline extends Widget {
863
+ declare class RangeInput extends Widget {
766
864
  private _label;
767
- private _data;
865
+ private _min;
866
+ private _max;
867
+ private _step;
768
868
  private _color;
769
- private _showRange;
770
- constructor(label: string, style?: Partial<Style>, opts?: SparklineOptions);
771
- setData(data: number[]): void;
772
- pushValue(value: number): void;
869
+ private _showValue;
870
+ private _activeHandle;
871
+ private _low;
872
+ private _high;
873
+ private _onChange?;
874
+ constructor(label: string, style?: Partial<Style>, opts?: RangeInputOptions);
875
+ getLow(): number;
876
+ getHigh(): number;
877
+ setLow(value: number): void;
878
+ setHigh(value: number): void;
879
+ setRange(low: number, high: number): void;
880
+ handleKey(event: KeyEvent): void;
773
881
  protected _renderSelf(screen: Screen): void;
774
882
  }
775
883
 
776
- interface StatusIndicatorOptions {
777
- /** Color when up/active */
778
- upColor?: Color;
779
- /** Color when down/inactive */
780
- downColor?: Color;
781
- }
782
884
  /**
783
- * StatusIndicatorsimple up/down indicator with label.
885
+ * TextInputa single-line text input field.
784
886
  *
785
- * Example:
786
- * API Server Online
787
- * Worker Offline
887
+ * Supports:
888
+ * - Cursor movement (left/right/Home/End)
889
+ * - Character insertion and deletion
890
+ * - Placeholder text
891
+ * - Password masking
892
+ * - Max length constraint
788
893
  */
789
- declare class StatusIndicator extends Widget {
790
- private _label;
791
- private _isUp;
792
- private _upColor;
793
- private _downColor;
794
- constructor(label: string, isUp: boolean, style?: Partial<Style>, opts?: StatusIndicatorOptions);
795
- setStatus(isUp: boolean): void;
796
- getStatus(): boolean;
797
- setLabel(label: string): void;
798
- protected _renderSelf(screen: Screen): void;
799
- }
800
-
801
- interface Bar {
802
- value: number;
803
- label?: string;
804
- color?: Color;
805
- }
806
- interface BarGroup {
807
- label?: string;
808
- bars: Bar[];
809
- }
810
- type BarChartDirection = 'vertical' | 'horizontal';
811
- interface BarChartOptions {
812
- /** Direction bars grow. Default: 'vertical'. */
813
- direction?: BarChartDirection;
814
- /** Width of each bar in cells. Default: 1. */
815
- barWidth?: number;
816
- /** Gap between bars in a group. Default: 1. */
817
- barGap?: number;
818
- /** Gap between groups. Default: 2. */
819
- groupGap?: number;
820
- /** Max value for scaling. Auto-detected if not set. */
821
- max?: number;
822
- /** Color for bars without a per-bar color. */
823
- barColor?: Color;
824
- /** Color for value labels. */
825
- valueColor?: Color;
826
- /** Color for text labels. */
827
- labelColor?: Color;
828
- }
829
- declare class BarChart extends Widget {
830
- private _data;
894
+ declare class TextInput extends Widget {
895
+ private _value;
896
+ private _cursorPos;
897
+ private _placeholder;
898
+ private _mask;
899
+ private _maxLength;
900
+ private _onChange?;
901
+ private _onSubmit?;
902
+ constructor(style?: Partial<Style>, options?: {
903
+ placeholder?: string;
904
+ mask?: string;
905
+ maxLength?: number;
906
+ onChange?: (value: string) => void;
907
+ onSubmit?: (value: string) => void;
908
+ });
909
+ get value(): string;
910
+ set value(v: string);
911
+ /**
912
+ * Handle keyboard events when the widget is focused.
913
+ */
914
+ handleKey(event: KeyEvent): void;
915
+ /**
916
+ * Handle a typed character.
917
+ */
918
+ insertChar(char: string): void;
919
+ /**
920
+ * Delete the character before the cursor.
921
+ */
922
+ deleteBack(): void;
923
+ /**
924
+ * Delete the character after the cursor.
925
+ */
926
+ deleteForward(): void;
927
+ moveCursorLeft(): void;
928
+ moveCursorRight(): void;
929
+ moveCursorHome(): void;
930
+ moveCursorEnd(): void;
931
+ submit(): void;
932
+ clear(): void;
933
+ protected _renderSelf(screen: Screen): void;
934
+ }
935
+
936
+ interface KnobOptions {
937
+ min?: number;
938
+ max?: number;
939
+ step?: number;
940
+ color?: Color;
941
+ showValue?: boolean;
942
+ onChange?: (value: number) => void;
943
+ }
944
+ declare class Knob extends Widget {
945
+ private _label;
946
+ private _value;
947
+ private _min;
948
+ private _max;
949
+ private _step;
950
+ private _color;
951
+ private _showValue;
952
+ private _onChange?;
953
+ constructor(label?: string, style?: Partial<Style>, opts?: KnobOptions);
954
+ get value(): number;
955
+ setValue(value: number): void;
956
+ handleKey(event: KeyEvent): void;
957
+ protected _renderSelf(screen: Screen): void;
958
+ }
959
+
960
+ interface PinInputOptions {
961
+ length?: number;
962
+ masked?: boolean;
963
+ onChange?: (value: string) => void;
964
+ onComplete?: (value: string) => void;
965
+ }
966
+ declare class PinInput extends Widget {
967
+ private _length;
968
+ private _masked;
969
+ private _value;
970
+ private _cursorPos;
971
+ private _onChange?;
972
+ private _onComplete?;
973
+ /**
974
+ * Creates a new PinInput widget.
975
+ *
976
+ * @param style Partial style properties for the widget.
977
+ * @param opts Configuration options for the PinInput.
978
+ */
979
+ constructor(style?: Partial<Style>, opts?: PinInputOptions);
980
+ get value(): string;
981
+ private get _isFull();
982
+ handleKey(event: KeyEvent): void;
983
+ protected _renderSelf(screen: Screen): void;
984
+ }
985
+
986
+ interface ContextMenuItem {
987
+ label: string;
988
+ value: string;
989
+ disabled?: boolean;
990
+ }
991
+ /**
992
+ * ContextMenu — a floating menu widget positioned at absolute coordinates.
993
+ *
994
+ * Supports:
995
+ * - Keyboard navigation (up/down arrows)
996
+ * - Selection confirmation (Enter)
997
+ * - Menu dismissal (Escape)
998
+ * - Callback on item selection
999
+ * - Disabled items
1000
+ * - Safe ASCII fallback for unicode icons
1001
+ */
1002
+ declare class ContextMenu extends Widget {
1003
+ private _items;
1004
+ private _selectedIndex;
1005
+ private _x;
1006
+ private _y;
1007
+ private _onItemSelect?;
1008
+ private _onClose?;
1009
+ constructor(items: ContextMenuItem[], x: number, y: number, style?: Partial<Style>, callbacks?: {
1010
+ onItemSelect?: (item: ContextMenuItem, index: number) => void;
1011
+ onClose?: () => void;
1012
+ });
1013
+ /**
1014
+ * Update the internal rect based on position and items count.
1015
+ * ContextMenu is typically 1-2 characters wider than the longest item label,
1016
+ * and height matches the number of items.
1017
+ */
1018
+ private _updateRect;
1019
+ get selectedIndex(): number;
1020
+ get selectedItem(): ContextMenuItem | undefined;
1021
+ /**
1022
+ * Move selection up
1023
+ */
1024
+ selectPrev(): void;
1025
+ /**
1026
+ * Move selection down
1027
+ */
1028
+ selectNext(): void;
1029
+ /**
1030
+ * Confirm the current selection
1031
+ */
1032
+ confirm(): void;
1033
+ /**
1034
+ * Close the context menu
1035
+ */
1036
+ close(): void;
1037
+ /**
1038
+ * Move the context menu to a new position
1039
+ */
1040
+ moveTo(x: number, y: number): void;
1041
+ protected _renderSelf(screen: Screen): void;
1042
+ }
1043
+
1044
+ /** External state object for Table widget. */
1045
+ interface TableState {
1046
+ /** Rows displayed by the table */
1047
+ rows: TableRow[];
1048
+ /** Scroll offset (first visible row index) */
1049
+ scrollOffset: number;
1050
+ /** Update rows */
1051
+ setRows(rows: TableRow[]): void;
1052
+ /** Scroll up */
1053
+ scrollPrev(): void;
1054
+ /** Scroll down */
1055
+ scrollNext(): void;
1056
+ }
1057
+ /** Hook that creates a fresh TableState. */
1058
+ declare function useTableState(initial: {
1059
+ rows: TableRow[];
1060
+ }): TableState;
1061
+
1062
+ interface TableColumn {
1063
+ /** Column header label */
1064
+ header: string;
1065
+ /** Key to pull data from row objects */
1066
+ key: string;
1067
+ /** Fixed width (chars). If omitted, auto-distributes. */
1068
+ width?: number;
1069
+ /** Text alignment within the column */
1070
+ align?: 'left' | 'center' | 'right';
1071
+ }
1072
+ type TableRow = Record<string, string | number>;
1073
+ interface TableOptions {
1074
+ /** Whether to show the header row */
1075
+ showHeader?: boolean;
1076
+ /** Color for the header row */
1077
+ headerColor?: Color;
1078
+ /** Whether rows are zebra-striped */
1079
+ stripe?: boolean;
1080
+ /** Stripe color */
1081
+ stripeColor?: Color;
1082
+ /** Column separator character */
1083
+ separator?: string;
1084
+ }
1085
+ interface TableProps {
1086
+ columns: TableColumn[];
1087
+ rows?: TableRow[];
1088
+ style?: Partial<Style>;
1089
+ options?: TableOptions;
1090
+ /** External state object – if provided, Table syncs rows through it */
1091
+ state?: TableState;
1092
+ /** Called whenever rows change via setRows */
1093
+ onStateChange?: (state: TableState) => void;
1094
+ }
1095
+ /**
1096
+ * Table — renders tabular data with columns, headers, and optional zebra-striping.
1097
+ *
1098
+ * Supports:
1099
+ * - Auto-width column distribution
1100
+ * - Fixed and percentage widths
1101
+ * - Header styling
1102
+ * - Zebra striping
1103
+ * - Text alignment per column
1104
+ * - Truncation for overflow
1105
+ * - External state via `state` prop and `useTableState` hook
1106
+ */
1107
+ declare class Table extends Widget {
1108
+ protected _columns: TableColumn[];
1109
+ protected _rows: TableRow[];
1110
+ protected _showHeader: boolean;
1111
+ protected _headerColor: Color;
1112
+ protected _stripe: boolean;
1113
+ protected _stripeColor: Color;
1114
+ protected _separator: string;
1115
+ private _state?;
1116
+ private _onStateChange?;
1117
+ private _selectedRow;
1118
+ private _sortColumn;
1119
+ constructor(columnsOrProps: TableColumn[] | TableProps, rows?: TableRow[], style?: Partial<Style>, options?: TableOptions);
1120
+ setRows(rows: TableRow[]): void;
1121
+ sortByColumn(columnKey: string): void;
1122
+ private _pushState;
1123
+ handleKey(event: KeyEvent): void;
1124
+ protected _renderSelf(screen: Screen): void;
1125
+ protected _computeColumnWidths(totalWidth: number): number[];
1126
+ protected _alignText(text: string, width: number, align: 'left' | 'center' | 'right'): string;
1127
+ }
1128
+
1129
+ interface TreeTableColumn {
1130
+ /** Column header label */
1131
+ header: string;
1132
+ /** Key to pull data from row objects */
1133
+ key: string;
1134
+ /** Fixed width (chars). If omitted, auto-distributes. */
1135
+ width?: number;
1136
+ /** Text alignment within the column */
1137
+ align?: 'left' | 'center' | 'right';
1138
+ }
1139
+ interface TreeTableRow {
1140
+ children?: TreeTableRow[];
1141
+ expanded?: boolean;
1142
+ [key: string]: unknown;
1143
+ }
1144
+ interface TreeTableOptions {
1145
+ /** Whether to show the header row */
1146
+ showHeader?: boolean;
1147
+ /** Color for the header row */
1148
+ headerColor?: Color;
1149
+ /** Whether rows are zebra-striped */
1150
+ stripe?: boolean;
1151
+ /** Stripe color */
1152
+ stripeColor?: Color;
1153
+ /** Column separator character */
1154
+ separator?: string;
1155
+ /** Indentation per depth (default 2) */
1156
+ indent?: number;
1157
+ /** Callback when a row is selected */
1158
+ onSelect?: (row: TreeTableRow) => void;
1159
+ }
1160
+ interface VisibleEntry {
1161
+ row: TreeTableRow;
1162
+ depth: number;
1163
+ }
1164
+ /**
1165
+ * TreeTable — combines Tree expand/collapse with Table columns.
1166
+ *
1167
+ * Supports:
1168
+ * - Nested rows with column alignment
1169
+ * - Expand/collapse with arrows or Enter
1170
+ * - Keyboard navigation
1171
+ * - Unicode and ASCII symbols
1172
+ * - Zebra striping
1173
+ * - Header styling
1174
+ */
1175
+ declare class TreeTable extends Widget {
1176
+ private _columns;
1177
+ private _rows;
1178
+ private _showHeader;
1179
+ private _headerColor;
1180
+ private _stripe;
1181
+ private _stripeColor;
1182
+ private _separator;
1183
+ private _indent;
1184
+ private _onSelect?;
1185
+ protected _selectedIndex: number;
1186
+ protected _scrollOffset: number;
1187
+ protected _visibleRows: VisibleEntry[];
1188
+ constructor(columns: TreeTableColumn[], rows: TreeTableRow[], style?: Partial<Style>, options?: TreeTableOptions);
1189
+ get selectedIndex(): number;
1190
+ get selectedRow(): TreeTableRow | undefined;
1191
+ setRows(rows: TreeTableRow[]): void;
1192
+ /** Move cursor up one visible row */
1193
+ movePrev(): void;
1194
+ /** Move cursor down one visible row */
1195
+ moveNext(): void;
1196
+ /** Go to first visible row */
1197
+ moveFirst(): void;
1198
+ /** Go to last visible row */
1199
+ moveLast(): void;
1200
+ /** Expand the selected row (if it has children and is collapsed) */
1201
+ expand(): void;
1202
+ /** Collapse the selected row, or move to parent if already collapsed/leaf */
1203
+ collapse(): void;
1204
+ /** Toggle expand/collapse */
1205
+ toggle(): void;
1206
+ /**
1207
+ * Handle a key event. Call this from your app's key-routing logic
1208
+ * when this widget is focused.
1209
+ */
1210
+ handleKey(event: KeyEvent): void;
1211
+ protected _renderSelf(screen: Screen): void;
1212
+ private _computeColumnWidths;
1213
+ private _alignText;
1214
+ private _buildVisibleRows;
1215
+ private _clampScroll;
1216
+ }
1217
+
1218
+ interface GaugeOptions {
1219
+ /** Color of the filled portion */
1220
+ color?: Color;
1221
+ /** Show percentage label */
1222
+ showLabel?: boolean;
1223
+ }
1224
+ /**
1225
+ * Gauge — a self-contained metric display with label, bar, and value.
1226
+ *
1227
+ * Example:
1228
+ * CPU ████████░░░░ 65%
1229
+ */
1230
+ declare class Gauge extends Widget {
1231
+ private _label;
1232
+ private _value;
1233
+ private _color;
1234
+ private _showLabel;
1235
+ constructor(label: string, style?: Partial<Style>, opts?: GaugeOptions);
1236
+ setValue(value: number): void;
1237
+ getValue(): number;
1238
+ setLabel(label: string): void;
1239
+ protected _renderSelf(screen: Screen): void;
1240
+ }
1241
+
1242
+ interface LineGaugeOptions {
1243
+ /** Filled portion character. Default: '━' with ASCII fallback '=' */
1244
+ filledChar?: string;
1245
+ /** Empty portion character. Default: '─' with ASCII fallback '-' */
1246
+ emptyChar?: string;
1247
+ /** Show percentage label at right. Default: true */
1248
+ showLabel?: boolean;
1249
+ fillColor?: Color;
1250
+ emptyColor?: Color;
1251
+ }
1252
+ declare class LineGauge extends Widget {
1253
+ private _value;
1254
+ private _filledChar;
1255
+ private _emptyChar;
1256
+ private _showLabel;
1257
+ private _fillColor?;
1258
+ private _emptyColor?;
1259
+ constructor(style?: Partial<Style>, opts?: LineGaugeOptions);
1260
+ setValue(value: number): void;
1261
+ getValue(): number;
1262
+ protected _renderSelf(screen: Screen): void;
1263
+ }
1264
+
1265
+ interface CalendarOptions {
1266
+ date?: Date;
1267
+ selectedColor?: Color;
1268
+ todayColor?: Color;
1269
+ onSelect?: (date: Date) => void;
1270
+ }
1271
+ declare class Calendar extends Widget {
1272
+ private _selectedDate;
1273
+ private _currentMonth;
1274
+ private _selectedColor;
1275
+ private _todayColor;
1276
+ private _onSelect?;
1277
+ focusable: boolean;
1278
+ constructor(style?: Partial<Style>, opts?: CalendarOptions);
1279
+ setMonth(year: number, month: number): void;
1280
+ getSelectedDate(): Date;
1281
+ handleKey(event: KeyEvent): void;
1282
+ private _moveSelection;
1283
+ protected _renderSelf(screen: Screen): void;
1284
+ }
1285
+
1286
+ interface SparklineOptions {
1287
+ /** Color of the sparkline */
1288
+ color?: Color;
1289
+ /** Show min/max labels */
1290
+ showRange?: boolean;
1291
+ /** Rendering style */
1292
+ marker?: 'block' | 'braille';
1293
+ }
1294
+ /**
1295
+ * Sparkline — a compact inline chart showing a data trend.
1296
+ *
1297
+ * Example:
1298
+ * Latency ▂▃▅▇▅▃▂▁▃▅█▅▃
1299
+ */
1300
+ declare class Sparkline extends Widget {
1301
+ private _label;
1302
+ private _data;
1303
+ private _color;
1304
+ private _showRange;
1305
+ private _marker;
1306
+ constructor(label: string, style?: Partial<Style>, opts?: SparklineOptions);
1307
+ setData(data: number[]): void;
1308
+ pushValue(value: number): void;
1309
+ protected _renderSelf(screen: Screen): void;
1310
+ }
1311
+
1312
+ interface StatusIndicatorOptions {
1313
+ /** Color when up/active */
1314
+ upColor?: Color;
1315
+ /** Color when down/inactive */
1316
+ downColor?: Color;
1317
+ }
1318
+ /**
1319
+ * StatusIndicator — simple up/down indicator with label.
1320
+ *
1321
+ * Example:
1322
+ * ● API Server — Online
1323
+ * ○ Worker — Offline
1324
+ */
1325
+ declare class StatusIndicator extends Widget {
1326
+ private _label;
1327
+ private _isUp;
1328
+ private _upColor;
1329
+ private _downColor;
1330
+ constructor(label: string, isUp: boolean, style?: Partial<Style>, opts?: StatusIndicatorOptions);
1331
+ setStatus(isUp: boolean): void;
1332
+ getStatus(): boolean;
1333
+ setLabel(label: string): void;
1334
+ protected _renderSelf(screen: Screen): void;
1335
+ }
1336
+
1337
+ interface Bar {
1338
+ value: number;
1339
+ label?: string;
1340
+ color?: Color;
1341
+ }
1342
+ interface BarGroup {
1343
+ label?: string;
1344
+ bars: Bar[];
1345
+ }
1346
+ type BarChartDirection = 'vertical' | 'horizontal';
1347
+ interface BarChartOptions {
1348
+ /** Direction bars grow. Default: 'vertical'. */
1349
+ direction?: BarChartDirection;
1350
+ /** Width of each bar in cells. Default: 1. */
1351
+ barWidth?: number;
1352
+ /** Gap between bars in a group. Default: 1. */
1353
+ barGap?: number;
1354
+ /** Gap between groups. Default: 2. */
1355
+ groupGap?: number;
1356
+ /** Max value for scaling. Auto-detected if not set. */
1357
+ max?: number;
1358
+ /** Color for bars without a per-bar color. */
1359
+ barColor?: Color;
1360
+ /** Color for value labels. */
1361
+ valueColor?: Color;
1362
+ /** Color for text labels. */
1363
+ labelColor?: Color;
1364
+ }
1365
+ declare class BarChart extends Widget {
1366
+ private _data;
831
1367
  private _direction;
832
1368
  private _barWidth;
833
1369
  private _barGap;
834
1370
  private _groupGap;
835
1371
  private _max?;
836
- private _barColor;
1372
+ private _barColor;
1373
+ private _valueColor;
1374
+ private _labelColor;
1375
+ constructor(data: BarGroup[], style?: Partial<Style>, opts?: BarChartOptions);
1376
+ setData(data: BarGroup[]): void;
1377
+ setMax(max: number | undefined): void;
1378
+ protected _renderSelf(screen: Screen): void;
1379
+ private _computeMax;
1380
+ private _renderVertical;
1381
+ private _renderHorizontal;
1382
+ }
1383
+
1384
+ interface HistogramOptions {
1385
+ bins?: number;
1386
+ barColor?: Color;
1387
+ xLabel?: string;
1388
+ }
1389
+ declare class Histogram extends Widget {
1390
+ private _values;
1391
+ private _bins;
1392
+ private _barColor;
1393
+ private _xLabel?;
1394
+ constructor(style?: Partial<Style>, opts?: HistogramOptions);
1395
+ setData(values: number[]): void;
1396
+ protected _renderSelf(screen: Screen): void;
1397
+ private _computeBins;
1398
+ }
1399
+
1400
+ interface StackedSeries {
1401
+ label: string;
1402
+ data: number[];
1403
+ color?: Color;
1404
+ }
1405
+ interface StackedBarChartOptions {
1406
+ categories?: string[];
1407
+ barWidth?: number;
1408
+ }
1409
+ declare class StackedBarChart extends Widget {
1410
+ private _series;
1411
+ private _categories;
1412
+ private _barWidth;
1413
+ constructor(style?: Partial<Style>, opts?: StackedBarChartOptions);
1414
+ setSeries(series: StackedSeries[]): void;
1415
+ protected _renderSelf(screen: Screen): void;
1416
+ private _categoryCount;
1417
+ private _totals;
1418
+ private _renderBraille;
1419
+ private _renderAscii;
1420
+ private _renderLabels;
1421
+ }
1422
+
1423
+ interface GanttTask {
1424
+ label?: string;
1425
+ start: number;
1426
+ duration: number;
1427
+ color?: Color;
1428
+ }
1429
+ interface GanttChartOptions {
1430
+ taskHeight?: number;
1431
+ taskGap?: number;
1432
+ minTime?: number;
1433
+ maxTime?: number;
1434
+ barColor?: Color;
1435
+ labelColor?: Color;
1436
+ }
1437
+ declare class GanttChart extends Widget {
1438
+ private _tasks;
1439
+ private _taskHeight;
1440
+ private _taskGap;
1441
+ private _minTime?;
1442
+ private _maxTime?;
1443
+ private _barColor;
1444
+ private _labelColor;
1445
+ constructor(tasks: GanttTask[], style?: Partial<Style>, opts?: GanttChartOptions);
1446
+ setTasks(tasks: GanttTask[]): void;
1447
+ protected _renderSelf(screen: Screen): void;
1448
+ }
1449
+
1450
+ interface GridOptions {
1451
+ /** Number of equal-width columns */
1452
+ columns: number;
1453
+ /** Gap between items in both directions (default: 1) */
1454
+ gap?: number;
1455
+ /** Row gap override (overrides gap for rows) */
1456
+ rowGap?: number;
1457
+ /** Column gap override (overrides gap for columns) */
1458
+ colGap?: number;
1459
+ }
1460
+ /**
1461
+ * Grid — a CSS-Grid-like layout widget.
1462
+ *
1463
+ * Items fill left-to-right, wrapping to a new row every `columns` items.
1464
+ * Internally creates a column-flex Box per row, each with equal-flex-grow items.
1465
+ *
1466
+ * The `addChild()` override means the reconciler's generic child-adding
1467
+ * loop works without any special casing.
1468
+ */
1469
+ declare class Grid extends Widget {
1470
+ private _columns;
1471
+ private _colGap;
1472
+ private _rowGap;
1473
+ private _rows;
1474
+ private _itemCount;
1475
+ constructor(style: Partial<Style>, options: GridOptions);
1476
+ protected _renderSelf(_screen: Screen): void;
1477
+ /**
1478
+ * Add a widget to the grid. Items fill left-to-right,
1479
+ * wrapping to a new row automatically every `columns` items.
1480
+ * Overrides Widget.addChild so the reconciler generic loop works unchanged.
1481
+ */
1482
+ addChild(widget: Widget): void;
1483
+ /** Add an item explicitly (alias for addChild) */
1484
+ addItem(widget: Widget): void;
1485
+ /** Remove all items and reset the grid */
1486
+ clearItems(): void;
1487
+ }
1488
+
1489
+ interface ScrollViewOptions {
1490
+ /** Total height of content in rows */
1491
+ contentHeight?: number;
1492
+ /** Show scrollbar indicator on right edge */
1493
+ showScrollbar?: boolean;
1494
+ /** Whether to use scroll acceleration */
1495
+ scrollAccel?: boolean;
1496
+ }
1497
+ /**
1498
+ * ScrollView — a height-bounded scrollable container.
1499
+ *
1500
+ * Children are rendered with a vertical offset applied (scrolling).
1501
+ * Responds to up/down arrow keys and Page Up/Page Down.
1502
+ */
1503
+ declare class ScrollView extends Widget {
1504
+ private _scrollOffset;
1505
+ private _contentHeight;
1506
+ private _showScrollbar;
1507
+ private _scrollAccel;
1508
+ private _acceleration;
1509
+ constructor(style?: Partial<Style>, opts?: ScrollViewOptions);
1510
+ /** Set the total content height (in rows) */
1511
+ setContentHeight(h: number): void;
1512
+ /** Get current scroll offset */
1513
+ get scrollOffset(): number;
1514
+ /** Scroll by delta rows */
1515
+ scrollBy(delta: number): void;
1516
+ /** Scroll to absolute offset */
1517
+ scrollTo(offset: number): void;
1518
+ private _clampOffset;
1519
+ private getScrollDelta;
1520
+ /** Handle keyboard navigation */
1521
+ handleKey(event: KeyEvent): void;
1522
+ render(screen: Screen): void;
1523
+ private _renderScrollbar;
1524
+ protected _renderSelf(_screen: Screen): void;
1525
+ }
1526
+
1527
+ interface CenterOptions {
1528
+ /** Center horizontally (default: true) */
1529
+ horizontal?: boolean;
1530
+ /** Center vertically (default: true) */
1531
+ vertical?: boolean;
1532
+ }
1533
+ /**
1534
+ * Center — centers a single child widget horizontally and/or vertically.
1535
+ *
1536
+ * Computes centering offsets at render time from the child's measured size.
1537
+ */
1538
+ declare class Center extends Widget {
1539
+ private _horizontal;
1540
+ private _vertical;
1541
+ constructor(style?: Partial<Style>, opts?: CenterOptions);
1542
+ protected _renderSelf(_screen: Screen): void;
1543
+ render(screen: Screen): void;
1544
+ }
1545
+
1546
+ interface CardOptions {
1547
+ /** Optional title shown in the top border */
1548
+ title?: string;
1549
+ /** Color for the border and title */
1550
+ borderColor?: Color;
1551
+ }
1552
+ /**
1553
+ * Card — a bordered container with an optional title in the top border.
1554
+ *
1555
+ * Like a Box with border + padding, but supports embedding a title string
1556
+ * directly in the top border line.
1557
+ */
1558
+ declare class Card extends Widget {
1559
+ private _title;
1560
+ private _borderColor?;
1561
+ constructor(style?: Partial<Style>, opts?: CardOptions);
1562
+ setTitle(title: string): void;
1563
+ protected _renderSelf(screen: Screen): void;
1564
+ }
1565
+
1566
+ interface MasonryOptions {
1567
+ /** Number of columns. Default: 2 */
1568
+ columns?: number;
1569
+ /** Vertical gap between items. Default: 0 */
1570
+ gap?: number;
1571
+ }
1572
+ declare class Masonry extends Widget {
1573
+ private _columns;
1574
+ private _gap;
1575
+ constructor(children: Widget[], style?: Partial<Style>, opts?: MasonryOptions);
1576
+ setChildren(children: Widget[]): void;
1577
+ syncLayout(): void;
1578
+ protected _renderSelf(_screen: Screen): void;
1579
+ private _layout;
1580
+ }
1581
+
1582
+ interface ColumnsOptions {
1583
+ /** Gap between columns in cells (default: 1) */
1584
+ gap?: number;
1585
+ }
1586
+ /**
1587
+ * Columns — splits available width evenly across child widgets.
1588
+ *
1589
+ * Children are laid out side-by-side with equal flex-grow.
1590
+ * Internally uses a flex-row Box; the addChild override applies
1591
+ * flexGrow:1 to each child so the reconciler's generic loop works.
1592
+ */
1593
+ declare class Columns extends Widget {
1594
+ private _inner;
1595
+ constructor(style?: Partial<Style>, opts?: ColumnsOptions);
1596
+ addChild(widget: Widget): void;
1597
+ removeChild(widget: Widget): void;
1598
+ clearChildren(): void;
1599
+ protected _renderSelf(_screen: Screen): void;
1600
+ }
1601
+
1602
+ type DockEdge = 'top' | 'right' | 'bottom' | 'left' | 'fill';
1603
+ interface DockItem {
1604
+ widget: Widget;
1605
+ edge: DockEdge;
1606
+ size?: number;
1607
+ }
1608
+ interface DockOptions {
1609
+ style?: Partial<Style>;
1610
+ }
1611
+ declare class Dock extends Widget {
1612
+ private _items;
1613
+ constructor(items: DockItem[], style?: Partial<Style>);
1614
+ setItems(items: DockItem[]): void;
1615
+ updateRect(rect: Rect): void;
1616
+ protected _renderSelf(_screen: Screen): void;
1617
+ render(screen: Screen): void;
1618
+ }
1619
+
1620
+ type DividerOrientation = 'horizontal' | 'vertical';
1621
+ interface DividerOptions {
1622
+ /** Direction of the divider line */
1623
+ orientation?: DividerOrientation;
1624
+ /** Optional centered label inside the line */
1625
+ label?: string;
1626
+ /** Character used to draw the line (overrides default) */
1627
+ char?: string;
1628
+ /** Color of the line */
1629
+ color?: Color;
1630
+ }
1631
+ /**
1632
+ * Divider — a horizontal or vertical separator line with optional label.
1633
+ *
1634
+ * Examples:
1635
+ * ──────────────── Stats ──────────────── (horizontal with label)
1636
+ * ──────────────────────────────────────── (horizontal)
1637
+ * │ (vertical, repeating down the height)
1638
+ */
1639
+ declare class Divider extends Widget {
1640
+ private _orientation;
1641
+ private _label;
1642
+ private _char;
1643
+ private _color;
1644
+ constructor(style?: Partial<Style>, opts?: DividerOptions);
1645
+ setLabel(label: string): void;
1646
+ setOrientation(orientation: DividerOrientation): void;
1647
+ setChar(char: string): void;
1648
+ setColor(color: Color): void;
1649
+ protected _renderSelf(screen: Screen): void;
1650
+ private _renderHorizontal;
1651
+ private _renderVertical;
1652
+ }
1653
+
1654
+ interface AspectRatioOptions {
1655
+ /** Width:height ratio */
1656
+ ratio?: number;
1657
+ /** contain = fit inside, cover = fill */
1658
+ fit?: 'contain' | 'cover';
1659
+ }
1660
+ declare class AspectRatio extends Widget {
1661
+ private _ratio;
1662
+ private _fit;
1663
+ constructor(child: Widget, style?: Partial<Style>, opts?: AspectRatioOptions);
1664
+ setChild(child: Widget): void;
1665
+ protected _renderSelf(_screen: Screen): void;
1666
+ render(screen: Screen): void;
1667
+ }
1668
+
1669
+ interface FillOptions {
1670
+ char?: string;
1671
+ color?: Color;
1672
+ }
1673
+ declare class Fill extends Widget {
1674
+ private _char;
1675
+ private _color?;
1676
+ constructor(style?: Partial<Style>, opts?: FillOptions);
1677
+ setChar(char: string): void;
1678
+ protected _renderSelf(screen: Screen): void;
1679
+ }
1680
+
1681
+ interface SplitPaneOptions {
1682
+ /** Horizontal split ratio for the left pane (0–1, default: 0.5) */
1683
+ ratio?: number;
1684
+ /** Minimum width in cells for each pane (default: 1) */
1685
+ minSize?: number;
1686
+ }
1687
+ /**
1688
+ * SplitPane — two-pane horizontal layout with a draggable divider.
1689
+ *
1690
+ * The left pane occupies columns [0, leftWidth − 1], the divider sits at
1691
+ * leftWidth, and the right pane occupies [leftWidth + 1, totalWidth − 1].
1692
+ * Use shift+left / shift+right to resize when focused.
1693
+ */
1694
+ declare class SplitPane extends Widget {
1695
+ private _ratio;
1696
+ private readonly _minSize;
1697
+ constructor(left: Widget, right: Widget, style?: Partial<Style>, opts?: SplitPaneOptions);
1698
+ getRatio(): number;
1699
+ setRatio(ratio: number): void;
1700
+ handleKey(event: KeyEvent): void;
1701
+ syncLayout(): void;
1702
+ protected _renderSelf(screen: Screen): void;
1703
+ private _clampRatio;
1704
+ private _positionChildren;
1705
+ }
1706
+
1707
+ interface ProgressBarOptions {
1708
+ /** Current value (0–1) */
1709
+ value?: number;
1710
+ /** Character for the filled portion */
1711
+ fillChar?: string;
1712
+ /** Character for the empty portion */
1713
+ emptyChar?: string;
1714
+ /** Color of the filled portion */
1715
+ fillColor?: Color;
1716
+ /** Show percentage label */
1717
+ showLabel?: boolean;
1718
+ /** Label format: 'percent' | 'fraction' | 'custom' */
1719
+ labelFormat?: 'percent' | 'fraction';
1720
+ /** Total for fraction display */
1721
+ total?: number;
1722
+ }
1723
+ /**
1724
+ * ProgressBar — horizontal progress indicator.
1725
+ *
1726
+ * Supports:
1727
+ * - Configurable fill/empty characters
1728
+ * - Custom fill color
1729
+ * - Percentage or fraction label
1730
+ * - Smooth animation-ready value changes
1731
+ */
1732
+ declare class ProgressBar extends Widget {
1733
+ private _value;
1734
+ private _fillChar;
1735
+ private _emptyChar;
1736
+ private _fillColor;
1737
+ private _showLabel;
1738
+ private _labelFormat;
1739
+ private _total;
1740
+ constructor(style?: Partial<Style>, options?: ProgressBarOptions);
1741
+ /** Set progress value (0–1) */
1742
+ setValue(value: number): void;
1743
+ get value(): number;
1744
+ protected _renderSelf(screen: Screen): void;
1745
+ }
1746
+
1747
+ /**
1748
+ * A single progress item in MultiProgress
1749
+ */
1750
+ interface ProgressItem {
1751
+ label: string;
1752
+ value: number;
1753
+ color?: Color;
1754
+ }
1755
+ /**
1756
+ * Options for MultiProgress widget
1757
+ */
1758
+ interface MultiProgressOptions {
1759
+ items: ProgressItem[];
1760
+ labelWidth?: number;
1761
+ showValues?: boolean;
1762
+ }
1763
+ /**
1764
+ * MultiProgress — stacks multiple labeled progress bars in a vertical list.
1765
+ *
1766
+ * Each item renders on its own row with a label, bar, and optional percentage.
1767
+ *
1768
+ * Supports:
1769
+ * - Multiple items with individual colors
1770
+ * - Custom label column width
1771
+ * - Optional percentage display
1772
+ * - Smooth animation-ready value changes
1773
+ */
1774
+ declare class MultiProgress extends Widget {
1775
+ private _items;
1776
+ private _labelWidth;
1777
+ private _showValues;
1778
+ constructor(options: MultiProgressOptions, style?: Partial<Style>);
1779
+ /**
1780
+ * Replace all items and mark dirty
1781
+ */
1782
+ setItems(items: ProgressItem[]): void;
1783
+ /**
1784
+ * Update a single item's value
1785
+ */
1786
+ updateItem(index: number, value: number): void;
1787
+ /**
1788
+ * Test-only getter for items array
1789
+ * @internal
1790
+ */
1791
+ getItemsForTest(): ProgressItem[];
1792
+ /**
1793
+ * Test-only getter for labelWidth
1794
+ * @internal
1795
+ */
1796
+ getLabelWidthForTest(): number;
1797
+ /**
1798
+ * Test-only getter for showValues
1799
+ * @internal
1800
+ */
1801
+ getShowValuesForTest(): boolean;
1802
+ /**
1803
+ * Test-only getter for style height
1804
+ * @internal
1805
+ */
1806
+ getHeightForTest(): number;
1807
+ /**
1808
+ * Test-only setter for dirty state
1809
+ * @internal
1810
+ */
1811
+ setDirtyForTest(value: boolean): void;
1812
+ protected _renderSelf(screen: Screen): void;
1813
+ }
1814
+
1815
+ /**
1816
+ * Built-in spinner frame sets.
1817
+ */
1818
+ declare const SPINNER_FRAMES: Record<string, {
1819
+ frames: string[];
1820
+ asciiFrames: string[];
1821
+ interval: number;
1822
+ }>;
1823
+ interface SpinnerOptions {
1824
+ /** Spinner preset name or custom frames */
1825
+ spinner?: string | {
1826
+ frames: string[];
1827
+ interval: number;
1828
+ };
1829
+ /** Spinner preset name (preferred option) */
1830
+ preset?: string;
1831
+ /** Text label displayed after the spinner */
1832
+ label?: string;
1833
+ /** Color for the spinner frames */
1834
+ color?: Color;
1835
+ /** Whether the spinner is active/animating (default: true) */
1836
+ active?: boolean;
1837
+ /** Text to display when active is false (e.g., '✓ Done') */
1838
+ doneText?: string;
1839
+ /** Custom frame interval in milliseconds */
1840
+ interval?: number;
1841
+ }
1842
+ /**
1843
+ * Spinner — animated loading indicator.
1844
+ *
1845
+ * Supports:
1846
+ * - 10 built-in spinner presets
1847
+ * - Custom frame sequences
1848
+ * - Configurable color and label
1849
+ * - Active state control and custom done state text
1850
+ * - Automatic frame advancement with system-clock smoothness
1851
+ * - ASCII fallbacks and no-motion environment support
1852
+ */
1853
+ declare class Spinner extends Widget {
1854
+ private _frames;
1855
+ private _interval;
1856
+ private _frameIndex;
1857
+ private _label;
1858
+ private _color;
1859
+ private _elapsed;
1860
+ private _timerUnsub?;
1861
+ private _active;
1862
+ private _doneText?;
1863
+ private _startTime?;
1864
+ constructor(style?: Partial<Style>, options?: SpinnerOptions);
1865
+ /** Update the active state */
1866
+ setActive(active: boolean): void;
1867
+ /** Update the spinner label */
1868
+ setLabel(label: string): void;
1869
+ /** Update doneText */
1870
+ setDoneText(doneText: string): void;
1871
+ /**
1872
+ * Advance the spinner frame based on elapsed time.
1873
+ * Call this with a delta (ms) from the render loop.
1874
+ */
1875
+ tick(deltaMs: number): void;
1876
+ /** Lifecycle: start the frame-advance timer (only when motion is enabled). */
1877
+ mount(): void;
1878
+ /** Lifecycle: stop the frame-advance timer. */
1879
+ unmount(): void;
1880
+ protected _renderSelf(screen: Screen): void;
1881
+ }
1882
+
1883
+ interface LoadingDotsOptions {
1884
+ /** Label shown before the dots. */
1885
+ label?: string;
1886
+ /** Maximum number of dots in the cycle. Default: 3 */
1887
+ maxDots?: number;
1888
+ /** Dot color. Default: cyan */
1889
+ color?: Color;
1890
+ }
1891
+ declare class LoadingDots extends Widget {
1892
+ private _label;
1893
+ private _maxDots;
1894
+ private _color;
1895
+ private _dotCount;
1896
+ constructor(style?: Partial<Style>, opts?: LoadingDotsOptions);
1897
+ tick(): void;
1898
+ setLabel(label: string): void;
1899
+ protected _renderSelf(screen: Screen): void;
1900
+ }
1901
+
1902
+ type TaskStatus = 'pending' | 'running' | 'done' | 'error';
1903
+ interface TaskItem {
1904
+ id: string | number;
1905
+ label: string;
1906
+ status: TaskStatus;
1907
+ }
1908
+ interface TaskListOptions {
1909
+ pendingText?: string;
1910
+ runningText?: string;
1911
+ doneText?: string;
1912
+ errorText?: string;
1913
+ /** When true, the running indicator animates with a spinner. */
1914
+ wheelspin?: boolean;
1915
+ }
1916
+ /**
1917
+ * TaskList — a vertical list of tasks with status indicators.
1918
+ *
1919
+ * Each task renders on its own row:
1920
+ * Build ⠋ ← running + wheelspin + unicode
1921
+ * Lint ... ← pending (default pendingText)
1922
+ * Tests ✓ ← done (custom doneText)
1923
+ * Deploy ✗ ← error (custom errorText)
1924
+ */
1925
+ declare class TaskList extends Widget {
1926
+ private _tasks;
1927
+ private _pendingText;
1928
+ private _runningText;
1929
+ private _doneText;
1930
+ private _errorText;
1931
+ private _wheelspin;
1932
+ private _frameIndex;
1933
+ private _elapsed;
1934
+ constructor(style?: Partial<Style>, options?: TaskListOptions, tasks?: TaskItem[]);
1935
+ /** Replace the task list and schedule a re-render. */
1936
+ setTasks(tasks: TaskItem[]): void;
1937
+ /**
1938
+ * Advance the spinner animation by `dt` milliseconds.
1939
+ * Only has an effect when `wheelspin` is enabled and there is at least
1940
+ * one running task. Call this from the app's render/tick loop.
1941
+ */
1942
+ tick(dt: number): void;
1943
+ protected _renderSelf(screen: Screen): void;
1944
+ }
1945
+
1946
+ type ScrollbarOrientation = 'verticalRight' | 'verticalLeft' | 'horizontalBottom' | 'horizontalTop';
1947
+ interface ScrollbarOptions {
1948
+ /** Total number of content items. */
1949
+ contentLength: number;
1950
+ /** Number of items visible in the viewport. */
1951
+ viewportLength: number;
1952
+ /** Current scroll position (0-based). */
1953
+ position?: number;
1954
+ /** Scrollbar orientation. Default: 'verticalRight'. */
1955
+ orientation?: ScrollbarOrientation;
1956
+ /** Color of the thumb. */
1957
+ thumbColor?: Color;
1958
+ /** Color of the track. */
1959
+ trackColor?: Color;
1960
+ /** Show begin/end arrow symbols. Default: true. */
1961
+ showArrows?: boolean;
1962
+ }
1963
+ declare class Scrollbar extends Widget {
1964
+ private _contentLength;
1965
+ private _viewportLength;
1966
+ private _position;
1967
+ private _orientation;
1968
+ private _thumbColor;
1969
+ private _trackColor;
1970
+ private _showArrows;
1971
+ constructor(style: Partial<Style> | undefined, opts: ScrollbarOptions);
1972
+ setPosition(position: number): void;
1973
+ setContentLength(length: number): void;
1974
+ setViewportLength(length: number): void;
1975
+ protected _renderSelf(screen: Screen): void;
1976
+ }
1977
+
1978
+ interface SkeletonOptions {
1979
+ variant?: 'pulse' | 'shimmer';
1980
+ intervalMs?: number;
1981
+ chars?: [string, string];
1982
+ color?: Color;
1983
+ }
1984
+ declare class Skeleton extends Widget {
1985
+ private _frame;
1986
+ private _shimmerPos;
1987
+ private _variant;
1988
+ private _chars;
1989
+ private _intervalMs;
1990
+ private _unsubscribe?;
1991
+ constructor(style?: Partial<Style>, opts?: SkeletonOptions);
1992
+ unmount(): void;
1993
+ protected _renderSelf(screen: Screen): void;
1994
+ }
1995
+
1996
+ type StatusVariant = 'success' | 'error' | 'warning' | 'info';
1997
+ interface StatusMessageOptions {
1998
+ /** Variant determines icon and color */
1999
+ variant?: StatusVariant;
2000
+ /** Override the icon character */
2001
+ icon?: string;
2002
+ }
2003
+ /**
2004
+ * StatusMessage — a single-line status indicator.
2005
+ *
2006
+ * Renders an icon (✓/✗/⚠/ℹ) followed by a message, colored by variant.
2007
+ */
2008
+ declare class StatusMessage extends Widget {
2009
+ private _message;
2010
+ private _variant;
2011
+ private _icon?;
2012
+ constructor(message: string, style?: Partial<Style>, opts?: StatusMessageOptions);
2013
+ setMessage(message: string): void;
2014
+ setVariant(variant: StatusVariant): void;
2015
+ protected _renderSelf(screen: Screen): void;
2016
+ }
2017
+
2018
+ interface BannerOptions {
2019
+ /** Variant determines border color */
2020
+ variant?: StatusVariant;
2021
+ /** Title displayed on first line in bold */
2022
+ title?: string;
2023
+ /** Body text */
2024
+ body?: string;
2025
+ }
2026
+ /**
2027
+ * Banner — full-width alert with title and body text.
2028
+ *
2029
+ * Shows a bordered box with a bold title line and body text,
2030
+ * colored according to variant. The border is drawn manually
2031
+ * to use the variant color.
2032
+ */
2033
+ declare class Banner extends Widget {
2034
+ private _variant;
2035
+ private _title;
2036
+ private _body;
2037
+ constructor(style?: Partial<Style>, opts?: BannerOptions);
2038
+ setTitle(title: string): void;
2039
+ setBody(body: string): void;
2040
+ setVariant(variant: StatusVariant): void;
2041
+ protected _renderSelf(screen: Screen): void;
2042
+ }
2043
+
2044
+ interface AlertOptions {
2045
+ /** Variant determines icon and border color */
2046
+ variant?: StatusVariant;
2047
+ /** The message to display */
2048
+ message: string;
2049
+ }
2050
+ /**
2051
+ * Alert — full-width status message box with a colored border and an icon prefix.
2052
+ *
2053
+ * Renders a bordered box containing an icon and a message on a single line,
2054
+ * colored according to the variant. Uses `caps.unicode` to choose between
2055
+ * Unicode box-drawing/icons and ASCII fallback borders/icons.
2056
+ */
2057
+ declare class Alert extends Widget {
2058
+ private _variant;
2059
+ private _message;
2060
+ constructor(opts: AlertOptions, style?: Partial<Style>);
2061
+ /** Set the alert message */
2062
+ setMessage(message: string): void;
2063
+ /** Get the alert message */
2064
+ getMessage(): string;
2065
+ /** Set the alert variant */
2066
+ setVariant(variant: StatusVariant): void;
2067
+ /** Get the alert variant */
2068
+ getVariant(): StatusVariant;
2069
+ protected _renderSelf(screen: Screen): void;
2070
+ }
2071
+
2072
+ interface EmptyStateOptions {
2073
+ icon?: string;
2074
+ description?: string;
2075
+ hint?: string;
2076
+ }
2077
+ declare class EmptyState extends Widget {
2078
+ private _title;
2079
+ private _icon;
2080
+ private _description;
2081
+ private _hint;
2082
+ constructor(title: string, style?: Partial<Style>, opts?: EmptyStateOptions);
2083
+ setTitle(title: string): void;
2084
+ setDescription(description: string): void;
2085
+ protected _renderSelf(screen: Screen): void;
2086
+ }
2087
+
2088
+ type CalloutVariant = 'info' | 'warn' | 'success' | 'danger';
2089
+ interface CalloutOptions {
2090
+ variant?: CalloutVariant;
2091
+ title?: string;
2092
+ }
2093
+ declare class Callout extends Widget {
2094
+ private _message;
2095
+ private _variant;
2096
+ private _title;
2097
+ constructor(message: string, style?: Partial<Style>, opts?: CalloutOptions);
2098
+ setMessage(message: string): void;
2099
+ setVariant(variant: CalloutVariant): void;
2100
+ protected _renderSelf(screen: Screen): void;
2101
+ }
2102
+
2103
+ interface KeyValuePair {
2104
+ key: string;
2105
+ value: any;
2106
+ }
2107
+ interface KeyValueOptions {
2108
+ /** Separator between key and value (default: ': ') */
2109
+ separator?: string;
2110
+ /** Color for keys */
2111
+ keyColor?: _termuijs_core.Color;
2112
+ /** Color for values */
2113
+ valueColor?: _termuijs_core.Color;
2114
+ }
2115
+ /**
2116
+ * KeyValue — aligned key: value pairs.
2117
+ *
2118
+ * Keys are right-aligned to the width of the longest key.
2119
+ * Values follow after the separator.
2120
+ */
2121
+ declare class KeyValue extends Widget {
2122
+ private _pairs;
2123
+ private _separator;
2124
+ private _keyColor?;
2125
+ private _valueColor?;
2126
+ private _expandedPaths;
2127
+ private _selectedIndex;
2128
+ constructor(pairs: Array<KeyValuePair> | Record<string, any>, style?: Partial<Style>, opts?: KeyValueOptions);
2129
+ setPairs(pairs: Array<KeyValuePair> | Record<string, any>): void;
2130
+ private _updateFocusable;
2131
+ private _getVisibleRows;
2132
+ moveUp(): void;
2133
+ moveDown(): void;
2134
+ toggleSelected(): void;
2135
+ handleKey(key: string): void;
2136
+ protected _renderSelf(screen: Screen): void;
2137
+ }
2138
+
2139
+ interface SidebarItem {
2140
+ label: string;
2141
+ badge?: string;
2142
+ active?: boolean;
2143
+ }
2144
+ interface SidebarOptions {
2145
+ /** Whether the sidebar is collapsed */
2146
+ collapsed?: boolean;
2147
+ /** Collapsed width in cells (default: 3) */
2148
+ collapsedWidth?: number;
2149
+ /** Active item highlight color */
2150
+ activeColor?: _termuijs_core.Color;
2151
+ /** Badge color */
2152
+ badgeColor?: _termuijs_core.Color;
2153
+ }
2154
+ /**
2155
+ * Sidebar — a vertical list of navigation items with optional badges.
2156
+ *
2157
+ * Supports active item highlighting and collapsible mode.
2158
+ */
2159
+ declare class Sidebar extends Widget {
2160
+ private _items;
2161
+ private _collapsed;
2162
+ private _collapsedWidth;
2163
+ private _activeColor;
2164
+ private _badgeColor;
2165
+ constructor(items: SidebarItem[], style?: Partial<Style>, opts?: SidebarOptions);
2166
+ setItems(items: SidebarItem[]): void;
2167
+ setCollapsed(collapsed: boolean): void;
2168
+ toggle(): void;
2169
+ get isCollapsed(): boolean;
2170
+ protected _renderSelf(screen: Screen): void;
2171
+ }
2172
+
2173
+ interface LineChartOptions {
2174
+ /** Color of the plotted points/lines */
2175
+ color?: Color;
2176
+ /** Show Y-axis labels */
2177
+ showYAxis?: boolean;
2178
+ /** Show X-axis labels */
2179
+ showXAxis?: boolean;
2180
+ /** Label for the Y axis */
2181
+ yLabel?: string;
2182
+ /** Maximum Y value (auto if not set) */
2183
+ max?: number;
2184
+ /** Minimum Y value (auto if not set) */
2185
+ min?: number;
2186
+ }
2187
+ /**
2188
+ * LineChart — ASCII/Unicode line plot for a series of numbers.
2189
+ *
2190
+ * Normalizes data to the available height, samples to fit width.
2191
+ * Plots points with simple vertical bar connectors between adjacent points.
2192
+ */
2193
+ declare class LineChart extends Widget {
2194
+ private _data;
2195
+ private _color;
2196
+ private _showYAxis;
2197
+ private _showXAxis;
2198
+ private _yLabel;
2199
+ private _max?;
2200
+ private _min?;
2201
+ constructor(data: number[], style?: Partial<Style>, opts?: LineChartOptions);
2202
+ setData(data: number[]): void;
2203
+ pushValue(value: number): void;
2204
+ protected _renderSelf(screen: Screen): void;
2205
+ }
2206
+
2207
+ interface AreaChartOptions {
2208
+ xLabel?: string;
2209
+ yLabel?: string;
2210
+ lineColor?: Color;
2211
+ fillColor?: Color;
2212
+ showLine?: boolean;
2213
+ }
2214
+ declare class AreaChart extends Widget {
2215
+ private _data;
2216
+ private _xLabel;
2217
+ private _yLabel;
2218
+ private _lineColor;
2219
+ private _fillColor;
2220
+ private _showLine;
2221
+ constructor(style?: Partial<Style>, opts?: AreaChartOptions);
2222
+ setData(values: number[]): void;
2223
+ protected _renderSelf(screen: Screen): void;
2224
+ }
2225
+
2226
+ interface HeatMapOptions {
2227
+ /** Color for maximum value cells */
2228
+ highColor?: Color;
2229
+ /** Color for minimum value cells */
2230
+ lowColor?: Color;
2231
+ /** Row labels (left side) */
2232
+ rowLabels?: string[];
2233
+ /** Column labels (top) */
2234
+ colLabels?: string[];
2235
+ }
2236
+ /**
2237
+ * HeatMap — 2D matrix displayed with character-density shading.
2238
+ *
2239
+ * Values are normalized 0–1 and mapped to 4 shading levels.
2240
+ */
2241
+ declare class HeatMap extends Widget {
2242
+ private _matrix;
2243
+ private _highColor;
2244
+ private _lowColor;
2245
+ private _rowLabels;
2246
+ private _colLabels;
2247
+ constructor(matrix: number[][], style?: Partial<Style>, opts?: HeatMapOptions);
2248
+ setMatrix(matrix: number[][]): void;
2249
+ protected _renderSelf(screen: Screen): void;
2250
+ }
2251
+
2252
+ interface DefinitionPair {
2253
+ term: string;
2254
+ definition: string;
2255
+ }
2256
+ interface DefinitionOptions {
2257
+ /** Indentation for definition lines (default: 2) */
2258
+ indent?: number;
2259
+ /** Blank line between pairs (default: true) */
2260
+ spacing?: boolean;
2261
+ /** Color for term labels */
2262
+ termColor?: _termuijs_core.Color;
2263
+ /** Color for definition text */
2264
+ definitionColor?: _termuijs_core.Color;
2265
+ }
2266
+ /**
2267
+ * Definition — term + definition pairs, stacked vertically.
2268
+ *
2269
+ * Each pair renders as:
2270
+ * Term
2271
+ * definition text (indented)
2272
+ *
2273
+ * Similar to KeyValue but stacked rather than inline.
2274
+ */
2275
+ declare class Definition extends Widget {
2276
+ private _pairs;
2277
+ private _indent;
2278
+ private _spacing;
2279
+ private _termColor?;
2280
+ private _definitionColor?;
2281
+ constructor(pairs: DefinitionPair[] | Record<string, string>, style?: Partial<Style>, opts?: DefinitionOptions);
2282
+ setPairs(pairs: DefinitionPair[] | Record<string, string>): void;
2283
+ protected _renderSelf(screen: Screen): void;
2284
+ }
2285
+
2286
+ interface HexdumpOptions {
2287
+ /** Bytes per row. Default: 16 */
2288
+ bytesPerRow?: number;
2289
+ /** Character shown for non-printable bytes in ASCII column. Default: '.' */
2290
+ placeholder?: string;
2291
+ }
2292
+ declare class Hexdump extends Widget {
2293
+ private data;
2294
+ private opts;
2295
+ constructor(data: Uint8Array, style?: Partial<Style>, opts?: HexdumpOptions);
2296
+ setData(data: Uint8Array): void;
2297
+ protected _renderSelf(screen: Screen): void;
2298
+ }
2299
+
2300
+ interface BulletRange {
2301
+ to: number;
2302
+ color?: Color;
2303
+ }
2304
+ interface BulletChartOptions {
2305
+ max?: number;
2306
+ ranges?: BulletRange[];
2307
+ valueColor?: Color;
2308
+ targetColor?: Color;
2309
+ label?: string;
2310
+ }
2311
+ /**
2312
+ * BulletChart — a metric display with target marker and qualitative range bands.
2313
+ */
2314
+ declare class BulletChart extends Widget {
2315
+ private _value;
2316
+ private _target;
2317
+ private _max;
2318
+ private _ranges;
837
2319
  private _valueColor;
838
- private _labelColor;
839
- constructor(data: BarGroup[], style?: Partial<Style>, opts?: BarChartOptions);
840
- setData(data: BarGroup[]): void;
841
- setMax(max: number | undefined): void;
2320
+ private _targetColor;
2321
+ private _label;
2322
+ constructor(style?: Partial<Style>, opts?: BulletChartOptions);
2323
+ setValue(value: number): void;
2324
+ setTarget(target: number): void;
2325
+ protected _renderSelf(screen: Screen): void;
2326
+ }
2327
+
2328
+ interface BreadcrumbsOptions {
2329
+ /** Separator drawn between segments. Default: caps.unicode ? '❯' : '>' */
2330
+ separator?: string;
2331
+ /** Color of the last (current) segment. Default: cyan */
2332
+ activeColor?: Color;
2333
+ }
2334
+ /**
2335
+ * Breadcrumbs — renders a non-interactive path trail of segments with separators and truncation.
2336
+ *
2337
+ * Example output:
2338
+ * Home ❯ Docs ❯ API
2339
+ */
2340
+ declare class Breadcrumbs extends Widget {
2341
+ private _segments;
2342
+ private _separator?;
2343
+ private _activeColor?;
2344
+ constructor(segments: string[], style?: Partial<Style>, opts?: BreadcrumbsOptions);
2345
+ /** Update the trail of segments. */
2346
+ setSegments(segments: string[]): void;
842
2347
  protected _renderSelf(screen: Screen): void;
843
- private _computeMax;
844
- private _renderVertical;
845
- private _renderHorizontal;
846
2348
  }
847
2349
 
848
- interface GridOptions {
849
- /** Number of equal-width columns */
850
- columns: number;
851
- /** Gap between items in both directions (default: 1) */
852
- gap?: number;
853
- /** Row gap override (overrides gap for rows) */
854
- rowGap?: number;
855
- /** Column gap override (overrides gap for columns) */
856
- colGap?: number;
2350
+ interface AvatarOptions {
2351
+ /** Override the dynamically generated color */
2352
+ color?: Color;
2353
+ /** Shape of the avatar */
2354
+ shape?: 'square' | 'circle';
857
2355
  }
858
2356
  /**
859
- * Grid — a CSS-Grid-like layout widget.
2357
+ * Avatar — a widget that displays user initials with a generated color.
2358
+ */
2359
+ declare class Avatar extends Widget {
2360
+ private _name;
2361
+ private _color?;
2362
+ private _shape;
2363
+ private _initials;
2364
+ private _fallbackColor;
2365
+ constructor(name: string, style?: Partial<Style>, opts?: AvatarOptions);
2366
+ setName(name: string): void;
2367
+ getName(): string;
2368
+ setColor(color: Color): void;
2369
+ getColor(): Color | undefined;
2370
+ setShape(shape: 'square' | 'circle'): void;
2371
+ getShape(): 'square' | 'circle';
2372
+ private _extractInitials;
2373
+ private _generateColor;
2374
+ protected _renderSelf(screen: Screen): void;
2375
+ }
2376
+
2377
+ interface BigTextOptions {
2378
+ /** Color for the rendered characters */
2379
+ color?: Color;
2380
+ }
2381
+ /**
2382
+ * BigText — renders text as large 5×3 ASCII art banner characters.
860
2383
  *
861
- * Items fill left-to-right, wrapping to a new row every `columns` items.
862
- * Internally creates a column-flex Box per row, each with equal-flex-grow items.
2384
+ * Supports A–Z (uppercase), 0–9, and common punctuation.
2385
+ * Unrecognized characters fall back to a narrow glyph.
2386
+ */
2387
+ declare class BigText extends Widget {
2388
+ private _text;
2389
+ private _color;
2390
+ constructor(text: string, style?: Partial<Style>, opts?: BigTextOptions);
2391
+ setText(text: string): void;
2392
+ protected _renderSelf(screen: Screen): void;
2393
+ }
2394
+
2395
+ interface GradientOptions {
2396
+ /** Start color (hex string like '#ff0000' or named color string) */
2397
+ startColor?: string;
2398
+ /** End color (hex string like '#0000ff' or named color string) */
2399
+ endColor?: string;
2400
+ /** Text alignment */
2401
+ align?: 'left' | 'center' | 'right';
2402
+ }
2403
+ /**
2404
+ * Gradient — text rendered with a smooth color gradient.
863
2405
  *
864
- * The `addChild()` override means the reconciler's generic child-adding
865
- * loop works without any special casing.
2406
+ * Each character is colored by linearly interpolating between startColor and endColor.
2407
+ * Falls back to a single foreground color if true-color is unavailable.
866
2408
  */
867
- declare class Grid extends Widget {
868
- private _columns;
869
- private _colGap;
870
- private _rowGap;
871
- private _rows;
872
- private _itemCount;
873
- constructor(style: Partial<Style>, options: GridOptions);
874
- protected _renderSelf(_screen: Screen): void;
875
- /**
876
- * Add a widget to the grid. Items fill left-to-right,
877
- * wrapping to a new row automatically every `columns` items.
878
- * Overrides Widget.addChild so the reconciler generic loop works unchanged.
879
- */
880
- addChild(widget: Widget): void;
881
- /** Add an item explicitly (alias for addChild) */
882
- addItem(widget: Widget): void;
883
- /** Remove all items and reset the grid */
884
- clearItems(): void;
2409
+ declare class Gradient extends Widget {
2410
+ private _text;
2411
+ private _startColor;
2412
+ private _endColor;
2413
+ private _align;
2414
+ constructor(text: string, style?: Partial<Style>, opts?: GradientOptions);
2415
+ setText(text: string): void;
2416
+ setColors(start: string, end: string): void;
2417
+ protected _renderSelf(screen: Screen): void;
885
2418
  }
886
2419
 
887
- interface ScrollViewOptions {
888
- /** Total height of content in rows */
889
- contentHeight?: number;
890
- /** Show scrollbar indicator on right edge */
891
- showScrollbar?: boolean;
2420
+ interface MarkdownOptions {
2421
+ content: string;
2422
+ }
2423
+ declare class Markdown extends Widget {
2424
+ private _content;
2425
+ private writeText;
2426
+ private renderInline;
2427
+ private renderCodeBlock;
2428
+ constructor(options: MarkdownOptions, style?: Partial<Style>);
2429
+ /** Update markdown content and mark dirty. */
2430
+ setContent(content: string): void;
2431
+ getContent(): string;
2432
+ protected _renderSelf(screen: Screen): void;
2433
+ }
2434
+
2435
+ interface CodeOptions {
2436
+ language?: string;
2437
+ showLineNumbers?: boolean;
2438
+ }
2439
+ declare class Code extends Widget {
2440
+ private _code;
2441
+ private _language;
2442
+ private _showLineNumbers;
2443
+ constructor(code: string, style?: Partial<Style>, opts?: CodeOptions);
2444
+ setCode(code: string): void;
2445
+ setLanguage(language: string): void;
2446
+ protected _renderSelf(screen: Screen): void;
2447
+ protected _renderBorder(screen: Screen): void;
2448
+ }
2449
+
2450
+ type BadgeVariant = 'info' | 'success' | 'warning' | 'error' | 'neutral';
2451
+ interface BadgeOptions {
2452
+ /** Variant determines background color. Default: 'neutral'. */
2453
+ variant?: BadgeVariant;
892
2454
  }
893
2455
  /**
894
- * ScrollView — a height-bounded scrollable container.
2456
+ * Badge — a short inline label with a colored background.
895
2457
  *
896
- * Children are rendered with a vertical offset applied (scrolling).
897
- * Responds to up/down arrow keys and Page Up/Page Down.
2458
+ * Used for status indicators such as "online", "error", "beta".
2459
+ * Renders a bordered box with the text on a colored background.
2460
+ * Uses `caps.unicode` to choose between Unicode box-drawing and ASCII fallback.
2461
+ *
2462
+ * CONSTRUCTOR: (text, style?, opts?)
898
2463
  */
899
- declare class ScrollView extends Widget {
900
- private _scrollOffset;
901
- private _contentHeight;
902
- private _showScrollbar;
903
- constructor(style?: Partial<Style>, opts?: ScrollViewOptions);
904
- /** Set the total content height (in rows) */
905
- setContentHeight(h: number): void;
906
- /** Get current scroll offset */
907
- get scrollOffset(): number;
908
- /** Scroll by delta rows */
909
- scrollBy(delta: number): void;
910
- /** Scroll to absolute offset */
911
- scrollTo(offset: number): void;
912
- private _clampOffset;
913
- /** Handle keyboard navigation */
914
- onKey(event: KeyEvent): void;
915
- render(screen: Screen): void;
916
- private _renderScrollbar;
917
- protected _renderSelf(_screen: Screen): void;
2464
+ declare class Badge extends Widget {
2465
+ private _text;
2466
+ private _variant;
2467
+ constructor(text: string, style?: Partial<Style>, opts?: BadgeOptions);
2468
+ /** Update the badge text. */
2469
+ setText(text: string): void;
2470
+ /** Get the current badge text. */
2471
+ getText(): string;
2472
+ /** Update the badge variant. */
2473
+ setVariant(variant: BadgeVariant): void;
2474
+ /** Get the current badge variant. */
2475
+ getVariant(): BadgeVariant;
2476
+ protected _renderSelf(screen: Screen): void;
918
2477
  }
919
2478
 
920
- interface CenterOptions {
921
- /** Center horizontally (default: true) */
922
- horizontal?: boolean;
923
- /** Center vertically (default: true) */
924
- vertical?: boolean;
2479
+ interface KbdOptions {
2480
+ color?: Color;
925
2481
  }
926
2482
  /**
927
- * Centercenters a single child widget horizontally and/or vertically.
2483
+ * Kbdan inline label representing a keyboard input.
928
2484
  *
929
- * Computes centering offsets at render time from the child's measured size.
2485
+ * Used for displaying hotkeys or shortcuts (e.g., "Ctrl+C").
2486
+ * Renders an inline block with a distinct background to simulate a key press.
930
2487
  */
931
- declare class Center extends Widget {
932
- private _horizontal;
933
- private _vertical;
934
- constructor(style?: Partial<Style>, opts?: CenterOptions);
935
- protected _renderSelf(_screen: Screen): void;
936
- render(screen: Screen): void;
2488
+ declare class Kbd extends Widget {
2489
+ private _keys;
2490
+ private _opts;
2491
+ constructor(keys: string, style?: Partial<Style>, opts?: KbdOptions);
2492
+ /** Update the kbd keys. */
2493
+ setKeys(keys: string): void;
2494
+ /** Get the current kbd keys. */
2495
+ getKeys(): string;
2496
+ protected _renderSelf(screen: Screen): void;
937
2497
  }
938
2498
 
939
- interface CardOptions {
940
- /** Optional title shown in the top border */
941
- title?: string;
942
- /** Color for the border and title */
2499
+ type TagVariant = 'info' | 'success' | 'warning' | 'error' | 'neutral';
2500
+ interface TagOptions {
2501
+ /** Variant determines border and text color. Default: 'neutral'. */
2502
+ variant?: TagVariant;
2503
+ }
2504
+ /**
2505
+ * Tag — a short inline label with a colored border and no background fill.
2506
+ *
2507
+ * Used for categorical labels such as "typescript", "react", "v2.0".
2508
+ * Renders a bordered box with the text colored by variant but no background.
2509
+ * Uses `caps.unicode` to choose between Unicode box-drawing and ASCII fallback.
2510
+ *
2511
+ * CONSTRUCTOR: (text, style?, opts?)
2512
+ */
2513
+ declare class Tag extends Widget {
2514
+ private _text;
2515
+ private _variant;
2516
+ constructor(text: string, style?: Partial<Style>, opts?: TagOptions);
2517
+ /** Update the tag text. */
2518
+ setText(text: string): void;
2519
+ /** Get the current tag text. */
2520
+ getText(): string;
2521
+ /** Update the tag variant. */
2522
+ setVariant(variant: TagVariant): void;
2523
+ /** Get the current tag variant. */
2524
+ getVariant(): TagVariant;
2525
+ protected _renderSelf(screen: Screen): void;
2526
+ }
2527
+
2528
+ interface PlaceholderOptions {
2529
+ /** Fill character. Default: '░' with ASCII fallback '.' */
2530
+ fillChar?: string;
2531
+ borderColor?: Color;
2532
+ labelColor?: Color;
2533
+ }
2534
+ /**
2535
+ * Placeholder - a labeled stand-in box for prototyping terminal layouts.
2536
+ */
2537
+ declare class Placeholder extends Widget {
2538
+ private _label;
2539
+ private _fillChar?;
2540
+ private _borderColor?;
2541
+ private _labelColor?;
2542
+ constructor(label: string, style?: Partial<Style>, opts?: PlaceholderOptions);
2543
+ setLabel(label: string): void;
2544
+ protected _renderSelf(screen: Screen): void;
2545
+ }
2546
+
2547
+ interface WatermarkOptions {
2548
+ /** Color of the repeated text. Default: brightBlack */
2549
+ color?: Color;
2550
+ /** Diagonal tilt angle in characters. 0 = horizontal rows. Default: 0 */
2551
+ angle?: 0 | 45;
2552
+ }
2553
+ /**
2554
+ * Watermark - fills its area with faint repeating text.
2555
+ */
2556
+ declare class Watermark extends Widget {
2557
+ private _text;
2558
+ private _color;
2559
+ private _angle;
2560
+ constructor(text: string, style?: Partial<Style>, opts?: WatermarkOptions);
2561
+ setText(text: string): void;
2562
+ protected _renderSelf(screen: Screen): void;
2563
+ }
2564
+
2565
+ type BadgePosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
2566
+ interface NotificationBadgeOptions {
2567
+ /** Notification count to display. Default: 0. */
2568
+ count?: number;
2569
+ /** Corner position for the badge. Default: 'top-right'. */
2570
+ position?: BadgePosition;
2571
+ }
2572
+ /**
2573
+ * NotificationBadge - a small count label rendered at a corner position.
2574
+ *
2575
+ * Used for unread counts, alert indicators, and notification overlays.
2576
+ * Renders the count as a compact colored label at one of four corner positions.
2577
+ * Shows "99+" when the count exceeds 99. Renders nothing when count is 0.
2578
+ */
2579
+ declare class NotificationBadge extends Widget {
2580
+ private _count;
2581
+ private _position;
2582
+ constructor(opts?: NotificationBadgeOptions, style?: Partial<Style>);
2583
+ /** Update the notification count. */
2584
+ setCount(count: number): void;
2585
+ /** Get the current notification count. */
2586
+ getCount(): number;
2587
+ /** Update the badge position. */
2588
+ setPosition(position: BadgePosition): void;
2589
+ /** Get the current badge position. */
2590
+ getPosition(): BadgePosition;
2591
+ protected _renderSelf(screen: Screen): void;
2592
+ }
2593
+
2594
+ interface CarouselOptions {
2595
+ loop?: boolean;
2596
+ showDots?: boolean;
2597
+ showArrows?: boolean;
2598
+ }
2599
+ declare class Carousel extends Widget {
2600
+ private _items;
2601
+ private _index;
2602
+ private _opts;
2603
+ constructor(items: string[], style?: Partial<Style>, opts?: CarouselOptions);
2604
+ getIndex(): number;
2605
+ setIndex(index: number): void;
2606
+ next(): void;
2607
+ prev(): void;
2608
+ setItems(items: string[]): void;
2609
+ handleKey(event: KeyEvent): void;
2610
+ protected _renderSelf(screen: Screen): void;
2611
+ }
2612
+
2613
+ interface TooltipOptions {
2614
+ text: string;
2615
+ visible: boolean;
2616
+ }
2617
+ /**
2618
+ * Tooltip — displays contextual help text.
2619
+ *
2620
+ * The widget renders within its own assigned rect.
2621
+ * The parent is responsible for positioning it via updateRect().
2622
+ */
2623
+ declare class Tooltip extends Widget {
2624
+ private _text;
2625
+ private _visible;
2626
+ constructor(options: TooltipOptions, style?: Partial<Style>);
2627
+ protected _renderSelf(screen: Screen): void;
2628
+ setText(text: string): void;
2629
+ getText(): string;
2630
+ setVisible(visible: boolean): void;
2631
+ getVisible(): boolean;
2632
+ }
2633
+
2634
+ interface PanelOptions {
2635
+ /** Required title shown in the top border */
2636
+ title: string;
2637
+ /** Optional color for the border and title */
943
2638
  borderColor?: Color;
944
2639
  }
945
2640
  /**
946
- * Card — a bordered container with an optional title in the top border.
2641
+ * Panel — a labeled container widget.
2642
+ *
2643
+ * A Box with a required title rendered inside the top border line.
2644
+ * Use it as a labeled container for grouping related content.
2645
+ *
2646
+ * Unicode: ╭─ My Panel ──────╮
2647
+ * ASCII: +-- My Panel -----+
2648
+ */
2649
+ declare class Panel extends Widget {
2650
+ private _title;
2651
+ private _borderColor?;
2652
+ constructor(style: Partial<Style> | undefined, opts: PanelOptions);
2653
+ setTitle(title: string): void;
2654
+ protected _renderSelf(screen: Screen): void;
2655
+ }
2656
+
2657
+ interface ClockOptions {
2658
+ showSeconds?: boolean;
2659
+ use24Hour?: boolean;
2660
+ digitColor?: Color;
2661
+ }
2662
+ declare class Clock extends Widget {
2663
+ private _showSeconds;
2664
+ private _use24Hour;
2665
+ private _digits;
2666
+ private _digitColor;
2667
+ private _ampm;
2668
+ private _digitPartLength;
2669
+ constructor(style?: Partial<Style>, opts?: ClockOptions);
2670
+ setTime(time: Date): void;
2671
+ protected _renderSelf(screen: Screen): void;
2672
+ }
2673
+
2674
+ interface LinkOptions {
2675
+ /** The target URL for the OSC 8 hyperlink anchor. */
2676
+ url: string;
2677
+ /** Underline and anchor fallback color object. Default: blue */
2678
+ color?: Color;
2679
+ /** Whether to append the URL visually when terminal capabilities lack unicode/OSC 8 support. Default: true */
2680
+ showUrlFallback?: boolean;
2681
+ }
2682
+ declare class Link extends Widget {
2683
+ private _text;
2684
+ private _url;
2685
+ private _color;
2686
+ private _showUrlFallback;
2687
+ constructor(text: string, style: Partial<Style> | undefined, opts: LinkOptions);
2688
+ setText(text: string): void;
2689
+ setUrl(url: string): void;
2690
+ /**
2691
+ * Helper to safely slice text based on its visible terminal cell width grid blocks
2692
+ */
2693
+ private _sliceByWidth;
2694
+ protected _renderSelf(screen: Screen): void;
2695
+ }
2696
+
2697
+ /**
2698
+ * Represents an individual shortcut item in the shortcut bar.
2699
+ */
2700
+ interface ShortcutItem {
2701
+ /** Keyboard key character/name (e.g. 'F1', 'q', 'ctrl+c') */
2702
+ key: string;
2703
+ /** Labeled explanation (e.g. 'Help', 'Quit') */
2704
+ label: string;
2705
+ /** Optional callback triggered on matching key press */
2706
+ action?: () => void;
2707
+ }
2708
+ /**
2709
+ * Options to configure styling and behavior of the ShortcutBar.
2710
+ */
2711
+ interface ShortcutBarOptions {
2712
+ /** Custom styles for the key (e.g., fg/bg colors). Default: cyan, bold */
2713
+ keyStyle?: Partial<Style>;
2714
+ /** Custom styles for the label text. Default: white */
2715
+ labelStyle?: Partial<Style>;
2716
+ /** Horizontal separator string. Default: ' ' (three spaces) */
2717
+ separator?: string;
2718
+ }
2719
+ /**
2720
+ * ShortcutBar — a horizontal footer bar that displays quick key bindings.
2721
+ * Matches design aesthetics of classic terminal tools (like nano, htop).
2722
+ */
2723
+ declare class ShortcutBar extends Widget {
2724
+ private _items;
2725
+ private _keyStyle;
2726
+ private _labelStyle;
2727
+ private _separator;
2728
+ /**
2729
+ * Creates an instance of ShortcutBar.
2730
+ * @param items Initial list of shortcut items.
2731
+ * @param style Partial widget style object.
2732
+ * @param opts Custom options for key styling, label styling, and separator.
2733
+ */
2734
+ constructor(items?: ShortcutItem[], style?: Partial<Style>, opts?: ShortcutBarOptions);
2735
+ /**
2736
+ * Sets or replaces the current list of shortcut items.
2737
+ * @param items The new list of shortcut items.
2738
+ */
2739
+ setItems(items: ShortcutItem[]): void;
2740
+ /**
2741
+ * Retrieves the current list of shortcut items.
2742
+ * @returns The list of shortcut items.
2743
+ */
2744
+ getItems(): ShortcutItem[];
2745
+ /**
2746
+ * Updates the horizontal separator string printed between shortcut segments.
2747
+ * @param separator The new separator string.
2748
+ */
2749
+ setSeparator(separator: string): void;
2750
+ /**
2751
+ * Retrieves the current horizontal separator string.
2752
+ * @returns The separator string.
2753
+ */
2754
+ getSeparator(): string;
2755
+ /**
2756
+ * Updates the custom styles applied to keys and label segments.
2757
+ * @param keyStyle Partial styling to apply to keys.
2758
+ * @param labelStyle Partial styling to apply to labels.
2759
+ */
2760
+ setStyles(keyStyle?: Partial<Style>, labelStyle?: Partial<Style>): void;
2761
+ /**
2762
+ * Handles keyboard keypress events. Triggers the action callback of the
2763
+ * shortcut item matching the pressed key (case-insensitively).
2764
+ * @param event The key event triggered by the user.
2765
+ */
2766
+ handleKey(event: KeyEvent): void;
2767
+ protected _renderSelf(screen: Screen): void;
2768
+ }
2769
+
2770
+ interface AccordionSection {
2771
+ /** Section header title */
2772
+ title: string;
2773
+ /** Section body content (may contain newlines) */
2774
+ content: string;
2775
+ }
2776
+ interface AccordionOptions {
2777
+ /** Allow multiple sections open at once. Default: false */
2778
+ multiple?: boolean;
2779
+ /** Index of the initially open section. Default: 0 */
2780
+ openIndex?: number;
2781
+ /** Expand indicator char. Default: '▶' (or '>' in ASCII) */
2782
+ expandChar?: string;
2783
+ /** Collapse indicator char. Default: '▼' (or 'v' in ASCII) */
2784
+ collapseChar?: string;
2785
+ /** Callback fired when a section is toggled */
2786
+ onToggle?: (index: number, open: boolean) => void;
2787
+ }
2788
+ /**
2789
+ * Accordion — a group of collapsible sections.
947
2790
  *
948
- * Like a Box with border + padding, but supports embedding a title string
949
- * directly in the top border line.
2791
+ * Renders each section as:
2792
+ * Row 0: [indicator] [title]
2793
+ * Rows 1+: content lines indented by 2 spaces (if section is open)
2794
+ *
2795
+ * Press Enter or Space to toggle the focused section.
2796
+ * Press up/down arrow keys to move between sections.
2797
+ *
2798
+ * @example
2799
+ * const accordion = new Accordion([
2800
+ * { title: 'System Info', content: 'CPU: 45%\nRAM: 2.1 GB' },
2801
+ * { title: 'Network', content: 'eth0: 192.168.1.1' },
2802
+ * ]);
950
2803
  */
951
- declare class Card extends Widget {
952
- private _title;
953
- private _borderColor?;
954
- constructor(style?: Partial<Style>, opts?: CardOptions);
955
- setTitle(title: string): void;
2804
+ declare class Accordion extends Widget {
2805
+ private _sections;
2806
+ private _openSet;
2807
+ private _multiple;
2808
+ private _expandChar;
2809
+ private _collapseChar;
2810
+ private _onToggle?;
2811
+ private _focusedIndex;
2812
+ constructor(sections: AccordionSection[], style?: Partial<Style>, opts?: AccordionOptions);
2813
+ /** Open a section by index. No-op if already open or index out of bounds. */
2814
+ open(index: number): void;
2815
+ /** Close a section by index. No-op if already closed. */
2816
+ close(index: number): void;
2817
+ /** Toggle a section open or closed by index. */
2818
+ toggle(index: number): void;
2819
+ /** Returns true if the section at the given index is open. */
2820
+ isOpen(index: number): boolean;
2821
+ /** Returns the index of the currently keyboard-focused section. */
2822
+ getFocusedIndex(): number;
2823
+ /** Replace all sections and reset open/focus state. */
2824
+ setSections(sections: AccordionSection[]): void;
2825
+ /**
2826
+ * Handle a key event. Call this from your app's key-routing logic
2827
+ * when this widget is focused.
2828
+ */
2829
+ handleKey(event: KeyEvent): void;
2830
+ /** Render all sections with their open/closed state. */
956
2831
  protected _renderSelf(screen: Screen): void;
2832
+ /** Recalculate total height based on open sections. */
2833
+ private _updateHeight;
957
2834
  }
958
2835
 
959
- interface ColumnsOptions {
960
- /** Gap between columns in cells (default: 1) */
961
- gap?: number;
2836
+ type StepStatus = 'completed' | 'active' | 'pending';
2837
+ type StepperOrientation = 'horizontal' | 'vertical';
2838
+ interface StepperStep {
2839
+ /** Step label */
2840
+ label: string;
2841
+ /** Step status. Default: 'pending' */
2842
+ status?: StepStatus;
2843
+ }
2844
+ interface StepperOptions {
2845
+ /** Layout direction. Default: 'horizontal' */
2846
+ orientation?: StepperOrientation;
2847
+ /** Color for active step. Default: cyan */
2848
+ activeColor?: Color;
2849
+ /** Color for completed step. Default: green */
2850
+ completedColor?: Color;
2851
+ /** Color for pending step. Default: white */
2852
+ pendingColor?: Color;
962
2853
  }
963
2854
  /**
964
- * Columnssplits available width evenly across child widgets.
2855
+ * Stepperrenders a sequence of steps with status indicators.
965
2856
  *
966
- * Children are laid out side-by-side with equal flex-grow.
967
- * Internally uses a flex-row Box; the addChild override applies
968
- * flexGrow:1 to each child so the reconciler's generic loop works.
2857
+ * Horizontal example:
2858
+ * Setup ──── Config ──── Review ──── ○ Done
2859
+ *
2860
+ * Vertical example:
2861
+ * ✓ Setup
2862
+ * │
2863
+ * ● Config
2864
+ * │
2865
+ * ○ Review
2866
+ *
2867
+ * Icons: ✓/+ (completed), ●/* (active), ○/- (pending)
2868
+ * Unicode fallback via caps.unicode.
969
2869
  */
970
- declare class Columns extends Widget {
971
- private _inner;
972
- constructor(style?: Partial<Style>, opts?: ColumnsOptions);
973
- addChild(widget: Widget): void;
974
- removeChild(widget: Widget): void;
975
- clearChildren(): void;
976
- protected _renderSelf(_screen: Screen): void;
2870
+ declare class Stepper extends Widget {
2871
+ private _steps;
2872
+ private _orientation;
2873
+ private _activeColor;
2874
+ private _completedColor;
2875
+ private _pendingColor;
2876
+ constructor(steps: StepperStep[], style?: Partial<Style>, opts?: StepperOptions);
2877
+ /** Replace all steps. Clones input to prevent external mutation. */
2878
+ setSteps(steps: StepperStep[]): void;
2879
+ /** Get current steps. Returns copies to prevent external mutation. */
2880
+ getSteps(): StepperStep[];
2881
+ /** Update the status of a single step by index. */
2882
+ setStepStatus(index: number, status: StepStatus): void;
2883
+ /** Advance the active step to the next one. */
2884
+ nextStep(): void;
2885
+ /** Move the active step to the previous one. */
2886
+ prevStep(): void;
2887
+ /** Render all steps with connectors and status icons. */
2888
+ protected _renderSelf(screen: Screen): void;
2889
+ /** Render steps left-to-right on a single row. */
2890
+ private _renderHorizontal;
2891
+ /** Render steps top-to-bottom with vertical connectors. */
2892
+ private _renderVertical;
2893
+ /** Returns the icon, color, and text attributes for a given status. */
2894
+ private _stepStyle;
977
2895
  }
978
2896
 
979
- interface ProgressBarOptions {
980
- /** Current value (0–1) */
981
- value?: number;
982
- /** Character for the filled portion */
983
- fillChar?: string;
984
- /** Character for the empty portion */
985
- emptyChar?: string;
986
- /** Color of the filled portion */
987
- fillColor?: Color;
988
- /** Show percentage label */
989
- showLabel?: boolean;
990
- /** Label format: 'percent' | 'fraction' | 'custom' */
991
- labelFormat?: 'percent' | 'fraction';
992
- /** Total for fraction display */
993
- total?: number;
2897
+ interface QRCodePatternOptions {
2898
+ darkChar?: string;
2899
+ lightChar?: string;
2900
+ showText?: boolean;
2901
+ }
2902
+ interface QRCodeOptions extends QRCodePatternOptions {
2903
+ errorCorrectionLevel?: 'L' | 'M' | 'Q' | 'H';
2904
+ }
2905
+ declare class QRCodePattern extends Widget {
2906
+ private data;
2907
+ private opts;
2908
+ constructor(data: string, style?: Partial<Style>, opts?: QRCodePatternOptions);
2909
+ setData(data: string): void;
2910
+ private isFinder;
2911
+ private renderFinder;
2912
+ protected _renderSelf(screen: Screen): void;
2913
+ }
2914
+ declare const QRCode: typeof QRCodePattern;
2915
+
2916
+ interface StackOptions {
2917
+ /** Which child is on top (receives key events). Default: last child */
2918
+ activeIndex?: number;
994
2919
  }
995
2920
  /**
996
- * ProgressBarhorizontal progress indicator.
2921
+ * Stacka widget that layers children on top of each other.
997
2922
  *
998
- * Supports:
999
- * - Configurable fill/empty characters
1000
- * - Custom fill color
1001
- * - Percentage or fraction label
1002
- * - Smooth animation-ready value changes
2923
+ * All children share the same rect (the Stack's bounds).
2924
+ * Children render in array order: index 0 is bottom, last index is top.
1003
2925
  */
1004
- declare class ProgressBar extends Widget {
1005
- private _value;
1006
- private _fillChar;
1007
- private _emptyChar;
1008
- private _fillColor;
1009
- private _showLabel;
1010
- private _labelFormat;
1011
- private _total;
1012
- constructor(style?: Partial<Style>, options?: ProgressBarOptions);
1013
- /** Set progress value (0–1) */
1014
- setValue(value: number): void;
1015
- get value(): number;
2926
+ declare class Stack extends Widget {
2927
+ private _activeIndex;
2928
+ constructor(children: Widget[], style?: Partial<Style>, opts?: StackOptions);
2929
+ /**
2930
+ * Replace all children with a new array.
2931
+ */
2932
+ setChildren(children: Widget[]): void;
2933
+ /**
2934
+ * Set which child is active (on top).
2935
+ */
2936
+ setActiveIndex(index: number): void;
2937
+ /**
2938
+ * Get the currently active child index.
2939
+ */
2940
+ getActiveIndex(): number;
2941
+ /**
2942
+ * Required abstract method implementation.
2943
+ * Stack is a pure layout container — no self-rendering needed.
2944
+ */
2945
+ protected _renderSelf(_screen: Screen): void;
2946
+ }
2947
+
2948
+ interface ScatterPoint {
2949
+ x: number;
2950
+ y: number;
2951
+ color?: Color;
2952
+ }
2953
+ interface ScatterPlotOptions {
2954
+ /** X axis label */
2955
+ xLabel?: string;
2956
+ /** Y axis label */
2957
+ yLabel?: string;
2958
+ /** Point marker. Default: '•' with ASCII fallback '.' */
2959
+ marker?: string;
2960
+ pointColor?: Color;
2961
+ }
2962
+ declare class ScatterPlot extends Widget {
2963
+ private points;
2964
+ private options;
2965
+ constructor(style?: Partial<Style>, opts?: ScatterPlotOptions);
2966
+ setData(points: ScatterPoint[]): void;
1016
2967
  protected _renderSelf(screen: Screen): void;
1017
2968
  }
1018
2969
 
1019
- /**
1020
- * A single progress item in MultiProgress
1021
- */
1022
- interface ProgressItem {
2970
+ interface RadarSeries {
1023
2971
  label: string;
1024
- value: number;
2972
+ /** One value per axis, range [0, 1] */
2973
+ values: number[];
1025
2974
  color?: Color;
1026
2975
  }
2976
+ interface RadarChartOptions {
2977
+ /** Axis names, one per spoke */
2978
+ axes?: string[];
2979
+ lineColor?: Color;
2980
+ }
2981
+ declare class RadarChart extends Widget {
2982
+ private series;
2983
+ private options;
2984
+ constructor(style?: Partial<Style>, opts?: RadarChartOptions);
2985
+ setSeries(series: RadarSeries[]): void;
2986
+ protected _renderSelf(screen: Screen): void;
2987
+ private drawLine;
2988
+ private renderLabels;
2989
+ }
2990
+
2991
+ interface StatOptions {
2992
+ delta?: number;
2993
+ valueColor?: Color;
2994
+ }
2995
+ declare class Stat extends Widget {
2996
+ private _label;
2997
+ private _value;
2998
+ private _delta;
2999
+ private _valueColor;
3000
+ constructor(label: string, value: string, style?: Partial<Style>, opts?: StatOptions);
3001
+ setValue(value: string): void;
3002
+ setDelta(delta: number | undefined): void;
3003
+ protected _renderSelf(screen: Screen): void;
3004
+ }
3005
+
3006
+ interface Candle {
3007
+ open: number;
3008
+ high: number;
3009
+ low: number;
3010
+ close: number;
3011
+ }
3012
+ interface CandlestickChartOptions {
3013
+ /** Color for bullish (close > open) candles */
3014
+ upColor?: Color;
3015
+ /** Color for bearish (close < open) candles */
3016
+ downColor?: Color;
3017
+ /** Color for the wick (high/low lines) */
3018
+ wickColor?: Color;
3019
+ }
1027
3020
  /**
1028
- * Options for MultiProgress widget
3021
+ * CandlestickChart renders OHLC candle data as a terminal chart.
3022
+ *
3023
+ * Each candle occupies one column. The body shows open/close range,
3024
+ * wicks extend to high/low. Bullish candles use upColor, bearish use downColor.
1029
3025
  */
1030
- interface MultiProgressOptions {
1031
- items: ProgressItem[];
1032
- labelWidth?: number;
1033
- showValues?: boolean;
3026
+ declare class CandlestickChart extends Widget {
3027
+ private _candles;
3028
+ private _upColor;
3029
+ private _downColor;
3030
+ private _wickColor;
3031
+ constructor(style?: Partial<Style>, opts?: CandlestickChartOptions);
3032
+ setData(candles: Candle[]): void;
3033
+ protected _renderSelf(screen: Screen): void;
3034
+ }
3035
+
3036
+ interface TimerOptions {
3037
+ /** Duration to count down from in milliseconds. */
3038
+ duration: number;
3039
+ /** Tick interval in milliseconds. Default: 1000. */
3040
+ interval?: number;
1034
3041
  }
1035
3042
  /**
1036
- * MultiProgressstacks multiple labeled progress bars in a vertical list.
3043
+ * Timercounts down from a duration to zero.
1037
3044
  *
1038
- * Each item renders on its own row with a label, bar, and optional percentage.
1039
- *
1040
- * Supports:
1041
- * - Multiple items with individual colors
1042
- * - Custom label column width
1043
- * - Optional percentage display
1044
- * - Smooth animation-ready value changes
3045
+ * - Accepts `duration` in milliseconds.
3046
+ * - Exposes `start()`, `stop()`, and `reset()` methods.
3047
+ * - Fires `onComplete()` callback when it reaches zero.
3048
+ * - Renders as `MM:SS` for durations < 1 hour, `HH:MM:SS` for longer.
3049
+ * - Calls `this.markDirty()` on every tick so the render loop re-paints.
3050
+ * - Clears the interval on `stop()` and in `destroy()` to prevent leaks.
1045
3051
  */
1046
- declare class MultiProgress extends Widget {
1047
- private _items;
1048
- private _labelWidth;
1049
- private _showValues;
1050
- constructor(options: MultiProgressOptions, style?: Partial<Style>);
3052
+ declare class Timer extends Widget {
3053
+ /** Duration to count down from (ms). */
3054
+ private _duration;
3055
+ /** Tick interval in ms (default 1000). */
3056
+ private _interval;
3057
+ /** Remaining time in ms. */
3058
+ private _remaining;
3059
+ /** Whether the timer is currently running. */
3060
+ private _running;
3061
+ /** Internal setInterval handle. */
3062
+ private _intervalId;
1051
3063
  /**
1052
- * Replace all items and mark dirty
3064
+ * Called when the countdown reaches zero.
3065
+ * Assign a function to this property to receive the event.
3066
+ *
3067
+ * @example
3068
+ * timer.onComplete = () => {};
1053
3069
  */
1054
- setItems(items: ProgressItem[]): void;
3070
+ onComplete: (() => void) | undefined;
3071
+ constructor(options: TimerOptions, style?: Partial<Style>);
3072
+ /** Start (or resume) the countdown. No-op if already running. */
3073
+ start(): void;
3074
+ /** Pause the countdown. No-op if already stopped. */
3075
+ stop(): void;
1055
3076
  /**
1056
- * Update a single item's value
3077
+ * Reset the remaining time back to the original duration and stop any
3078
+ * running countdown.
1057
3079
  */
1058
- updateItem(index: number, value: number): void;
3080
+ reset(): void;
3081
+ /** Returns `true` when the countdown has reached zero. */
3082
+ isComplete(): boolean;
3083
+ /** Returns the remaining time in milliseconds. */
3084
+ getRemaining(): number;
3085
+ /**
3086
+ * Release all resources held by this widget.
3087
+ * Call this when the widget is no longer needed to avoid timer leaks.
3088
+ */
3089
+ destroy(): void;
3090
+ /** Stop the interval when the widget is unmounted. */
3091
+ unmount(): void;
3092
+ /** Called on each interval tick. */
3093
+ private _tick;
3094
+ /** Safely clear the internal interval. */
3095
+ private _clearInterval;
3096
+ /**
3097
+ * Format milliseconds as `MM:SS` or `HH:MM:SS`.
3098
+ *
3099
+ * Chooses `HH:MM:SS` when the original duration is >= 1 hour (3600000 ms).
3100
+ */
3101
+ private _format;
1059
3102
  protected _renderSelf(screen: Screen): void;
1060
3103
  }
1061
3104
 
1062
- /**
1063
- * Built-in spinner frame sets.
1064
- */
1065
- declare const SPINNER_FRAMES: Record<string, {
1066
- frames: string[];
1067
- interval: number;
1068
- }>;
1069
- interface SpinnerOptions {
1070
- /** Spinner preset name or custom frames */
1071
- spinner?: string | {
1072
- frames: string[];
1073
- interval: number;
1074
- };
1075
- /** Text label displayed after the spinner */
1076
- label?: string;
1077
- /** Color for the spinner frames */
1078
- color?: Color;
3105
+ interface StopwatchOptions {
3106
+ /** Tick interval in milliseconds. Default: 10 (for centisecond precision). */
3107
+ interval?: number;
1079
3108
  }
1080
3109
  /**
1081
- * Spinneranimated loading indicator.
3110
+ * Stopwatchcounts up from zero, displaying elapsed time.
1082
3111
  *
1083
- * Supports:
1084
- * - 8 built-in spinner presets
1085
- * - Custom frame sequences
1086
- * - Configurable color and label
1087
- * - Automatic frame advancement via tick()
3112
+ * - Exposes `start()`, `stop()`, and `reset()` methods.
3113
+ * - Renders elapsed time as `MM:SS.ms` (e.g. `01:23.45`).
3114
+ * - Calls `this.markDirty()` on every tick so the render loop re-paints.
3115
+ * - Clears the interval on `stop()` and in `destroy()` to prevent leaks.
1088
3116
  */
1089
- declare class Spinner extends Widget {
1090
- private _frames;
1091
- private _interval;
1092
- private _frameIndex;
1093
- private _label;
1094
- private _color;
1095
- private _lastTick;
3117
+ declare class Stopwatch extends Widget {
3118
+ /** Accumulated elapsed time in ms (from prior start/stop cycles). */
1096
3119
  private _elapsed;
1097
- private _timerUnsub?;
1098
- constructor(style?: Partial<Style>, options?: SpinnerOptions);
1099
- /** Update the spinner label */
1100
- setLabel(label: string): void;
3120
+ /** Timestamp (Date.now()) when the current run started, or undefined if stopped. */
3121
+ private _startTime;
3122
+ /** Tick interval in ms (default 10). */
3123
+ private _interval;
3124
+ /** Whether the stopwatch is currently running. */
3125
+ private _running;
3126
+ /** Internal setInterval handle. */
3127
+ private _intervalId;
3128
+ constructor(options?: StopwatchOptions, style?: Partial<Style>);
3129
+ /** Start (or resume) the stopwatch. No-op if already running. */
3130
+ start(): void;
3131
+ /** Pause the stopwatch. No-op if already stopped. */
3132
+ stop(): void;
3133
+ /** Reset elapsed time to zero and stop the stopwatch. */
3134
+ reset(): void;
3135
+ /** Returns the total elapsed milliseconds (including current run). */
3136
+ getElapsed(): number;
3137
+ /** Returns `true` when the stopwatch is currently running. */
3138
+ isRunning(): boolean;
1101
3139
  /**
1102
- * Advance the spinner frame based on elapsed time.
1103
- * Call this with a delta (ms) from the render loop.
3140
+ * Release all resources held by this widget.
3141
+ * Call this when the widget is no longer needed to avoid timer leaks.
1104
3142
  */
1105
- tick(deltaMs: number): void;
1106
- /** Lifecycle: start the frame-advance timer (only when motion is enabled). */
1107
- mount(): void;
1108
- /** Lifecycle: stop the frame-advance timer. */
3143
+ destroy(): void;
3144
+ /** Stop the interval when the widget is unmounted. */
1109
3145
  unmount(): void;
3146
+ /** Called on each interval tick. */
3147
+ private _tick;
3148
+ /** Safely clear the internal interval. */
3149
+ private _clearInterval;
3150
+ /**
3151
+ * Format milliseconds as `MM:SS.ms`.
3152
+ *
3153
+ * The `.ms` portion shows centiseconds (hundredths of a second).
3154
+ * Example: 75423 ms → `01:15.42`
3155
+ */
3156
+ private _format;
1110
3157
  protected _renderSelf(screen: Screen): void;
3158
+ setInterval(interval: number): void;
3159
+ getInterval(): number;
1111
3160
  }
1112
3161
 
1113
- type ScrollbarOrientation = 'verticalRight' | 'verticalLeft' | 'horizontalBottom' | 'horizontalTop';
1114
- interface ScrollbarOptions {
1115
- /** Total number of content items. */
1116
- contentLength: number;
1117
- /** Number of items visible in the viewport. */
1118
- viewportLength: number;
1119
- /** Current scroll position (0-based). */
1120
- position?: number;
1121
- /** Scrollbar orientation. Default: 'verticalRight'. */
1122
- orientation?: ScrollbarOrientation;
1123
- /** Color of the thumb. */
1124
- thumbColor?: Color;
1125
- /** Color of the track. */
1126
- trackColor?: Color;
1127
- /** Show begin/end arrow symbols. Default: true. */
1128
- showArrows?: boolean;
3162
+ interface OrderedListItem {
3163
+ text: string;
3164
+ /** Nested items */
3165
+ children?: OrderedListItem[];
1129
3166
  }
1130
- declare class Scrollbar extends Widget {
1131
- private _contentLength;
1132
- private _viewportLength;
1133
- private _position;
1134
- private _orientation;
1135
- private _thumbColor;
1136
- private _trackColor;
1137
- private _showArrows;
1138
- constructor(style: Partial<Style> | undefined, opts: ScrollbarOptions);
1139
- setPosition(position: number): void;
1140
- setContentLength(length: number): void;
1141
- setViewportLength(length: number): void;
3167
+ interface OrderedListOptions {
3168
+ /** Indent width per level. Default: 3 */
3169
+ indent?: number;
3170
+ /** Numbering style: '1.' for arabic, 'a.' for lowercase alpha, 'i.' for lowercase roman. Default: '1.' */
3171
+ style?: '1.' | 'a.' | 'i.';
3172
+ }
3173
+ /**
3174
+ * OrderedList — renders a numbered list with optional nesting.
3175
+ */
3176
+ declare class OrderedList extends Widget {
3177
+ private _items;
3178
+ private _opts;
3179
+ constructor(items: OrderedListItem[], style?: Partial<Style>, opts?: OrderedListOptions);
3180
+ setItems(items: OrderedListItem[]): void;
3181
+ protected _renderSelf(screen: Screen): void;
3182
+ }
3183
+
3184
+ interface TypewriterOptions {
3185
+ /** Characters revealed per tick. Must be a positive integer. Default: 1 */
3186
+ speed?: number;
3187
+ /** Cursor glyph drawn at the reveal head. Default: caps-aware block. */
3188
+ cursor?: string;
3189
+ }
3190
+ /**
3191
+ * Reveals static text character by character.
3192
+ *
3193
+ * The host is responsible for calling `tick()` at whatever cadence it likes
3194
+ * (timer, animation loop, etc.). No internal timer is used.
3195
+ *
3196
+ * @example
3197
+ * ```ts
3198
+ * const tw = new Typewriter('hello world');
3199
+ * const interval = setInterval(() => {
3200
+ * tw.tick();
3201
+ * screen.render();
3202
+ * }, 80);
3203
+ * ```
3204
+ */
3205
+ declare class Typewriter extends Widget {
3206
+ private _text;
3207
+ private _revealed;
3208
+ private _speed;
3209
+ private _cursor;
3210
+ constructor(text: string, style?: Partial<Style>, opts?: TypewriterOptions);
3211
+ /** Advance the reveal head by `speed` characters. No-op once fully revealed. */
3212
+ tick(): void;
3213
+ /** Return the reveal counter to zero. */
3214
+ reset(): void;
3215
+ /** Replace the text and reset the reveal counter. */
3216
+ setText(text: string): void;
3217
+ protected _renderSelf(screen: Screen): void;
3218
+ }
3219
+
3220
+ type TimelineStatus = 'done' | 'active' | 'pending';
3221
+ interface TimelineItem {
3222
+ title: string;
3223
+ time?: string;
3224
+ status?: TimelineStatus;
3225
+ }
3226
+ /**
3227
+ * Timeline — renders a vertical list of timeline items.
3228
+ *
3229
+ * Each item gets a connector (├─ / └─) and a status icon:
3230
+ * ● active (cyan/bold), ✓ done (green), ○ pending (dim).
3231
+ */
3232
+ declare class Timeline extends Widget {
3233
+ private _items;
3234
+ constructor(items: TimelineItem[], style?: Partial<Style>);
3235
+ setItems(items: TimelineItem[]): void;
3236
+ protected _renderSelf(screen: Screen): void;
3237
+ }
3238
+
3239
+ type MarqueeDirection = 'left' | 'right';
3240
+ interface MarqueeOptions {
3241
+ direction?: MarqueeDirection;
3242
+ speed?: number;
3243
+ gap?: number;
3244
+ }
3245
+ declare class Marquee extends Widget {
3246
+ private _text;
3247
+ private _direction;
3248
+ private _speed;
3249
+ private _gap;
3250
+ private _offset;
3251
+ constructor(text: string, style?: Partial<Style>, opts?: MarqueeOptions);
3252
+ tick(): void;
3253
+ setText(text: string): void;
3254
+ protected _renderSelf(screen: Screen): void;
3255
+ }
3256
+
3257
+ type SortDirection = 'asc' | 'desc' | 'none';
3258
+ interface DataGridColumn extends TableColumn {
3259
+ /** Whether the column can be sorted. Default: true. */
3260
+ sortable?: boolean;
3261
+ }
3262
+ type DataGridRow = TableRow;
3263
+ interface DataGridOptions extends TableOptions {
3264
+ /** Callback fired when sort changes. */
3265
+ onSort?: (key: string, direction: SortDirection) => void;
3266
+ /** Callback fired when the filter changes. */
3267
+ onFilter?: (filter: string) => void;
3268
+ }
3269
+ declare class DataGrid extends Table {
3270
+ private _onSort?;
3271
+ private _onFilter?;
3272
+ private _sortKey;
3273
+ private _sortDir;
3274
+ private _filter;
3275
+ private _filterOpen;
3276
+ private _selectedCol;
3277
+ focusable: boolean;
3278
+ constructor(columns: DataGridColumn[], rows: DataGridRow[], style?: Partial<Style>, options?: DataGridOptions);
3279
+ get sortKey(): string | null;
3280
+ get sortDirection(): SortDirection;
3281
+ get filter(): string;
3282
+ get filterOpen(): boolean;
3283
+ get selectedColumn(): number;
3284
+ setSelectedColumn(col: number): void;
3285
+ setFilter(filter: string): void;
3286
+ clearFilter(): void;
3287
+ cycleSort(): void;
3288
+ handleKey(event: KeyEvent): void;
1142
3289
  protected _renderSelf(screen: Screen): void;
3290
+ private _getVisibleRows;
1143
3291
  }
1144
3292
 
1145
- interface SkeletonOptions {
1146
- /** Animation style: 'pulse' alternates two chars; 'shimmer' scrolls a highlight band */
1147
- variant?: 'pulse' | 'shimmer';
1148
- /** Animation interval in ms (default: 600) */
1149
- intervalMs?: number;
1150
- /** Characters for pulse: [dim, bright]. Default: ['░', '▒'] (ASCII fallback: ['-', '#']) */
1151
- chars?: [string, string];
1152
- /** Color for the bright state (optional) */
1153
- color?: Color;
3293
+ declare class ScrollAcceleration {
3294
+ private lastScrollTime;
3295
+ getMultiplier(now: number): number;
3296
+ reset(): void;
1154
3297
  }
1155
- /**
1156
- * Skeleton — animated loading placeholder.
1157
- *
1158
- * Supports:
1159
- * - 'pulse' variant: alternates between dim and bright fill characters
1160
- * - 'shimmer' variant: scrolls a bright band (~20% width) across the widget
1161
- * - Automatic ASCII fallback when unicode is unavailable
1162
- * - No animation when caps.motion is false (static frame 0)
1163
- */
1164
- declare class Skeleton extends Widget {
1165
- private _frame;
1166
- private _shimmerPos;
1167
- private _unsub?;
1168
- private _chars;
1169
- private _variant;
1170
- private _intervalMs;
1171
- constructor(style?: Partial<Style>, options?: SkeletonOptions);
1172
- unmount(): void;
3298
+
3299
+ interface PieSlice {
3300
+ label: string;
3301
+ value: number;
3302
+ color: string | Color;
3303
+ }
3304
+ interface PieChartOptions {
3305
+ slices?: PieSlice[];
3306
+ style?: Partial<Style>;
3307
+ showLegend?: boolean;
3308
+ }
3309
+ declare class PieChart extends Widget {
3310
+ private _slices;
3311
+ private _showLegend;
3312
+ constructor(options?: PieChartOptions);
3313
+ get slices(): ReadonlyArray<PieSlice>;
3314
+ setSlices(slices: PieSlice[]): void;
1173
3315
  protected _renderSelf(screen: Screen): void;
3316
+ private _renderPie;
3317
+ private _findSliceAt;
3318
+ private _renderBars;
3319
+ private _renderLegend;
3320
+ private _total;
3321
+ private _colorOf;
1174
3322
  }
1175
3323
 
1176
- type StatusVariant = 'success' | 'error' | 'warning' | 'info';
1177
- interface StatusMessageOptions {
1178
- /** Variant determines icon and color */
1179
- variant?: StatusVariant;
1180
- /** Override the icon character */
1181
- icon?: string;
3324
+ interface BrailleCanvasOptions {
3325
+ width: number;
3326
+ height: number;
3327
+ color?: Color;
1182
3328
  }
1183
- /**
1184
- * StatusMessage — a single-line status indicator.
1185
- *
1186
- * Renders an icon (✓/✗/⚠/ℹ) followed by a message, colored by variant.
1187
- */
1188
- declare class StatusMessage extends Widget {
1189
- private _message;
1190
- private _variant;
1191
- private _icon?;
1192
- constructor(message: string, style?: Partial<Style>, opts?: StatusMessageOptions);
1193
- setMessage(message: string): void;
1194
- setVariant(variant: StatusVariant): void;
3329
+ declare class BrailleCanvas extends Widget {
3330
+ private _canvasWidth;
3331
+ private _canvasHeight;
3332
+ private _pixels;
3333
+ private _color?;
3334
+ constructor(opts: BrailleCanvasOptions, style?: Partial<Style>);
3335
+ drawPixel(x: number, y: number): void;
3336
+ drawLine(x0: number, y0: number, x1: number, y1: number): void;
1195
3337
  protected _renderSelf(screen: Screen): void;
1196
3338
  }
1197
3339
 
1198
- interface BannerOptions {
1199
- /** Variant determines border color */
1200
- variant?: StatusVariant;
1201
- /** Title displayed on first line in bold */
1202
- title?: string;
1203
- /** Body text */
1204
- body?: string;
3340
+ interface ProgressColumnProps {
3341
+ maxRefresh?: number;
3342
+ }
3343
+ interface TextColumnProps extends ProgressColumnProps {
3344
+ template?: string;
3345
+ }
3346
+ type ProgressColumnRenderer = (task: Record<string, unknown>) => string;
3347
+ interface ProgressColumnDefinition {
3348
+ kind: 'bar' | 'text' | 'time' | 'speed' | 'percentage';
3349
+ maxRefresh?: number;
3350
+ template?: string;
3351
+ render?: ProgressColumnRenderer;
3352
+ }
3353
+ declare function BarColumn(props?: ProgressColumnProps): ProgressColumnDefinition;
3354
+ declare function TextColumn(props?: TextColumnProps): ProgressColumnDefinition;
3355
+ declare function TimeColumn(props?: ProgressColumnProps): ProgressColumnDefinition;
3356
+ declare function SpeedColumn(props?: ProgressColumnProps): ProgressColumnDefinition;
3357
+ declare function PercentageColumn(props?: ProgressColumnProps): ProgressColumnDefinition;
3358
+
3359
+ interface ProgressTask {
3360
+ label?: string;
3361
+ value?: number;
3362
+ status?: string;
3363
+ [key: string]: unknown;
1205
3364
  }
1206
- /**
1207
- * Banner — full-width alert with title and body text.
1208
- *
1209
- * Shows a bordered box with a bold title line and body text,
1210
- * colored according to variant. The border is drawn manually
1211
- * to use the variant color.
1212
- */
1213
- declare class Banner extends Widget {
1214
- private _variant;
1215
- private _title;
1216
- private _body;
1217
- constructor(style?: Partial<Style>, opts?: BannerOptions);
1218
- setTitle(title: string): void;
1219
- setBody(body: string): void;
1220
- setVariant(variant: StatusVariant): void;
3365
+ interface ProgressProps {
3366
+ tasks?: ProgressTask[];
3367
+ columns?: ProgressColumnDefinition[];
3368
+ children?: unknown;
3369
+ }
3370
+ declare class Progress extends Widget {
3371
+ private _tasks;
3372
+ private _columns;
3373
+ private _lastRefreshTimes;
3374
+ private _columnCache;
3375
+ private _resolveColumns;
3376
+ constructor(props?: ProgressProps, style?: Partial<Style>);
3377
+ get tasks(): ProgressTask[];
3378
+ get columns(): ProgressColumnDefinition[];
3379
+ setTasks(tasks: ProgressTask[]): void;
1221
3380
  protected _renderSelf(screen: Screen): void;
1222
3381
  }
1223
3382
 
1224
- interface KeyValuePair {
1225
- key: string;
1226
- value: string;
3383
+ declare class Highlight extends Box {
3384
+ constructor(text: string, query: string | RegExp, style?: Partial<Style>);
3385
+ private _buildSegments;
3386
+ update(text: string, query: string | RegExp, style?: Partial<Style>): void;
1227
3387
  }
1228
- interface KeyValueOptions {
1229
- /** Separator between key and value (default: ': ') */
1230
- separator?: string;
1231
- /** Color for keys */
1232
- keyColor?: _termuijs_core.Color;
1233
- /** Color for values */
1234
- valueColor?: _termuijs_core.Color;
3388
+
3389
+ interface ThinkingBlockOptions {
3390
+ width?: number;
3391
+ thinking?: string;
1235
3392
  }
1236
- /**
1237
- * KeyValue — aligned key: value pairs.
1238
- *
1239
- * Keys are right-aligned to the width of the longest key.
1240
- * Values follow after the separator.
1241
- */
1242
- declare class KeyValue extends Widget {
1243
- private _pairs;
1244
- private _separator;
1245
- private _keyColor?;
1246
- private _valueColor?;
1247
- constructor(pairs: Array<KeyValuePair> | Record<string, string>, style?: Partial<Style>, opts?: KeyValueOptions);
1248
- setPairs(pairs: Array<KeyValuePair> | Record<string, string>): void;
3393
+ declare class ThinkingBlock extends Widget {
3394
+ private _text;
3395
+ private _expanded;
3396
+ private _streaming;
3397
+ private _dots;
3398
+ private _timerUnsub?;
3399
+ constructor(options?: ThinkingBlockOptions, style?: Partial<Style>);
3400
+ appendText(chunk: string): void;
3401
+ setStreaming(streaming: boolean): void;
3402
+ toggle(): void;
3403
+ handleKey(event: KeyEvent): void;
3404
+ mount(): void;
3405
+ unmount(): void;
1249
3406
  protected _renderSelf(screen: Screen): void;
1250
3407
  }
1251
3408
 
1252
- interface SidebarItem {
1253
- label: string;
1254
- badge?: string;
1255
- active?: boolean;
1256
- }
1257
- interface SidebarOptions {
1258
- /** Whether the sidebar is collapsed */
1259
- collapsed?: boolean;
1260
- /** Collapsed width in cells (default: 3) */
1261
- collapsedWidth?: number;
1262
- /** Active item highlight color */
1263
- activeColor?: _termuijs_core.Color;
1264
- /** Badge color */
1265
- badgeColor?: _termuijs_core.Color;
3409
+ interface CollapsibleOptions {
3410
+ /** Start open. Default: false */
3411
+ open?: boolean;
3412
+ /** Expand indicator char. Default: '▶' (or '>' in ASCII) */
3413
+ expandChar?: string;
3414
+ /** Collapse indicator char. Default: '▼' (or 'v' in ASCII) */
3415
+ collapseChar?: string;
3416
+ /** Callback when toggled */
3417
+ onToggle?: (open: boolean) => void;
1266
3418
  }
1267
3419
  /**
1268
- * Sidebar — a vertical list of navigation items with optional badges.
3420
+ * Collapsible — a toggleable section with title and body.
1269
3421
  *
1270
- * Supports active item highlighting and collapsible mode.
3422
+ * Renders:
3423
+ * - Row 0: [indicator] [title]
3424
+ * - Rows 1+: body lines (if open)
3425
+ *
3426
+ * Press Enter or Space to toggle open/closed state.
1271
3427
  */
1272
- declare class Sidebar extends Widget {
1273
- private _items;
1274
- private _collapsed;
1275
- private _collapsedWidth;
1276
- private _activeColor;
1277
- private _badgeColor;
1278
- constructor(items: SidebarItem[], style?: Partial<Style>, opts?: SidebarOptions);
1279
- setItems(items: SidebarItem[]): void;
1280
- setCollapsed(collapsed: boolean): void;
3428
+ declare class Collapsible extends Widget {
3429
+ private _title;
3430
+ private _body;
3431
+ private _open;
3432
+ private _expandChar;
3433
+ private _collapseChar;
3434
+ private _onToggle?;
3435
+ focusable: boolean;
3436
+ constructor(title: string, body: string, style?: Partial<Style>, opts?: CollapsibleOptions);
3437
+ /** Update the title and re-render. */
3438
+ setTitle(title: string): void;
3439
+ /** Update the body and re-render. */
3440
+ setBody(body: string): void;
3441
+ /** Toggle between open and closed. Fires onToggle callback. */
1281
3442
  toggle(): void;
1282
- get isCollapsed(): boolean;
3443
+ /** Check if currently open. */
3444
+ isOpen(): boolean;
3445
+ /**
3446
+ * Handle key events.
3447
+ */
3448
+ handleKey(event: KeyEvent): void;
1283
3449
  protected _renderSelf(screen: Screen): void;
1284
3450
  }
1285
3451
 
1286
- interface LineChartOptions {
1287
- /** Color of the plotted points/lines */
3452
+ interface DigitsOptions {
1288
3453
  color?: Color;
1289
- /** Show Y-axis labels */
1290
- showYAxis?: boolean;
1291
- /** Show X-axis labels */
1292
- showXAxis?: boolean;
1293
- /** Label for the Y axis */
1294
- yLabel?: string;
1295
- /** Maximum Y value (auto if not set) */
1296
- max?: number;
1297
- /** Minimum Y value (auto if not set) */
1298
- min?: number;
1299
3454
  }
1300
3455
  /**
1301
- * LineChartASCII/Unicode line plot for a series of numbers.
3456
+ * Digitsrenders a numeric string as large 3-row ASCII art.
3457
+ * Similar to a 7-segment display.
1302
3458
  *
1303
- * Normalizes data to the available height, samples to fit width.
1304
- * Plots points with simple vertical bar connectors between adjacent points.
3459
+ * Example:
3460
+ * new Digits({ value: '42', color: 'cyan', width: 20, height: 3 })
1305
3461
  */
1306
- declare class LineChart extends Widget {
1307
- private _data;
3462
+ declare class Digits extends Widget {
3463
+ private _value;
1308
3464
  private _color;
1309
- private _showYAxis;
1310
- private _showXAxis;
1311
- private _yLabel;
1312
- private _max?;
1313
- private _min?;
1314
- constructor(data: number[], style?: Partial<Style>, opts?: LineChartOptions);
1315
- setData(data: number[]): void;
1316
- pushValue(value: number): void;
3465
+ constructor(style?: Partial<Style>, opts?: DigitsOptions);
3466
+ setValue(value: string): void;
3467
+ getValue(): string;
3468
+ setColor(color: Color): void;
1317
3469
  protected _renderSelf(screen: Screen): void;
1318
3470
  }
1319
3471
 
1320
- interface HeatMapOptions {
1321
- /** Color for maximum value cells */
1322
- highColor?: Color;
1323
- /** Color for minimum value cells */
1324
- lowColor?: Color;
1325
- /** Row labels (left side) */
1326
- rowLabels?: string[];
1327
- /** Column labels (top) */
1328
- colLabels?: string[];
1329
- }
1330
- /**
1331
- * HeatMap — 2D matrix displayed with character-density shading.
1332
- *
1333
- * Values are normalized 0–1 and mapped to 4 shading levels.
1334
- */
1335
- declare class HeatMap extends Widget {
1336
- private _matrix;
1337
- private _highColor;
1338
- private _lowColor;
1339
- private _rowLabels;
1340
- private _colLabels;
1341
- constructor(matrix: number[][], style?: Partial<Style>, opts?: HeatMapOptions);
1342
- setMatrix(matrix: number[][]): void;
3472
+ type TreeNode = {
3473
+ name: string;
3474
+ type: 'file' | 'dir';
3475
+ children?: TreeNode[];
3476
+ };
3477
+ interface DirectoryTreeOptions {
3478
+ tree?: TreeNode[];
3479
+ path?: string;
3480
+ onSelect?: (node: TreeNode, path: string) => void;
3481
+ }
3482
+ declare class DirectoryTree extends Widget {
3483
+ private _tree;
3484
+ private _visible;
3485
+ private _selectedIndex;
3486
+ private _expanded;
3487
+ onSelect?: (node: TreeNode, path: string) => void;
3488
+ constructor(options: DirectoryTreeOptions, style?: Partial<Style>);
3489
+ private _rebuild;
3490
+ private _walk;
3491
+ private _toggle;
3492
+ private _select;
3493
+ handleKey(event: KeyEvent): boolean;
1343
3494
  protected _renderSelf(screen: Screen): void;
1344
3495
  }
1345
3496
 
1346
- interface DefinitionPair {
1347
- term: string;
1348
- definition: string;
3497
+ interface ListItem {
3498
+ text: string;
3499
+ children?: ListItem[];
1349
3500
  }
1350
- interface DefinitionOptions {
1351
- /** Indentation for definition lines (default: 2) */
3501
+ interface UnorderedListOptions {
3502
+ /** Bullet characters per nesting level. Default uses Unicode with ASCII fallback. */
3503
+ markers?: string[];
3504
+ /** Indent width per level. Default: 2 */
1352
3505
  indent?: number;
1353
- /** Blank line between pairs (default: true) */
1354
- spacing?: boolean;
1355
- /** Color for term labels */
1356
- termColor?: _termuijs_core.Color;
1357
- /** Color for definition text */
1358
- definitionColor?: _termuijs_core.Color;
1359
3506
  }
1360
3507
  /**
1361
- * Definition term + definition pairs, stacked vertically.
1362
- *
1363
- * Each pair renders as:
1364
- * Term
1365
- * definition text (indented)
1366
- *
1367
- * Similar to KeyValue but stacked rather than inline.
3508
+ * UnorderedList - renders a bulleted list with optional nested children.
1368
3509
  */
1369
- declare class Definition extends Widget {
1370
- private _pairs;
3510
+ declare class UnorderedList extends Widget {
3511
+ private _items;
3512
+ private _markers?;
1371
3513
  private _indent;
1372
- private _spacing;
1373
- private _termColor?;
1374
- private _definitionColor?;
1375
- constructor(pairs: DefinitionPair[] | Record<string, string>, style?: Partial<Style>, opts?: DefinitionOptions);
1376
- setPairs(pairs: DefinitionPair[] | Record<string, string>): void;
3514
+ constructor(items: ListItem[], style?: Partial<Style>, opts?: UnorderedListOptions);
3515
+ setItems(items: ListItem[]): void;
1377
3516
  protected _renderSelf(screen: Screen): void;
3517
+ private _markerForDepth;
1378
3518
  }
1379
3519
 
1380
- interface BigTextOptions {
1381
- /** Color for the rendered characters */
3520
+ type RuleOrientation = 'horizontal' | 'vertical';
3521
+ interface RuleOptions {
3522
+ /** Line direction. Default: 'horizontal'. */
3523
+ orientation?: RuleOrientation;
3524
+ /** Title centered in the line (horizontal only). */
3525
+ title?: string;
3526
+ /** Line color. Default: brightBlack */
1382
3527
  color?: Color;
1383
3528
  }
1384
3529
  /**
1385
- * BigTextrenders text as large 5×3 ASCII art banner characters.
3530
+ * Rulea horizontal or vertical divider line with an optional centered title.
1386
3531
  *
1387
- * Supports A–Z (uppercase), 0–9, and common punctuation.
1388
- * Unrecognized characters fall back to a narrow glyph.
1389
- */
1390
- declare class BigText extends Widget {
1391
- private _text;
1392
- private _color;
1393
- constructor(text: string, style?: Partial<Style>, opts?: BigTextOptions);
1394
- setText(text: string): void;
1395
- protected _renderSelf(screen: Screen): void;
1396
- }
1397
-
1398
- interface GradientOptions {
1399
- /** Start color (hex string like '#ff0000' or named color string) */
1400
- startColor?: string;
1401
- /** End color (hex string like '#0000ff' or named color string) */
1402
- endColor?: string;
1403
- /** Text alignment */
1404
- align?: 'left' | 'center' | 'right';
1405
- }
1406
- /**
1407
- * Gradient — text rendered with a smooth color gradient.
3532
+ * Horizontal example (no title):
3533
+ * ────────────────────
1408
3534
  *
1409
- * Each character is colored by linearly interpolating between startColor and endColor.
1410
- * Falls back to a single foreground color if true-color is unavailable.
3535
+ * Horizontal example (with title):
3536
+ * ────── Logs ──────
3537
+ *
3538
+ * Vertical example:
3539
+ * │
3540
+ * │
3541
+ * │
3542
+ *
3543
+ * Uses `caps.unicode` to choose between Unicode box-drawing and ASCII fallback.
1411
3544
  */
1412
- declare class Gradient extends Widget {
1413
- private _text;
1414
- private _startColor;
1415
- private _endColor;
1416
- private _align;
1417
- constructor(text: string, style?: Partial<Style>, opts?: GradientOptions);
1418
- setText(text: string): void;
1419
- setColors(start: string, end: string): void;
3545
+ declare class Rule extends Widget {
3546
+ private _orientation;
3547
+ private _title;
3548
+ private _color;
3549
+ constructor(style?: Partial<Style>, opts?: RuleOptions);
3550
+ /** Update the title text. Calls markDirty(). */
3551
+ setTitle(title: string): void;
1420
3552
  protected _renderSelf(screen: Screen): void;
1421
3553
  }
1422
3554
 
1423
- export { Banner, type BannerOptions, type Bar, BarChart, type BarChartDirection, type BarChartOptions, type BarGroup, BigText, type BigTextOptions, Box, Card, type CardOptions, Center, type CenterOptions, ChatMessage, type ChatMessageOptions, Columns, type ColumnsOptions, type Command, CommandPalette, type CommandPaletteOptions, Definition, type DefinitionOptions, type DefinitionPair, type DiffLine, DiffView, type DiffViewOptions, Gauge, type GaugeOptions, Gradient, type GradientOptions, Grid, type GridOptions, HeatMap, type HeatMapOptions, type JSONNodeData, type JSONNodeType, JSONView, type JSONViewOptions, KeyValue, type KeyValueOptions, type KeyValuePair, LineChart, type LineChartOptions, List, type ListItem, LogView, type LogViewOptions, type MessageRole, MultiProgress, type MultiProgressOptions, ProgressBar, type ProgressBarOptions, type ProgressItem, SPINNER_FRAMES, type ScrollRange, ScrollView, type ScrollViewOptions, Scrollbar, type ScrollbarOptions, type ScrollbarOrientation, Sidebar, type SidebarItem, type SidebarOptions, Skeleton, type SkeletonOptions, Sparkline, type SparklineOptions, Spinner, type SpinnerOptions, StatusIndicator, type StatusIndicatorOptions, StatusMessage, type StatusMessageOptions, type StatusVariant, StreamingText, type StreamingTextOptions, Table, type TableColumn, type TableOptions, type TableRow, Text, TextInput, type TextProps, ToolApproval, type ToolApprovalOptions, ToolCall, type ToolCallOptions, type ToolCallStatus, Tree, type TreeNode, type TreeOptions, VirtualList, type VirtualListOptions, Widget, type WidgetEvents, computeRange, computeVariableRange, jsonToTree };
3555
+ export { Accordion, type AccordionOptions, type AccordionSection, Alert, type AlertOptions, AreaChart, type AreaChartOptions, AspectRatio, type AspectRatioOptions, Avatar, type AvatarOptions, Badge, type BadgeOptions, type BadgePosition, type BadgeVariant, Banner, type BannerOptions, type Bar, BarChart, type BarChartDirection, type BarChartOptions, BarColumn, type BarGroup, BigText, type BigTextOptions, Box, BrailleCanvas, type BrailleCanvasOptions, Breadcrumbs, type BreadcrumbsOptions, BulletChart, type BulletChartOptions, type BulletRange, Button, type ButtonOptions, type ButtonVariant, Calendar, type CalendarOptions, Callout, type CalloutOptions, type CalloutVariant, type Candle, CandlestickChart, type CandlestickChartOptions, Canvas, Card, type CardOptions, Carousel, type CarouselOptions, Center, type CenterOptions, ChatMessage, type ChatMessageOptions, Clock, type ClockOptions, Code, type CodeOptions, Collapsible, type CollapsibleOptions, Columns, type ColumnsOptions, type Command, CommandPalette, type CommandPaletteOptions, ContextMenu, type ContextMenuItem, DataGrid, type DataGridColumn, type DataGridOptions, type DataGridRow, DataGrid as DataGridView, Definition, type DefinitionOptions, type DefinitionPair, type DiffLine, DiffView, type DiffViewOptions, Digits, type DigitsOptions, DirectoryTree, type DirectoryTreeOptions, Divider, type DividerOptions, type DividerOrientation, Dock, type DockEdge, type DockItem, type DockOptions, EmptyState, type EmptyStateOptions, Fill, type FillOptions, GanttChart, type GanttChartOptions, type GanttTask, Gauge, type GaugeOptions, Gradient, type GradientOptions, Grid, type GridOptions, HeatMap, type HeatMapOptions, Hexdump, type HexdumpOptions, Highlight, Histogram, type HistogramOptions, type JSONNodeData, type JSONNodeType, JSONView, type JSONViewOptions, Kbd, type KbdOptions, KeyValue, type KeyValueOptions, type KeyValuePair, Knob, type KnobOptions, LineChart, type LineChartOptions, LineGauge, type LineGaugeOptions, Link, type LinkOptions, List, type ListItem$1 as ListItem, type ListProps, type ListState, LoadingDots, type LoadingDotsOptions, LogView, type LogViewOptions, Markdown, type MarkdownOptions, Marquee, type MarqueeDirection, type MarqueeOptions, Masonry, type MasonryOptions, type MessageRole, MultiProgress, type MultiProgressOptions, NotificationBadge, type NotificationBadgeOptions, OrderedList, type OrderedListItem, type OrderedListOptions, Panel, PercentageColumn, PieChart, type PieChartOptions, type PieSlice, PinInput, type PinInputOptions, Placeholder, type PlaceholderOptions, Progress, ProgressBar, type ProgressBarOptions, type ProgressBarStyle, type ProgressColumnDefinition, type ProgressColumnProps, type ProgressItem, type ProgressProps, ProgressString, type ProgressStringProps, type ProgressTask, Pty, type PtyOptions, QRCode, type QRCodeOptions, QRCodePattern, type QRCodePatternOptions, RadarChart, type RadarChartOptions, type RadarSeries, RangeInput, type RangeInputOptions, Rating, type RatingOptions, Rule, type RuleOptions, type RuleOrientation, SPINNER_FRAMES, ScatterPlot, type ScatterPlotOptions, type ScatterPoint, ScrollAcceleration, type ScrollRange, ScrollView, type ScrollViewOptions, Scrollbar, type ScrollbarOptions, type ScrollbarOrientation, ShortcutBar, type ShortcutBarOptions, type ShortcutItem, Sidebar, type SidebarItem, type SidebarOptions, Skeleton, type SkeletonOptions, Slider, type SliderOptions, type SortDirection, Sparkline, type SparklineOptions, SpeedColumn, Spinner, type SpinnerOptions, SplitPane, type SplitPaneOptions, Stack, type StackOptions, StackedBarChart, type StackedBarChartOptions, type StackedSeries, Stat, type StatOptions, StatusIndicator, type StatusIndicatorOptions, StatusMessage, type StatusMessageOptions, type StatusVariant, type StepStatus, Stepper, type StepperOptions, type StepperOrientation, type StepperStep, Stopwatch, type StopwatchOptions, StreamingText, type StreamingTextOptions, Table, type TableColumn, type TableOptions, type TableProps, type TableRow, type TableState, Tag, type TagOptions, type TagVariant, type TaskItem, TaskList, type TaskListOptions, type TaskStatus, Text, TextColumn, TextInput, type TextProps, ThinkingBlock, type ThinkingBlockOptions, TimeColumn, Timeline, type TimelineItem, type TimelineStatus, Timer, type TimerOptions, ToolApproval, type ToolApprovalOptions, ToolCall, type ToolCallOptions, type ToolCallStatus, Tooltip, type TooltipOptions, Tree, type TreeNode$1 as TreeNode, type TreeOptions, TreeTable, type TreeTableColumn, type TreeTableOptions, type TreeTableRow, Typewriter, type TypewriterOptions, UnorderedList, type UnorderedListOptions, VirtualList, type VirtualListOptions, Watermark, type WatermarkOptions, Widget, type WidgetEvents, _resetWidgetIdCounter, computeRange, computeVariableRange, jsonToTree, useListState, useTableState };