/**
 * Row (1-indexed) where the scroll region ends and the bottom region
 * begins. Returns 0 before `installRegion` runs or in non-TTY mode.
 */
export declare function scrollBottomRow(): number;
/**
 * Install the terminal scroll region so the top `H - bottomRows` rows
 * scroll natively (preserving scrollback, copy-paste, mouse-select)
 * and the bottom `bottomRows` rows are reserved for the TUI Screen
 * to render via `BottomRegionOutputTarget`. Idempotent. No-op when
 * stdout is not a TTY (the caller falls back to line-buffered output).
 */
export declare function installRegion(bottomRows: number): void;
/**
 * Reset the terminal to its default (full) scroll region and print a
 * trailing newline so the next shell prompt lands below the bottom
 * region after the REPL exits. Idempotent.
 */
export declare function resetRegion(): void;
/**
 * Save the cursor, move to the start of the bottom region, run `fn`
 * (which should write a frame to stdout via the wrapped OutputTarget),
 * restore the cursor. Keeps stdout's logical cursor inside the scroll
 * region so subsequent plain writes don't corrupt the bottom region.
 *
 * In non-TTY mode the cursor moves are skipped but `fn` still runs.
 */
export declare function withBottomCursor(fn: () => void): void;
/**
 * Recompute the scroll-region split after a terminal resize. Re-reads
 * `process.stdout.rows` and re-issues the scroll-region escape with
 * the same `installedBottomRows` value. Called from a SIGWINCH
 * listener installed via `installResizeHandler`, or directly from
 * tests.
 */
export declare function onResize(): void;
/**
 * Install a SIGWINCH listener that re-issues the scroll region on
 * terminal resize. Returns a teardown function that removes the
 * listener. Idempotent — calling twice without teardown still leaves
 * exactly one listener installed.
 */
export declare function installResizeHandler(): () => void;
