@alchemy.run/sigil 0.0.0-alpha.3 → 0.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -13
- package/THIRD_PARTY_NOTICES.md +70 -23
- package/dist/Text-D5HUf3Fj.d.ts +452 -0
- package/dist/ansi.d.ts +137 -143
- package/dist/ansi.js +87 -2
- package/dist/capabilities.d.ts +5 -0
- package/dist/capabilities.js +3 -0
- package/dist/cell-_ZVhbfl0.js +44 -0
- package/dist/color-CkbalRqK.js +2 -0
- package/dist/color-policy-BMzMwV7Q.d.ts +22 -0
- package/dist/color-policy-SVj1pYTA.js +560 -0
- package/dist/color-profile-DHhQHY55.js +36 -0
- package/dist/color-profile-u0Nhe9Nv.d.ts +97 -0
- package/dist/color.d.ts +21 -0
- package/dist/color.js +3 -0
- package/dist/cursor-position-D2LAkRG0.d.ts +7 -0
- package/dist/detect-Bh4yGP6w.d.ts +186 -0
- package/dist/detect-BuTXtY6e.js +373 -0
- package/dist/{devtools-BhYGjb7h.js → devtools-DbthxoD1.js} +22 -23
- package/dist/env-YVw64yZS.js +9 -0
- package/dist/escapes-CB_6CWOE.d.ts +72 -0
- package/dist/geometry-BxXOzJgo.d.ts +11 -0
- package/dist/index-Bmc2tRPk.d.ts +21 -0
- package/dist/index.d.ts +235 -754
- package/dist/index.js +1362 -3001
- package/dist/osc-CCH7xDoS.js +71 -0
- package/dist/osc-Cn0fw77g.d.ts +23 -0
- package/dist/paint-C19minOS.d.ts +81 -0
- package/dist/query-vaIeGOkH.d.ts +152 -0
- package/dist/router.d.ts +392 -0
- package/dist/router.js +709 -0
- package/dist/sample-Cqw1bjUL.js +445 -0
- package/dist/screen-BOh__-65.js +324 -0
- package/dist/screen-BReKIheE.d.ts +40 -0
- package/dist/screen.d.ts +5 -0
- package/dist/screen.js +5 -0
- package/dist/semantic-text-style-DIMzC7xt.js +91 -0
- package/dist/serialize-BTkAZgw1.js +79 -0
- package/dist/session-BJmzX2NJ.js +664 -0
- package/dist/sgr-BhwaWAJB.js +246 -0
- package/dist/store-CgrG9K4y.d.ts +72 -0
- package/dist/string-width-CijQwpIk.js +69 -0
- package/dist/strip-BvU4toXG.js +6 -0
- package/dist/terminal.d.ts +118 -0
- package/dist/terminal.js +2 -0
- package/dist/tokenize-AjqbvtiT.js +1242 -0
- package/dist/tokenize-Dx1y_l5H.d.ts +57 -0
- package/dist/truncate-D31fhU6i.js +562 -0
- package/dist/use-focus-C2sciZOo.js +1335 -0
- package/package.json +43 -17
- package/src/ansi/chalk.ts +12 -53
- package/src/ansi/cursor.ts +2 -4
- package/src/ansi/east-asian-width.ts +44 -0
- package/src/ansi/escapes.ts +18 -26
- package/src/ansi/graphemes.ts +8 -0
- package/src/ansi/hyperlink.ts +44 -0
- package/src/ansi/index.ts +14 -14
- package/src/ansi/osc.ts +77 -0
- package/src/ansi/sgr.ts +2 -5
- package/src/ansi/slice.ts +1 -1
- package/src/ansi/string-width.ts +91 -206
- package/src/ansi/strip.ts +13 -33
- package/src/ansi/tokenize.ts +96 -169
- package/src/ansi/truncate.ts +5 -3
- package/src/ansi/wrap.ts +13 -14
- package/src/ansi-tokenizer.ts +1 -1
- package/src/capabilities/color-policy.ts +34 -0
- package/src/capabilities/detect.ts +594 -0
- package/src/capabilities/index.ts +37 -0
- package/src/capabilities/query.ts +657 -0
- package/src/capabilities/store.ts +379 -0
- package/src/color/index.ts +3 -0
- package/src/color/paint.ts +169 -0
- package/src/color/palette.ts +48 -0
- package/src/color/sample.ts +323 -0
- package/src/color.ts +1 -0
- package/src/components/AnsiText.tsx +42 -0
- package/src/components/App.tsx +109 -22
- package/src/components/BackgroundContext.ts +2 -3
- package/src/components/Box.tsx +43 -60
- package/src/components/CursorContext.ts +1 -1
- package/src/components/ErrorBoundary.tsx +1 -1
- package/src/components/ErrorOverview.tsx +8 -7
- package/src/components/Hyperlink.tsx +56 -0
- package/src/components/Spacer.tsx +1 -1
- package/src/components/Static.tsx +1 -1
- package/src/components/StderrContext.ts +0 -2
- package/src/components/StdinContext.ts +0 -1
- package/src/components/StdoutContext.ts +1 -3
- package/src/components/TerminalOscContext.ts +25 -0
- package/src/components/Text.tsx +23 -46
- package/src/components/Transform.tsx +2 -2
- package/src/cursor-position.ts +1 -1
- package/src/devtools.ts +84 -24
- package/src/dom.ts +11 -8
- package/src/env.ts +12 -0
- package/src/get-max-width.ts +1 -1
- package/src/global.d.ts +6 -4
- package/src/{boxes.ts → glyphs.ts} +17 -18
- package/src/hooks/use-animation.ts +1 -1
- package/src/hooks/use-app.ts +1 -1
- package/src/hooks/use-box-metrics.ts +1 -1
- package/src/hooks/use-capabilities.ts +73 -0
- package/src/hooks/use-cursor.ts +3 -3
- package/src/hooks/use-focus-manager.ts +1 -1
- package/src/hooks/use-focus.ts +5 -6
- package/src/hooks/use-input.ts +4 -4
- package/src/hooks/use-is-screen-reader-enabled.ts +1 -1
- package/src/hooks/use-paste.ts +2 -2
- package/src/hooks/use-stderr.ts +1 -1
- package/src/hooks/use-stdin.ts +1 -1
- package/src/hooks/use-stdout.ts +1 -1
- package/src/hooks/use-terminal-osc.ts +59 -0
- package/src/hooks/use-window-size.ts +2 -2
- package/src/index.ts +88 -44
- package/src/ink.tsx +620 -745
- package/src/input-parser.ts +1 -1
- package/src/instances.ts +1 -1
- package/src/kitty-keyboard.ts +128 -0
- package/src/measure-element.ts +1 -1
- package/src/measure-text.ts +2 -2
- package/src/{render-node-to-output.ts → paint-tree.ts} +78 -53
- package/src/parse-keypress.ts +4 -5
- package/src/parse-stack-line.ts +0 -1
- package/src/patch-console.ts +44 -0
- package/src/reconciler.ts +36 -62
- package/src/render-background.ts +37 -16
- package/src/render-border.ts +97 -64
- package/src/render-frame.ts +83 -0
- package/src/render-to-string.ts +24 -9
- package/src/render.ts +24 -16
- package/src/router/components.tsx +343 -0
- package/src/router/context.ts +41 -0
- package/src/router/history.ts +194 -0
- package/src/router/hooks.tsx +391 -0
- package/src/router/index.ts +34 -0
- package/src/router/matcher.ts +571 -0
- package/src/sanitize-ansi.ts +1 -1
- package/src/screen/ansi.ts +184 -0
- package/src/screen/canvas.ts +137 -0
- package/src/screen/cell.ts +138 -0
- package/src/screen/color-profile.ts +47 -0
- package/src/screen/geometry.ts +9 -0
- package/src/screen/index.ts +6 -0
- package/src/screen/screen.ts +272 -0
- package/src/screen/serialize.ts +129 -0
- package/src/screen.ts +1 -0
- package/src/semantic-text-style.ts +118 -0
- package/src/signal-exit.ts +4 -5
- package/src/squash-text-nodes.ts +4 -7
- package/src/stream.ts +2 -4
- package/src/structured-text.ts +321 -0
- package/src/styles.ts +16 -17
- package/src/terminal/index.ts +2 -0
- package/src/terminal/inline-presenter.ts +120 -0
- package/src/terminal/input.ts +86 -0
- package/src/terminal/render-scheduler.ts +37 -0
- package/src/terminal/screen-presenter.ts +188 -0
- package/src/terminal/session.ts +407 -0
- package/src/terminal-size.ts +9 -8
- package/src/terminal.ts +1 -0
- package/src/testing/browser.ts +588 -0
- package/src/testing/emulators.ts +205 -0
- package/src/testing/explorer-app/index.html +12 -0
- package/src/testing/explorer-app/main.ts +381 -0
- package/src/testing/explorer-app/style.css +194 -0
- package/src/testing/explorer-app/tsconfig.json +15 -0
- package/src/testing/explorer-app/vite-env.d.ts +1 -0
- package/src/testing/index.ts +26 -0
- package/src/testing/keys.ts +56 -0
- package/src/testing/live.ts +85 -0
- package/src/testing/matchers.ts +70 -0
- package/src/testing/public.ts +94 -0
- package/src/testing/terminal.ts +349 -0
- package/src/testing/vitest.ts +157 -0
- package/src/transform-adapter.ts +14 -0
- package/src/types.ts +1 -6
- package/src/utils.ts +2 -2
- package/src/wrap-text.ts +4 -4
- package/src/yoga/config.ts +2 -2
- package/src/yoga/core/absoluteLayout.ts +15 -15
- package/src/yoga/core/baseline.ts +3 -3
- package/src/yoga/core/cache.ts +4 -4
- package/src/yoga/core/calculateLayout.ts +33 -27
- package/src/yoga/core/config.ts +1 -1
- package/src/yoga/core/flexLine.ts +3 -3
- package/src/yoga/core/helpers.ts +3 -3
- package/src/yoga/core/layoutResults.ts +4 -4
- package/src/yoga/core/node.ts +16 -16
- package/src/yoga/core/pixelGrid.ts +4 -4
- package/src/yoga/core/style.ts +11 -11
- package/src/yoga/core/types.ts +2 -2
- package/src/yoga/index.ts +6 -6
- package/src/yoga/node.ts +8 -8
- package/dist/sgr-CMfEpjSk.d.ts +0 -91
- package/dist/truncate-CBiyyZzw.js +0 -2156
- package/src/ansi/supports-color.ts +0 -213
- package/src/ansi/widest-line.ts +0 -12
- package/src/auto-bind.ts +0 -41
- package/src/colorize.ts +0 -60
- package/src/devtools-window-polyfill.ts +0 -73
- package/src/indent-string.ts +0 -16
- package/src/is-in-ci.ts +0 -7
- package/src/log-update.ts +0 -370
- package/src/output.ts +0 -308
- package/src/renderer.ts +0 -73
- package/src/write-synchronized.ts +0 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,88 +1,15 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { a as Multiplexer, c as TerminalAppearance, d as detectCapabilities, f as detectColorLevel, h as detectUnicodeSupport, i as ColorSupportLevel, l as TerminalIdentity, m as detectTerminal, n as ColorInfo, o as PixelGeometry, p as detectHyperlinkSupport, r as ColorSupport, s as RgbColor, t as Capabilities, u as createSupportsColor } from "./detect-Bh4yGP6w.js";
|
|
2
|
+
import { n as TerminalProgressState, t as ClipboardSelection } from "./osc-Cn0fw77g.js";
|
|
3
|
+
import { a as getTerminalQuery, i as applyTerminalQuery, n as TerminalQueryOptions, o as queryTerminal, r as TerminalQueryResult, s as refreshTerminalQuery, t as PixelSize } from "./query-vaIeGOkH.js";
|
|
4
|
+
import { i as OutputStream, n as capabilities, r as getCapabilities, t as CapabilitiesStore } from "./store-CgrG9K4y.js";
|
|
5
|
+
import { s as CellStyle, t as ColorProfile } from "./color-profile-u0Nhe9Nv.js";
|
|
6
|
+
import { s as Paint } from "./paint-C19minOS.js";
|
|
7
|
+
import { n as Text, r as Styles, t as Props$8 } from "./Text-D5HUf3Fj.js";
|
|
2
8
|
import { i as Node } from "./index-DDVME65c.js";
|
|
9
|
+
import { t as CursorPosition } from "./cursor-position-D2LAkRG0.js";
|
|
3
10
|
import { Writable } from "node:stream";
|
|
4
|
-
import { ReactNode, RefObject } from "react";
|
|
11
|
+
import { PropsWithChildren, ReactNode, Ref, RefObject } from "react";
|
|
5
12
|
import { EventEmitter } from "node:events";
|
|
6
|
-
//#region src/components/AppContext.d.ts
|
|
7
|
-
/**
|
|
8
|
-
A handle returned by `suspendTerminal()` when called without a callback.
|
|
9
|
-
|
|
10
|
-
Call `resume()` to give terminal ownership back to Ink, or use `await using`
|
|
11
|
-
so the suspension is resumed automatically when it leaves scope.
|
|
12
|
-
*/
|
|
13
|
-
type TerminalSuspension = {
|
|
14
|
-
readonly resume: () => Promise<void>;
|
|
15
|
-
readonly [Symbol.asyncDispose]: () => Promise<void>;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
Temporarily hand the terminal over to a child process (e.g. `$EDITOR`, `less`,
|
|
19
|
-
`fzf`), then restore Ink's terminal state and force a full redraw.
|
|
20
|
-
*/
|
|
21
|
-
type SuspendTerminal = {
|
|
22
|
-
(callback: () => void | Promise<void>): Promise<void>;
|
|
23
|
-
(): Promise<TerminalSuspension>;
|
|
24
|
-
};
|
|
25
|
-
type Props = {
|
|
26
|
-
/**
|
|
27
|
-
Exit (unmount) the whole Ink app.
|
|
28
|
-
|
|
29
|
-
- `exit()` — resolves `waitUntilExit()` with `undefined`.
|
|
30
|
-
- `exit(new Error('…'))` — rejects `waitUntilExit()` with the error.
|
|
31
|
-
- `exit(value)` — resolves `waitUntilExit()` with `value`.
|
|
32
|
-
*/
|
|
33
|
-
readonly exit: (errorOrResult?: unknown) => void;
|
|
34
|
-
/**
|
|
35
|
-
Returns a promise that settles after pending render output is flushed to stdout.
|
|
36
|
-
|
|
37
|
-
@example
|
|
38
|
-
```jsx
|
|
39
|
-
import {useEffect} from 'react';
|
|
40
|
-
import {useApp} from 'ink';
|
|
41
|
-
|
|
42
|
-
const Example = () => {
|
|
43
|
-
const {waitUntilRenderFlush} = useApp();
|
|
44
|
-
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
void (async () => {
|
|
47
|
-
await waitUntilRenderFlush();
|
|
48
|
-
runNextCommand();
|
|
49
|
-
})();
|
|
50
|
-
}, [waitUntilRenderFlush]);
|
|
51
|
-
|
|
52
|
-
return …;
|
|
53
|
-
};
|
|
54
|
-
```
|
|
55
|
-
*/
|
|
56
|
-
readonly waitUntilRenderFlush: () => Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
Temporarily release the terminal so a child process can take it over, then
|
|
59
|
-
restore Ink's terminal state and force a full redraw.
|
|
60
|
-
|
|
61
|
-
Use the callback form for the common case — Ink restores the terminal even
|
|
62
|
-
if the callback throws:
|
|
63
|
-
|
|
64
|
-
@example
|
|
65
|
-
```jsx
|
|
66
|
-
import {useApp} from 'ink';
|
|
67
|
-
|
|
68
|
-
const {suspendTerminal} = useApp();
|
|
69
|
-
|
|
70
|
-
await suspendTerminal(async () => {
|
|
71
|
-
await runEditor();
|
|
72
|
-
});
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Or hold a suspension and resume it yourself:
|
|
76
|
-
|
|
77
|
-
@example
|
|
78
|
-
```jsx
|
|
79
|
-
await using suspension = await suspendTerminal();
|
|
80
|
-
await runEditor();
|
|
81
|
-
```
|
|
82
|
-
*/
|
|
83
|
-
readonly suspendTerminal: SuspendTerminal;
|
|
84
|
-
};
|
|
85
|
-
//#endregion
|
|
86
13
|
//#region src/kitty-keyboard.d.ts
|
|
87
14
|
declare const kittyFlags: {
|
|
88
15
|
readonly disambiguateEscapeCodes: 1;
|
|
@@ -107,21 +34,6 @@ type KittyKeyboardOptions = {
|
|
|
107
34
|
flags?: KittyFlagName[];
|
|
108
35
|
};
|
|
109
36
|
//#endregion
|
|
110
|
-
//#region src/cursor-position.d.ts
|
|
111
|
-
type CursorPosition = {
|
|
112
|
-
x: number;
|
|
113
|
-
y: number;
|
|
114
|
-
};
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/stream.d.ts
|
|
117
|
-
type OutputStream = NodeJS.WritableStream & {
|
|
118
|
-
isTTY?: boolean;
|
|
119
|
-
columns?: number;
|
|
120
|
-
rows?: number;
|
|
121
|
-
destroyed?: boolean;
|
|
122
|
-
writableEnded?: boolean;
|
|
123
|
-
};
|
|
124
|
-
//#endregion
|
|
125
37
|
//#region src/ink.d.ts
|
|
126
38
|
/**
|
|
127
39
|
The origin of a chunk captured by `patchConsole`: a patched `console.*`
|
|
@@ -137,164 +49,35 @@ type RenderMetrics = {
|
|
|
137
49
|
*/
|
|
138
50
|
renderTime: number;
|
|
139
51
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
Patch console methods so `console.*` output doesn't mix with Ink's output.
|
|
148
|
-
|
|
149
|
-
Pass `"stdio"` to additionally intercept direct `stdout.write` /
|
|
150
|
-
`stderr.write` calls (from dependencies, native warnings, child tooling)
|
|
151
|
-
on the streams Ink renders to. Captured output is line-buffered and
|
|
152
|
-
spliced above the live frame, exactly like console output; Ink's own
|
|
153
|
-
frame writes bypass the capture.
|
|
52
|
+
/**
|
|
53
|
+
A live React terminal runtime for one stdout stream, created by `createInk`.
|
|
54
|
+
*/
|
|
55
|
+
type Ink = {
|
|
56
|
+
/**
|
|
57
|
+
Replace the previous root node with a new one or update props of the current root node.
|
|
154
58
|
*/
|
|
155
|
-
|
|
59
|
+
render: (node: ReactNode) => void;
|
|
156
60
|
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
Called with each captured chunk and its origin: `"console"` for patched
|
|
160
|
-
`console.*` calls, `"stdio"` for direct stream writes (only emitted with
|
|
161
|
-
`patchConsole: "stdio"`). Return `true` to take ownership of the chunk —
|
|
162
|
-
Ink will not display it, letting the app render it itself (for example
|
|
163
|
-
inside a `<Static>` transcript).
|
|
61
|
+
Unmount the app and release the terminal.
|
|
164
62
|
*/
|
|
165
|
-
|
|
166
|
-
onRender?: (metrics: RenderMetrics) => void;
|
|
167
|
-
isScreenReaderEnabled?: boolean;
|
|
168
|
-
waitUntilExit?: () => Promise<unknown>;
|
|
169
|
-
maxFps?: number;
|
|
170
|
-
incrementalRendering?: boolean;
|
|
63
|
+
unmount: (error?: Error | number | null) => void;
|
|
171
64
|
/**
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
When enabled:
|
|
175
|
-
- Suspense boundaries work correctly with async data
|
|
176
|
-
- `useTransition` and `useDeferredValue` are fully functional
|
|
177
|
-
- Updates can be interrupted for higher priority work
|
|
178
|
-
|
|
179
|
-
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.
|
|
180
|
-
|
|
181
|
-
@default false
|
|
182
|
-
@experimental
|
|
65
|
+
Returns a promise that settles when the app is unmounted.
|
|
183
66
|
*/
|
|
184
|
-
|
|
185
|
-
kittyKeyboard?: KittyKeyboardOptions;
|
|
67
|
+
waitUntilExit: () => Promise<unknown>;
|
|
186
68
|
/**
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
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.
|
|
190
|
-
|
|
191
|
-
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.
|
|
192
|
-
|
|
193
|
-
Set to `false` to force non-interactive mode or `true` to force interactive mode when the automatic detection doesn't suit your use case.
|
|
194
|
-
|
|
195
|
-
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.
|
|
196
|
-
|
|
197
|
-
@default true (false if in CI or `stdout.isTTY` is falsy)
|
|
198
|
-
|
|
199
|
-
@see {@link RenderOptions.interactive}
|
|
69
|
+
Returns a promise that settles after pending render output is flushed to stdout.
|
|
200
70
|
*/
|
|
201
|
-
|
|
71
|
+
waitUntilRenderFlush: () => Promise<void>;
|
|
202
72
|
/**
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
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.
|
|
206
|
-
|
|
207
|
-
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.
|
|
208
|
-
|
|
209
|
-
Only works in interactive mode. Ignored when `interactive` is `false` or in a non-interactive environment (CI, piped stdout).
|
|
210
|
-
|
|
211
|
-
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.
|
|
212
|
-
|
|
213
|
-
@default false
|
|
214
|
-
|
|
215
|
-
@see {@link RenderOptions.alternateScreen}
|
|
73
|
+
Clear output.
|
|
216
74
|
*/
|
|
217
|
-
|
|
75
|
+
clear: () => void;
|
|
76
|
+
/** Copy text through the renderer-owned terminal session. */
|
|
77
|
+
copyToClipboard: (text: string, selection?: ClipboardSelection) => boolean;
|
|
78
|
+
/** Update terminal-native progress through the renderer-owned session. */
|
|
79
|
+
setProgress: (state: TerminalProgressState, value?: number) => boolean;
|
|
218
80
|
};
|
|
219
|
-
declare class Ink {
|
|
220
|
-
/**
|
|
221
|
-
Whether this instance is using concurrent rendering mode.
|
|
222
|
-
*/
|
|
223
|
-
readonly isConcurrent: boolean;
|
|
224
|
-
private readonly options;
|
|
225
|
-
private readonly log;
|
|
226
|
-
private cursorPosition;
|
|
227
|
-
private readonly throttledLog;
|
|
228
|
-
private readonly isScreenReaderEnabled;
|
|
229
|
-
private readonly interactive;
|
|
230
|
-
private readonly renderThrottleMs;
|
|
231
|
-
private alternateScreen;
|
|
232
|
-
private isUnmounted;
|
|
233
|
-
private isUnmounting;
|
|
234
|
-
private lastOutput;
|
|
235
|
-
private lastOutputToRender;
|
|
236
|
-
private lastOutputHeight;
|
|
237
|
-
private lastTerminalWidth;
|
|
238
|
-
private lastTerminalHeight;
|
|
239
|
-
private readonly container;
|
|
240
|
-
private readonly rootNode;
|
|
241
|
-
private fullStaticOutput;
|
|
242
|
-
private readonly exitPromise;
|
|
243
|
-
private exitResult;
|
|
244
|
-
private beforeExitHandler?;
|
|
245
|
-
private restoreConsole?;
|
|
246
|
-
private readonly captureTargets?;
|
|
247
|
-
private readonly capturedStdioTails;
|
|
248
|
-
private readonly unsubscribeResize?;
|
|
249
|
-
private readonly throttledOnRender?;
|
|
250
|
-
private hasPendingThrottledRender;
|
|
251
|
-
private kittyProtocolEnabled;
|
|
252
|
-
private kittyFlags;
|
|
253
|
-
private cancelKittyDetection?;
|
|
254
|
-
private nextRenderCommit?;
|
|
255
|
-
private isSuspended;
|
|
256
|
-
private pauseInput?;
|
|
257
|
-
private resumeInput?;
|
|
258
|
-
constructor(options: Options$3);
|
|
259
|
-
resized: () => void;
|
|
260
|
-
resolveExitPromise: (result?: unknown) => void;
|
|
261
|
-
rejectExitPromise: (reason?: Error) => void;
|
|
262
|
-
unsubscribeExit: () => void;
|
|
263
|
-
handleAppExit: (errorOrResult?: unknown) => void;
|
|
264
|
-
setCursorPosition: (position: CursorPosition | undefined) => void;
|
|
265
|
-
restoreLastOutput: () => void;
|
|
266
|
-
calculateLayout: () => void;
|
|
267
|
-
handleStaticChange: () => void;
|
|
268
|
-
onRender: () => void;
|
|
269
|
-
render(node: ReactNode): void;
|
|
270
|
-
writeToStdout(data: string): void;
|
|
271
|
-
writeToStderr(data: string): void;
|
|
272
|
-
unmount(error?: Error | number | null): void;
|
|
273
|
-
waitUntilExit(): Promise<unknown>;
|
|
274
|
-
waitUntilRenderFlush(): Promise<void>;
|
|
275
|
-
clear(): void;
|
|
276
|
-
patchConsole(): void;
|
|
277
|
-
private patchDirectStdio;
|
|
278
|
-
private handleCapturedStdio;
|
|
279
|
-
private flushCapturedStdio;
|
|
280
|
-
registerInputControl(pauseInput: () => void, resumeInput: () => void): void;
|
|
281
|
-
suspendTerminal(callback: () => void | Promise<void>): Promise<void>;
|
|
282
|
-
suspendTerminal(): Promise<TerminalSuspension>;
|
|
283
|
-
private setAlternateScreen;
|
|
284
|
-
private resolveInteractiveOption;
|
|
285
|
-
private resolveAlternateScreenOption;
|
|
286
|
-
private shouldSync;
|
|
287
|
-
private writeBestEffort;
|
|
288
|
-
private awaitExit;
|
|
289
|
-
private hasPendingConcurrentWork;
|
|
290
|
-
private awaitNextRender;
|
|
291
|
-
private renderInteractiveFrame;
|
|
292
|
-
private initKittyKeyboard;
|
|
293
|
-
private confirmKittySupport;
|
|
294
|
-
private enableKittyProtocol;
|
|
295
|
-
private beginSuspend;
|
|
296
|
-
private endSuspend;
|
|
297
|
-
}
|
|
298
81
|
//#endregion
|
|
299
82
|
//#region src/render.d.ts
|
|
300
83
|
type RenderOptions = {
|
|
@@ -365,12 +148,12 @@ type RenderOptions = {
|
|
|
365
148
|
*/
|
|
366
149
|
maxFps?: number;
|
|
367
150
|
/**
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
151
|
+
Override the output color profile for this render instance. When omitted,
|
|
152
|
+
the profile follows the capabilities of `stdout` and capability upgrades
|
|
153
|
+
redraw the live frame. Static content already written to scrollback is not
|
|
154
|
+
replayed or recolored.
|
|
372
155
|
*/
|
|
373
|
-
|
|
156
|
+
colorProfile?: ColorProfile;
|
|
374
157
|
/**
|
|
375
158
|
Enable React Concurrent Rendering mode.
|
|
376
159
|
|
|
@@ -395,7 +178,7 @@ type RenderOptions = {
|
|
|
395
178
|
/**
|
|
396
179
|
Override automatic interactive mode detection.
|
|
397
180
|
|
|
398
|
-
By default, Ink detects whether the environment is interactive based on CI detection (
|
|
181
|
+
By default, Ink detects whether the environment is interactive based on CI detection (the `CI` environment variable) and `stdout.isTTY`. Most users should not need to set this.
|
|
399
182
|
|
|
400
183
|
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.
|
|
401
184
|
|
|
@@ -472,6 +255,10 @@ type Instance = {
|
|
|
472
255
|
Clear output.
|
|
473
256
|
*/
|
|
474
257
|
clear: () => void;
|
|
258
|
+
/** Copy text through the renderer-owned terminal session. */
|
|
259
|
+
copyToClipboard: (text: string, selection?: ClipboardSelection) => boolean;
|
|
260
|
+
/** Update terminal-native progress through the renderer-owned session. */
|
|
261
|
+
setProgress: (state: TerminalProgressState, value?: number) => boolean;
|
|
475
262
|
};
|
|
476
263
|
/**
|
|
477
264
|
Mount a component and render the output.
|
|
@@ -486,6 +273,11 @@ type RenderToStringOptions = {
|
|
|
486
273
|
@default 80
|
|
487
274
|
*/
|
|
488
275
|
columns?: number;
|
|
276
|
+
/**
|
|
277
|
+
Color profile used for deterministic serialization. By default this retains
|
|
278
|
+
the process color level for Ink compatibility.
|
|
279
|
+
*/
|
|
280
|
+
colorProfile?: ColorProfile;
|
|
489
281
|
};
|
|
490
282
|
/**
|
|
491
283
|
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.
|
|
@@ -516,416 +308,18 @@ console.log(output);
|
|
|
516
308
|
*/
|
|
517
309
|
declare const renderToString: (node: ReactNode, options?: RenderToStringOptions) => string;
|
|
518
310
|
//#endregion
|
|
519
|
-
//#region src/
|
|
520
|
-
type
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
readonly topLeft: string;
|
|
528
|
-
readonly top: string;
|
|
529
|
-
readonly topRight: string;
|
|
530
|
-
readonly right: string;
|
|
531
|
-
readonly bottomRight: string;
|
|
532
|
-
readonly bottom: string;
|
|
533
|
-
readonly bottomLeft: string;
|
|
534
|
-
readonly left: string;
|
|
311
|
+
//#region src/semantic-text-style.d.ts
|
|
312
|
+
type SemanticTextStyle = {
|
|
313
|
+
readonly foreground?: Paint;
|
|
314
|
+
readonly background?: Paint;
|
|
315
|
+
readonly resetForeground?: boolean;
|
|
316
|
+
readonly resetBackground?: boolean;
|
|
317
|
+
readonly underline?: CellStyle["underline"];
|
|
318
|
+
readonly attributes: number;
|
|
535
319
|
};
|
|
536
|
-
declare const boxes: {
|
|
537
|
-
readonly single: {
|
|
538
|
-
readonly topLeft: "┌";
|
|
539
|
-
readonly top: "─";
|
|
540
|
-
readonly topRight: "┐";
|
|
541
|
-
readonly right: "│";
|
|
542
|
-
readonly bottomRight: "┘";
|
|
543
|
-
readonly bottom: "─";
|
|
544
|
-
readonly bottomLeft: "└";
|
|
545
|
-
readonly left: "│";
|
|
546
|
-
};
|
|
547
|
-
readonly double: {
|
|
548
|
-
readonly topLeft: "╔";
|
|
549
|
-
readonly top: "═";
|
|
550
|
-
readonly topRight: "╗";
|
|
551
|
-
readonly right: "║";
|
|
552
|
-
readonly bottomRight: "╝";
|
|
553
|
-
readonly bottom: "═";
|
|
554
|
-
readonly bottomLeft: "╚";
|
|
555
|
-
readonly left: "║";
|
|
556
|
-
};
|
|
557
|
-
readonly round: {
|
|
558
|
-
readonly topLeft: "╭";
|
|
559
|
-
readonly top: "─";
|
|
560
|
-
readonly topRight: "╮";
|
|
561
|
-
readonly right: "│";
|
|
562
|
-
readonly bottomRight: "╯";
|
|
563
|
-
readonly bottom: "─";
|
|
564
|
-
readonly bottomLeft: "╰";
|
|
565
|
-
readonly left: "│";
|
|
566
|
-
};
|
|
567
|
-
readonly bold: {
|
|
568
|
-
readonly topLeft: "┏";
|
|
569
|
-
readonly top: "━";
|
|
570
|
-
readonly topRight: "┓";
|
|
571
|
-
readonly right: "┃";
|
|
572
|
-
readonly bottomRight: "┛";
|
|
573
|
-
readonly bottom: "━";
|
|
574
|
-
readonly bottomLeft: "┗";
|
|
575
|
-
readonly left: "┃";
|
|
576
|
-
};
|
|
577
|
-
readonly singleDouble: {
|
|
578
|
-
readonly topLeft: "╓";
|
|
579
|
-
readonly top: "─";
|
|
580
|
-
readonly topRight: "╖";
|
|
581
|
-
readonly right: "║";
|
|
582
|
-
readonly bottomRight: "╜";
|
|
583
|
-
readonly bottom: "─";
|
|
584
|
-
readonly bottomLeft: "╙";
|
|
585
|
-
readonly left: "║";
|
|
586
|
-
};
|
|
587
|
-
readonly doubleSingle: {
|
|
588
|
-
readonly topLeft: "╒";
|
|
589
|
-
readonly top: "═";
|
|
590
|
-
readonly topRight: "╕";
|
|
591
|
-
readonly right: "│";
|
|
592
|
-
readonly bottomRight: "╛";
|
|
593
|
-
readonly bottom: "═";
|
|
594
|
-
readonly bottomLeft: "╘";
|
|
595
|
-
readonly left: "│";
|
|
596
|
-
};
|
|
597
|
-
readonly classic: {
|
|
598
|
-
readonly topLeft: "+";
|
|
599
|
-
readonly top: "-";
|
|
600
|
-
readonly topRight: "+";
|
|
601
|
-
readonly right: "|";
|
|
602
|
-
readonly bottomRight: "+";
|
|
603
|
-
readonly bottom: "-";
|
|
604
|
-
readonly bottomLeft: "+";
|
|
605
|
-
readonly left: "|";
|
|
606
|
-
};
|
|
607
|
-
readonly arrow: {
|
|
608
|
-
readonly topLeft: "↘";
|
|
609
|
-
readonly top: "↓";
|
|
610
|
-
readonly topRight: "↙";
|
|
611
|
-
readonly right: "←";
|
|
612
|
-
readonly bottomRight: "↖";
|
|
613
|
-
readonly bottom: "↑";
|
|
614
|
-
readonly bottomLeft: "↗";
|
|
615
|
-
readonly left: "→";
|
|
616
|
-
};
|
|
617
|
-
};
|
|
618
|
-
type Boxes = typeof boxes;
|
|
619
320
|
//#endregion
|
|
620
|
-
//#region src/
|
|
621
|
-
|
|
622
|
-
Allows creating a union type by combining primitive types and literal types
|
|
623
|
-
without sacrificing auto-completion in IDEs for the literal type part of the
|
|
624
|
-
union.
|
|
625
|
-
*/
|
|
626
|
-
type LiteralUnion<LiteralType, BaseType extends string | number> = LiteralType | (BaseType & Record<never, never>);
|
|
627
|
-
/**
|
|
628
|
-
Create a type from an object type without certain keys.
|
|
629
|
-
*/
|
|
630
|
-
type Except<ObjectType, KeysType extends keyof ObjectType> = Omit<ObjectType, KeysType>;
|
|
631
|
-
//#endregion
|
|
632
|
-
//#region src/styles.d.ts
|
|
633
|
-
type Styles = {
|
|
634
|
-
readonly textWrap?: "wrap" | "hard" | "truncate-end" | "truncate" | "truncate-middle" | "truncate-start";
|
|
635
|
-
/**
|
|
636
|
-
Controls how the element is positioned.
|
|
637
|
-
|
|
638
|
-
When `position` is `static`, `top`, `right`, `bottom`, and `left` are ignored.
|
|
639
|
-
*/
|
|
640
|
-
readonly position?: "absolute" | "relative" | "static";
|
|
641
|
-
/**
|
|
642
|
-
Top offset for positioned elements.
|
|
643
|
-
*/
|
|
644
|
-
readonly top?: number | string;
|
|
645
|
-
/**
|
|
646
|
-
Right offset for positioned elements.
|
|
647
|
-
*/
|
|
648
|
-
readonly right?: number | string;
|
|
649
|
-
/**
|
|
650
|
-
Bottom offset for positioned elements.
|
|
651
|
-
*/
|
|
652
|
-
readonly bottom?: number | string;
|
|
653
|
-
/**
|
|
654
|
-
Left offset for positioned elements.
|
|
655
|
-
*/
|
|
656
|
-
readonly left?: number | string;
|
|
657
|
-
/**
|
|
658
|
-
Size of the gap between an element's columns.
|
|
659
|
-
*/
|
|
660
|
-
readonly columnGap?: number;
|
|
661
|
-
/**
|
|
662
|
-
Size of the gap between an element's rows.
|
|
663
|
-
*/
|
|
664
|
-
readonly rowGap?: number;
|
|
665
|
-
/**
|
|
666
|
-
Size of the gap between an element's columns and rows. A shorthand for `columnGap` and `rowGap`.
|
|
667
|
-
*/
|
|
668
|
-
readonly gap?: number;
|
|
669
|
-
/**
|
|
670
|
-
Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft`, and `marginRight`.
|
|
671
|
-
*/
|
|
672
|
-
readonly margin?: number;
|
|
673
|
-
/**
|
|
674
|
-
Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
|
|
675
|
-
*/
|
|
676
|
-
readonly marginX?: number;
|
|
677
|
-
/**
|
|
678
|
-
Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
|
|
679
|
-
*/
|
|
680
|
-
readonly marginY?: number;
|
|
681
|
-
/**
|
|
682
|
-
Top margin.
|
|
683
|
-
*/
|
|
684
|
-
readonly marginTop?: number;
|
|
685
|
-
/**
|
|
686
|
-
Bottom margin.
|
|
687
|
-
*/
|
|
688
|
-
readonly marginBottom?: number;
|
|
689
|
-
/**
|
|
690
|
-
Left margin.
|
|
691
|
-
*/
|
|
692
|
-
readonly marginLeft?: number;
|
|
693
|
-
/**
|
|
694
|
-
Right margin.
|
|
695
|
-
*/
|
|
696
|
-
readonly marginRight?: number;
|
|
697
|
-
/**
|
|
698
|
-
Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`.
|
|
699
|
-
*/
|
|
700
|
-
readonly padding?: number;
|
|
701
|
-
/**
|
|
702
|
-
Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
|
|
703
|
-
*/
|
|
704
|
-
readonly paddingX?: number;
|
|
705
|
-
/**
|
|
706
|
-
Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
|
|
707
|
-
*/
|
|
708
|
-
readonly paddingY?: number;
|
|
709
|
-
/**
|
|
710
|
-
Top padding.
|
|
711
|
-
*/
|
|
712
|
-
readonly paddingTop?: number;
|
|
713
|
-
/**
|
|
714
|
-
Bottom padding.
|
|
715
|
-
*/
|
|
716
|
-
readonly paddingBottom?: number;
|
|
717
|
-
/**
|
|
718
|
-
Left padding.
|
|
719
|
-
*/
|
|
720
|
-
readonly paddingLeft?: number;
|
|
721
|
-
/**
|
|
722
|
-
Right padding.
|
|
723
|
-
*/
|
|
724
|
-
readonly paddingRight?: number;
|
|
725
|
-
/**
|
|
726
|
-
This property defines the ability for a flex item to grow if necessary.
|
|
727
|
-
See [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/).
|
|
728
|
-
*/
|
|
729
|
-
readonly flexGrow?: number;
|
|
730
|
-
/**
|
|
731
|
-
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.
|
|
732
|
-
See [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/).
|
|
733
|
-
*/
|
|
734
|
-
readonly flexShrink?: number;
|
|
735
|
-
/**
|
|
736
|
-
It establishes the main-axis, thus defining the direction flex items are placed in the flex container.
|
|
737
|
-
See [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/).
|
|
738
|
-
*/
|
|
739
|
-
readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
|
|
740
|
-
/**
|
|
741
|
-
It specifies the initial size of the flex item, before any available space is distributed according to the flex factors.
|
|
742
|
-
See [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/).
|
|
743
|
-
*/
|
|
744
|
-
readonly flexBasis?: number | string;
|
|
745
|
-
/**
|
|
746
|
-
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.
|
|
747
|
-
See [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/).
|
|
748
|
-
*/
|
|
749
|
-
readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
750
|
-
/**
|
|
751
|
-
The align-items property defines the default behavior for how items are laid out along the cross axis (perpendicular to the main axis).
|
|
752
|
-
See [align-items](https://css-tricks.com/almanac/properties/a/align-items/).
|
|
753
|
-
*/
|
|
754
|
-
readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
|
|
755
|
-
/**
|
|
756
|
-
It makes possible to override the align-items value for specific flex items.
|
|
757
|
-
See [align-self](https://css-tricks.com/almanac/properties/a/align-self/).
|
|
758
|
-
*/
|
|
759
|
-
readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | "stretch" | "baseline";
|
|
760
|
-
/**
|
|
761
|
-
It defines the alignment along the cross axis when there are multiple lines of flex items (when using flex-wrap).
|
|
762
|
-
See [align-content](https://css-tricks.com/almanac/properties/a/align-content/).
|
|
763
|
-
*/
|
|
764
|
-
readonly alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly";
|
|
765
|
-
/**
|
|
766
|
-
It defines the alignment along the main axis.
|
|
767
|
-
See [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/).
|
|
768
|
-
*/
|
|
769
|
-
readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center";
|
|
770
|
-
/**
|
|
771
|
-
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.
|
|
772
|
-
*/
|
|
773
|
-
readonly width?: number | string;
|
|
774
|
-
/**
|
|
775
|
-
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.
|
|
776
|
-
*/
|
|
777
|
-
readonly height?: number | string;
|
|
778
|
-
/**
|
|
779
|
-
Sets a minimum width of the element.
|
|
780
|
-
Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
|
|
781
|
-
*/
|
|
782
|
-
readonly minWidth?: number | string;
|
|
783
|
-
/**
|
|
784
|
-
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.
|
|
785
|
-
*/
|
|
786
|
-
readonly minHeight?: number | string;
|
|
787
|
-
/**
|
|
788
|
-
Sets a maximum width of the element.
|
|
789
|
-
Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
|
|
790
|
-
*/
|
|
791
|
-
readonly maxWidth?: number | string;
|
|
792
|
-
/**
|
|
793
|
-
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.
|
|
794
|
-
*/
|
|
795
|
-
readonly maxHeight?: number | string;
|
|
796
|
-
/**
|
|
797
|
-
Defines the aspect ratio (width/height) for the element.
|
|
798
|
-
|
|
799
|
-
Use it with at least one size constraint (`width`, `height`, `minHeight`, or `maxHeight`) so Ink can derive the missing dimension.
|
|
800
|
-
*/
|
|
801
|
-
readonly aspectRatio?: number;
|
|
802
|
-
/**
|
|
803
|
-
Set this property to `none` to hide the element.
|
|
804
|
-
*/
|
|
805
|
-
readonly display?: "flex" | "none";
|
|
806
|
-
/**
|
|
807
|
-
Add a border with a specified style. If `borderStyle` is `undefined` (the default), no border will be added.
|
|
808
|
-
*/
|
|
809
|
-
readonly borderStyle?: keyof Boxes | BoxStyle;
|
|
810
|
-
/**
|
|
811
|
-
Determines whether the top border is visible.
|
|
812
|
-
|
|
813
|
-
@default true
|
|
814
|
-
*/
|
|
815
|
-
readonly borderTop?: boolean;
|
|
816
|
-
/**
|
|
817
|
-
Determines whether the bottom border is visible.
|
|
818
|
-
|
|
819
|
-
@default true
|
|
820
|
-
*/
|
|
821
|
-
readonly borderBottom?: boolean;
|
|
822
|
-
/**
|
|
823
|
-
Determines whether the left border is visible.
|
|
824
|
-
|
|
825
|
-
@default true
|
|
826
|
-
*/
|
|
827
|
-
readonly borderLeft?: boolean;
|
|
828
|
-
/**
|
|
829
|
-
Determines whether the right border is visible.
|
|
830
|
-
|
|
831
|
-
@default true
|
|
832
|
-
*/
|
|
833
|
-
readonly borderRight?: boolean;
|
|
834
|
-
/**
|
|
835
|
-
Change border color. A shorthand for setting `borderTopColor`, `borderRightColor`, `borderBottomColor`, and `borderLeftColor`.
|
|
836
|
-
*/
|
|
837
|
-
readonly borderColor?: LiteralUnion<ForegroundColorName, string>;
|
|
838
|
-
/**
|
|
839
|
-
Change the top border color. Accepts the same values as `color` in `Text` component.
|
|
840
|
-
*/
|
|
841
|
-
readonly borderTopColor?: LiteralUnion<ForegroundColorName, string>;
|
|
842
|
-
/**
|
|
843
|
-
Change the bottom border color. Accepts the same values as `color` in `Text` component.
|
|
844
|
-
*/
|
|
845
|
-
readonly borderBottomColor?: LiteralUnion<ForegroundColorName, string>;
|
|
846
|
-
/**
|
|
847
|
-
Change the left border color. Accepts the same values as `color` in `Text` component.
|
|
848
|
-
*/
|
|
849
|
-
readonly borderLeftColor?: LiteralUnion<ForegroundColorName, string>;
|
|
850
|
-
/**
|
|
851
|
-
Change the right border color. Accepts the same values as `color` in `Text` component.
|
|
852
|
-
*/
|
|
853
|
-
readonly borderRightColor?: LiteralUnion<ForegroundColorName, string>;
|
|
854
|
-
/**
|
|
855
|
-
Dim the border color. A shorthand for setting `borderTopDimColor`, `borderBottomDimColor`, `borderLeftDimColor`, and `borderRightDimColor`.
|
|
856
|
-
|
|
857
|
-
@default false
|
|
858
|
-
*/
|
|
859
|
-
readonly borderDimColor?: boolean;
|
|
860
|
-
/**
|
|
861
|
-
Dim the top border color.
|
|
862
|
-
|
|
863
|
-
@default false
|
|
864
|
-
*/
|
|
865
|
-
readonly borderTopDimColor?: boolean;
|
|
866
|
-
/**
|
|
867
|
-
Dim the bottom border color.
|
|
868
|
-
|
|
869
|
-
@default false
|
|
870
|
-
*/
|
|
871
|
-
readonly borderBottomDimColor?: boolean;
|
|
872
|
-
/**
|
|
873
|
-
Dim the left border color.
|
|
874
|
-
|
|
875
|
-
@default false
|
|
876
|
-
*/
|
|
877
|
-
readonly borderLeftDimColor?: boolean;
|
|
878
|
-
/**
|
|
879
|
-
Dim the right border color.
|
|
880
|
-
|
|
881
|
-
@default false
|
|
882
|
-
*/
|
|
883
|
-
readonly borderRightDimColor?: boolean;
|
|
884
|
-
/**
|
|
885
|
-
Change border background color. A shorthand for setting `borderTopBackgroundColor`, `borderRightBackgroundColor`, `borderBottomBackgroundColor`, and `borderLeftBackgroundColor`.
|
|
886
|
-
*/
|
|
887
|
-
readonly borderBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
|
|
888
|
-
/**
|
|
889
|
-
Change top border background color. Accepts the same values as `backgroundColor` in `Text` component.
|
|
890
|
-
*/
|
|
891
|
-
readonly borderTopBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
|
|
892
|
-
/**
|
|
893
|
-
Change bottom border background color. Accepts the same values as `backgroundColor` in `Text` component.
|
|
894
|
-
*/
|
|
895
|
-
readonly borderBottomBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
|
|
896
|
-
/**
|
|
897
|
-
Change left border background color. Accepts the same values as `backgroundColor` in `Text` component.
|
|
898
|
-
*/
|
|
899
|
-
readonly borderLeftBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
|
|
900
|
-
/**
|
|
901
|
-
Change right border background color. Accepts the same values as `backgroundColor` in `Text` component.
|
|
902
|
-
*/
|
|
903
|
-
readonly borderRightBackgroundColor?: LiteralUnion<ForegroundColorName, string>;
|
|
904
|
-
/**
|
|
905
|
-
Behavior for an element's overflow in both directions.
|
|
906
|
-
|
|
907
|
-
@default 'visible'
|
|
908
|
-
*/
|
|
909
|
-
readonly overflow?: "visible" | "hidden";
|
|
910
|
-
/**
|
|
911
|
-
Behavior for an element's overflow in the horizontal direction.
|
|
912
|
-
|
|
913
|
-
@default 'visible'
|
|
914
|
-
*/
|
|
915
|
-
readonly overflowX?: "visible" | "hidden";
|
|
916
|
-
/**
|
|
917
|
-
Behavior for an element's overflow in the vertical direction.
|
|
918
|
-
|
|
919
|
-
@default 'visible'
|
|
920
|
-
*/
|
|
921
|
-
readonly overflowY?: "visible" | "hidden";
|
|
922
|
-
/**
|
|
923
|
-
Background color for the element.
|
|
924
|
-
|
|
925
|
-
Accepts the same values as `color` in the `<Text>` component.
|
|
926
|
-
*/
|
|
927
|
-
readonly backgroundColor?: LiteralUnion<ForegroundColorName, string>;
|
|
928
|
-
};
|
|
321
|
+
//#region src/transform-adapter.d.ts
|
|
322
|
+
type AnsiTransformer = (text: string, line: number) => string;
|
|
929
323
|
//#endregion
|
|
930
324
|
//#region src/dom.d.ts
|
|
931
325
|
type InkNode = {
|
|
@@ -942,7 +336,9 @@ type DOMElement = {
|
|
|
942
336
|
nodeName: ElementNames;
|
|
943
337
|
attributes: Record<string, DOMNodeAttribute>;
|
|
944
338
|
childNodes: DOMNode[];
|
|
945
|
-
|
|
339
|
+
internal_ansi?: boolean;
|
|
340
|
+
internal_transform?: AnsiTransformer;
|
|
341
|
+
internal_textStyle?: SemanticTextStyle;
|
|
946
342
|
internal_accessibility?: {
|
|
947
343
|
role?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
|
|
948
344
|
state?: {
|
|
@@ -978,7 +374,7 @@ type DOMNode<T = {
|
|
|
978
374
|
type DOMNodeAttribute = boolean | string | number;
|
|
979
375
|
//#endregion
|
|
980
376
|
//#region src/components/Box.d.ts
|
|
981
|
-
type Props$
|
|
377
|
+
type Props$2 = Omit<Styles, "textWrap"> & {
|
|
982
378
|
/**
|
|
983
379
|
A label for the element for screen readers.
|
|
984
380
|
*/
|
|
@@ -1009,89 +405,103 @@ type Props$1 = Except<Styles, "textWrap"> & {
|
|
|
1009
405
|
/**
|
|
1010
406
|
`<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
|
|
1011
407
|
*/
|
|
1012
|
-
declare
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
*/
|
|
1016
|
-
readonly "aria-label"?: string;
|
|
1017
|
-
/**
|
|
1018
|
-
Hide the element from screen readers.
|
|
1019
|
-
*/
|
|
1020
|
-
readonly "aria-hidden"?: boolean;
|
|
1021
|
-
/**
|
|
1022
|
-
The role of the element.
|
|
1023
|
-
*/
|
|
1024
|
-
readonly "aria-role"?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
|
|
1025
|
-
/**
|
|
1026
|
-
The state of the element.
|
|
1027
|
-
*/
|
|
1028
|
-
readonly "aria-state"?: {
|
|
1029
|
-
readonly busy?: boolean;
|
|
1030
|
-
readonly checked?: boolean;
|
|
1031
|
-
readonly disabled?: boolean;
|
|
1032
|
-
readonly expanded?: boolean;
|
|
1033
|
-
readonly multiline?: boolean;
|
|
1034
|
-
readonly multiselectable?: boolean;
|
|
1035
|
-
readonly readonly?: boolean;
|
|
1036
|
-
readonly required?: boolean;
|
|
1037
|
-
readonly selected?: boolean;
|
|
1038
|
-
};
|
|
1039
|
-
} & {
|
|
1040
|
-
children?: import("react").ReactNode | undefined;
|
|
1041
|
-
} & import("react").RefAttributes<DOMElement>>;
|
|
408
|
+
declare function Box({ children, ref, backgroundColor, "aria-label": ariaLabel, "aria-hidden": ariaHidden, "aria-role": role, "aria-state": ariaState, ...style }: PropsWithChildren<Props$2> & {
|
|
409
|
+
readonly ref?: Ref<DOMElement>;
|
|
410
|
+
}): import("react").JSX.Element | null;
|
|
1042
411
|
//#endregion
|
|
1043
|
-
//#region src/components/
|
|
1044
|
-
type Props
|
|
1045
|
-
/**
|
|
1046
|
-
|
|
1047
|
-
|
|
412
|
+
//#region src/components/AnsiText.d.ts
|
|
413
|
+
type Props = {
|
|
414
|
+
/** External text containing ANSI SGR styling or OSC 8 hyperlinks. */
|
|
415
|
+
readonly children: string;
|
|
416
|
+
readonly wrap?: Styles["textWrap"];
|
|
1048
417
|
readonly "aria-label"?: string;
|
|
1049
|
-
/**
|
|
1050
|
-
Hide the element from screen readers.
|
|
1051
|
-
*/
|
|
1052
418
|
readonly "aria-hidden"?: boolean;
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* Renders explicitly trusted ANSI-styled output as structured terminal cells.
|
|
422
|
+
* Ordinary `Text` continues to strip terminal control sequences.
|
|
423
|
+
*/
|
|
424
|
+
declare function AnsiText({ children, wrap, "aria-label": ariaLabel, "aria-hidden": ariaHidden }: Props): import("react").JSX.Element | null;
|
|
425
|
+
//#endregion
|
|
426
|
+
//#region src/components/AppContext.d.ts
|
|
427
|
+
/**
|
|
428
|
+
A handle returned by `suspendTerminal()` when called without a callback.
|
|
429
|
+
|
|
430
|
+
Call `resume()` to give terminal ownership back to Ink, or use `await using`
|
|
431
|
+
so the suspension is resumed automatically when it leaves scope.
|
|
432
|
+
*/
|
|
433
|
+
type TerminalSuspension = {
|
|
434
|
+
readonly resume: () => Promise<void>;
|
|
435
|
+
readonly [Symbol.asyncDispose]: () => Promise<void>;
|
|
436
|
+
};
|
|
437
|
+
/**
|
|
438
|
+
Temporarily hand the terminal over to a child process (e.g. `$EDITOR`, `less`,
|
|
439
|
+
`fzf`), then restore Ink's terminal state and force a full redraw.
|
|
440
|
+
*/
|
|
441
|
+
type SuspendTerminal = {
|
|
442
|
+
(callback: () => void | Promise<void>): Promise<void>;
|
|
443
|
+
(): Promise<TerminalSuspension>;
|
|
444
|
+
};
|
|
445
|
+
type Props$1 = {
|
|
1053
446
|
/**
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
*/
|
|
1060
|
-
readonly backgroundColor?: LiteralUnion<ForegroundColorName, string>;
|
|
1061
|
-
/**
|
|
1062
|
-
Dim the color (make it less bright).
|
|
1063
|
-
*/
|
|
1064
|
-
readonly dimColor?: boolean;
|
|
1065
|
-
/**
|
|
1066
|
-
Make the text bold.
|
|
1067
|
-
*/
|
|
1068
|
-
readonly bold?: boolean;
|
|
1069
|
-
/**
|
|
1070
|
-
Make the text italic.
|
|
1071
|
-
*/
|
|
1072
|
-
readonly italic?: boolean;
|
|
1073
|
-
/**
|
|
1074
|
-
Make the text underlined.
|
|
1075
|
-
*/
|
|
1076
|
-
readonly underline?: boolean;
|
|
1077
|
-
/**
|
|
1078
|
-
Make the text crossed out with a line.
|
|
447
|
+
Exit (unmount) the whole Ink app.
|
|
448
|
+
|
|
449
|
+
- `exit()` — resolves `waitUntilExit()` with `undefined`.
|
|
450
|
+
- `exit(new Error('…'))` — rejects `waitUntilExit()` with the error.
|
|
451
|
+
- `exit(value)` — resolves `waitUntilExit()` with `value`.
|
|
1079
452
|
*/
|
|
1080
|
-
readonly
|
|
453
|
+
readonly exit: (errorOrResult?: unknown) => void;
|
|
1081
454
|
/**
|
|
1082
|
-
|
|
455
|
+
Returns a promise that settles after pending render output is flushed to stdout.
|
|
456
|
+
|
|
457
|
+
@example
|
|
458
|
+
```jsx
|
|
459
|
+
import {useEffect} from 'react';
|
|
460
|
+
import {useApp} from 'ink';
|
|
461
|
+
|
|
462
|
+
const Example = () => {
|
|
463
|
+
const {waitUntilRenderFlush} = useApp();
|
|
464
|
+
|
|
465
|
+
useEffect(() => {
|
|
466
|
+
void (async () => {
|
|
467
|
+
await waitUntilRenderFlush();
|
|
468
|
+
runNextCommand();
|
|
469
|
+
})();
|
|
470
|
+
}, [waitUntilRenderFlush]);
|
|
471
|
+
|
|
472
|
+
return …;
|
|
473
|
+
};
|
|
474
|
+
```
|
|
1083
475
|
*/
|
|
1084
|
-
readonly
|
|
476
|
+
readonly waitUntilRenderFlush: () => Promise<void>;
|
|
1085
477
|
/**
|
|
1086
|
-
|
|
478
|
+
Temporarily release the terminal so a child process can take it over, then
|
|
479
|
+
restore Ink's terminal state and force a full redraw.
|
|
480
|
+
|
|
481
|
+
Use the callback form for the common case — Ink restores the terminal even
|
|
482
|
+
if the callback throws:
|
|
483
|
+
|
|
484
|
+
@example
|
|
485
|
+
```jsx
|
|
486
|
+
import {useApp} from 'ink';
|
|
487
|
+
|
|
488
|
+
const {suspendTerminal} = useApp();
|
|
489
|
+
|
|
490
|
+
await suspendTerminal(async () => {
|
|
491
|
+
await runEditor();
|
|
492
|
+
});
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
Or hold a suspension and resume it yourself:
|
|
496
|
+
|
|
497
|
+
@example
|
|
498
|
+
```jsx
|
|
499
|
+
await using suspension = await suspendTerminal();
|
|
500
|
+
await runEditor();
|
|
501
|
+
```
|
|
1087
502
|
*/
|
|
1088
|
-
readonly
|
|
1089
|
-
readonly children?: ReactNode;
|
|
503
|
+
readonly suspendTerminal: SuspendTerminal;
|
|
1090
504
|
};
|
|
1091
|
-
/**
|
|
1092
|
-
This component can display text and change its style to make it bold, underlined, italic, or strikethrough.
|
|
1093
|
-
*/
|
|
1094
|
-
declare function Text({ color, backgroundColor, dimColor, bold, italic, underline, strikethrough, inverse, wrap, children, "aria-label": ariaLabel, "aria-hidden": ariaHidden }: Props$6): import("react").JSX.Element | null;
|
|
1095
505
|
//#endregion
|
|
1096
506
|
//#region src/components/StdinContext.d.ts
|
|
1097
507
|
type PublicProps = {
|
|
@@ -1110,7 +520,7 @@ type PublicProps = {
|
|
|
1110
520
|
};
|
|
1111
521
|
//#endregion
|
|
1112
522
|
//#region src/components/StdoutContext.d.ts
|
|
1113
|
-
type Props$
|
|
523
|
+
type Props$7 = {
|
|
1114
524
|
/**
|
|
1115
525
|
Stdout stream passed to `render()` in `options.stdout` or `process.stdout` by default.
|
|
1116
526
|
*/
|
|
@@ -1122,7 +532,7 @@ type Props$5 = {
|
|
|
1122
532
|
};
|
|
1123
533
|
//#endregion
|
|
1124
534
|
//#region src/components/StderrContext.d.ts
|
|
1125
|
-
type Props$
|
|
535
|
+
type Props$6 = {
|
|
1126
536
|
/**
|
|
1127
537
|
Stderr stream passed to `render()` in `options.stderr` or `process.stderr` by default.
|
|
1128
538
|
*/
|
|
@@ -1134,7 +544,7 @@ type Props$4 = {
|
|
|
1134
544
|
};
|
|
1135
545
|
//#endregion
|
|
1136
546
|
//#region src/components/Static.d.ts
|
|
1137
|
-
type Props$
|
|
547
|
+
type Props$5<T> = {
|
|
1138
548
|
/**
|
|
1139
549
|
Array of items of any type to render using the function you pass as a component child.
|
|
1140
550
|
*/
|
|
@@ -1155,16 +565,16 @@ It's preferred to use `<Static>` for use cases like these when you can't know or
|
|
|
1155
565
|
|
|
1156
566
|
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.
|
|
1157
567
|
*/
|
|
1158
|
-
declare function Static<T>(props: Props$
|
|
568
|
+
declare function Static<T>(props: Props$5<T>): import("react").JSX.Element;
|
|
1159
569
|
//#endregion
|
|
1160
570
|
//#region src/components/Transform.d.ts
|
|
1161
|
-
type Props$
|
|
571
|
+
type Props$9 = {
|
|
1162
572
|
/**
|
|
1163
573
|
Screen-reader-specific text to output. If this is set, all children will be ignored.
|
|
1164
574
|
*/
|
|
1165
575
|
readonly accessibilityLabel?: string;
|
|
1166
576
|
/**
|
|
1167
|
-
|
|
577
|
+
Compatibility function that transforms the ANSI serialization of this subtree.
|
|
1168
578
|
*/
|
|
1169
579
|
readonly transform: (children: string, index: number) => string;
|
|
1170
580
|
readonly children?: ReactNode;
|
|
@@ -1172,11 +582,38 @@ type Props$7 = {
|
|
|
1172
582
|
/**
|
|
1173
583
|
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.
|
|
1174
584
|
*/
|
|
1175
|
-
declare function Transform({ children, transform, accessibilityLabel }: Props$
|
|
585
|
+
declare function Transform({ children, transform, accessibilityLabel }: Props$9): import("react").JSX.Element | null;
|
|
586
|
+
//#endregion
|
|
587
|
+
//#region src/components/Hyperlink.d.ts
|
|
588
|
+
type Props$3 = Omit<Props$8, "children"> & {
|
|
589
|
+
/**
|
|
590
|
+
The URL the hyperlink points to.
|
|
591
|
+
*/
|
|
592
|
+
readonly url: string;
|
|
593
|
+
/**
|
|
594
|
+
When the terminal does not support OSC 8 hyperlinks, append the URL in
|
|
595
|
+
parentheses after the text so it stays reachable. Set to `false` to render
|
|
596
|
+
the text alone.
|
|
597
|
+
|
|
598
|
+
@default true
|
|
599
|
+
*/
|
|
600
|
+
readonly fallback?: boolean;
|
|
601
|
+
readonly children?: ReactNode;
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
A clickable OSC 8 hyperlink — the counterpart to the router's `<Link>`, which
|
|
605
|
+
navigates between screens. On terminals without hyperlink support it falls
|
|
606
|
+
back to `text (url)`.
|
|
607
|
+
|
|
608
|
+
```tsx
|
|
609
|
+
<Hyperlink url="https://example.com">Documentation</Hyperlink>
|
|
610
|
+
```
|
|
611
|
+
*/
|
|
612
|
+
declare function Hyperlink({ url, fallback, children, ...textProps }: Props$3): import("react").JSX.Element;
|
|
1176
613
|
//#endregion
|
|
1177
614
|
//#region src/components/Newline.d.ts
|
|
1178
615
|
/** @jsxImportSource react */
|
|
1179
|
-
type Props$
|
|
616
|
+
type Props$4 = {
|
|
1180
617
|
/**
|
|
1181
618
|
Number of newlines to insert.
|
|
1182
619
|
|
|
@@ -1187,7 +624,7 @@ type Props$2 = {
|
|
|
1187
624
|
/**
|
|
1188
625
|
Adds one or more newline (`\n`) characters. Must be used within `<Text>` components.
|
|
1189
626
|
*/
|
|
1190
|
-
declare function Newline({ count }: Props$
|
|
627
|
+
declare function Newline({ count }: Props$4): import("react").JSX.Element;
|
|
1191
628
|
//#endregion
|
|
1192
629
|
//#region src/components/Spacer.d.ts
|
|
1193
630
|
/**
|
|
@@ -1197,6 +634,38 @@ It's useful as a shortcut for filling all the available space between elements.
|
|
|
1197
634
|
*/
|
|
1198
635
|
declare function Spacer(): import("react").JSX.Element;
|
|
1199
636
|
//#endregion
|
|
637
|
+
//#region src/hooks/use-capabilities.d.ts
|
|
638
|
+
/**
|
|
639
|
+
Returns everything knowable about the terminal: size, identity, platform,
|
|
640
|
+
color depth, theme, and feature support.
|
|
641
|
+
|
|
642
|
+
A thin wrapper over the framework-free capabilities store (`getCapabilities`):
|
|
643
|
+
environment-derived facts are available immediately; facts only the terminal
|
|
644
|
+
itself can answer fill in after a lazy one-time query, and re-mounting
|
|
645
|
+
consumers refreshes the dynamic facts (theme colors, pixel geometry).
|
|
646
|
+
Re-renders on terminal resize and whenever query answers arrive.
|
|
647
|
+
*/
|
|
648
|
+
declare const useCapabilities: () => Capabilities;
|
|
649
|
+
/**
|
|
650
|
+
Calls `onChange` whenever the terminal changes: resizes (including in-band
|
|
651
|
+
pixel geometry), color scheme switches, window focus, and query answers
|
|
652
|
+
arriving. The React wrapper over `capabilities.subscribe()` for side effects —
|
|
653
|
+
for rendering, use `useCapabilities` instead.
|
|
654
|
+
|
|
655
|
+
The callback always sees the latest render's closure and changing it does not
|
|
656
|
+
resubscribe. Both the new and previous snapshot are passed, so handlers can
|
|
657
|
+
react to the specific change:
|
|
658
|
+
|
|
659
|
+
```tsx
|
|
660
|
+
useCapabilitiesChange((next, previous) => {
|
|
661
|
+
if (next.theme.appearance !== previous.theme.appearance) {
|
|
662
|
+
// re-theme
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
```
|
|
666
|
+
*/
|
|
667
|
+
declare const useCapabilitiesChange: (onChange: (capabilities: Capabilities, previous: Capabilities) => void) => void;
|
|
668
|
+
//#endregion
|
|
1200
669
|
//#region src/hooks/use-input.d.ts
|
|
1201
670
|
/**
|
|
1202
671
|
Handy information about a key that was pressed.
|
|
@@ -1370,7 +839,7 @@ declare const usePaste: (handler: (text: string) => void, options?: Options$1) =
|
|
|
1370
839
|
/**
|
|
1371
840
|
A React hook that returns app lifecycle methods like `exit()` and `waitUntilRenderFlush()`.
|
|
1372
841
|
*/
|
|
1373
|
-
declare const useApp: () => Props;
|
|
842
|
+
declare const useApp: () => Props$1;
|
|
1374
843
|
//#endregion
|
|
1375
844
|
//#region src/hooks/use-stdin.d.ts
|
|
1376
845
|
/**
|
|
@@ -1382,13 +851,13 @@ declare const useStdin: () => PublicProps;
|
|
|
1382
851
|
/**
|
|
1383
852
|
A React hook that returns the stdout stream where Ink renders your app.
|
|
1384
853
|
*/
|
|
1385
|
-
declare const useStdout: () => Props$
|
|
854
|
+
declare const useStdout: () => Props$7;
|
|
1386
855
|
//#endregion
|
|
1387
856
|
//#region src/hooks/use-stderr.d.ts
|
|
1388
857
|
/**
|
|
1389
858
|
A React hook that returns the stderr stream.
|
|
1390
859
|
*/
|
|
1391
|
-
declare const useStderr: () => Props$
|
|
860
|
+
declare const useStderr: () => Props$6;
|
|
1392
861
|
//#endregion
|
|
1393
862
|
//#region src/hooks/use-focus.d.ts
|
|
1394
863
|
type Input = {
|
|
@@ -1422,7 +891,7 @@ A component that uses the `useFocus` hook becomes "focusable" to Ink, so when th
|
|
|
1422
891
|
declare const useFocus: ({ isActive, autoFocus, id: customId }?: Input) => Output$2;
|
|
1423
892
|
//#endregion
|
|
1424
893
|
//#region src/components/FocusContext.d.ts
|
|
1425
|
-
type Props$
|
|
894
|
+
type Props$10 = {
|
|
1426
895
|
readonly activeId?: string;
|
|
1427
896
|
readonly add: (id: string, options: {
|
|
1428
897
|
autoFocus: boolean;
|
|
@@ -1442,23 +911,23 @@ type Output$1 = {
|
|
|
1442
911
|
/**
|
|
1443
912
|
Enable focus management for all components.
|
|
1444
913
|
*/
|
|
1445
|
-
enableFocus: Props$
|
|
914
|
+
enableFocus: Props$10["enableFocus"];
|
|
1446
915
|
/**
|
|
1447
916
|
Disable focus management for all components. The currently active component (if there's one) will lose its focus.
|
|
1448
917
|
*/
|
|
1449
|
-
disableFocus: Props$
|
|
918
|
+
disableFocus: Props$10["disableFocus"];
|
|
1450
919
|
/**
|
|
1451
920
|
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.
|
|
1452
921
|
*/
|
|
1453
|
-
focusNext: Props$
|
|
922
|
+
focusNext: Props$10["focusNext"];
|
|
1454
923
|
/**
|
|
1455
924
|
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.
|
|
1456
925
|
*/
|
|
1457
|
-
focusPrevious: Props$
|
|
926
|
+
focusPrevious: Props$10["focusPrevious"];
|
|
1458
927
|
/**
|
|
1459
928
|
Switch focus to the element with provided `id`. If there's no element with that `id`, focus is not changed.
|
|
1460
929
|
*/
|
|
1461
|
-
focus: Props$
|
|
930
|
+
focus: Props$10["focus"];
|
|
1462
931
|
/**
|
|
1463
932
|
The ID of the currently focused component, or `undefined` if no component is focused.
|
|
1464
933
|
|
|
@@ -1473,7 +942,7 @@ type Output$1 = {
|
|
|
1473
942
|
};
|
|
1474
943
|
```
|
|
1475
944
|
*/
|
|
1476
|
-
activeId: Props$
|
|
945
|
+
activeId: Props$10["activeId"];
|
|
1477
946
|
};
|
|
1478
947
|
/**
|
|
1479
948
|
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.
|
|
@@ -1549,6 +1018,18 @@ const Spinner = () => {
|
|
|
1549
1018
|
*/
|
|
1550
1019
|
declare function useAnimation(options?: Options): AnimationResult;
|
|
1551
1020
|
//#endregion
|
|
1021
|
+
//#region src/hooks/use-terminal-osc.d.ts
|
|
1022
|
+
type ProgressOptions = {
|
|
1023
|
+
readonly state: TerminalProgressState;
|
|
1024
|
+
readonly value?: number;
|
|
1025
|
+
};
|
|
1026
|
+
declare const useProgress: ({ state, value }: ProgressOptions) => void;
|
|
1027
|
+
declare const useClipboard: () => ((text: string, selection?: ClipboardSelection) => void);
|
|
1028
|
+
declare const useTitle: (title?: string) => void;
|
|
1029
|
+
declare const useWorkingDirectory: (directory: URL | string) => void;
|
|
1030
|
+
declare const useNotification: () => ((title: string) => void);
|
|
1031
|
+
declare const usePointerShape: (shape: string) => void;
|
|
1032
|
+
//#endregion
|
|
1552
1033
|
//#region src/hooks/use-window-size.d.ts
|
|
1553
1034
|
/**
|
|
1554
1035
|
Dimensions of the terminal window.
|
|
@@ -1655,4 +1136,4 @@ Note: `measureElement()` returns `{x: 0, y: 0, width: 0, height: 0}` when called
|
|
|
1655
1136
|
*/
|
|
1656
1137
|
declare const measureElement: (node: DOMElement) => Output;
|
|
1657
1138
|
//#endregion
|
|
1658
|
-
export { type AnimationResult, type Props as AppProps, Box, type BoxMetrics, type Props$
|
|
1139
|
+
export { type AnimationResult, AnsiText, type Props as AnsiTextProps, type Props$1 as AppProps, Box, type BoxMetrics, type Props$2 as BoxProps, type Capabilities, type CapabilitiesStore, type CapturedOutputSource, type ColorInfo, type ColorSupport, type ColorSupportLevel, type CursorPosition, type DOMElement, type Output as ElementMetrics, Hyperlink, type Props$3 as HyperlinkProps, type Instance, type Key, type KittyFlagName, type KittyKeyboardOptions, type Multiplexer, Newline, type Props$4 as NewlineProps, type PixelGeometry, type PixelSize, type ProgressOptions, type RenderOptions, type RenderToStringOptions, type RgbColor, Spacer, Static, type Props$5 as StaticProps, type Props$6 as StderrProps, type PublicProps as StdinProps, type Props$7 as StdoutProps, type SuspendTerminal, type TerminalAppearance, type TerminalIdentity, type TerminalQueryOptions, type TerminalQueryResult, type TerminalSuspension, Text, type Props$8 as TextProps, Transform, type Props$9 as TransformProps, type UseBoxMetricsResult, type WindowSize, applyTerminalQuery, capabilities, createSupportsColor, detectCapabilities, detectColorLevel, detectHyperlinkSupport, detectTerminal, detectUnicodeSupport, getCapabilities, getTerminalQuery, kittyFlags, kittyModifiers, measureElement, queryTerminal, refreshTerminalQuery, render, renderToString, useAnimation, useApp, useBoxMetrics, useCapabilities, useCapabilitiesChange, useClipboard, useCursor, useFocus, useFocusManager, useInput, useIsScreenReaderEnabled, useNotification, usePaste, usePointerShape, useProgress, useStderr, useStdin, useStdout, useTitle, useWindowSize, useWorkingDirectory };
|