@alchemy.run/sigil 0.0.0-alpha.1

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.
@@ -0,0 +1,2379 @@
1
+ import { Writable } from "node:stream";
2
+ import React, { ReactNode, RefObject } from "react";
3
+ import { EventEmitter } from "node:events";
4
+ //#region src/cursor-position.d.ts
5
+ type CursorPosition = {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ //#endregion
10
+ //#region src/components/AppContext.d.ts
11
+ /**
12
+ A handle returned by `suspendTerminal()` when called without a callback.
13
+
14
+ Call `resume()` to give terminal ownership back to Ink, or use `await using`
15
+ so the suspension is resumed automatically when it leaves scope.
16
+ */
17
+ type TerminalSuspension = {
18
+ readonly resume: () => Promise<void>;
19
+ readonly [Symbol.asyncDispose]: () => Promise<void>;
20
+ };
21
+ /**
22
+ Temporarily hand the terminal over to a child process (e.g. `$EDITOR`, `less`,
23
+ `fzf`), then restore Ink's terminal state and force a full redraw.
24
+ */
25
+ type SuspendTerminal = {
26
+ (callback: () => void | Promise<void>): Promise<void>;
27
+ (): Promise<TerminalSuspension>;
28
+ };
29
+ type Props = {
30
+ /**
31
+ Exit (unmount) the whole Ink app.
32
+
33
+ - `exit()` — resolves `waitUntilExit()` with `undefined`.
34
+ - `exit(new Error('…'))` — rejects `waitUntilExit()` with the error.
35
+ - `exit(value)` — resolves `waitUntilExit()` with `value`.
36
+ */
37
+ readonly exit: (errorOrResult?: unknown) => void;
38
+ /**
39
+ Returns a promise that settles after pending render output is flushed to stdout.
40
+
41
+ @example
42
+ ```jsx
43
+ import {useEffect} from 'react';
44
+ import {useApp} from 'ink';
45
+
46
+ const Example = () => {
47
+ const {waitUntilRenderFlush} = useApp();
48
+
49
+ useEffect(() => {
50
+ void (async () => {
51
+ await waitUntilRenderFlush();
52
+ runNextCommand();
53
+ })();
54
+ }, [waitUntilRenderFlush]);
55
+
56
+ return …;
57
+ };
58
+ ```
59
+ */
60
+ readonly waitUntilRenderFlush: () => Promise<void>;
61
+ /**
62
+ Temporarily release the terminal so a child process can take it over, then
63
+ restore Ink's terminal state and force a full redraw.
64
+
65
+ Use the callback form for the common case — Ink restores the terminal even
66
+ if the callback throws:
67
+
68
+ @example
69
+ ```jsx
70
+ import {useApp} from 'ink';
71
+
72
+ const {suspendTerminal} = useApp();
73
+
74
+ await suspendTerminal(async () => {
75
+ await runEditor();
76
+ });
77
+ ```
78
+
79
+ Or hold a suspension and resume it yourself:
80
+
81
+ @example
82
+ ```jsx
83
+ await using suspension = await suspendTerminal();
84
+ await runEditor();
85
+ ```
86
+ */
87
+ readonly suspendTerminal: SuspendTerminal;
88
+ };
89
+ //#endregion
90
+ //#region src/kitty-keyboard.d.ts
91
+ declare const kittyFlags: {
92
+ readonly disambiguateEscapeCodes: 1;
93
+ readonly reportEventTypes: 2;
94
+ readonly reportAlternateKeys: 4;
95
+ readonly reportAllKeysAsEscapeCodes: 8;
96
+ readonly reportAssociatedText: 16;
97
+ };
98
+ type KittyFlagName = keyof typeof kittyFlags;
99
+ declare const kittyModifiers: {
100
+ readonly shift: 1;
101
+ readonly alt: 2;
102
+ readonly ctrl: 4;
103
+ readonly super: 8;
104
+ readonly hyper: 16;
105
+ readonly meta: 32;
106
+ readonly capsLock: 64;
107
+ readonly numLock: 128;
108
+ };
109
+ type KittyKeyboardOptions = {
110
+ mode?: "auto" | "enabled" | "disabled";
111
+ flags?: KittyFlagName[];
112
+ };
113
+ //#endregion
114
+ //#region src/stream.d.ts
115
+ type OutputStream = NodeJS.WritableStream & {
116
+ isTTY?: boolean;
117
+ columns?: number;
118
+ rows?: number;
119
+ destroyed?: boolean;
120
+ writableEnded?: boolean;
121
+ };
122
+ //#endregion
123
+ //#region src/ink.d.ts
124
+ /**
125
+ The origin of a chunk captured by `patchConsole`: a patched `console.*`
126
+ method, or a direct `stdout.write` / `stderr.write` call.
127
+ */
128
+ type CapturedOutputSource = "console" | "stdio";
129
+ /**
130
+ Performance metrics for a render operation.
131
+ */
132
+ type RenderMetrics = {
133
+ /**
134
+ Time spent rendering in milliseconds.
135
+ */
136
+ renderTime: number;
137
+ };
138
+ type Options$3 = {
139
+ stdout: OutputStream;
140
+ stdin: NodeJS.ReadableStream;
141
+ stderr: OutputStream;
142
+ debug: boolean;
143
+ exitOnCtrlC: boolean;
144
+ /**
145
+ Patch console methods so `console.*` output doesn't mix with Ink's output.
146
+
147
+ Pass `"stdio"` to additionally intercept direct `stdout.write` /
148
+ `stderr.write` calls (from dependencies, native warnings, child tooling)
149
+ on the streams Ink renders to. Captured output is line-buffered and
150
+ spliced above the live frame, exactly like console output; Ink's own
151
+ frame writes bypass the capture.
152
+ */
153
+ patchConsole: boolean | "stdio";
154
+ /**
155
+ Observe output captured by `patchConsole` before Ink displays it.
156
+
157
+ Called with each captured chunk and its origin: `"console"` for patched
158
+ `console.*` calls, `"stdio"` for direct stream writes (only emitted with
159
+ `patchConsole: "stdio"`). Return `true` to take ownership of the chunk —
160
+ Ink will not display it, letting the app render it itself (for example
161
+ inside a `<Static>` transcript).
162
+ */
163
+ onCapturedOutput?: (stream: "stdout" | "stderr", data: string, source: CapturedOutputSource) => boolean | undefined | void;
164
+ onRender?: (metrics: RenderMetrics) => void;
165
+ isScreenReaderEnabled?: boolean;
166
+ waitUntilExit?: () => Promise<unknown>;
167
+ maxFps?: number;
168
+ incrementalRendering?: boolean;
169
+ /**
170
+ Enable React Concurrent Rendering mode.
171
+
172
+ When enabled:
173
+ - Suspense boundaries work correctly with async data
174
+ - `useTransition` and `useDeferredValue` are fully functional
175
+ - Updates can be interrupted for higher priority work
176
+
177
+ Note: Concurrent mode changes the timing of renders. Some tests may need to use `act()` to properly await updates. Reusing the same stdout across multiple `render()` calls without unmounting is unsupported. Call `unmount()` first if you need to change the rendering mode or create a fresh instance.
178
+
179
+ @default false
180
+ @experimental
181
+ */
182
+ concurrent?: boolean;
183
+ kittyKeyboard?: KittyKeyboardOptions;
184
+ /**
185
+ Override automatic interactive mode detection.
186
+
187
+ By default, Ink detects whether the environment is interactive based on CI detection (via [`is-in-ci`](https://github.com/sindresorhus/is-in-ci)) and `stdout.isTTY`. Most users should not need to set this.
188
+
189
+ When non-interactive, Ink disables ANSI erase sequences, cursor manipulation, synchronized output, resize handling, and kitty keyboard auto-detection, writing only the final frame at unmount.
190
+
191
+ Set to `false` to force non-interactive mode or `true` to force interactive mode when the automatic detection doesn't suit your use case.
192
+
193
+ Note: Reusing the same stdout across multiple `render()` calls without unmounting is unsupported. Call `unmount()` first if you need to change this option or create a fresh instance.
194
+
195
+ @default true (false if in CI or `stdout.isTTY` is falsy)
196
+
197
+ @see {@link RenderOptions.interactive}
198
+ */
199
+ interactive?: boolean;
200
+ /**
201
+ Render the app in the terminal's alternate screen buffer. When enabled, the app renders on a separate screen, and the original terminal content is restored when the app exits. This is the same mechanism used by programs like vim, htop, and less.
202
+
203
+ Note: The terminal's scrollback buffer is not available while in the alternate screen. This is standard terminal behavior; programs like vim use the alternate screen specifically to avoid polluting the user's scrollback history.
204
+
205
+ Note: Ink intentionally treats alternate-screen teardown output as disposable. It does not preserve or replay teardown-time frames, hook writes, or `console.*` output after restoring the primary screen.
206
+
207
+ Only works in interactive mode. Ignored when `interactive` is `false` or in a non-interactive environment (CI, piped stdout).
208
+
209
+ Note: Reusing the same stdout across multiple `render()` calls without unmounting is unsupported. Call `unmount()` first if you need to change this option or create a fresh instance.
210
+
211
+ @default false
212
+
213
+ @see {@link RenderOptions.alternateScreen}
214
+ */
215
+ alternateScreen?: boolean;
216
+ };
217
+ declare class Ink {
218
+ /**
219
+ Whether this instance is using concurrent rendering mode.
220
+ */
221
+ readonly isConcurrent: boolean;
222
+ private readonly options;
223
+ private readonly log;
224
+ private cursorPosition;
225
+ private readonly throttledLog;
226
+ private readonly isScreenReaderEnabled;
227
+ private readonly interactive;
228
+ private readonly renderThrottleMs;
229
+ private alternateScreen;
230
+ private isUnmounted;
231
+ private isUnmounting;
232
+ private lastOutput;
233
+ private lastOutputToRender;
234
+ private lastOutputHeight;
235
+ private lastTerminalWidth;
236
+ private lastTerminalHeight;
237
+ private readonly container;
238
+ private readonly rootNode;
239
+ private fullStaticOutput;
240
+ private readonly exitPromise;
241
+ private exitResult;
242
+ private beforeExitHandler?;
243
+ private restoreConsole?;
244
+ private readonly captureTargets?;
245
+ private readonly capturedStdioTails;
246
+ private readonly unsubscribeResize?;
247
+ private readonly throttledOnRender?;
248
+ private hasPendingThrottledRender;
249
+ private kittyProtocolEnabled;
250
+ private kittyFlags;
251
+ private cancelKittyDetection?;
252
+ private nextRenderCommit?;
253
+ private isSuspended;
254
+ private pauseInput?;
255
+ private resumeInput?;
256
+ constructor(options: Options$3);
257
+ resized: () => void;
258
+ resolveExitPromise: (result?: unknown) => void;
259
+ rejectExitPromise: (reason?: Error) => void;
260
+ unsubscribeExit: () => void;
261
+ handleAppExit: (errorOrResult?: unknown) => void;
262
+ setCursorPosition: (position: CursorPosition | undefined) => void;
263
+ restoreLastOutput: () => void;
264
+ calculateLayout: () => void;
265
+ handleStaticChange: () => void;
266
+ onRender: () => void;
267
+ render(node: ReactNode): void;
268
+ writeToStdout(data: string): void;
269
+ writeToStderr(data: string): void;
270
+ unmount(error?: Error | number | null): void;
271
+ waitUntilExit(): Promise<unknown>;
272
+ waitUntilRenderFlush(): Promise<void>;
273
+ clear(): void;
274
+ patchConsole(): void;
275
+ private patchDirectStdio;
276
+ private handleCapturedStdio;
277
+ private flushCapturedStdio;
278
+ registerInputControl(pauseInput: () => void, resumeInput: () => void): void;
279
+ suspendTerminal(callback: () => void | Promise<void>): Promise<void>;
280
+ suspendTerminal(): Promise<TerminalSuspension>;
281
+ private setAlternateScreen;
282
+ private resolveInteractiveOption;
283
+ private resolveAlternateScreenOption;
284
+ private shouldSync;
285
+ private writeBestEffort;
286
+ private awaitExit;
287
+ private hasPendingConcurrentWork;
288
+ private awaitNextRender;
289
+ private renderInteractiveFrame;
290
+ private initKittyKeyboard;
291
+ private confirmKittySupport;
292
+ private enableKittyProtocol;
293
+ private beginSuspend;
294
+ private endSuspend;
295
+ }
296
+ //#endregion
297
+ //#region src/render.d.ts
298
+ type RenderOptions = {
299
+ /**
300
+ Output stream where the app will be rendered.
301
+
302
+ @default process.stdout
303
+ */
304
+ stdout?: NodeJS.WritableStream;
305
+ /**
306
+ Input stream where app will listen for input.
307
+
308
+ @default process.stdin
309
+ */
310
+ stdin?: NodeJS.ReadableStream;
311
+ /**
312
+ Error stream.
313
+ @default process.stderr
314
+ */
315
+ stderr?: NodeJS.WritableStream;
316
+ /**
317
+ If true, each update will be rendered as separate output, without replacing the previous one.
318
+
319
+ @default false
320
+ */
321
+ debug?: boolean;
322
+ /**
323
+ Configure whether Ink should listen for Ctrl+C keyboard input and exit the app. This is needed in case `process.stdin` is in raw mode, because then Ctrl+C is ignored by default and the process is expected to handle it manually.
324
+
325
+ @default true
326
+ */
327
+ exitOnCtrlC?: boolean;
328
+ /**
329
+ Patch console methods to ensure console output doesn't mix with Ink's output.
330
+
331
+ Pass `"stdio"` to additionally intercept direct `stdout.write` / `stderr.write` calls on the streams Ink renders to (output from dependencies, native warnings, child tooling). Captured chunks are line-buffered and spliced above the live frame like console output; partial lines are flushed at unmount. Use `onCapturedOutput` to observe captured chunks or take over their display.
332
+
333
+ Note: Once unmount starts, Ink restores the native console (and stream writes) before React cleanup runs. Teardown-time output then follows the normal behavior instead of being rerouted through Ink.
334
+
335
+ @default true
336
+ */
337
+ patchConsole?: boolean | "stdio";
338
+ /**
339
+ Observe output captured by `patchConsole` before Ink displays it.
340
+
341
+ Receives each captured chunk with its origin (`"console"` or `"stdio"`). Return `true` to take ownership of the chunk: Ink will not display it, so the app can render it itself — for example inside a `<Static>` transcript.
342
+ */
343
+ onCapturedOutput?: (stream: "stdout" | "stderr", data: string, source: "console" | "stdio") => boolean | undefined | void;
344
+ /**
345
+ Runs the given callback after each render and re-render with render metrics.
346
+
347
+ Note: this callback runs after Ink commits a frame, but it does not wait for `stdout`/`stderr` stream callbacks.
348
+ To run code after output is flushed, use `waitUntilRenderFlush()`.
349
+ */
350
+ onRender?: (metrics: RenderMetrics) => void;
351
+ /**
352
+ Enable screen reader support. See https://github.com/vadimdemedes/ink/blob/master/readme.md#screen-reader-support
353
+
354
+ @default process.env['INK_SCREEN_READER'] === 'true'
355
+ */
356
+ isScreenReaderEnabled?: boolean;
357
+ /**
358
+ Maximum frames per second for render updates.
359
+ This controls how frequently the UI can update to prevent excessive re-rendering.
360
+ Higher values allow more frequent updates but may impact performance.
361
+
362
+ @default 30
363
+ */
364
+ maxFps?: number;
365
+ /**
366
+ Enable incremental rendering mode which only updates changed lines instead of redrawing the entire output.
367
+ This can reduce flickering and improve performance for frequently updating UIs.
368
+
369
+ @default false
370
+ */
371
+ incrementalRendering?: boolean;
372
+ /**
373
+ Enable React Concurrent Rendering mode.
374
+
375
+ When enabled:
376
+ - Suspense boundaries work correctly with async data
377
+ - `useTransition` and `useDeferredValue` are fully functional
378
+ - Updates can be interrupted for higher priority work
379
+
380
+ Note: Concurrent mode changes the timing of renders. Some tests may need to use `act()` to properly await updates. Reusing the same stdout across multiple `render()` calls without unmounting is unsupported. Call `unmount()` first if you need to change the rendering mode or create a fresh instance.
381
+
382
+ @default false
383
+ */
384
+ concurrent?: boolean;
385
+ /**
386
+ Configure kitty keyboard protocol support for enhanced keyboard input.
387
+ Enables additional modifiers (super, hyper, capsLock, numLock) and
388
+ disambiguated key events in terminals that support the protocol.
389
+
390
+ @see https://sw.kovidgoyal.net/kitty/keyboard-protocol/
391
+ */
392
+ kittyKeyboard?: KittyKeyboardOptions;
393
+ /**
394
+ Override automatic interactive mode detection.
395
+
396
+ By default, Ink detects whether the environment is interactive based on CI detection (via [`is-in-ci`](https://github.com/sindresorhus/is-in-ci)) and `stdout.isTTY`. Most users should not need to set this.
397
+
398
+ When non-interactive, Ink disables ANSI erase sequences, cursor manipulation, synchronized output, resize handling, and kitty keyboard auto-detection, writing only the final frame at unmount.
399
+
400
+ Set to `false` to force non-interactive mode or `true` to force interactive mode when the automatic detection doesn't suit your use case.
401
+
402
+ Note: Reusing the same stdout across multiple `render()` calls without unmounting is unsupported. Call `unmount()` first if you need to change this option or create a fresh instance.
403
+
404
+ @default true (false if in CI or `stdout.isTTY` is falsy)
405
+ */
406
+ interactive?: boolean;
407
+ /**
408
+ Render the app in the terminal's alternate screen buffer. When enabled, the app renders on a separate screen, and the original terminal content is restored when the app exits. This is the same mechanism used by programs like vim, htop, and less.
409
+
410
+ Note: The terminal's scrollback buffer is not available while in the alternate screen. This is standard terminal behavior; programs like vim use the alternate screen specifically to avoid polluting the user's scrollback history.
411
+
412
+ Note: Ink intentionally treats alternate-screen teardown output as disposable. It does not preserve or replay teardown-time frames, hook writes, or `console.*` output after restoring the primary screen.
413
+
414
+ Only works in interactive mode. Ignored when `interactive` is `false` or in a non-interactive environment (CI, piped stdout).
415
+
416
+ Note: Reusing the same stdout across multiple `render()` calls without unmounting is unsupported. Call `unmount()` first if you need to change this option or create a fresh instance.
417
+
418
+ @default false
419
+ */
420
+ alternateScreen?: boolean;
421
+ };
422
+ type Instance = {
423
+ /**
424
+ Replace the previous root node with a new one or update props of the current root node.
425
+ */
426
+ rerender: Ink["render"];
427
+ /**
428
+ Manually unmount the whole Ink app.
429
+ */
430
+ unmount: Ink["unmount"];
431
+ /**
432
+ Returns a promise that settles when the app is unmounted.
433
+
434
+ It resolves with the value passed to `exit(value)` and rejects with the error passed to `exit(error)`.
435
+ When `unmount()` is called manually, it settles after unmount-related stdout writes complete.
436
+
437
+ @example
438
+ ```jsx
439
+ const {unmount, waitUntilExit} = render(<MyApp />);
440
+
441
+ setTimeout(unmount, 1000);
442
+
443
+ await waitUntilExit(); // resolves after `unmount()` is called
444
+ ```
445
+ */
446
+ waitUntilExit: Ink["waitUntilExit"];
447
+ /**
448
+ Returns a promise that settles after pending render output is flushed to stdout.
449
+
450
+ This can be used after `rerender()` when you need to run code only after the frame is written.
451
+
452
+ @example
453
+ ```jsx
454
+ const {rerender, waitUntilRenderFlush} = render(<MyApp step="loading" />);
455
+
456
+ rerender(<MyApp step="ready" />);
457
+ await waitUntilRenderFlush(); // output for "ready" is flushed
458
+
459
+ runNextCommand();
460
+ ```
461
+ */
462
+ waitUntilRenderFlush: Ink["waitUntilRenderFlush"];
463
+ /**
464
+ Unmount the current app and remove the internal Ink instance for this stdout.
465
+
466
+ This is mostly useful for advanced cases where you need `render()` to create a fresh instance for the same stream without leaving terminal state such as the alternate screen behind.
467
+ */
468
+ cleanup: () => void;
469
+ /**
470
+ Clear output.
471
+ */
472
+ clear: () => void;
473
+ };
474
+ /**
475
+ Mount a component and render the output.
476
+ */
477
+ declare const render: (node: ReactNode, options?: Writable | RenderOptions) => Instance;
478
+ //#endregion
479
+ //#region src/render-to-string.d.ts
480
+ type RenderToStringOptions = {
481
+ /**
482
+ Width of the virtual terminal in columns.
483
+
484
+ @default 80
485
+ */
486
+ columns?: number;
487
+ };
488
+ /**
489
+ Render a React element to a string synchronously. Unlike `render()`, this function does not write to stdout, does not set up any terminal event listeners, and returns the rendered output as a string.
490
+
491
+ Useful for generating documentation, writing output to files, testing, or any scenario where you need the rendered output as a string without starting a persistent terminal application.
492
+
493
+ **Notes:**
494
+
495
+ - Terminal-specific hooks (`useInput`, `useStdin`, `useStdout`, `useStderr`, `useApp`, `useFocus`, `useFocusManager`) return default no-op values since there is no terminal session. They will not throw, but they will not function as in a live terminal.
496
+ - `useEffect` callbacks will execute during rendering (due to synchronous rendering mode), but state updates they trigger will not affect the returned output, which reflects the initial render.
497
+ - `useLayoutEffect` callbacks fire synchronously during commit, so state updates they trigger **will** be reflected in the output.
498
+ - The `<Static>` component is supported — its output is prepended to the dynamic output.
499
+ - If a component throws during rendering, the error is propagated to the caller after cleanup.
500
+
501
+ @example
502
+ ```
503
+ import {renderToString, Text, Box} from 'ink';
504
+
505
+ const output = renderToString(
506
+ <Box padding={1}>
507
+ <Text color="green">Hello World</Text>
508
+ </Box>,
509
+ {columns: 40}
510
+ );
511
+
512
+ console.log(output);
513
+ ```
514
+ */
515
+ declare const renderToString: (node: ReactNode, options?: RenderToStringOptions) => string;
516
+ //#endregion
517
+ //#region src/types.d.ts
518
+ /**
519
+ Allows creating a union type by combining primitive types and literal types
520
+ without sacrificing auto-completion in IDEs for the literal type part of the
521
+ union.
522
+ */
523
+ type LiteralUnion<LiteralType, BaseType extends string | number> = LiteralType | (BaseType & Record<never, never>);
524
+ /**
525
+ Create a type from an object type without certain keys.
526
+ */
527
+ type Except<ObjectType, KeysType extends keyof ObjectType> = Omit<ObjectType, KeysType>;
528
+ //#endregion
529
+ //#region src/ansi/sgr.d.ts
530
+ declare const colorCodes: {
531
+ readonly black: readonly [30, 39];
532
+ readonly red: readonly [31, 39];
533
+ readonly green: readonly [32, 39];
534
+ readonly yellow: readonly [33, 39];
535
+ readonly blue: readonly [34, 39];
536
+ readonly magenta: readonly [35, 39];
537
+ readonly cyan: readonly [36, 39];
538
+ readonly white: readonly [37, 39];
539
+ readonly blackBright: readonly [90, 39];
540
+ readonly gray: readonly [90, 39];
541
+ readonly grey: readonly [90, 39];
542
+ readonly redBright: readonly [91, 39];
543
+ readonly greenBright: readonly [92, 39];
544
+ readonly yellowBright: readonly [93, 39];
545
+ readonly blueBright: readonly [94, 39];
546
+ readonly magentaBright: readonly [95, 39];
547
+ readonly cyanBright: readonly [96, 39];
548
+ readonly whiteBright: readonly [97, 39];
549
+ };
550
+ type ForegroundColorName = keyof typeof colorCodes;
551
+ //#endregion
552
+ //#region src/yoga/generated/YGEnums.d.ts
553
+ declare const Align: {
554
+ readonly Auto: 0;
555
+ readonly FlexStart: 1;
556
+ readonly Center: 2;
557
+ readonly FlexEnd: 3;
558
+ readonly Stretch: 4;
559
+ readonly Baseline: 5;
560
+ readonly SpaceBetween: 6;
561
+ readonly SpaceAround: 7;
562
+ readonly SpaceEvenly: 8;
563
+ readonly Start: 9;
564
+ readonly End: 10;
565
+ };
566
+ type Align = (typeof Align)[keyof typeof Align];
567
+ declare const BoxSizing: {
568
+ readonly BorderBox: 0;
569
+ readonly ContentBox: 1;
570
+ };
571
+ type BoxSizing = (typeof BoxSizing)[keyof typeof BoxSizing];
572
+ declare const Dimension: {
573
+ readonly Width: 0;
574
+ readonly Height: 1;
575
+ };
576
+ type Dimension = (typeof Dimension)[keyof typeof Dimension];
577
+ declare const Direction: {
578
+ readonly Inherit: 0;
579
+ readonly LTR: 1;
580
+ readonly RTL: 2;
581
+ };
582
+ type Direction = (typeof Direction)[keyof typeof Direction];
583
+ declare const Display: {
584
+ readonly Flex: 0;
585
+ readonly None: 1;
586
+ readonly Contents: 2;
587
+ readonly Grid: 3;
588
+ };
589
+ type Display = (typeof Display)[keyof typeof Display];
590
+ declare const Edge: {
591
+ readonly Left: 0;
592
+ readonly Top: 1;
593
+ readonly Right: 2;
594
+ readonly Bottom: 3;
595
+ readonly Start: 4;
596
+ readonly End: 5;
597
+ readonly Horizontal: 6;
598
+ readonly Vertical: 7;
599
+ readonly All: 8;
600
+ };
601
+ type Edge = (typeof Edge)[keyof typeof Edge];
602
+ declare const Errata: {
603
+ readonly None: 0;
604
+ readonly StretchFlexBasis: 1;
605
+ readonly AbsolutePositionWithoutInsetsExcludesPadding: 2;
606
+ readonly AbsolutePercentAgainstInnerSize: 4;
607
+ readonly MinSizeUndefinedInsteadOfAuto: 8;
608
+ readonly All: 2147483647;
609
+ readonly Classic: 2147483646;
610
+ };
611
+ type Errata = number;
612
+ declare const ExperimentalFeature: {
613
+ readonly WebFlexBasis: 0;
614
+ readonly FixFlexBasisFitContent: 1;
615
+ };
616
+ type ExperimentalFeature = (typeof ExperimentalFeature)[keyof typeof ExperimentalFeature];
617
+ declare const FlexDirection: {
618
+ readonly Column: 0;
619
+ readonly ColumnReverse: 1;
620
+ readonly Row: 2;
621
+ readonly RowReverse: 3;
622
+ };
623
+ type FlexDirection = (typeof FlexDirection)[keyof typeof FlexDirection];
624
+ declare const Gutter: {
625
+ readonly Column: 0;
626
+ readonly Row: 1;
627
+ readonly All: 2;
628
+ };
629
+ type Gutter = (typeof Gutter)[keyof typeof Gutter];
630
+ declare const Justify: {
631
+ readonly Auto: 0;
632
+ readonly FlexStart: 1;
633
+ readonly Center: 2;
634
+ readonly FlexEnd: 3;
635
+ readonly SpaceBetween: 4;
636
+ readonly SpaceAround: 5;
637
+ readonly SpaceEvenly: 6;
638
+ readonly Stretch: 7;
639
+ readonly Start: 8;
640
+ readonly End: 9;
641
+ };
642
+ type Justify = (typeof Justify)[keyof typeof Justify];
643
+ declare const MeasureMode: {
644
+ readonly Undefined: 0;
645
+ readonly Exactly: 1;
646
+ readonly AtMost: 2;
647
+ };
648
+ type MeasureMode = (typeof MeasureMode)[keyof typeof MeasureMode];
649
+ declare const NodeType: {
650
+ readonly Default: 0;
651
+ readonly Text: 1;
652
+ };
653
+ type NodeType = (typeof NodeType)[keyof typeof NodeType];
654
+ declare const Overflow: {
655
+ readonly Visible: 0;
656
+ readonly Hidden: 1;
657
+ readonly Scroll: 2;
658
+ };
659
+ type Overflow = (typeof Overflow)[keyof typeof Overflow];
660
+ declare const PositionType: {
661
+ readonly Static: 0;
662
+ readonly Relative: 1;
663
+ readonly Absolute: 2;
664
+ };
665
+ type PositionType = (typeof PositionType)[keyof typeof PositionType];
666
+ declare const Unit: {
667
+ readonly Undefined: 0;
668
+ readonly Point: 1;
669
+ readonly Percent: 2;
670
+ readonly Auto: 3;
671
+ readonly MaxContent: 4;
672
+ readonly FitContent: 5;
673
+ readonly Stretch: 6;
674
+ };
675
+ type Unit = (typeof Unit)[keyof typeof Unit];
676
+ declare const Wrap: {
677
+ readonly NoWrap: 0;
678
+ readonly Wrap: 1;
679
+ readonly WrapReverse: 2;
680
+ };
681
+ type Wrap = (typeof Wrap)[keyof typeof Wrap];
682
+ //#endregion
683
+ //#region src/yoga/core/config.d.ts
684
+ declare class Config$1 {
685
+ private useWebDefaults_;
686
+ private version_;
687
+ private experimentalFeatures_;
688
+ private errata_;
689
+ private pointScaleFactor_;
690
+ setUseWebDefaults(useWebDefaults: boolean): void;
691
+ useWebDefaults(): boolean;
692
+ setExperimentalFeatureEnabled(feature: ExperimentalFeature, enabled: boolean): void;
693
+ isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean;
694
+ getEnabledExperiments(): number;
695
+ setErrata(errata: Errata): void;
696
+ addErrata(errata: Errata): void;
697
+ removeErrata(errata: Errata): void;
698
+ getErrata(): Errata;
699
+ hasErrata(errata: Errata): boolean;
700
+ setPointScaleFactor(pointScaleFactor: number): void;
701
+ getPointScaleFactor(): number;
702
+ getVersion(): number;
703
+ }
704
+ //#endregion
705
+ //#region src/yoga/config.d.ts
706
+ /**
707
+ * Public Config wrapper over the core config, exposing the same surface as
708
+ * the WASM binding's ConfigImpl.
709
+ */
710
+ declare class Config {
711
+ /** @internal */
712
+ core: Config$1;
713
+ static create(): Config;
714
+ free(): void;
715
+ setExperimentalFeatureEnabled(feature: ExperimentalFeature, enabled: boolean): void;
716
+ isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean;
717
+ setPointScaleFactor(factor: number): void;
718
+ getErrata(): Errata;
719
+ setErrata(errata: Errata): void;
720
+ useWebDefaults(): boolean;
721
+ setUseWebDefaults(useWebDefaults: boolean): void;
722
+ }
723
+ //#endregion
724
+ //#region src/yoga/core/helpers.d.ts
725
+ declare const PhysicalEdge: {
726
+ readonly Left: 0;
727
+ readonly Top: 1;
728
+ readonly Right: 2;
729
+ readonly Bottom: 3;
730
+ };
731
+ type PhysicalEdge = (typeof PhysicalEdge)[keyof typeof PhysicalEdge];
732
+ declare const SizingMode: {
733
+ readonly StretchFit: 0;
734
+ readonly MaxContent: 1;
735
+ readonly FitContent: 2;
736
+ };
737
+ type SizingMode = (typeof SizingMode)[keyof typeof SizingMode];
738
+ //#endregion
739
+ //#region src/yoga/core/flexLine.d.ts
740
+ interface FlexLineRunningLayout {
741
+ totalFlexGrowFactors: number;
742
+ totalFlexShrinkScaledFactors: number;
743
+ remainingFreeSpace: number;
744
+ mainDim: number;
745
+ crossDim: number;
746
+ }
747
+ interface FlexLine {
748
+ itemsInFlow: Node$1[];
749
+ sizeConsumed: number;
750
+ numberOfAutoMargins: number;
751
+ endIndex: number;
752
+ layout: FlexLineRunningLayout;
753
+ }
754
+ //#endregion
755
+ //#region src/yoga/core/layoutResults.d.ts
756
+ declare class CachedMeasurement {
757
+ availableWidth: number;
758
+ availableHeight: number;
759
+ widthSizingMode: SizingMode;
760
+ heightSizingMode: SizingMode;
761
+ computedWidth: number;
762
+ computedHeight: number;
763
+ equals(measurement: CachedMeasurement): boolean;
764
+ }
765
+ declare class LayoutResults {
766
+ static readonly MaxCachedMeasurements = 8;
767
+ computedFlexBasisGeneration: number;
768
+ computedFlexBasis: number;
769
+ computedAutoMinMainSize: number;
770
+ generationCount: number;
771
+ configVersion: number;
772
+ lastOwnerDirection: Direction;
773
+ nextCachedMeasurementsIndex: number;
774
+ cachedMeasurements: CachedMeasurement[];
775
+ roundingDirty: boolean;
776
+ roundedAbsLeft: number;
777
+ roundedAbsTop: number;
778
+ roundedScale: number;
779
+ cachedLayout: CachedMeasurement;
780
+ flexLine: FlexLine | null;
781
+ flexLineStarts: number[] | null;
782
+ private direction_;
783
+ private hadOverflow_;
784
+ private values_;
785
+ direction(): Direction;
786
+ setDirection(direction: Direction): void;
787
+ hadOverflow(): boolean;
788
+ setHadOverflow(hadOverflow: boolean): void;
789
+ dimension(axis: Dimension): number;
790
+ setDimension(axis: Dimension, dimension: number): void;
791
+ measuredDimension(axis: Dimension): number;
792
+ rawDimension(axis: Dimension): number;
793
+ setMeasuredDimension(axis: Dimension, dimension: number): void;
794
+ setRawDimension(axis: Dimension, dimension: number): void;
795
+ position(physicalEdge: PhysicalEdge): number;
796
+ setPosition(physicalEdge: PhysicalEdge, dimension: number): void;
797
+ margin(physicalEdge: PhysicalEdge): number;
798
+ setMargin(physicalEdge: PhysicalEdge, dimension: number): void;
799
+ border(physicalEdge: PhysicalEdge): number;
800
+ setBorder(physicalEdge: PhysicalEdge, dimension: number): void;
801
+ padding(physicalEdge: PhysicalEdge): number;
802
+ setPadding(physicalEdge: PhysicalEdge, dimension: number): void;
803
+ }
804
+ //#endregion
805
+ //#region src/yoga/core/types.d.ts
806
+ /**
807
+ * A CSS <length-percentage> or keyword. `value` is NaN for keyword units.
808
+ * Instances are immutable and may be shared.
809
+ */
810
+ declare class StyleLength {
811
+ readonly value: number;
812
+ readonly unit: Unit;
813
+ protected constructor(value: number, unit: Unit);
814
+ static points(value: number): StyleLength;
815
+ static percent(value: number): StyleLength;
816
+ static ofAuto(): StyleLength;
817
+ static undefined(): StyleLength;
818
+ isAuto(): boolean;
819
+ isUndefined(): boolean;
820
+ isDefined(): boolean;
821
+ isPoints(): boolean;
822
+ isPercent(): boolean;
823
+ resolve(referenceLength: number): number;
824
+ equals(other: StyleLength): boolean;
825
+ inexactEquals(other: StyleLength): boolean;
826
+ }
827
+ /**
828
+ * A CSS value for sizes (width, min-width, flex-basis, ...) which additionally
829
+ * allows the auto/max-content/fit-content/stretch keywords.
830
+ */
831
+ declare class StyleSizeLength {
832
+ readonly value: number;
833
+ readonly unit: Unit;
834
+ protected constructor(value: number, unit: Unit);
835
+ static points(value: number): StyleSizeLength;
836
+ static percent(value: number): StyleSizeLength;
837
+ static ofAuto(): StyleSizeLength;
838
+ static ofMaxContent(): StyleSizeLength;
839
+ static ofFitContent(): StyleSizeLength;
840
+ static ofStretch(): StyleSizeLength;
841
+ static undefined(): StyleSizeLength;
842
+ isAuto(): boolean;
843
+ isMaxContent(): boolean;
844
+ isFitContent(): boolean;
845
+ isStretch(): boolean;
846
+ isUndefined(): boolean;
847
+ isDefined(): boolean;
848
+ isPoints(): boolean;
849
+ isPercent(): boolean;
850
+ resolve(referenceLength: number): number;
851
+ equals(other: StyleSizeLength): boolean;
852
+ inexactEquals(other: StyleSizeLength): boolean;
853
+ }
854
+ interface Size$1 {
855
+ width: number;
856
+ height: number;
857
+ }
858
+ //#endregion
859
+ //#region src/yoga/core/style.d.ts
860
+ declare class Style {
861
+ static readonly DefaultFlexGrow = 0;
862
+ static readonly DefaultFlexShrink = 0;
863
+ static readonly WebDefaultFlexShrink = 1;
864
+ private direction_;
865
+ private flexDirection_;
866
+ private justifyContent_;
867
+ private justifyItems_;
868
+ private justifySelf_;
869
+ private alignContent_;
870
+ private alignItems_;
871
+ private alignSelf_;
872
+ private positionType_;
873
+ private flexWrap_;
874
+ private overflow_;
875
+ private display_;
876
+ private boxSizing_;
877
+ private flex_;
878
+ private flexGrow_;
879
+ private flexShrink_;
880
+ private flexBasis_;
881
+ private margin_;
882
+ private position_;
883
+ private padding_;
884
+ private border_;
885
+ private gap_;
886
+ private marginResolved_;
887
+ private positionResolved_;
888
+ private paddingResolved_;
889
+ private borderResolved_;
890
+ private dimensions_;
891
+ private aspectRatio_;
892
+ direction(): Direction;
893
+ setDirection(value: Direction): void;
894
+ flexDirection(): FlexDirection;
895
+ setFlexDirection(value: FlexDirection): void;
896
+ justifyContent(): Justify;
897
+ setJustifyContent(value: Justify): void;
898
+ justifyItems(): Justify;
899
+ setJustifyItems(value: Justify): void;
900
+ justifySelf(): Justify;
901
+ setJustifySelf(value: Justify): void;
902
+ alignContent(): Align;
903
+ setAlignContent(value: Align): void;
904
+ alignItems(): Align;
905
+ setAlignItems(value: Align): void;
906
+ alignSelf(): Align;
907
+ setAlignSelf(value: Align): void;
908
+ positionType(): PositionType;
909
+ setPositionType(value: PositionType): void;
910
+ flexWrap(): Wrap;
911
+ setFlexWrap(value: Wrap): void;
912
+ overflow(): Overflow;
913
+ setOverflow(value: Overflow): void;
914
+ display(): Display;
915
+ setDisplay(value: Display): void;
916
+ flex(): number;
917
+ setFlex(value: number): void;
918
+ flexGrow(): number;
919
+ setFlexGrow(value: number): void;
920
+ flexShrink(): number;
921
+ setFlexShrink(value: number): void;
922
+ flexBasis(): StyleSizeLength;
923
+ setFlexBasis(value: StyleSizeLength): void;
924
+ margin(edge: Edge): StyleLength;
925
+ setMargin(edge: Edge, value: StyleLength): void;
926
+ position(edge: Edge): StyleLength;
927
+ setPosition(edge: Edge, value: StyleLength): void;
928
+ padding(edge: Edge): StyleLength;
929
+ setPadding(edge: Edge, value: StyleLength): void;
930
+ border(edge: Edge): StyleLength;
931
+ setBorder(edge: Edge, value: StyleLength): void;
932
+ gap(gutter: Gutter): StyleLength;
933
+ setGap(gutter: Gutter, value: StyleLength): void;
934
+ dimension(axis: Dimension): StyleSizeLength;
935
+ setDimension(axis: Dimension, value: StyleSizeLength): void;
936
+ minDimension(axis: Dimension): StyleSizeLength;
937
+ setMinDimension(axis: Dimension, value: StyleSizeLength): void;
938
+ maxDimension(axis: Dimension): StyleSizeLength;
939
+ setMaxDimension(axis: Dimension, value: StyleSizeLength): void;
940
+ resolvedMinDimension(direction: Direction, axis: Dimension, referenceLength: number, ownerWidth: number): number;
941
+ resolvedMaxDimension(direction: Direction, axis: Dimension, referenceLength: number, ownerWidth: number): number;
942
+ aspectRatio(): number;
943
+ setAspectRatio(value: number): void;
944
+ boxSizing(): BoxSizing;
945
+ setBoxSizing(value: BoxSizing): void;
946
+ horizontalInsetsDefined(): boolean;
947
+ verticalInsetsDefined(): boolean;
948
+ hasPositionOrMargin(): boolean;
949
+ hasPaddingOrBorder(): boolean;
950
+ isFlexStartPositionDefined(axis: FlexDirection, direction: Direction): boolean;
951
+ isFlexStartPositionAuto(axis: FlexDirection, direction: Direction): boolean;
952
+ isInlineStartPositionDefined(axis: FlexDirection, direction: Direction): boolean;
953
+ isInlineStartPositionAuto(axis: FlexDirection, direction: Direction): boolean;
954
+ isFlexEndPositionDefined(axis: FlexDirection, direction: Direction): boolean;
955
+ isFlexEndPositionAuto(axis: FlexDirection, direction: Direction): boolean;
956
+ isInlineEndPositionDefined(axis: FlexDirection, direction: Direction): boolean;
957
+ isInlineEndPositionAuto(axis: FlexDirection, direction: Direction): boolean;
958
+ computeFlexStartPosition(axis: FlexDirection, direction: Direction, axisSize: number): number;
959
+ computeInlineStartPosition(axis: FlexDirection, direction: Direction, axisSize: number): number;
960
+ computeFlexEndPosition(axis: FlexDirection, direction: Direction, axisSize: number): number;
961
+ computeInlineEndPosition(axis: FlexDirection, direction: Direction, axisSize: number): number;
962
+ computeFlexStartMargin(axis: FlexDirection, direction: Direction, widthSize: number): number;
963
+ computeInlineStartMargin(axis: FlexDirection, direction: Direction, widthSize: number): number;
964
+ computeFlexEndMargin(axis: FlexDirection, direction: Direction, widthSize: number): number;
965
+ computeInlineEndMargin(axis: FlexDirection, direction: Direction, widthSize: number): number;
966
+ computeFlexStartBorder(axis: FlexDirection, direction: Direction): number;
967
+ computeInlineStartBorder(axis: FlexDirection, direction: Direction): number;
968
+ computeFlexEndBorder(axis: FlexDirection, direction: Direction): number;
969
+ computeInlineEndBorder(axis: FlexDirection, direction: Direction): number;
970
+ computeFlexStartPadding(axis: FlexDirection, direction: Direction, widthSize: number): number;
971
+ computeInlineStartPadding(axis: FlexDirection, direction: Direction, widthSize: number): number;
972
+ computeFlexEndPadding(axis: FlexDirection, direction: Direction, widthSize: number): number;
973
+ computeInlineEndPadding(axis: FlexDirection, direction: Direction, widthSize: number): number;
974
+ computeInlineStartPaddingAndBorder(axis: FlexDirection, direction: Direction, widthSize: number): number;
975
+ computeFlexStartPaddingAndBorder(axis: FlexDirection, direction: Direction, widthSize: number): number;
976
+ computeInlineEndPaddingAndBorder(axis: FlexDirection, direction: Direction, widthSize: number): number;
977
+ computeFlexEndPaddingAndBorder(axis: FlexDirection, direction: Direction, widthSize: number): number;
978
+ computePaddingAndBorderForDimension(direction: Direction, dimension: Dimension, widthSize: number): number;
979
+ computeBorderForAxis(axis: FlexDirection): number;
980
+ computeMarginForAxis(axis: FlexDirection, widthSize: number): number;
981
+ computeGapForAxis(axis: FlexDirection, ownerSize: number): number;
982
+ computeGapForDimension(dimension: Dimension, ownerSize: number): number;
983
+ flexStartMarginIsAuto(axis: FlexDirection, direction: Direction): boolean;
984
+ flexEndMarginIsAuto(axis: FlexDirection, direction: Direction): boolean;
985
+ inlineStartMarginIsAuto(axis: FlexDirection, direction: Direction): boolean;
986
+ inlineEndMarginIsAuto(axis: FlexDirection, direction: Direction): boolean;
987
+ equals(other: Style): boolean;
988
+ copyFrom(other: Style): void;
989
+ private computeColumnGap;
990
+ private computeRowGap;
991
+ private computeLeftEdge;
992
+ private computeTopEdge;
993
+ private computeRightEdge;
994
+ private computeBottomEdge;
995
+ private buildResolvedEdges;
996
+ private resolvedPosition;
997
+ private resolvedMargin;
998
+ private resolvedPadding;
999
+ private resolvedBorder;
1000
+ computePosition(edge: PhysicalEdge, direction: Direction): StyleLength;
1001
+ computeMargin(edge: PhysicalEdge, direction: Direction): StyleLength;
1002
+ computePadding(edge: PhysicalEdge, direction: Direction): StyleLength;
1003
+ computeBorder(edge: PhysicalEdge, direction: Direction): StyleLength;
1004
+ }
1005
+ //#endregion
1006
+ //#region src/yoga/core/node.d.ts
1007
+ type MeasureFunc = (width: number, widthMode: MeasureMode, height: number, heightMode: MeasureMode) => Size$1;
1008
+ type BaselineFunc = (width: number, height: number) => number;
1009
+ type DirtiedFunc = () => void;
1010
+ declare class Node$1 {
1011
+ hasNewLayout_: boolean;
1012
+ isReferenceBaseline_: boolean;
1013
+ private isDirty_;
1014
+ alwaysFormsContainingBlock: boolean;
1015
+ nodeType: NodeType;
1016
+ private measureFunc_;
1017
+ private measureResult_;
1018
+ private baselineFunc_;
1019
+ private dirtiedFunc_;
1020
+ style: Style;
1021
+ layout: LayoutResults;
1022
+ lineIndex: number;
1023
+ private contentsChildrenCount_;
1024
+ owner: Node$1 | null;
1025
+ children: Node$1[];
1026
+ config: Config$1;
1027
+ private processedDimensionWidth_;
1028
+ private processedDimensionHeight_;
1029
+ private dimensionsDirty_;
1030
+ constructor(config?: Config$1);
1031
+ hasMeasureFunc(): boolean;
1032
+ measure(availableWidth: number, widthMode: MeasureMode, availableHeight: number, heightMode: MeasureMode): Size$1;
1033
+ hasBaselineFunc(): boolean;
1034
+ baseline(width: number, height: number): number;
1035
+ getDirtiedFunc(): DirtiedFunc | null;
1036
+ dimensionWithMargin(axis: FlexDirection, widthSize: number): number;
1037
+ isLayoutDimensionDefined(axis: FlexDirection): boolean;
1038
+ /**
1039
+ * Whether the node has a "definite length" along the given axis.
1040
+ * https://www.w3.org/TR/css-sizing-3/#definite
1041
+ */
1042
+ hasDefiniteLength(dim: Dimension, ownerSize: number): boolean;
1043
+ hasErrata(errata: number): boolean;
1044
+ hasContentsChildren(): boolean;
1045
+ getChildCount(): number;
1046
+ getChild(index: number): Node$1;
1047
+ /**
1048
+ * Children for layout purposes: skips display: contents nodes, splicing
1049
+ * their children in place. Returns the raw children array when nothing
1050
+ * needs splicing — do not mutate the result.
1051
+ */
1052
+ getLayoutChildren(): readonly Node$1[];
1053
+ getLayoutChildCount(): number;
1054
+ isDirty(): boolean;
1055
+ getProcessedDimension(dim: Dimension): StyleSizeLength;
1056
+ getResolvedDimension(direction: Direction, dim: Dimension, referenceLength: number, ownerWidth: number): number;
1057
+ setMeasureFunc(measureFunc: MeasureFunc | null): void;
1058
+ setBaselineFunc(baselineFunc: BaselineFunc | null): void;
1059
+ setCoreDirtiedFunc(dirtiedFunc: DirtiedFunc | null): void;
1060
+ insertChild(child: Node$1, index: number): void;
1061
+ setConfig(config: Config$1): void;
1062
+ setDirty(isDirty: boolean): void;
1063
+ setChildren(children: Node$1[]): void;
1064
+ removeChild(child: Node$1): boolean;
1065
+ removeChildAtIndex(index: number): void;
1066
+ clearChildren(): void;
1067
+ syncContentsChildrenCount(): void;
1068
+ setLayoutDirection(direction: Direction): void;
1069
+ setLayoutMargin(margin: number, edge: PhysicalEdge): void;
1070
+ setLayoutBorder(border: number, edge: PhysicalEdge): void;
1071
+ setLayoutPadding(padding: number, edge: PhysicalEdge): void;
1072
+ setLayoutLastOwnerDirection(direction: Direction): void;
1073
+ setLayoutComputedFlexBasis(computedFlexBasis: number): void;
1074
+ markLayoutWritten(): void;
1075
+ setLayoutPosition(position: number, edge: PhysicalEdge): void;
1076
+ setLayoutComputedFlexBasisGeneration(computedFlexBasisGeneration: number): void;
1077
+ setLayoutMeasuredDimension(measuredDimension: number, dim: Dimension): void;
1078
+ setLayoutHadOverflow(hadOverflow: boolean): void;
1079
+ setLayoutDimension(lengthValue: number, dim: Dimension): void;
1080
+ relativePosition(axis: FlexDirection, direction: Direction, axisSize: number): number;
1081
+ setPositionFromStyle(direction: Direction, ownerWidth: number, ownerHeight: number): void;
1082
+ processFlexBasis(): StyleSizeLength;
1083
+ resolveFlexBasis(direction: Direction, flexDirection: FlexDirection, referenceLength: number, ownerWidth: number): number;
1084
+ processDimensions(): void;
1085
+ invalidateProcessedDimensions(): void;
1086
+ resolveDirection(ownerDirection: Direction): Direction;
1087
+ cloneChildrenIfNeeded(): void;
1088
+ cloneContentsChildrenIfNeeded(): void;
1089
+ markDirtyAndPropagate(): void;
1090
+ resolveFlexGrow(): number;
1091
+ resolveFlexShrink(): number;
1092
+ isNodeFlexible(): boolean;
1093
+ reset(): void;
1094
+ }
1095
+ //#endregion
1096
+ //#region src/yoga/node.d.ts
1097
+ type Layout = {
1098
+ left: number;
1099
+ right: number;
1100
+ top: number;
1101
+ bottom: number;
1102
+ width: number;
1103
+ height: number;
1104
+ hadOverflow: boolean;
1105
+ };
1106
+ type Size = {
1107
+ width: number;
1108
+ height: number;
1109
+ };
1110
+ type Value = {
1111
+ unit: Unit;
1112
+ value: number;
1113
+ };
1114
+ type DirtiedFunction = (node: Node) => void;
1115
+ type MeasureFunction = (width: number, widthMode: MeasureMode, height: number, heightMode: MeasureMode) => Size;
1116
+ declare class Node extends Node$1 {
1117
+ private constructor();
1118
+ static create(config?: Config): Node;
1119
+ static createDefault(): Node;
1120
+ static createWithConfig(config: Config): Node;
1121
+ free(): void;
1122
+ freeRecursive(): void;
1123
+ insertChild(child: Node, index: number): void;
1124
+ removeChild(child: Node): boolean;
1125
+ getChildCount(): number;
1126
+ getChild(index: number): Node;
1127
+ getParent(): Node | null;
1128
+ setChildren(children: Node[]): void;
1129
+ reset(): void;
1130
+ copyStyle(other: Node): void;
1131
+ private updateStyleLength;
1132
+ private updateStyleSize;
1133
+ private updateStyleEnum;
1134
+ private setDimensionValue;
1135
+ private setMinDimensionValue;
1136
+ private setMaxDimensionValue;
1137
+ setPositionType(positionType: PositionType): void;
1138
+ setPosition(edge: Edge, position: number | `${number}%` | undefined): void;
1139
+ setPositionPercent(edge: Edge, position: number | undefined): void;
1140
+ setPositionAuto(edge: Edge): void;
1141
+ setAlignContent(alignContent: Align): void;
1142
+ setAlignItems(alignItems: Align): void;
1143
+ setAlignSelf(alignSelf: Align): void;
1144
+ setFlexDirection(flexDirection: FlexDirection): void;
1145
+ setFlexWrap(flexWrap: Wrap): void;
1146
+ setJustifyContent(justifyContent: Justify): void;
1147
+ setDirection(direction: Direction): void;
1148
+ setMargin(edge: Edge, margin: number | "auto" | `${number}%` | undefined): void;
1149
+ setMarginPercent(edge: Edge, margin: number | undefined): void;
1150
+ setMarginAuto(edge: Edge): void;
1151
+ setOverflow(overflow: Overflow): void;
1152
+ setDisplay(display: Display): void;
1153
+ setFlex(flex: number | undefined): void;
1154
+ setFlexBasis(flexBasis: number | "auto" | "fit-content" | "max-content" | "stretch" | `${number}%` | undefined): void;
1155
+ setFlexBasisPercent(flexBasis: number | undefined): void;
1156
+ setFlexBasisAuto(): void;
1157
+ setFlexBasisMaxContent(): void;
1158
+ setFlexBasisFitContent(): void;
1159
+ setFlexBasisStretch(): void;
1160
+ setFlexGrow(flexGrow: number | undefined): void;
1161
+ setFlexShrink(flexShrink: number | undefined): void;
1162
+ setWidth(width: number | "auto" | "fit-content" | "max-content" | "stretch" | `${number}%` | undefined): void;
1163
+ setWidthPercent(width: number | undefined): void;
1164
+ setWidthAuto(): void;
1165
+ setWidthMaxContent(): void;
1166
+ setWidthFitContent(): void;
1167
+ setWidthStretch(): void;
1168
+ setHeight(height: number | "auto" | "fit-content" | "max-content" | "stretch" | `${number}%` | undefined): void;
1169
+ setHeightPercent(height: number | undefined): void;
1170
+ setHeightAuto(): void;
1171
+ setHeightMaxContent(): void;
1172
+ setHeightFitContent(): void;
1173
+ setHeightStretch(): void;
1174
+ setMinWidth(minWidth: number | "fit-content" | "max-content" | "stretch" | `${number}%` | undefined): void;
1175
+ setMinWidthPercent(minWidth: number | undefined): void;
1176
+ setMinWidthMaxContent(): void;
1177
+ setMinWidthFitContent(): void;
1178
+ setMinWidthStretch(): void;
1179
+ setMinHeight(minHeight: number | "fit-content" | "max-content" | "stretch" | `${number}%` | undefined): void;
1180
+ setMinHeightPercent(minHeight: number | undefined): void;
1181
+ setMinHeightMaxContent(): void;
1182
+ setMinHeightFitContent(): void;
1183
+ setMinHeightStretch(): void;
1184
+ setMaxWidth(maxWidth: number | "fit-content" | "max-content" | "stretch" | `${number}%` | undefined): void;
1185
+ setMaxWidthPercent(maxWidth: number | undefined): void;
1186
+ setMaxWidthMaxContent(): void;
1187
+ setMaxWidthFitContent(): void;
1188
+ setMaxWidthStretch(): void;
1189
+ setMaxHeight(maxHeight: number | "fit-content" | "max-content" | "stretch" | `${number}%` | undefined): void;
1190
+ setMaxHeightPercent(maxHeight: number | undefined): void;
1191
+ setMaxHeightMaxContent(): void;
1192
+ setMaxHeightFitContent(): void;
1193
+ setMaxHeightStretch(): void;
1194
+ setAspectRatio(aspectRatio: number | undefined): void;
1195
+ setBorder(edge: Edge, borderWidth: number | undefined): void;
1196
+ setPadding(edge: Edge, padding: number | `${number}%` | undefined): void;
1197
+ setPaddingPercent(edge: Edge, padding: number | undefined): void;
1198
+ setGap(gutter: Gutter, gapLength: number | `${number}%` | undefined): void;
1199
+ setGapPercent(gutter: Gutter, gapLength: number | undefined): void;
1200
+ setBoxSizing(boxSizing: BoxSizing): void;
1201
+ setIsReferenceBaseline(isReferenceBaseline: boolean): void;
1202
+ setAlwaysFormsContainingBlock(alwaysFormsContainingBlock: boolean): void;
1203
+ getPositionType(): PositionType;
1204
+ getPosition(edge: Edge): Value;
1205
+ getAlignContent(): Align;
1206
+ getAlignItems(): Align;
1207
+ getAlignSelf(): Align;
1208
+ getFlexDirection(): FlexDirection;
1209
+ getFlexWrap(): Wrap;
1210
+ getJustifyContent(): Justify;
1211
+ getDirection(): Direction;
1212
+ getMargin(edge: Edge): Value;
1213
+ getOverflow(): Overflow;
1214
+ getDisplay(): Display;
1215
+ getFlexBasis(): Value;
1216
+ getFlexGrow(): number;
1217
+ getFlexShrink(): number;
1218
+ getWidth(): Value;
1219
+ getHeight(): Value;
1220
+ getMinWidth(): Value;
1221
+ getMinHeight(): Value;
1222
+ getMaxWidth(): Value;
1223
+ getMaxHeight(): Value;
1224
+ getAspectRatio(): number;
1225
+ getBorder(edge: Edge): number;
1226
+ getPadding(edge: Edge): Value;
1227
+ getGap(gutter: Gutter): Value;
1228
+ getBoxSizing(): BoxSizing;
1229
+ isReferenceBaseline(): boolean;
1230
+ setMeasureFunc(measureFunc: MeasureFunction | null): void;
1231
+ unsetMeasureFunc(): void;
1232
+ setDirtiedFunc(dirtiedFunc: DirtiedFunction | null): void;
1233
+ unsetDirtiedFunc(): void;
1234
+ markDirty(): void;
1235
+ isDirty(): boolean;
1236
+ markLayoutSeen(): void;
1237
+ hasNewLayout(): boolean;
1238
+ calculateLayout(width?: number | "auto" | undefined, height?: number | "auto" | undefined, direction?: Direction): void;
1239
+ getComputedLeft(): number;
1240
+ getComputedRight(): number;
1241
+ getComputedTop(): number;
1242
+ getComputedBottom(): number;
1243
+ getComputedWidth(): number;
1244
+ getComputedHeight(): number;
1245
+ getComputedHadOverflow(): boolean;
1246
+ getComputedLayout(): Layout;
1247
+ private resolvedLayoutProperty;
1248
+ getComputedMargin(edge: Edge): number;
1249
+ getComputedBorder(edge: Edge): number;
1250
+ getComputedPadding(edge: Edge): number;
1251
+ }
1252
+ //#endregion
1253
+ //#region src/boxes.d.ts
1254
+ /**
1255
+ Style of the box border.
1256
+ */
1257
+ type BoxStyle = {
1258
+ readonly topLeft: string;
1259
+ readonly top: string;
1260
+ readonly topRight: string;
1261
+ readonly right: string;
1262
+ readonly bottomRight: string;
1263
+ readonly bottom: string;
1264
+ readonly bottomLeft: string;
1265
+ readonly left: string;
1266
+ };
1267
+ declare const boxes: {
1268
+ readonly single: {
1269
+ readonly topLeft: "┌";
1270
+ readonly top: "─";
1271
+ readonly topRight: "┐";
1272
+ readonly right: "│";
1273
+ readonly bottomRight: "┘";
1274
+ readonly bottom: "─";
1275
+ readonly bottomLeft: "└";
1276
+ readonly left: "│";
1277
+ };
1278
+ readonly double: {
1279
+ readonly topLeft: "╔";
1280
+ readonly top: "═";
1281
+ readonly topRight: "╗";
1282
+ readonly right: "║";
1283
+ readonly bottomRight: "╝";
1284
+ readonly bottom: "═";
1285
+ readonly bottomLeft: "╚";
1286
+ readonly left: "║";
1287
+ };
1288
+ readonly round: {
1289
+ readonly topLeft: "╭";
1290
+ readonly top: "─";
1291
+ readonly topRight: "╮";
1292
+ readonly right: "│";
1293
+ readonly bottomRight: "╯";
1294
+ readonly bottom: "─";
1295
+ readonly bottomLeft: "╰";
1296
+ readonly left: "│";
1297
+ };
1298
+ readonly bold: {
1299
+ readonly topLeft: "┏";
1300
+ readonly top: "━";
1301
+ readonly topRight: "┓";
1302
+ readonly right: "┃";
1303
+ readonly bottomRight: "┛";
1304
+ readonly bottom: "━";
1305
+ readonly bottomLeft: "┗";
1306
+ readonly left: "┃";
1307
+ };
1308
+ readonly singleDouble: {
1309
+ readonly topLeft: "╓";
1310
+ readonly top: "─";
1311
+ readonly topRight: "╖";
1312
+ readonly right: "║";
1313
+ readonly bottomRight: "╜";
1314
+ readonly bottom: "─";
1315
+ readonly bottomLeft: "╙";
1316
+ readonly left: "║";
1317
+ };
1318
+ readonly doubleSingle: {
1319
+ readonly topLeft: "╒";
1320
+ readonly top: "═";
1321
+ readonly topRight: "╕";
1322
+ readonly right: "│";
1323
+ readonly bottomRight: "╛";
1324
+ readonly bottom: "═";
1325
+ readonly bottomLeft: "╘";
1326
+ readonly left: "│";
1327
+ };
1328
+ readonly classic: {
1329
+ readonly topLeft: "+";
1330
+ readonly top: "-";
1331
+ readonly topRight: "+";
1332
+ readonly right: "|";
1333
+ readonly bottomRight: "+";
1334
+ readonly bottom: "-";
1335
+ readonly bottomLeft: "+";
1336
+ readonly left: "|";
1337
+ };
1338
+ readonly arrow: {
1339
+ readonly topLeft: "↘";
1340
+ readonly top: "↓";
1341
+ readonly topRight: "↙";
1342
+ readonly right: "←";
1343
+ readonly bottomRight: "↖";
1344
+ readonly bottom: "↑";
1345
+ readonly bottomLeft: "↗";
1346
+ readonly left: "→";
1347
+ };
1348
+ };
1349
+ type Boxes = typeof boxes;
1350
+ //#endregion
1351
+ //#region src/styles.d.ts
1352
+ type Styles = {
1353
+ readonly textWrap?: "wrap" | "hard" | "truncate-end" | "truncate" | "truncate-middle" | "truncate-start";
1354
+ /**
1355
+ Controls how the element is positioned.
1356
+
1357
+ When `position` is `static`, `top`, `right`, `bottom`, and `left` are ignored.
1358
+ */
1359
+ readonly position?: "absolute" | "relative" | "static";
1360
+ /**
1361
+ Top offset for positioned elements.
1362
+ */
1363
+ readonly top?: number | string;
1364
+ /**
1365
+ Right offset for positioned elements.
1366
+ */
1367
+ readonly right?: number | string;
1368
+ /**
1369
+ Bottom offset for positioned elements.
1370
+ */
1371
+ readonly bottom?: number | string;
1372
+ /**
1373
+ Left offset for positioned elements.
1374
+ */
1375
+ readonly left?: number | string;
1376
+ /**
1377
+ Size of the gap between an element's columns.
1378
+ */
1379
+ readonly columnGap?: number;
1380
+ /**
1381
+ Size of the gap between an element's rows.
1382
+ */
1383
+ readonly rowGap?: number;
1384
+ /**
1385
+ Size of the gap between an element's columns and rows. A shorthand for `columnGap` and `rowGap`.
1386
+ */
1387
+ readonly gap?: number;
1388
+ /**
1389
+ Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft`, and `marginRight`.
1390
+ */
1391
+ readonly margin?: number;
1392
+ /**
1393
+ Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
1394
+ */
1395
+ readonly marginX?: number;
1396
+ /**
1397
+ Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
1398
+ */
1399
+ readonly marginY?: number;
1400
+ /**
1401
+ Top margin.
1402
+ */
1403
+ readonly marginTop?: number;
1404
+ /**
1405
+ Bottom margin.
1406
+ */
1407
+ readonly marginBottom?: number;
1408
+ /**
1409
+ Left margin.
1410
+ */
1411
+ readonly marginLeft?: number;
1412
+ /**
1413
+ Right margin.
1414
+ */
1415
+ readonly marginRight?: number;
1416
+ /**
1417
+ Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`.
1418
+ */
1419
+ readonly padding?: number;
1420
+ /**
1421
+ Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
1422
+ */
1423
+ readonly paddingX?: number;
1424
+ /**
1425
+ Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
1426
+ */
1427
+ readonly paddingY?: number;
1428
+ /**
1429
+ Top padding.
1430
+ */
1431
+ readonly paddingTop?: number;
1432
+ /**
1433
+ Bottom padding.
1434
+ */
1435
+ readonly paddingBottom?: number;
1436
+ /**
1437
+ Left padding.
1438
+ */
1439
+ readonly paddingLeft?: number;
1440
+ /**
1441
+ Right padding.
1442
+ */
1443
+ readonly paddingRight?: number;
1444
+ /**
1445
+ This property defines the ability for a flex item to grow if necessary.
1446
+ See [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/).
1447
+ */
1448
+ readonly flexGrow?: number;
1449
+ /**
1450
+ It specifies the “flex shrink factor”, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when there isn’t enough space on the row.
1451
+ See [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/).
1452
+ */
1453
+ readonly flexShrink?: number;
1454
+ /**
1455
+ It establishes the main-axis, thus defining the direction flex items are placed in the flex container.
1456
+ See [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/).
1457
+ */
1458
+ readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
1459
+ /**
1460
+ It specifies the initial size of the flex item, before any available space is distributed according to the flex factors.
1461
+ See [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/).
1462
+ */
1463
+ readonly flexBasis?: number | string;
1464
+ /**
1465
+ It defines whether the flex items are forced in a single line or can be flowed into multiple lines. If set to multiple lines, it also defines the cross-axis which determines the direction new lines are stacked in.
1466
+ See [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/).
1467
+ */
1468
+ readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
1469
+ /**
1470
+ The align-items property defines the default behavior for how items are laid out along the cross axis (perpendicular to the main axis).
1471
+ See [align-items](https://css-tricks.com/almanac/properties/a/align-items/).
1472
+ */
1473
+ readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
1474
+ /**
1475
+ It makes possible to override the align-items value for specific flex items.
1476
+ See [align-self](https://css-tricks.com/almanac/properties/a/align-self/).
1477
+ */
1478
+ readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | "stretch" | "baseline";
1479
+ /**
1480
+ It defines the alignment along the cross axis when there are multiple lines of flex items (when using flex-wrap).
1481
+ See [align-content](https://css-tricks.com/almanac/properties/a/align-content/).
1482
+ */
1483
+ readonly alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly";
1484
+ /**
1485
+ It defines the alignment along the main axis.
1486
+ See [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/).
1487
+ */
1488
+ readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center";
1489
+ /**
1490
+ Width of the element in spaces. You can also set it as a percentage, which will calculate the width based on the width of the parent element.
1491
+ */
1492
+ readonly width?: number | string;
1493
+ /**
1494
+ Height of the element in lines (rows). You can also set it as a percentage, which will calculate the height based on the height of the parent element.
1495
+ */
1496
+ readonly height?: number | string;
1497
+ /**
1498
+ Sets a minimum width of the element.
1499
+ Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
1500
+ */
1501
+ readonly minWidth?: number | string;
1502
+ /**
1503
+ Sets a minimum height of the element in lines (rows). You can also set it as a percentage, which will calculate the minimum height based on the height of the parent element.
1504
+ */
1505
+ readonly minHeight?: number | string;
1506
+ /**
1507
+ Sets a maximum width of the element.
1508
+ Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
1509
+ */
1510
+ readonly maxWidth?: number | string;
1511
+ /**
1512
+ Sets a maximum height of the element in lines (rows). You can also set it as a percentage, which will calculate the maximum height based on the height of the parent element.
1513
+ */
1514
+ readonly maxHeight?: number | string;
1515
+ /**
1516
+ Defines the aspect ratio (width/height) for the element.
1517
+
1518
+ Use it with at least one size constraint (`width`, `height`, `minHeight`, or `maxHeight`) so Ink can derive the missing dimension.
1519
+ */
1520
+ readonly aspectRatio?: number;
1521
+ /**
1522
+ Set this property to `none` to hide the element.
1523
+ */
1524
+ readonly display?: "flex" | "none";
1525
+ /**
1526
+ Add a border with a specified style. If `borderStyle` is `undefined` (the default), no border will be added.
1527
+ */
1528
+ readonly borderStyle?: keyof Boxes | BoxStyle;
1529
+ /**
1530
+ Determines whether the top border is visible.
1531
+
1532
+ @default true
1533
+ */
1534
+ readonly borderTop?: boolean;
1535
+ /**
1536
+ Determines whether the bottom border is visible.
1537
+
1538
+ @default true
1539
+ */
1540
+ readonly borderBottom?: boolean;
1541
+ /**
1542
+ Determines whether the left border is visible.
1543
+
1544
+ @default true
1545
+ */
1546
+ readonly borderLeft?: boolean;
1547
+ /**
1548
+ Determines whether the right border is visible.
1549
+
1550
+ @default true
1551
+ */
1552
+ readonly borderRight?: boolean;
1553
+ /**
1554
+ Change border color. A shorthand for setting `borderTopColor`, `borderRightColor`, `borderBottomColor`, and `borderLeftColor`.
1555
+ */
1556
+ readonly borderColor?: LiteralUnion<ForegroundColorName, string>;
1557
+ /**
1558
+ Change the top border color. Accepts the same values as `color` in `Text` component.
1559
+ */
1560
+ readonly borderTopColor?: LiteralUnion<ForegroundColorName, string>;
1561
+ /**
1562
+ Change the bottom border color. Accepts the same values as `color` in `Text` component.
1563
+ */
1564
+ readonly borderBottomColor?: LiteralUnion<ForegroundColorName, string>;
1565
+ /**
1566
+ Change the left border color. Accepts the same values as `color` in `Text` component.
1567
+ */
1568
+ readonly borderLeftColor?: LiteralUnion<ForegroundColorName, string>;
1569
+ /**
1570
+ Change the right border color. Accepts the same values as `color` in `Text` component.
1571
+ */
1572
+ readonly borderRightColor?: LiteralUnion<ForegroundColorName, string>;
1573
+ /**
1574
+ Dim the border color. A shorthand for setting `borderTopDimColor`, `borderBottomDimColor`, `borderLeftDimColor`, and `borderRightDimColor`.
1575
+
1576
+ @default false
1577
+ */
1578
+ readonly borderDimColor?: boolean;
1579
+ /**
1580
+ Dim the top border color.
1581
+
1582
+ @default false
1583
+ */
1584
+ readonly borderTopDimColor?: boolean;
1585
+ /**
1586
+ Dim the bottom border color.
1587
+
1588
+ @default false
1589
+ */
1590
+ readonly borderBottomDimColor?: boolean;
1591
+ /**
1592
+ Dim the left border color.
1593
+
1594
+ @default false
1595
+ */
1596
+ readonly borderLeftDimColor?: boolean;
1597
+ /**
1598
+ Dim the right border color.
1599
+
1600
+ @default false
1601
+ */
1602
+ readonly borderRightDimColor?: boolean;
1603
+ /**
1604
+ Change border background color. A shorthand for setting `borderTopBackgroundColor`, `borderRightBackgroundColor`, `borderBottomBackgroundColor`, and `borderLeftBackgroundColor`.
1605
+ */
1606
+ readonly borderBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
1607
+ /**
1608
+ Change top border background color. Accepts the same values as `backgroundColor` in `Text` component.
1609
+ */
1610
+ readonly borderTopBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
1611
+ /**
1612
+ Change bottom border background color. Accepts the same values as `backgroundColor` in `Text` component.
1613
+ */
1614
+ readonly borderBottomBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
1615
+ /**
1616
+ Change left border background color. Accepts the same values as `backgroundColor` in `Text` component.
1617
+ */
1618
+ readonly borderLeftBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
1619
+ /**
1620
+ Change right border background color. Accepts the same values as `backgroundColor` in `Text` component.
1621
+ */
1622
+ readonly borderRightBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
1623
+ /**
1624
+ Behavior for an element's overflow in both directions.
1625
+
1626
+ @default 'visible'
1627
+ */
1628
+ readonly overflow?: "visible" | "hidden";
1629
+ /**
1630
+ Behavior for an element's overflow in the horizontal direction.
1631
+
1632
+ @default 'visible'
1633
+ */
1634
+ readonly overflowX?: "visible" | "hidden";
1635
+ /**
1636
+ Behavior for an element's overflow in the vertical direction.
1637
+
1638
+ @default 'visible'
1639
+ */
1640
+ readonly overflowY?: "visible" | "hidden";
1641
+ /**
1642
+ Background color for the element.
1643
+
1644
+ Accepts the same values as `color` in the `<Text>` component.
1645
+ */
1646
+ readonly backgroundColor?: LiteralUnion<ForegroundColorName, string>;
1647
+ };
1648
+ //#endregion
1649
+ //#region src/render-node-to-output.d.ts
1650
+ type OutputTransformer = (s: string, index: number) => string;
1651
+ //#endregion
1652
+ //#region src/dom.d.ts
1653
+ type InkNode = {
1654
+ parentNode: DOMElement | undefined;
1655
+ yogaNode?: Node;
1656
+ internal_static?: boolean;
1657
+ style: Styles;
1658
+ };
1659
+ type LayoutListener = () => void;
1660
+ type TextName = "#text";
1661
+ type ElementNames = "ink-root" | "ink-box" | "ink-text" | "ink-virtual-text";
1662
+ type NodeNames = ElementNames | TextName;
1663
+ type DOMElement = {
1664
+ nodeName: ElementNames;
1665
+ attributes: Record<string, DOMNodeAttribute>;
1666
+ childNodes: DOMNode[];
1667
+ internal_transform?: OutputTransformer;
1668
+ internal_accessibility?: {
1669
+ role?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
1670
+ state?: {
1671
+ busy?: boolean;
1672
+ checked?: boolean;
1673
+ disabled?: boolean;
1674
+ expanded?: boolean;
1675
+ multiline?: boolean;
1676
+ multiselectable?: boolean;
1677
+ readonly?: boolean;
1678
+ required?: boolean;
1679
+ selected?: boolean;
1680
+ };
1681
+ };
1682
+ isStaticDirty?: boolean;
1683
+ staticNode?: DOMElement;
1684
+ previousStaticNode?: DOMElement;
1685
+ onComputeLayout?: () => void;
1686
+ onRender?: () => void;
1687
+ onImmediateRender?: () => void;
1688
+ onStaticChange?: () => void;
1689
+ internal_layoutListeners?: Set<LayoutListener>;
1690
+ } & InkNode;
1691
+ type TextNode = {
1692
+ nodeName: TextName;
1693
+ nodeValue: string;
1694
+ } & InkNode;
1695
+ type DOMNode<T = {
1696
+ nodeName: NodeNames;
1697
+ }> = T extends {
1698
+ nodeName: infer U;
1699
+ } ? U extends "#text" ? TextNode : DOMElement : never;
1700
+ type DOMNodeAttribute = boolean | string | number;
1701
+ //#endregion
1702
+ //#region src/components/Box.d.ts
1703
+ type Props$1 = Except<Styles, "textWrap"> & {
1704
+ /**
1705
+ A label for the element for screen readers.
1706
+ */
1707
+ readonly "aria-label"?: string;
1708
+ /**
1709
+ Hide the element from screen readers.
1710
+ */
1711
+ readonly "aria-hidden"?: boolean;
1712
+ /**
1713
+ The role of the element.
1714
+ */
1715
+ readonly "aria-role"?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
1716
+ /**
1717
+ The state of the element.
1718
+ */
1719
+ readonly "aria-state"?: {
1720
+ readonly busy?: boolean;
1721
+ readonly checked?: boolean;
1722
+ readonly disabled?: boolean;
1723
+ readonly expanded?: boolean;
1724
+ readonly multiline?: boolean;
1725
+ readonly multiselectable?: boolean;
1726
+ readonly readonly?: boolean;
1727
+ readonly required?: boolean;
1728
+ readonly selected?: boolean;
1729
+ };
1730
+ };
1731
+ /**
1732
+ `<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
1733
+ */
1734
+ declare const Box: React.ForwardRefExoticComponent<Except<Styles, "textWrap"> & {
1735
+ /**
1736
+ A label for the element for screen readers.
1737
+ */
1738
+ readonly "aria-label"?: string;
1739
+ /**
1740
+ Hide the element from screen readers.
1741
+ */
1742
+ readonly "aria-hidden"?: boolean;
1743
+ /**
1744
+ The role of the element.
1745
+ */
1746
+ readonly "aria-role"?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
1747
+ /**
1748
+ The state of the element.
1749
+ */
1750
+ readonly "aria-state"?: {
1751
+ readonly busy?: boolean;
1752
+ readonly checked?: boolean;
1753
+ readonly disabled?: boolean;
1754
+ readonly expanded?: boolean;
1755
+ readonly multiline?: boolean;
1756
+ readonly multiselectable?: boolean;
1757
+ readonly readonly?: boolean;
1758
+ readonly required?: boolean;
1759
+ readonly selected?: boolean;
1760
+ };
1761
+ } & {
1762
+ children?: React.ReactNode | undefined;
1763
+ } & React.RefAttributes<DOMElement>>;
1764
+ //#endregion
1765
+ //#region src/components/Text.d.ts
1766
+ type Props$6 = {
1767
+ /**
1768
+ A label for the element for screen readers.
1769
+ */
1770
+ readonly "aria-label"?: string;
1771
+ /**
1772
+ Hide the element from screen readers.
1773
+ */
1774
+ readonly "aria-hidden"?: boolean;
1775
+ /**
1776
+ Change text color. Ink uses Chalk under the hood, so all its functionality is supported.
1777
+ */
1778
+ readonly color?: LiteralUnion<ForegroundColorName, string>;
1779
+ /**
1780
+ Same as `color`, but for the background.
1781
+ */
1782
+ readonly backgroundColor?: LiteralUnion<ForegroundColorName, string>;
1783
+ /**
1784
+ Dim the color (make it less bright).
1785
+ */
1786
+ readonly dimColor?: boolean;
1787
+ /**
1788
+ Make the text bold.
1789
+ */
1790
+ readonly bold?: boolean;
1791
+ /**
1792
+ Make the text italic.
1793
+ */
1794
+ readonly italic?: boolean;
1795
+ /**
1796
+ Make the text underlined.
1797
+ */
1798
+ readonly underline?: boolean;
1799
+ /**
1800
+ Make the text crossed out with a line.
1801
+ */
1802
+ readonly strikethrough?: boolean;
1803
+ /**
1804
+ Inverse background and foreground colors.
1805
+ */
1806
+ readonly inverse?: boolean;
1807
+ /**
1808
+ This property tells Ink to wrap or truncate text if its width is larger than the container. If `wrap` is passed (the default), Ink will wrap text and split it into multiple lines. If `hard` is passed, Ink will fill each line to the full column width, breaking words as necessary. If `truncate-*` is passed, Ink will truncate text instead, resulting in one line of text with the rest cut off.
1809
+ */
1810
+ readonly wrap?: Styles["textWrap"];
1811
+ readonly children?: ReactNode;
1812
+ };
1813
+ /**
1814
+ This component can display text and change its style to make it bold, underlined, italic, or strikethrough.
1815
+ */
1816
+ declare function Text({ color, backgroundColor, dimColor, bold, italic, underline, strikethrough, inverse, wrap, children, "aria-label": ariaLabel, "aria-hidden": ariaHidden }: Props$6): React.JSX.Element | null;
1817
+ //#endregion
1818
+ //#region src/components/StdinContext.d.ts
1819
+ type PublicProps = {
1820
+ /**
1821
+ The stdin stream passed to `render()` in `options.stdin`, or `process.stdin` by default. Useful if your app needs to handle user input.
1822
+ */
1823
+ readonly stdin: NodeJS.ReadableStream;
1824
+ /**
1825
+ Ink exposes this function via own `<StdinContext>` to be able to handle Ctrl+C, that's why you should use Ink's `setRawMode` instead of `process.stdin.setRawMode`. If the `stdin` stream passed to Ink does not support setRawMode, this function does nothing.
1826
+ */
1827
+ readonly setRawMode: (value: boolean) => void;
1828
+ /**
1829
+ A boolean flag determining if the current `stdin` supports `setRawMode`. A component using `setRawMode` might want to use `isRawModeSupported` to nicely fall back in environments where raw mode is not supported.
1830
+ */
1831
+ readonly isRawModeSupported: boolean;
1832
+ };
1833
+ //#endregion
1834
+ //#region src/components/StdoutContext.d.ts
1835
+ type Props$5 = {
1836
+ /**
1837
+ Stdout stream passed to `render()` in `options.stdout` or `process.stdout` by default.
1838
+ */
1839
+ readonly stdout: OutputStream;
1840
+ /**
1841
+ Write any string to stdout while preserving Ink's output. It's useful when you want to display external information outside of Ink's rendering and ensure there's no conflict between the two. It's similar to `<Static>`, except it can't accept components; it only works with strings.
1842
+ */
1843
+ readonly write: (data: string) => void;
1844
+ };
1845
+ //#endregion
1846
+ //#region src/components/StderrContext.d.ts
1847
+ type Props$4 = {
1848
+ /**
1849
+ Stderr stream passed to `render()` in `options.stderr` or `process.stderr` by default.
1850
+ */
1851
+ readonly stderr: NodeJS.WritableStream;
1852
+ /**
1853
+ Write any string to stderr while preserving Ink's output. It's useful when you want to display external information outside of Ink's rendering and ensure there's no conflict between the two. It's similar to `<Static>`, except it can't accept components; it only works with strings.
1854
+ */
1855
+ readonly write: (data: string) => void;
1856
+ };
1857
+ //#endregion
1858
+ //#region src/components/Static.d.ts
1859
+ type Props$3<T> = {
1860
+ /**
1861
+ Array of items of any type to render using the function you pass as a component child.
1862
+ */
1863
+ readonly items: T[];
1864
+ /**
1865
+ Styles to apply to a container of child elements. See <Box> for supported properties.
1866
+ */
1867
+ readonly style?: Styles;
1868
+ /**
1869
+ Function that is called to render every item in the `items` array. The first argument is the item itself, and the second argument is the index of that item in the `items` array. Note that a `key` must be assigned to the root component.
1870
+ */
1871
+ readonly children: (item: T, index: number) => ReactNode;
1872
+ };
1873
+ /**
1874
+ `<Static>` component permanently renders its output above everything else. It's useful for displaying activity like completed tasks or logs—things that don't change after they're rendered (hence the name "Static").
1875
+
1876
+ It's preferred to use `<Static>` for use cases like these when you can't know or control the number of items that need to be rendered.
1877
+
1878
+ For example, [Tap](https://github.com/tapjs/node-tap) uses `<Static>` to display a list of completed tests. [Gatsby](https://github.com/gatsbyjs/gatsby) uses it to display a list of generated pages while still displaying a live progress bar.
1879
+ */
1880
+ declare function Static<T>(props: Props$3<T>): React.JSX.Element;
1881
+ //#endregion
1882
+ //#region src/components/Transform.d.ts
1883
+ type Props$7 = {
1884
+ /**
1885
+ Screen-reader-specific text to output. If this is set, all children will be ignored.
1886
+ */
1887
+ readonly accessibilityLabel?: string;
1888
+ /**
1889
+ Function that transforms children output. It accepts children and must return transformed children as well. Note that when children use `<Text>` styling props (e.g. `color`, `bold`), the string will contain ANSI escape codes.
1890
+ */
1891
+ readonly transform: (children: string, index: number) => string;
1892
+ readonly children?: ReactNode;
1893
+ };
1894
+ /**
1895
+ Transform a string representation of React components before they're written to output. For example, you might want to apply a gradient to text, add a clickable link, or create some text effects. These use cases can't accept React nodes as input; they expect a string. That's what the <Transform> component does: it gives you an output string of its child components and lets you transform it in any way.
1896
+ */
1897
+ declare function Transform({ children, transform, accessibilityLabel }: Props$7): React.JSX.Element | null;
1898
+ //#endregion
1899
+ //#region src/components/Newline.d.ts
1900
+ type Props$2 = {
1901
+ /**
1902
+ Number of newlines to insert.
1903
+
1904
+ @default 1
1905
+ */
1906
+ readonly count?: number;
1907
+ };
1908
+ /**
1909
+ Adds one or more newline (`\n`) characters. Must be used within `<Text>` components.
1910
+ */
1911
+ declare function Newline({ count }: Props$2): React.JSX.Element;
1912
+ //#endregion
1913
+ //#region src/components/Spacer.d.ts
1914
+ /**
1915
+ A flexible space that expands along the major axis of its containing layout.
1916
+
1917
+ It's useful as a shortcut for filling all the available space between elements.
1918
+ */
1919
+ declare function Spacer(): React.JSX.Element;
1920
+ //#endregion
1921
+ //#region src/hooks/use-input.d.ts
1922
+ /**
1923
+ Handy information about a key that was pressed.
1924
+ */
1925
+ type Key = {
1926
+ /**
1927
+ Up arrow key was pressed.
1928
+ */
1929
+ upArrow: boolean;
1930
+ /**
1931
+ Down arrow key was pressed.
1932
+ */
1933
+ downArrow: boolean;
1934
+ /**
1935
+ Left arrow key was pressed.
1936
+ */
1937
+ leftArrow: boolean;
1938
+ /**
1939
+ Right arrow key was pressed.
1940
+ */
1941
+ rightArrow: boolean;
1942
+ /**
1943
+ Page Down key was pressed.
1944
+ */
1945
+ pageDown: boolean;
1946
+ /**
1947
+ Page Up key was pressed.
1948
+ */
1949
+ pageUp: boolean;
1950
+ /**
1951
+ Home key was pressed.
1952
+ */
1953
+ home: boolean;
1954
+ /**
1955
+ End key was pressed.
1956
+ */
1957
+ end: boolean;
1958
+ /**
1959
+ Return (Enter) key was pressed.
1960
+ */
1961
+ return: boolean;
1962
+ /**
1963
+ Escape key was pressed.
1964
+ */
1965
+ escape: boolean;
1966
+ /**
1967
+ Ctrl key was pressed.
1968
+ */
1969
+ ctrl: boolean;
1970
+ /**
1971
+ Shift key was pressed.
1972
+ */
1973
+ shift: boolean;
1974
+ /**
1975
+ Tab key was pressed.
1976
+ */
1977
+ tab: boolean;
1978
+ /**
1979
+ Backspace key was pressed.
1980
+ */
1981
+ backspace: boolean;
1982
+ /**
1983
+ Delete key was pressed.
1984
+ */
1985
+ delete: boolean;
1986
+ /**
1987
+ [Meta key](https://en.wikipedia.org/wiki/Meta_key) was pressed.
1988
+ */
1989
+ meta: boolean;
1990
+ /**
1991
+ Super key (Cmd on Mac, Win on Windows) was pressed.
1992
+
1993
+ Only available with kitty keyboard protocol.
1994
+ */
1995
+ super: boolean;
1996
+ /**
1997
+ Hyper key was pressed.
1998
+
1999
+ Only available with kitty keyboard protocol.
2000
+ */
2001
+ hyper: boolean;
2002
+ /**
2003
+ Caps Lock is active.
2004
+
2005
+ Only available with kitty keyboard protocol.
2006
+ */
2007
+ capsLock: boolean;
2008
+ /**
2009
+ Num Lock is active.
2010
+
2011
+ Only available with kitty keyboard protocol.
2012
+ */
2013
+ numLock: boolean;
2014
+ /**
2015
+ Event type for key events.
2016
+
2017
+ Only available with kitty keyboard protocol.
2018
+ */
2019
+ eventType?: "press" | "repeat" | "release";
2020
+ };
2021
+ type Handler = (input: string, key: Key) => void;
2022
+ type Options$2 = {
2023
+ /**
2024
+ Enable or disable capturing of user input. Useful when there are multiple `useInput` hooks used at once to avoid handling the same input several times.
2025
+
2026
+ @default true
2027
+ */
2028
+ isActive?: boolean;
2029
+ };
2030
+ /**
2031
+ A React hook that returns `void` and handles user input.
2032
+ It's a more convenient alternative to using `StdinContext` and listening for `data` events. The callback you pass to `useInput` is called for each character when the user enters any input. However, if the user pastes text and it's more than one character, the callback will be called only once, and the whole string will be passed as `input`.
2033
+
2034
+ ```
2035
+ import {useInput} from 'ink';
2036
+
2037
+ const UserInput = () => {
2038
+ useInput((input, key) => {
2039
+ if (input === 'q') {
2040
+ // Exit program
2041
+ }
2042
+
2043
+ if (key.leftArrow) {
2044
+ // Left arrow key pressed
2045
+ }
2046
+ });
2047
+
2048
+ return …
2049
+ };
2050
+ ```
2051
+ */
2052
+ declare const useInput: (inputHandler: Handler, options?: Options$2) => void;
2053
+ //#endregion
2054
+ //#region src/hooks/use-paste.d.ts
2055
+ type Options$1 = {
2056
+ /**
2057
+ Enable or disable the paste handler. Useful when multiple components use `usePaste` and only one should be active at a time.
2058
+
2059
+ @default true
2060
+ */
2061
+ isActive?: boolean;
2062
+ };
2063
+ /**
2064
+ A React hook that calls `handler` whenever the user pastes text in the terminal. Bracketed paste mode (`\x1b[?2004h`) is automatically enabled while the hook is active, so pasted text arrives as a single string rather than being misinterpreted as individual key presses.
2065
+
2066
+ `usePaste` and `useInput` can be used together in the same component. They operate on separate event channels, so paste content is never forwarded to `useInput` handlers when `usePaste` is active.
2067
+
2068
+ ```
2069
+ import {useInput, usePaste} from 'ink';
2070
+
2071
+ const MyInput = () => {
2072
+ useInput((input, key) => {
2073
+ // Only receives typed characters and key events, not pasted text.
2074
+ if (key.return) {
2075
+ // Submit
2076
+ }
2077
+ });
2078
+
2079
+ usePaste((text) => {
2080
+ // Receives the full pasted string, including newlines.
2081
+ console.log('Pasted:', text);
2082
+ });
2083
+
2084
+ return …
2085
+ };
2086
+ ```
2087
+ */
2088
+ declare const usePaste: (handler: (text: string) => void, options?: Options$1) => void;
2089
+ //#endregion
2090
+ //#region src/hooks/use-app.d.ts
2091
+ /**
2092
+ A React hook that returns app lifecycle methods like `exit()` and `waitUntilRenderFlush()`.
2093
+ */
2094
+ declare const useApp: () => Props;
2095
+ //#endregion
2096
+ //#region src/hooks/use-stdin.d.ts
2097
+ /**
2098
+ A React hook that returns the stdin stream and stdin-related utilities.
2099
+ */
2100
+ declare const useStdin: () => PublicProps;
2101
+ //#endregion
2102
+ //#region src/hooks/use-stdout.d.ts
2103
+ /**
2104
+ A React hook that returns the stdout stream where Ink renders your app.
2105
+ */
2106
+ declare const useStdout: () => Props$5;
2107
+ //#endregion
2108
+ //#region src/hooks/use-stderr.d.ts
2109
+ /**
2110
+ A React hook that returns the stderr stream.
2111
+ */
2112
+ declare const useStderr: () => Props$4;
2113
+ //#endregion
2114
+ //#region src/hooks/use-focus.d.ts
2115
+ type Input = {
2116
+ /**
2117
+ Enable or disable this component's focus, while still maintaining its position in the list of focusable components.
2118
+ */
2119
+ isActive?: boolean;
2120
+ /**
2121
+ Auto-focus this component if there's no active (focused) component right now.
2122
+ */
2123
+ autoFocus?: boolean;
2124
+ /**
2125
+ Assign an ID to this component, so it can be programmatically focused with `focus(id)`.
2126
+ */
2127
+ id?: string;
2128
+ };
2129
+ type Output$2 = {
2130
+ /**
2131
+ Determines whether this component is focused.
2132
+ */
2133
+ isFocused: boolean;
2134
+ /**
2135
+ Allows focusing a specific element with the provided `id`.
2136
+ */
2137
+ focus: (id: string) => void;
2138
+ };
2139
+ /**
2140
+ A React hook that returns focus state and focus controls for the current component.
2141
+ A component that uses the `useFocus` hook becomes "focusable" to Ink, so when the user presses <kbd>Tab</kbd>, Ink will switch focus to this component. If there are multiple components that execute the `useFocus` hook, focus will be given to them in the order in which these components are rendered.
2142
+ */
2143
+ declare const useFocus: ({ isActive, autoFocus, id: customId }?: Input) => Output$2;
2144
+ //#endregion
2145
+ //#region src/components/FocusContext.d.ts
2146
+ type Props$8 = {
2147
+ readonly activeId?: string;
2148
+ readonly add: (id: string, options: {
2149
+ autoFocus: boolean;
2150
+ }) => void;
2151
+ readonly remove: (id: string) => void;
2152
+ readonly activate: (id: string) => void;
2153
+ readonly deactivate: (id: string) => void;
2154
+ readonly enableFocus: () => void;
2155
+ readonly disableFocus: () => void;
2156
+ readonly focusNext: () => void;
2157
+ readonly focusPrevious: () => void;
2158
+ readonly focus: (id: string) => void;
2159
+ };
2160
+ //#endregion
2161
+ //#region src/hooks/use-focus-manager.d.ts
2162
+ type Output$1 = {
2163
+ /**
2164
+ Enable focus management for all components.
2165
+ */
2166
+ enableFocus: Props$8["enableFocus"];
2167
+ /**
2168
+ Disable focus management for all components. The currently active component (if there's one) will lose its focus.
2169
+ */
2170
+ disableFocus: Props$8["disableFocus"];
2171
+ /**
2172
+ Switch focus to the next focusable component. If there's no active component right now, focus will be given to the first focusable component. If the active component is the last in the list of focusable components, focus will be switched to the first focusable component.
2173
+ */
2174
+ focusNext: Props$8["focusNext"];
2175
+ /**
2176
+ Switch focus to the previous focusable component. If there's no active component right now, focus will be given to the first focusable component. If the active component is the first in the list of focusable components, focus will be switched to the last focusable component.
2177
+ */
2178
+ focusPrevious: Props$8["focusPrevious"];
2179
+ /**
2180
+ Switch focus to the element with provided `id`. If there's no element with that `id`, focus is not changed.
2181
+ */
2182
+ focus: Props$8["focus"];
2183
+ /**
2184
+ The ID of the currently focused component, or `undefined` if no component is focused.
2185
+
2186
+ @example
2187
+ ```tsx
2188
+ import {Text, useFocusManager} from 'ink';
2189
+
2190
+ const Example = () => {
2191
+ const {activeId} = useFocusManager();
2192
+
2193
+ return <Text>Focused: {activeId ?? 'none'}</Text>;
2194
+ };
2195
+ ```
2196
+ */
2197
+ activeId: Props$8["activeId"];
2198
+ };
2199
+ /**
2200
+ A React hook that returns methods to enable or disable focus management for all components or manually switch focus to the next or previous components.
2201
+ */
2202
+ declare const useFocusManager: () => Output$1;
2203
+ //#endregion
2204
+ //#region src/hooks/use-is-screen-reader-enabled.d.ts
2205
+ /**
2206
+ A React hook that returns whether a screen reader is enabled.
2207
+ This is useful when you want to render different output for screen readers.
2208
+ */
2209
+ declare const useIsScreenReaderEnabled: () => boolean;
2210
+ //#endregion
2211
+ //#region src/hooks/use-cursor.d.ts
2212
+ /**
2213
+ A React hook that returns methods to control the terminal cursor position.
2214
+
2215
+ Setting a cursor position makes the cursor visible at the specified coordinates (relative to the Ink output origin). This is useful for IME (Input Method Editor) support, where the composing character is displayed at the cursor location.
2216
+
2217
+ Pass `undefined` to hide the cursor.
2218
+ */
2219
+ declare const useCursor: () => {
2220
+ setCursorPosition: (position: CursorPosition | undefined) => void;
2221
+ };
2222
+ //#endregion
2223
+ //#region src/hooks/use-animation.d.ts
2224
+ type Options = {
2225
+ /**
2226
+ Time between ticks in milliseconds.
2227
+
2228
+ @default 100
2229
+ */
2230
+ readonly interval?: number;
2231
+ /**
2232
+ Whether the animation is running. When set to `false`, the animation stops. When toggled back to `true`, all values reset to `0`.
2233
+
2234
+ @default true
2235
+ */
2236
+ readonly isActive?: boolean;
2237
+ };
2238
+ type AnimationResult = {
2239
+ /**
2240
+ Discrete counter that increments by 1 each interval. Useful for indexed sequences like spinner frames.
2241
+ */
2242
+ readonly frame: number;
2243
+ /**
2244
+ Total elapsed time in milliseconds since the animation started or was last reset. Useful for continuous math-based animations like sine waves: `Math.sin(time / 1000 * Math.PI * 2)`.
2245
+ */
2246
+ readonly time: number;
2247
+ /**
2248
+ Time in milliseconds since the previous rendered tick. Accounts for throttled renders. Useful for physics-based or velocity-driven motion: `position += speed * delta`.
2249
+ */
2250
+ readonly delta: number;
2251
+ /**
2252
+ Resets `frame`, `time`, and `delta` to `0` and restarts timing from the current moment. Useful for one-shot animations triggered by events.
2253
+ */
2254
+ readonly reset: () => void;
2255
+ };
2256
+ /**
2257
+ A React hook that drives animations. Returns a frame counter, elapsed time, frame delta, and a reset function. All animations share a single timer internally, so multiple animated components consolidate into one render cycle.
2258
+
2259
+ @example
2260
+ ```
2261
+ import {Text, useAnimation} from 'ink';
2262
+
2263
+ const Spinner = () => {
2264
+ const {frame} = useAnimation({interval: 80});
2265
+ const characters = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
2266
+
2267
+ return <Text>{characters[frame % characters.length]}</Text>;
2268
+ };
2269
+ ```
2270
+ */
2271
+ declare function useAnimation(options?: Options): AnimationResult;
2272
+ //#endregion
2273
+ //#region src/hooks/use-window-size.d.ts
2274
+ /**
2275
+ Dimensions of the terminal window.
2276
+ */
2277
+ type WindowSize = {
2278
+ /**
2279
+ Number of columns (horizontal character cells).
2280
+ */
2281
+ readonly columns: number;
2282
+ /**
2283
+ Number of rows (vertical character cells).
2284
+ */
2285
+ readonly rows: number;
2286
+ };
2287
+ /**
2288
+ A React hook that returns the current terminal window dimensions and re-renders the component whenever the terminal is resized.
2289
+ */
2290
+ declare const useWindowSize: () => WindowSize;
2291
+ //#endregion
2292
+ //#region src/hooks/use-box-metrics.d.ts
2293
+ /**
2294
+ Metrics of a box element.
2295
+
2296
+ All positions are relative to the element's parent.
2297
+ */
2298
+ type BoxMetrics = {
2299
+ /**
2300
+ Element width.
2301
+ */
2302
+ readonly width: number;
2303
+ /**
2304
+ Element height.
2305
+ */
2306
+ readonly height: number;
2307
+ /**
2308
+ Distance from the left edge of the parent.
2309
+ */
2310
+ readonly left: number;
2311
+ /**
2312
+ Distance from the top edge of the parent.
2313
+ */
2314
+ readonly top: number;
2315
+ };
2316
+ type UseBoxMetricsResult = BoxMetrics & {
2317
+ /**
2318
+ Whether the currently tracked element has been measured in the latest layout pass.
2319
+ */
2320
+ readonly hasMeasured: boolean;
2321
+ };
2322
+ /**
2323
+ A React hook that returns the current layout metrics for a tracked box element.
2324
+ It updates when layout changes (for example terminal resize, sibling/content changes, or position changes).
2325
+
2326
+ The hook returns `{width: 0, height: 0, left: 0, top: 0}` until the first layout pass completes. It also returns zeros when the tracked ref is detached.
2327
+
2328
+ Use `hasMeasured` to detect when the currently tracked element has been measured.
2329
+
2330
+ @example
2331
+ ```tsx
2332
+ import {useRef} from 'react';
2333
+ import {Box, Text, useBoxMetrics} from 'ink';
2334
+
2335
+ const Example = () => {
2336
+ const ref = useRef(null);
2337
+ const {width, height, left, top, hasMeasured} = useBoxMetrics(ref);
2338
+ return (
2339
+ <Box ref={ref}>
2340
+ <Text>
2341
+ {hasMeasured ? `${width}x${height} at ${left},${top}` : 'Measuring...'}
2342
+ </Text>
2343
+ </Box>
2344
+ );
2345
+ };
2346
+ ```
2347
+ */
2348
+ declare const useBoxMetrics: (ref: RefObject<DOMElement | null>) => UseBoxMetricsResult;
2349
+ //#endregion
2350
+ //#region src/measure-element.d.ts
2351
+ type Output = {
2352
+ /**
2353
+ Horizontal position (0-based column) within the live layout region.
2354
+ */
2355
+ x: number;
2356
+ /**
2357
+ Vertical position (0-based row) within the live layout region.
2358
+ */
2359
+ y: number;
2360
+ /**
2361
+ Element width.
2362
+ */
2363
+ width: number;
2364
+ /**
2365
+ Element height.
2366
+ */
2367
+ height: number;
2368
+ };
2369
+ /**
2370
+ Measure the layout metrics of a particular `<Box>` element.
2371
+ Returns an object with `x`, `y`, `width`, and `height` properties.
2372
+
2373
+ `x` and `y` are the element's position within the live layout region, computed by walking up the layout tree and accumulating each ancestor's offset. These are layout-tree coordinates, not terminal viewport coordinates. To compare them with mouse events, convert the event coordinates using the live region's viewport position. This is necessary even in alternate-screen mode when output, such as `<Static>` content, appears above the live region.
2374
+
2375
+ Note: `measureElement()` returns `{x: 0, y: 0, width: 0, height: 0}` when called during render (before layout is calculated). Call it from post-render code, such as `useEffect`, `useLayoutEffect`, input handlers, or timer callbacks. When content changes, pass the relevant dependency to your effect so it re-measures after each update.
2376
+ */
2377
+ declare const measureElement: (node: DOMElement) => Output;
2378
+ //#endregion
2379
+ export { type AnimationResult, type Props as AppProps, Box, type BoxMetrics, type Props$1 as BoxProps, type CapturedOutputSource, type CursorPosition, type DOMElement, type Output as ElementMetrics, type Instance, type Key, type KittyFlagName, type KittyKeyboardOptions, Newline, type Props$2 as NewlineProps, type RenderOptions, type RenderToStringOptions, Spacer, Static, type Props$3 as StaticProps, type Props$4 as StderrProps, type PublicProps as StdinProps, type Props$5 as StdoutProps, type SuspendTerminal, type TerminalSuspension, Text, type Props$6 as TextProps, Transform, type Props$7 as TransformProps, type UseBoxMetricsResult, type WindowSize, kittyFlags, kittyModifiers, measureElement, render, renderToString, useAnimation, useApp, useBoxMetrics, useCursor, useFocus, useFocusManager, useInput, useIsScreenReaderEnabled, usePaste, useStderr, useStdin, useStdout, useWindowSize };