/** * Pure functions for select menu rendering and input handling. * * All functions are side-effect-free and testable in isolation. * IO concerns (stdin/stdout, raw mode) remain in select.ts. * Viewport logic lives in select-viewport.ts. */ export interface SelectOptionItem { label: string; value: T; description?: string; details?: string[]; /** * When false the row is a non-interactive heading: the cursor skips it, * Enter is ignored, and it renders without a selection marker. Absent or * true keeps the row selectable (the default for every existing caller). */ selectable?: boolean; } export type KeyInputResult = { action: 'move'; newIndex: number; } | { action: 'confirm'; selectedIndex: number; } | { action: 'cancel'; cancelIndex: number; } | { action: 'bookmark'; selectedIndex: number; } | { action: 'remove_bookmark'; selectedIndex: number; } | { action: 'exit'; } | { action: 'none'; }; export interface ViewportState { readonly scrollOffset: number; readonly maxOptionLines: number; readonly active: boolean; } export declare function renderSingleOption(opt: SelectOptionItem, isSelected: boolean, maxWidth: number): string[]; export declare function renderCancelOption(isSelected: boolean, cancelLabel: string): string; export declare function countItemLines(opt: SelectOptionItem): number; export declare function renderMenu(options: SelectOptionItem[], selectedIndex: number, hasCancelOption: boolean, cancelLabel?: string): string[]; export declare function countRenderedLines(options: SelectOptionItem[], hasCancelOption: boolean): number; /** * Find the first selectable row at or after `start`, scanning forward and * wrapping. Returns the Cancel row when no option is selectable and a Cancel * row exists, otherwise `start` unchanged. */ export declare function firstSelectableIndex(options: readonly SelectOptionItem[], start: number, hasCancelOption: boolean): number; export declare function handleKeyInput(key: string, currentIndex: number, totalItems: number, hasCancelOption: boolean, optionCount: number, options?: readonly SelectOptionItem[]): KeyInputResult; //# sourceMappingURL=select-menu.d.ts.map