tuil
ReferencePackages@mwillbanks/tuil-inkAPI

TuilRenderOptions

interface exported by @mwillbanks/tuil-ink.

View rawEdit

interface

Public interface exported by @mwillbanks/tuil-ink.

export interface TuilRenderOptions extends RenderOptions {
  readonly semanticRegistry?: SemanticRegistry;
}

Members

MemberTypeRequiredDescriptionRelated types
semanticRegistrySemanticRegistry | undefinedNoThe semanticRegistry member uses the SemanticRegistry | undefined contract.SemanticRegistry
stdoutNodeJS.WriteStream | undefinedNoOutput stream where the app will be rendered.
stdinNodeJS.ReadStream | undefinedNoInput stream where app will listen for input.
stderrNodeJS.WriteStream | undefinedNoError stream.
debugboolean | undefinedNoIf true, each update will be rendered as separate output, without replacing the previous one.
exitOnCtrlCboolean | undefinedNoConfigure 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.
patchConsoleboolean | undefinedNoPatch console methods to ensure console output doesn't mix with Ink's output. Note: Once unmount starts, Ink restores the native console before React cleanup runs. Teardown-time console.* output then follows the normal console behavior instead of being rerouted through Ink.
onRender((metrics: RenderMetrics) => void) | undefinedNoRuns the given callback after each render and re-render with render metrics. Note: this callback runs after Ink commits a frame, but it does not wait for stdout/stderr stream callbacks. To run code after output is flushed, use waitUntilRenderFlush().
isScreenReaderEnabledboolean | undefinedNoEnable screen reader support. See https://github.com/vadimdemedes/ink/blob/master/readme.md#screen-reader-support
maxFpsnumber | undefinedNoMaximum frames per second for render updates. This controls how frequently the UI can update to prevent excessive re-rendering. Higher values allow more frequent updates but may impact performance.
incrementalRenderingboolean | undefinedNoEnable incremental rendering mode which only updates changed lines instead of redrawing the entire output. This can reduce flickering and improve performance for frequently updating UIs.
concurrentboolean | undefinedNoEnable React Concurrent Rendering mode. When enabled: - Suspense boundaries work correctly with async data - useTransition and useDeferredValue are fully functional - Updates can be interrupted for higher priority work 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.
kittyKeyboardKittyKeyboardOptions | undefinedNoConfigure kitty keyboard protocol support for enhanced keyboard input. Enables additional modifiers (super, hyper, capsLock, numLock) and disambiguated key events in terminals that support the protocol.
interactiveboolean | undefinedNoOverride automatic interactive mode detection. By default, Ink detects whether the environment is interactive based on CI detection (via is-in-ci) and stdout.isTTY. Most users should not need to set this. 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. Set to false to force non-interactive mode or true to force interactive mode when the automatic detection doesn't suit your use case. 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.
alternateScreenboolean | undefinedNoRender 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. 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. 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. Only works in interactive mode. Ignored when interactive is false or in a non-interactive environment (CI, piped stdout). 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.

Parameters

This declaration has no public members.

Returns

This declaration does not return a value.

Throws

No thrown errors are documented for this declaration.

Source

View the secondary source reference

Package

@mwillbanks/tuil-ink

On this page