/** * Screen: the top-level entry point that ties Solid rendering to the terminal. * * Creates a root TermNode, starts the frame scheduler, manages input, * and handles the terminal lifecycle (raw mode, cleanup on exit). * * Usage: * const screen = mount(() => , { fps: 30 }) * // later: * screen.unmount() */ import type { Element as JSXElement } from "solid-js"; import { type InputBus } from "../input/hooks.js"; import { type TermNode } from "../renderer/term-node.js"; export interface ScreenOptions { /** Use alternate screen buffer (default: false — prefer primary buffer for terminal-native feel) */ altScreen?: boolean; /** Terminal columns (default: stdout columns or 80) */ cols?: number; /** * Content-driven height (default: false). When true, the active region * height equals the content height instead of the terminal height. * Content grows downward from the cursor position; when it exceeds the * viewport, old content scrolls into terminal scrollback via natural LFs. * This matches Claude Code / Ink's primary-screen rendering model. */ contentDriven?: boolean; /** Enable input handling (default: true) */ enableInput?: boolean; /** Target frames per second (default: 30) */ fps?: number; /** Enable kitty keyboard protocol (default: false) */ kittyKeyboard?: boolean; /** Enable mouse tracking (default: false) */ mouse?: boolean; /** Terminal rows (default: stdout rows or 24) */ rows?: number; /** Whether synchronized output is supported (default: false) */ syncOutput?: boolean; /** Write function (default: process.stdout.write) */ write?: (data: string) => void; } export interface Screen { /** * Commit a component to scrollback above the active render region. * Renders the JSX once, writes it permanently, then disposes the tree. * Use this to "finalize" completed output (e.g., finished tool calls, messages). */ commit(content: () => JSXElement): void; /** * Commit a component inline — renders once, disposes reactivity, and inserts * the frozen nodes into a target parent within the viewport. Unlike commit(), * the content stays visible in the active render region and participates in * layout/paint, but has no reactive subscriptions. */ commitTo(content: () => JSXElement, parent: TermNode, anchor?: TermNode): void; /** The input bus — for direct event subscription outside components. */ input: InputBus; /** Whether mouse tracking is currently enabled. */ mouse: boolean; /** Force an immediate render (bypasses frame scheduler). */ refresh(): void; /** Resize the screen. Triggers a full re-render. */ resize(cols: number, rows: number): void; /** The root TermNode — available for testing/inspection. */ root: TermNode; /** Enable or disable mouse tracking at runtime. */ setMouse(enabled: boolean): void; /** Stop the frame loop, dispose the Solid tree, restore terminal. */ unmount(): void; } export declare function mount(code: () => JSXElement, options?: ScreenOptions): Screen; //# sourceMappingURL=screen.d.ts.map