@visulima/tui 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/box.d.ts +25 -25
  3. package/dist/components/canvas.d.ts +26 -31
  4. package/dist/components/cursor.d.ts +39 -44
  5. package/dist/components/error-overview.d.ts +1 -3
  6. package/dist/components/error-overview.js +1 -1
  7. package/dist/components/newline.d.ts +6 -8
  8. package/dist/components/spacer.d.ts +4 -4
  9. package/dist/components/static-render.d.ts +9 -40
  10. package/dist/components/static.d.ts +13 -13
  11. package/dist/components/text.d.ts +34 -47
  12. package/dist/components/transform.d.ts +7 -11
  13. package/dist/core/index.d.ts +11 -11
  14. package/dist/core/index.js +1 -1
  15. package/dist/ink/canvas/index.d.ts +10 -10
  16. package/dist/ink/hooks/use-animation.d.ts +22 -22
  17. package/dist/ink/hooks/use-app.d.ts +3 -3
  18. package/dist/ink/hooks/use-box-metrics.d.ts +16 -16
  19. package/dist/ink/hooks/use-clipboard.d.ts +16 -16
  20. package/dist/ink/hooks/use-color-blindness.d.ts +16 -16
  21. package/dist/ink/hooks/use-console-capture.d.ts +19 -19
  22. package/dist/ink/hooks/use-cursor.d.ts +6 -6
  23. package/dist/ink/hooks/use-focus-manager.d.ts +25 -25
  24. package/dist/ink/hooks/use-focus.d.ts +14 -18
  25. package/dist/ink/hooks/use-form.d.ts +32 -32
  26. package/dist/ink/hooks/use-hotkey.d.ts +17 -17
  27. package/dist/ink/hooks/use-input.d.ts +92 -92
  28. package/dist/ink/hooks/use-input.js +2 -2
  29. package/dist/ink/hooks/use-interval.d.ts +14 -14
  30. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +3 -3
  31. package/dist/ink/hooks/use-key-bindings.d.ts +32 -32
  32. package/dist/ink/hooks/use-key-chord.d.ts +15 -15
  33. package/dist/ink/hooks/use-paste.d.ts +38 -38
  34. package/dist/ink/hooks/use-paste.js +1 -1
  35. package/dist/ink/hooks/use-persistent-state.d.ts +46 -46
  36. package/dist/ink/hooks/use-persistent-state.js +2 -2
  37. package/dist/ink/hooks/use-scroll-acceleration.d.ts +24 -24
  38. package/dist/ink/hooks/use-scroll-input.d.ts +15 -15
  39. package/dist/ink/hooks/use-stderr.d.ts +6 -6
  40. package/dist/ink/hooks/use-stderr.js +1 -1
  41. package/dist/ink/hooks/use-stdin.d.ts +10 -10
  42. package/dist/ink/hooks/use-stdin.js +1 -1
  43. package/dist/ink/hooks/use-stdout.d.ts +6 -6
  44. package/dist/ink/hooks/use-stdout.js +1 -1
  45. package/dist/ink/hooks/use-stopwatch.d.ts +12 -12
  46. package/dist/ink/hooks/use-terminal-palette.d.ts +11 -11
  47. package/dist/ink/hooks/use-text-buffer.d.ts +2 -2
  48. package/dist/ink/hooks/use-text-selection.d.ts +18 -18
  49. package/dist/ink/hooks/use-timeout.d.ts +11 -11
  50. package/dist/ink/hooks/use-timer.d.ts +19 -19
  51. package/dist/ink/hooks/use-window-size.d.ts +8 -8
  52. package/dist/ink/hooks/use-window-size.js +1 -1
  53. package/dist/ink/index.d.ts +109 -122
  54. package/dist/ink/index.js +1 -1
  55. package/dist/ink/mouse/use-element-position.d.ts +6 -6
  56. package/dist/ink/mouse/use-mouse-action.d.ts +1 -1
  57. package/dist/ink/mouse/use-mouse-position.d.ts +1 -1
  58. package/dist/ink/mouse/use-mouse.d.ts +1 -1
  59. package/dist/ink/mouse/use-on-mouse-click.d.ts +3 -3
  60. package/dist/ink/mouse/use-on-mouse-hover.d.ts +2 -2
  61. package/dist/ink/mouse/use-on-mouse-state.d.ts +2 -2
  62. package/dist/ink/public/cursor.d.ts +21 -21
  63. package/dist/ink/public/dom.d.ts +2 -2
  64. package/dist/ink/public/highlighter.d.ts +16 -26
  65. package/dist/ink/public/input.d.ts +6 -6
  66. package/dist/ink/public/styles.d.ts +1 -1
  67. package/dist/ink/public/utils.d.ts +2 -2
  68. package/dist/packem_shared/{DevTools-D9tfChBc.js → DevTools-CZ-O0Ckm.js} +1 -1
  69. package/dist/packem_shared/FocusContext-BWFqf9kb.js +1 -0
  70. package/dist/packem_shared/InputParser-CUAGWKQQ.js +2 -0
  71. package/dist/packem_shared/MouseProvider-DOcWCRVq.js +1 -0
  72. package/dist/packem_shared/{Renderer-DsskdkUd.js → Renderer-BeS49FNq.js} +1 -1
  73. package/dist/packem_shared/{TuiApp-DjIgv5Sk.js → TuiApp-CCVaiKbf.js} +1 -1
  74. package/dist/packem_shared/app-context.d-DMLw5Nxy.d.ts +56 -0
  75. package/dist/packem_shared/{buffer.d-j_dP5JyC.d.ts → buffer.d-CttIC480.d.ts} +26 -26
  76. package/dist/packem_shared/clipboard.d-nDPQkZ2H.d.ts +23 -0
  77. package/dist/packem_shared/color-matrix.d-sTqnJ23h.d.ts +50 -0
  78. package/dist/packem_shared/createInlineLoop-BMDYJkRp.js +2 -0
  79. package/dist/packem_shared/{dom.d-g-nsYquD.d.ts → dom.d-CLGlidfI.d.ts} +138 -151
  80. package/dist/packem_shared/{input.d-D-Yxqha8.d.ts → input.d-CL_4MfL-.d.ts} +30 -24
  81. package/dist/packem_shared/load-native-root-binding-CxJnHcac.js +1 -0
  82. package/dist/packem_shared/{mouse-context.d-BfL9xGk_.d.ts → mouse-context.d-W-nszUps.d.ts} +8 -8
  83. package/dist/packem_shared/reconciler-D4fi5NfR.js +1 -0
  84. package/dist/packem_shared/reconciler-DkwOtC5B.js +1 -0
  85. package/dist/packem_shared/render-CPVY5vpQ.js +1 -0
  86. package/dist/packem_shared/render-CvhjGwOg.js +24 -0
  87. package/dist/packem_shared/render.d-DjQhFsiN.d.ts +435 -0
  88. package/dist/packem_shared/{renderToString-DqLFFPvO.js → renderToString-B1LgWcJe.js} +1 -1
  89. package/dist/packem_shared/{renderToString-DkTmJPaS.js → renderToString-Df6HST7u.js} +1 -1
  90. package/dist/packem_shared/{selection.d-KWphH--_.d.ts → selection.d-BSAWa4ey.d.ts} +16 -16
  91. package/dist/packem_shared/stderr-context-CR2LLec6.js +1 -0
  92. package/dist/packem_shared/stdin-context-BjMA9Sbi.js +1 -0
  93. package/dist/packem_shared/stdout-context-DAAlQct2.js +1 -0
  94. package/dist/packem_shared/styles.d-CKGQFfm4.d.ts +485 -0
  95. package/dist/packem_shared/{terminal-palette.d-D2SQjfn-.d.ts → terminal-palette.d-JbWHISW-.d.ts} +7 -7
  96. package/dist/packem_shared/utils-CVgM8kTn.js +1 -0
  97. package/dist/react/index.d.ts +160 -178
  98. package/dist/react/index.js +1 -1
  99. package/dist/testing/index.d.ts +151 -151
  100. package/dist/testing/index.js +1 -1
  101. package/index.js +52 -52
  102. package/package.json +13 -13
  103. package/dist/packem_shared/FocusContext-C2Sosxa4.js +0 -1
  104. package/dist/packem_shared/InputParser-CiBitCva.js +0 -2
  105. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +0 -1
  106. package/dist/packem_shared/app-context.d-CG88lgkg.d.ts +0 -56
  107. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +0 -23
  108. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +0 -50
  109. package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +0 -2
  110. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +0 -1
  111. package/dist/packem_shared/reconciler-ClpU7Y-V.js +0 -1
  112. package/dist/packem_shared/reconciler-DhUGYWCr.js +0 -1
  113. package/dist/packem_shared/render-D7aV_hO1.js +0 -24
  114. package/dist/packem_shared/render-DMcWfI6-.js +0 -1
  115. package/dist/packem_shared/render.d-BvfwvSCx.d.ts +0 -435
  116. package/dist/packem_shared/stderr-context-Bvnik0hL.js +0 -1
  117. package/dist/packem_shared/stdin-context-88AhuztD.js +0 -1
  118. package/dist/packem_shared/stdout-context-BnblEPez.js +0 -1
  119. package/dist/packem_shared/styles.d-D7iZuNC-.d.ts +0 -492
  120. package/dist/packem_shared/utils-C8l_3Dzw.js +0 -1
@@ -1,15 +1,12 @@
1
1
  import React, { Context, RefObject, ReactNode } from 'react';
2
- import { M as MouseEvent, T as TuiApp, c as InputParser, a as InlineOptions } from "../packem_shared/input.d-D-Yxqha8.js";
2
+ import { M as MouseEvent, T as TuiApp, c as InputParser, a as InlineOptions } from "../packem_shared/input.d-CL_4MfL-.js";
3
3
  import Yoga from 'yoga-layout';
4
4
  interface DevToolsProps {
5
5
  children: React.ReactNode;
6
6
  /** Show/hide the HUD without unmounting (default: true) */
7
7
  enabled?: boolean;
8
8
  }
9
- declare const DevTools: ({
10
- children,
11
- enabled
12
- }: DevToolsProps) => React.ReactElement;
9
+ declare const DevTools: ({ children, enabled }: DevToolsProps) => React.ReactElement;
13
10
  type FocusContextProps = {
14
11
  activate: (id: string) => void;
15
12
  activeId: string | undefined;
@@ -37,11 +34,7 @@ type UseFocusResult = {
37
34
  focus: (id: string) => void;
38
35
  isFocused: boolean;
39
36
  };
40
- declare const useFocus: ({
41
- autoFocus,
42
- id: customId,
43
- isActive
44
- }?: UseFocusOptions) => UseFocusResult;
37
+ declare const useFocus: ({ autoFocus, id: customId, isActive }?: UseFocusOptions) => UseFocusResult;
45
38
  type UseFocusManagerResult = {
46
39
  activeId: string | undefined;
47
40
  disableFocus: () => void;
@@ -71,13 +64,13 @@ declare class LayoutNode {
71
64
  remove(): void;
72
65
  removeChild(child: LayoutNode): void;
73
66
  /**
74
- * Free this node's Yoga allocation. Called via detachDeletedInstance
75
- * in the reconciler after React has permanently removed this node.
76
- *
77
- * Does NOT recurse — React calls detachDeletedInstance on every node
78
- * in a deleted subtree individually, so each node frees only itself.
79
- * The _destroyed guard prevents double-free if free() is also called.
80
- */
67
+ * Free this node's Yoga allocation. Called via detachDeletedInstance
68
+ * in the reconciler after React has permanently removed this node.
69
+ *
70
+ * Does NOT recurse — React calls detachDeletedInstance on every node
71
+ * in a deleted subtree individually, so each node frees only itself.
72
+ * The _destroyed guard prevents double-free if free() is also called.
73
+ */
81
74
  destroy(): void;
82
75
  calculateLayout(width: number, height: number): void;
83
76
  getLayout(): ReturnType<YogaNode$1["getComputedLayout"]>;
@@ -109,54 +102,54 @@ interface Key {
109
102
  }
110
103
  type InputHandler = (input: string, key: Key) => void;
111
104
  /**
112
- * Subscribes to keyboard input. Uses a stable ref so the effect runs
113
- * exactly once (on mount) regardless of how often the component re-renders.
114
- * Always invokes the latest handler passed by the caller.
115
- */
105
+ * Subscribes to keyboard input. Uses a stable ref so the effect runs
106
+ * exactly once (on mount) regardless of how often the component re-renders.
107
+ * Always invokes the latest handler passed by the caller.
108
+ */
116
109
  declare const useInput: (handler: InputHandler) => void;
117
110
  interface UsePasteOptions {
118
111
  /**
119
- * Enable or disable capturing pasted text.
120
- * Useful when multiple components use usePaste and only one should be active.
121
- * @default true
122
- */
112
+ * Enable or disable capturing pasted text.
113
+ * Useful when multiple components use usePaste and only one should be active.
114
+ * @default true
115
+ */
123
116
  isActive?: boolean;
124
117
  }
125
118
  type PasteHandler = (text: string) => void;
126
119
  /**
127
- * Subscribe to bracketed paste events.
128
- *
129
- * `usePaste` and `useInput` can be used together. Paste content is delivered
130
- * through this hook and not forwarded to useInput while at least one paste
131
- * listener is active.
132
- */
120
+ * Subscribe to bracketed paste events.
121
+ *
122
+ * `usePaste` and `useInput` can be used together. Paste content is delivered
123
+ * through this hook and not forwarded to useInput while at least one paste
124
+ * listener is active.
125
+ */
133
126
  declare const usePaste: (handler: PasteHandler, options?: UsePasteOptions) => void;
134
127
  /**
135
- * Raw access to the TuiContext — app instance + input parser.
136
- * Useful for advanced integrations (e.g. DevTools, custom hooks).
137
- */
128
+ * Raw access to the TuiContext — app instance + input parser.
129
+ * Useful for advanced integrations (e.g. DevTools, custom hooks).
130
+ */
138
131
  declare const useTuiContext: () => TuiContextProps;
139
132
  /**
140
- * Access app controls. Returns { exit } for Ink compatibility.
141
- * exit() triggers a clean shutdown (restores terminal, stops input, exits process).
142
- */
133
+ * Access app controls. Returns { exit } for Ink compatibility.
134
+ * exit() triggers a clean shutdown (restores terminal, stops input, exits process).
135
+ */
143
136
  declare const useApp: () => {
144
137
  exit: () => void;
145
138
  quit: () => void;
146
139
  };
147
140
  /**
148
- * Returns current terminal dimensions and re-renders on resize (SIGWINCH).
149
- * Ink-compatible: const { columns, rows } = useWindowSize()
150
- */
141
+ * Returns current terminal dimensions and re-renders on resize (SIGWINCH).
142
+ * Ink-compatible: const { columns, rows } = useWindowSize()
143
+ */
151
144
  declare const useWindowSize: () => {
152
145
  columns: number;
153
146
  rows: number;
154
147
  };
155
148
  /**
156
- * Write to stdout without disturbing the TUI.
157
- * Ink-compatible: const { write, stdout } = useStdout()
158
- * Output is buffered while the alternate screen is active and flushed on exit.
159
- */
149
+ * Write to stdout without disturbing the TUI.
150
+ * Ink-compatible: const { write, stdout } = useStdout()
151
+ * Output is buffered while the alternate screen is active and flushed on exit.
152
+ */
160
153
  declare const useStdout: () => {
161
154
  stdout: NodeJS.WriteStream & {
162
155
  fd: 1;
@@ -164,10 +157,10 @@ declare const useStdout: () => {
164
157
  write: (text: string) => void;
165
158
  };
166
159
  /**
167
- * Write to stderr without disturbing the TUI.
168
- * Ink-compatible: const { write, stderr } = useStderr()
169
- * Output is buffered while the alternate screen is active and flushed on exit.
170
- */
160
+ * Write to stderr without disturbing the TUI.
161
+ * Ink-compatible: const { write, stderr } = useStderr()
162
+ * Output is buffered while the alternate screen is active and flushed on exit.
163
+ */
171
164
  declare const useStderr: () => {
172
165
  stderr: NodeJS.WriteStream & {
173
166
  fd: 2;
@@ -175,9 +168,9 @@ declare const useStderr: () => {
175
168
  write: (text: string) => void;
176
169
  };
177
170
  /**
178
- * Access raw stdin stream and raw mode controls.
179
- * Ink-compatible: const { stdin, setRawMode, isRawModeSupported } = useStdin()
180
- */
171
+ * Access raw stdin stream and raw mode controls.
172
+ * Ink-compatible: const { stdin, setRawMode, isRawModeSupported } = useStdin()
173
+ */
181
174
  declare const useStdin: () => {
182
175
  isRawModeSupported: boolean;
183
176
  setRawMode: (value: boolean) => void;
@@ -186,11 +179,11 @@ declare const useStdin: () => {
186
179
  };
187
180
  };
188
181
  /**
189
- * Measure the dimensions of a Box element.
190
- * Returns { width, height } after layout has been calculated.
191
- * Returns { width: 0, height: 0 } when called during render (before layout).
192
- * Ink-compatible: measureElement(ref.current)
193
- */
182
+ * Measure the dimensions of a Box element.
183
+ * Returns { width, height } after layout has been calculated.
184
+ * Returns { width: 0, height: 0 } when called during render (before layout).
185
+ * Ink-compatible: measureElement(ref.current)
186
+ */
194
187
  declare const measureElement: (node: LayoutNode | null) => {
195
188
  height: number;
196
189
  width: number;
@@ -205,23 +198,23 @@ interface UseBoxMetricsResult extends BoxMetrics {
205
198
  readonly hasMeasured: boolean;
206
199
  }
207
200
  /**
208
- * Returns the current layout metrics for a Box ref, updating on every render
209
- * and on terminal resize.
210
- * Ink-compatible: const { width, height, left, top, hasMeasured } = useBoxMetrics(ref)
211
- */
201
+ * Returns the current layout metrics for a Box ref, updating on every render
202
+ * and on terminal resize.
203
+ * Ink-compatible: const { width, height, left, top, hasMeasured } = useBoxMetrics(ref)
204
+ */
212
205
  declare const useBoxMetrics: (ref: RefObject<LayoutNode | null>) => UseBoxMetricsResult;
213
206
  /**
214
- * Returns whether a screen reader is enabled.
215
- * Stub: always returns false — no screen reader support.
216
- * Ink-compatible: const isEnabled = useIsScreenReaderEnabled()
217
- */
207
+ * Returns whether a screen reader is enabled.
208
+ * Stub: always returns false — no screen reader support.
209
+ * Ink-compatible: const isEnabled = useIsScreenReaderEnabled()
210
+ */
218
211
  declare const useIsScreenReaderEnabled: () => boolean;
219
212
  /**
220
- * Returns cursor positioning controls.
221
- * Stub: the native renderer hides the cursor during rendering (alternate screen).
222
- * setCursorPosition is a no-op — provided for Ink API compatibility only.
223
- * Ink-compatible: const { setCursorPosition } = useCursor()
224
- */
213
+ * Returns cursor positioning controls.
214
+ * Stub: the native renderer hides the cursor during rendering (alternate screen).
215
+ * setCursorPosition is a no-op — provided for Ink API compatibility only.
216
+ * Ink-compatible: const { setCursorPosition } = useCursor()
217
+ */
225
218
  declare const useCursor: () => {
226
219
  setCursorPosition: (position: {
227
220
  x: number;
@@ -229,22 +222,22 @@ declare const useCursor: () => {
229
222
  } | undefined) => void;
230
223
  };
231
224
  /**
232
- * Scroll state for a fixed-height viewport over variable-height content.
233
- *
234
- * Usage:
235
- * const scroll = useScrollable({ viewportHeight: 20, contentHeight: totalRows })
236
- *
237
- * &lt;Box height={20}>
238
- * &lt;Box marginTop={-scroll.offset}>
239
- * {items}
240
- * &lt;/Box>
241
- * &lt;/Box>
242
- *
243
- * contentHeight can be updated as content grows. The offset is automatically
244
- * clamped so it never scrolls past the end.
245
- *
246
- * scrollToBottom() is idempotent — safe to call on every new message append.
247
- */
225
+ * Scroll state for a fixed-height viewport over variable-height content.
226
+ *
227
+ * Usage:
228
+ * const scroll = useScrollable({ viewportHeight: 20, contentHeight: totalRows })
229
+ *
230
+ * &lt;Box height={20}>
231
+ * &lt;Box marginTop={-scroll.offset}>
232
+ * {items}
233
+ * &lt;/Box>
234
+ * &lt;/Box>
235
+ *
236
+ * contentHeight can be updated as content grows. The offset is automatically
237
+ * clamped so it never scrolls past the end.
238
+ *
239
+ * scrollToBottom() is idempotent — safe to call on every new message append.
240
+ */
248
241
  interface UseScrollableOptions {
249
242
  /** Total height of the content in rows — update as content grows */
250
243
  contentHeight: number;
@@ -269,24 +262,21 @@ interface UseScrollableResult {
269
262
  /** Scroll up one row */
270
263
  scrollUp: () => void;
271
264
  }
272
- declare const useScrollable: ({
273
- contentHeight,
274
- viewportHeight
275
- }: UseScrollableOptions) => UseScrollableResult;
265
+ declare const useScrollable: ({ contentHeight, viewportHeight }: UseScrollableOptions) => UseScrollableResult;
276
266
  type MouseHandler = (event: MouseEvent) => void;
277
267
  /**
278
- * Subscribe to mouse events. Requires mouse tracking to be enabled (it is by
279
- * default — TerminalGuard enables SGR 1006 mouse tracking on start).
280
- *
281
- * Usage:
282
- * useMouse((event) => {
283
- * if (event.button === 'left') { ... }
284
- * if (event.button === 'scrollUp') { ... }
285
- * // event: { x, y, button, shift, ctrl, meta }
286
- * })
287
- *
288
- * button values: 'left' | 'right' | 'middle' | 'scrollUp' | 'scrollDown'
289
- */
268
+ * Subscribe to mouse events. Requires mouse tracking to be enabled (it is by
269
+ * default — TerminalGuard enables SGR 1006 mouse tracking on start).
270
+ *
271
+ * Usage:
272
+ * useMouse((event) => {
273
+ * if (event.button === 'left') { ... }
274
+ * if (event.button === 'scrollUp') { ... }
275
+ * // event: { x, y, button, shift, ctrl, meta }
276
+ * })
277
+ *
278
+ * button values: 'left' | 'right' | 'middle' | 'scrollUp' | 'scrollDown'
279
+ */
290
280
  declare const useMouse: (handler: MouseHandler) => void;
291
281
  interface UseTextInputOptions {
292
282
  /** Initial value (default: '') */
@@ -309,22 +299,17 @@ interface UseTextInputResult {
309
299
  value: string;
310
300
  }
311
301
  /**
312
- * Managed text input with cursor, backspace, delete, left/right navigation,
313
- * home/end, bracketed paste, and submit on Enter.
314
- *
315
- * Usage:
316
- * const { value, cursor } = useTextInput({ onSubmit: (v) => console.log(v) })
317
- * &lt;Text>{value.slice(0, cursor)}&lt;Text inverse> &lt;/Text>{value.slice(cursor)}&lt;/Text>
318
- *
319
- * Renders a block cursor by inverting the character at cursor position.
320
- * When cursor is at end, renders a trailing space as the cursor block.
321
- */
322
- declare const useTextInput: ({
323
- initialValue,
324
- isActive,
325
- onChange,
326
- onSubmit
327
- }?: UseTextInputOptions) => UseTextInputResult;
302
+ * Managed text input with cursor, backspace, delete, left/right navigation,
303
+ * home/end, bracketed paste, and submit on Enter.
304
+ *
305
+ * Usage:
306
+ * const { value, cursor } = useTextInput({ onSubmit: (v) => console.log(v) })
307
+ * &lt;Text>{value.slice(0, cursor)}&lt;Text inverse> &lt;/Text>{value.slice(cursor)}&lt;/Text>
308
+ *
309
+ * Renders a block cursor by inverting the character at cursor position.
310
+ * When cursor is at end, renders a trailing space as the cursor block.
311
+ */
312
+ declare const useTextInput: ({ initialValue, isActive, onChange, onSubmit }?: UseTextInputOptions) => UseTextInputResult;
328
313
  /** Ink-compat render options */
329
314
  interface RenderOptions {
330
315
  /** Ignored — the native renderer is always concurrent */
@@ -358,18 +343,18 @@ interface InlineInstance {
358
343
  waitUntilExit: () => Promise<void>;
359
344
  }
360
345
  /**
361
- * Render a React element inline — no alternate screen. The UI appears
362
- * directly below the current shell prompt and stays in terminal scrollback
363
- * on exit (or is destroyed if `onExit: 'destroy'` is set).
364
- *
365
- * The root Box is sized to `cols × rows`. Use `useInput` and `useApp`
366
- * exactly as in a full-screen render.
367
- * @example
368
- * ```tsx
369
- * const { waitUntilExit } = renderInline(<Picker />, { rows: 12, onExit: 'destroy' })
370
- * await waitUntilExit()
371
- * ```
372
- */
346
+ * Render a React element inline — no alternate screen. The UI appears
347
+ * directly below the current shell prompt and stays in terminal scrollback
348
+ * on exit (or is destroyed if `onExit: 'destroy'` is set).
349
+ *
350
+ * The root Box is sized to `cols × rows`. Use `useInput` and `useApp`
351
+ * exactly as in a full-screen render.
352
+ * @example
353
+ * ```tsx
354
+ * const { waitUntilExit } = renderInline(<Picker />, { rows: 12, onExit: 'destroy' })
355
+ * await waitUntilExit()
356
+ * ```
357
+ */
373
358
  declare function renderInline(element: React.ReactElement, options?: InlineOptions & {
374
359
  maxFps?: number;
375
360
  }): InlineInstance;
@@ -380,27 +365,27 @@ interface RenderToStringOptions {
380
365
  rows?: number;
381
366
  }
382
367
  /**
383
- * Render a React element to a plain string synchronously.
384
- * No TTY, no stdin, no alternate screen — pure layout + buffer read-back.
385
- *
386
- * Useful for testing, documentation generation, and any scenario where
387
- * you need rendered output as a string without a live terminal.
388
- *
389
- * Notes:
390
- * - Terminal hooks (useInput, useApp, useStdin, useStdout, useStderr,
391
- * useFocus, useFocusManager) return safe no-op defaults — they do not throw.
392
- * - useEffect callbacks run but state updates they trigger do not affect output.
393
- * - useLayoutEffect callbacks fire synchronously and DO affect output.
394
- */
368
+ * Render a React element to a plain string synchronously.
369
+ * No TTY, no stdin, no alternate screen — pure layout + buffer read-back.
370
+ *
371
+ * Useful for testing, documentation generation, and any scenario where
372
+ * you need rendered output as a string without a live terminal.
373
+ *
374
+ * Notes:
375
+ * - Terminal hooks (useInput, useApp, useStdin, useStdout, useStderr,
376
+ * useFocus, useFocusManager) return safe no-op defaults — they do not throw.
377
+ * - useEffect callbacks run but state updates they trigger do not affect output.
378
+ * - useLayoutEffect callbacks fire synchronously and DO affect output.
379
+ */
395
380
  declare function renderToString(element: React.ReactElement, options?: RenderToStringOptions): string;
396
381
  declare function renderTreeToBuffer(root: LayoutNode, buffer: Uint32Array, cols: number, rows: number): void;
397
382
  type YogaNode = ReturnType<typeof Yoga.Node.create>;
398
383
  declare const NAMED_COLORS: Record<string, number>;
399
384
  /**
400
- * Resolve a color value to an ANSI 256-color index.
401
- * Accepts: number (pass-through), string name ("green"), hex ("#FF8800"),
402
- * rgb() ("rgb(255,136,0)"), ansi256() ("ansi256(42)"), or undefined (→ 255 = terminal default).
403
- */
385
+ * Resolve a color value to an ANSI 256-color index.
386
+ * Accepts: number (pass-through), string name ("green"), hex ("#FF8800"),
387
+ * rgb() ("rgb(255,136,0)"), ansi256() ("ansi256(42)"), or undefined (→ 255 = terminal default).
388
+ */
404
389
  declare function resolveColor(color: number | string | undefined): number;
405
390
  type Styles = {
406
391
  alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around";
@@ -432,7 +417,8 @@ type Styles = {
432
417
  flexShrink?: number;
433
418
  flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
434
419
  gap?: number;
435
- height?: number | string; /** Internal flag for sticky header alternate nodes */
420
+ height?: number | string;
421
+ /** Internal flag for sticky header alternate nodes */
436
422
  internalStickyAlternate?: boolean;
437
423
  inverse?: boolean;
438
424
  italic?: boolean;
@@ -476,43 +462,39 @@ type Styles = {
476
462
  declare const applyStyles: (node: YogaNode, style?: Styles, currentStyle?: Styles) => void;
477
463
  type StaticProps<T> = {
478
464
  /**
479
- * Render function called for each item. Must assign a unique `key` to the
480
- * root element returned.
481
- */
465
+ * Render function called for each item. Must assign a unique `key` to the
466
+ * root element returned.
467
+ */
482
468
  readonly children: (item: T, index: number) => ReactNode;
483
469
  /**
484
- * Array of items to render. Only newly-added items are rendered into the layout —
485
- * previously rendered items are frozen (never re-rendered or cleared).
486
- * Ideal for streaming output: completed tasks, log lines, test results.
487
- */
470
+ * Array of items to render. Only newly-added items are rendered into the layout —
471
+ * previously rendered items are frozen (never re-rendered or cleared).
472
+ * Ideal for streaming output: completed tasks, log lines, test results.
473
+ */
488
474
  readonly items: T[];
489
475
  /**
490
- * Optional styles for the static container Box.
491
- */
476
+ * Optional styles for the static container Box.
477
+ */
492
478
  readonly style?: Record<string, unknown>;
493
479
  };
494
480
  /**
495
- * `&lt;Static>` permanently renders its output above the dynamic UI.
496
- *
497
- * Items are rendered once and frozen — they are never re-rendered or cleared.
498
- * New items appended to `items` are rendered incrementally and accumulate
499
- * in the layout above the dynamic content.
500
- *
501
- * Matches the Ink `&lt;Static>` API exactly.
502
- * @example
503
- * ```tsx
504
- * <Static items={completedTasks}>
505
- * {task => (
506
- * <Box key={task.id}>
507
- * <Text color="green">✔ {task.title}</Text>
508
- * </Box>
509
- * )}
510
- * </Static>
511
- * ```
512
- */
513
- declare function Static<T>({
514
- children: renderItem,
515
- items,
516
- style
517
- }: StaticProps<T>): React.ReactElement;
481
+ * `&lt;Static>` permanently renders its output above the dynamic UI.
482
+ *
483
+ * Items are rendered once and frozen — they are never re-rendered or cleared.
484
+ * New items appended to `items` are rendered incrementally and accumulate
485
+ * in the layout above the dynamic content.
486
+ *
487
+ * Matches the Ink `&lt;Static>` API exactly.
488
+ * @example
489
+ * ```tsx
490
+ * <Static items={completedTasks}>
491
+ * {task => (
492
+ * <Box key={task.id}>
493
+ * <Text color="green">✔ {task.title}</Text>
494
+ * </Box>
495
+ * )}
496
+ * </Static>
497
+ * ```
498
+ */
499
+ declare function Static<T>({ children: renderItem, items, style }: StaticProps<T>): React.ReactElement;
518
500
  export { BoxMetrics, DevTools, DevToolsProps, FocusContext, FocusContextProps, FocusProvider, type InlineInstance, InputHandler, type Instance, Key, LayoutNode, MouseHandler, NAMED_COLORS, PasteHandler, type RenderOptions, RenderToStringOptions, Static, StaticProps, Styles, TuiContext, TuiContextProps, UseBoxMetricsResult, UseFocusManagerResult, UseFocusOptions, UseFocusResult, UsePasteOptions, UseScrollableOptions, UseScrollableResult, UseTextInputOptions, UseTextInputResult, applyStyles, measureElement, render, renderInline, renderToString, renderTreeToBuffer, resolveColor, useApp, useBoxMetrics, useCursor, useFocus, useFocusManager, useInput, useIsScreenReaderEnabled, useMouse, usePaste, useScrollable, useStderr, useStdin, useStdout, useTextInput, useTuiContext, useWindowSize };
@@ -1 +1 @@
1
- import{DevTools as o}from"../packem_shared/DevTools-D9tfChBc.js";import{FocusContext as u,FocusProvider as s,useFocus as n,useFocusManager as p}from"../packem_shared/FocusContext-C2Sosxa4.js";import{TuiContext as d,measureElement as f,useApp as l,useBoxMetrics as m,useCursor as a,useInput as i,useIsScreenReaderEnabled as S,useMouse as c,usePaste as T,useScrollable as C,useStderr as F,useStdin as I,useStdout as M,useTextInput as v,useTuiContext as y,useWindowSize as E}from"../packem_shared/TuiContext-BNmP0lMY.js";import{render as g,renderInline as A}from"../packem_shared/render-DMcWfI6-.js";import{renderToString as D}from"../packem_shared/renderToString-DkTmJPaS.js";import{Static as N}from"../packem_shared/Static-DSzsElz4.js";import{LayoutNode as P}from"../packem_shared/LayoutNode-LPYsuzBg.js";import{NAMED_COLORS as w,applyStyles as z,resolveColor as W}from"../packem_shared/NAMED_COLORS-82DpREQV.js";import{renderTreeToBuffer as h}from"../packem_shared/renderTreeToBuffer-BpSD0sBJ.js";export{o as DevTools,u as FocusContext,s as FocusProvider,P as LayoutNode,w as NAMED_COLORS,N as Static,d as TuiContext,z as applyStyles,f as measureElement,g as render,A as renderInline,D as renderToString,h as renderTreeToBuffer,W as resolveColor,l as useApp,m as useBoxMetrics,a as useCursor,n as useFocus,p as useFocusManager,i as useInput,S as useIsScreenReaderEnabled,c as useMouse,T as usePaste,C as useScrollable,F as useStderr,I as useStdin,M as useStdout,v as useTextInput,y as useTuiContext,E as useWindowSize};
1
+ import{DevTools as o}from"../packem_shared/DevTools-CZ-O0Ckm.js";import{FocusContext as u,FocusProvider as s,useFocus as n,useFocusManager as p}from"../packem_shared/FocusContext-BWFqf9kb.js";import{TuiContext as d,measureElement as f,useApp as l,useBoxMetrics as m,useCursor as a,useInput as i,useIsScreenReaderEnabled as S,useMouse as c,usePaste as T,useScrollable as C,useStderr as F,useStdin as I,useStdout as M,useTextInput as v,useTuiContext as y,useWindowSize as E}from"../packem_shared/TuiContext-BNmP0lMY.js";import{render as g,renderInline as A}from"../packem_shared/render-CPVY5vpQ.js";import{renderToString as D}from"../packem_shared/renderToString-Df6HST7u.js";import{Static as N}from"../packem_shared/Static-DSzsElz4.js";import{LayoutNode as P}from"../packem_shared/LayoutNode-LPYsuzBg.js";import{NAMED_COLORS as w,applyStyles as z,resolveColor as W}from"../packem_shared/NAMED_COLORS-82DpREQV.js";import{renderTreeToBuffer as h}from"../packem_shared/renderTreeToBuffer-BpSD0sBJ.js";export{o as DevTools,u as FocusContext,s as FocusProvider,P as LayoutNode,w as NAMED_COLORS,N as Static,d as TuiContext,z as applyStyles,f as measureElement,g as render,A as renderInline,D as renderToString,h as renderTreeToBuffer,W as resolveColor,l as useApp,m as useBoxMetrics,a as useCursor,n as useFocus,p as useFocusManager,i as useInput,S as useIsScreenReaderEnabled,c as useMouse,T as usePaste,C as useScrollable,F as useStderr,I as useStdin,M as useStdout,v as useTextInput,y as useTuiContext,E as useWindowSize};