@jsvision/ui / ApplicationOptions
Interface: ApplicationOptions
Defined in: ui/src/app/application.ts:23
Options for createApplication. Everything is optional — an app starts with no arguments.
Properties
adaptAmbiguousWidth?
optionaladaptAmbiguousWidth?:boolean
Defined in: ui/src/app/application.ts:69
On a real terminal, automatically switch to ASCII-safe frame chrome if the startup probe finds the ambiguous-width glyphs render double-width. Default true; pass false to skip the probe.
caps?
optionalcaps?:"auto"|CapabilityProfile
Defined in: ui/src/app/application.ts:29
Terminal capability profile that drives color-depth encoding for every painted frame. Defaults to 'auto', which detects the running terminal's capabilities via resolveCapabilities(). Pass an explicit profile to override the detection (used verbatim, no re-resolution).
clipboardKeys?
optionalclipboardKeys?:ClipboardKeys
Defined in: ui/src/app/application.ts:44
Which clipboard key set the framework binds by default (default 'both' — modern Ctrl+A/C/X/V plus the classic Ctrl+Insert/Shift+Insert/Shift+Delete aliases). Any keymap you supply merges on top and wins on a conflicting chord. Use 'none' to bind no clipboard chords (e.g. an app hosting a WordStar-mode Editor) and supply your own keymap instead.
input?
optionalinput?:ReadStream
Defined in: ui/src/app/application.ts:57
Input stream to read from; defaults to process.stdin. Inject a fake TTY stream to run headlessly.
keymap?
optionalkeymap?:Keymap
Defined in: ui/src/app/application.ts:37
Key-chord → command map (from core's createKeymap) applied across the whole app.
logger?
optionallogger?:Logger
Defined in: ui/src/app/application.ts:35
Logger that receives errors thrown from a view's draw()/onEvent(); defaults to a no-op logger.
menuBar?
optionalmenuBar?:MenuBar
Defined in: ui/src/app/application.ts:46
Optional menu bar shown as the top row. Build one with menuBar(...).
output?
optionaloutput?:WriteStream
Defined in: ui/src/app/application.ts:59
Output stream to write to; defaults to process.stdout.
requireTty?
optionalrequireTty?:boolean
Defined in: ui/src/app/application.ts:83
Require an interactive TTY at startup. When true (the default), run() asserts the terminal essentials before taking over the screen and throws EssentialsNotMetError when there is no interactive terminal at all — a cron/CI job, a container with no tty, or stdin and stdout both redirected with no controlling terminal — instead of silently starting a keyboard-less app. (Piping output while a controlling terminal exists still works: the host binds /dev/tty.) Set false for headless/automated runs that drive the loop without a real terminal.
Example
// A headless integration test drives run() without a terminal:
const app = createApplication({ caps, requireTty: false });
const exit = app.run(); // starts against injected streams; no EssentialsNotMetErrorrevealKey?
optionalrevealKey?:string|null
Defined in: ui/src/app/application.ts:53
The key that toggles accelerator mode (default 'f12'): while on, every ~X~ hotkey is underlined and a bare letter fires the matching accelerator. Pass null to disable the feature.
runtime?
optionalruntime?:RuntimeAdapter
Defined in: ui/src/app/application.ts:55
OS boundary the host runs against; defaults to the real Node runtime. Inject a fake in tests.
statusLine?
optionalstatusLine?:StatusLine
Defined in: ui/src/app/application.ts:48
Optional status line shown as the bottom row. Build one with statusLine(...).
theme?
optionaltheme?:Theme
Defined in: ui/src/app/application.ts:33
Color/style theme applied to every view; defaults to the built-in defaultTheme.
viewport?
optionalviewport?:Size2D
Defined in: ui/src/app/application.ts:31
Initial viewport size in cells. Defaults to the output terminal's size, or 80×24 if unknown.
warnAmbiguousWidth?
optionalwarnAmbiguousWidth?:boolean
Defined in: ui/src/app/application.ts:64
On a real terminal, warn once at startup if the terminal renders the ambiguous-width frame glyphs double-width (which shifts alignment). Default true; pass false to skip the probe in tests.