import type { Element } from "../../tui/elements.js"; import { type FormState, type Row } from "./form.js"; /** The label column: the widest label as drawn, plus a gap. */ export declare const LABEL_WIDTH: number; export type FormViewArgs = { state: FormState; width: number; height: number; /** The key hints for the form mode, from its bindings. */ hints: string; }; /** Everything the drawing needs to know about one row of the body. `row` * is null for a line the cursor never visits. `typed` is true when the * cursor row takes typing, so it is drawn as a text input; a choice row * is drawn on the cursor background with no block cursor. */ export type RowView = { row: Row | null; label: string; value: string; /** Shown dim in the value column while the value is empty. */ help: string; cursor: boolean; typed: boolean; heading: boolean; }; /** The rows of the body, in order: the fields, then the graders section. */ export declare function rowViewsOf(state: FormState): RowView[]; /** Every line of the body in order, each tagged with the row it belongs * to. One place computes the wrapping; drawing and scrolling both read it. */ export declare function bodyLines(state: FormState, width: number): { row: Row | null; element: Element; }[]; export declare function renderForm(args: FormViewArgs): Element; /** The state with `scrollTop` moved so the cursor row is on screen: its * last line when the cursor came down onto it, its first line (the one * with the label) when the cursor came up onto it or the row is taller * than the screen. Run after every key, so a row that vanished is * absorbed too. */ export declare function scrolledToCursor(state: FormState, width: number, height: number): FormState; /** One row as screen lines, each element exactly one line tall. A value * that does not fit on one line continues on the lines below, under the * value column. The typed cursor row is a text input, so the cursor looks * like every other input in the toolkit; a choice cursor row is drawn on * the cursor background with nothing to type into. An empty row shows its * help dim. A text input draws its value as is, with no style tags read, * so its line only has its control characters removed; escaping braces * there would show the backslashes. The lines above it are ordinary * lines, which do read style tags, so their braces are escaped. */ export declare function drawRow(view: RowView, width: number): Element[]; /** The rows a text input shows for the value under the cursor. The value * is wrapped here, since a text input clips a long line rather than * wrapping it, and the cursor then sits at the end of the last row. * * `wrapText` drops the spaces at the end of a row once a value wraps, and * a person typing a space at the end of a long goal would then see the * cursor stay put. So the value is wrapped without its trailing spaces and * they are put back on the last row. A row that fills the width gets an * empty row after it, because a text input leaves the cursor out when its * last row is full; the width is measured as drawn, so a row of wide * characters counts its columns and not its code units. */ export declare function cursorRows(value: string, width: number): string[]; /** What the command prints once the screen is gone: the folder written and * the commands to run next. These go to the terminal, not the style * parser, so only control characters are removed: a `{` in a path must * print as `{`, or the command could not be copied. */ export declare function wroteSummary(testDir: string, nextCommands: string[]): string[];