import type { Component } from "@earendil-works/pi-tui"; /** * Row-intent discriminated union. `kind` is the single discriminator — * pre-1.0.3 boolean flags have been removed (see `banned-flags.test.ts`). * Modeled after `QuestionnaireAction` (`key-router.ts:13-32`) and `Effect` * (`state-reducer.ts:26-32`) — pure literal-tagged variants, no shared base, * exhaustive-`switch` enforcement via non-`void` returns. * * Variant semantics: * - `option`: a regular author-defined option row. * - `other`: the inline free-text input row appended to single-select questions * (label is "Type something."). Renders as inline `Input` when active. * - `chat`: the abandon-questionnaire escape-hatch row (label is "Chat about this"). * Renders as inline `Input` when active. * - `next`: the explicit commit-and-advance row appended to multi-select questions * (label is "Next"). Renders without a number / checkbox. */ export type WrappingSelectItem = { kind: "option"; label: string; description?: string; } | { kind: "other"; label: string; description?: string; } | { kind: "chat"; label: string; description?: string; } | { kind: "next"; label: string; description?: string; }; export interface WrappingSelectTheme { selectedText: (text: string) => string; description: (text: string) => string; scrollInfo: (text: string) => string; } /** * Numbering controls. * * Use `numberStartOffset` + `totalItemsForNumbering` when a list is logically a slice of a * larger numbered sequence — e.g. the chat row lives in its own WrappingSelect but should * render as `(N+1).` where N is the previous list's item count, with the column padded as * if both lists were one continuous numbered sequence. */ export interface WrappingSelectOptions { /** Start numbering at this offset + 1 (default 0 → rows labeled 1, 2, 3 …). */ numberStartOffset?: number; /** Override the total used to pad the number column (useful when items span multiple lists). */ totalItemsForNumbering?: number; /** When false, rows that normally open an inline editor stay ordinary labeled rows. */ inlineInputEnabled?: boolean; } export declare class WrappingSelect implements Component { private static readonly ACTIVE_POINTER; private static readonly INACTIVE_POINTER; private static readonly NUMBER_SEPARATOR; private static readonly CURSOR_INVERSE_START; private static readonly CURSOR_INVERSE_END; private static readonly CONFIRMED_MARK; private static readonly MIN_CONTENT_WIDTH; private readonly items; private readonly maxVisible; private readonly theme; private readonly inlineInputEnabled; private numberStartOffset; private totalItemsForNumbering; private selectedIndex; private focused; private inputBuffer; private inputCursor; /** * Index of the row that was previously confirmed for this list (e.g. the user's prior * answer when re-entering a multi-question tab). Renders `