import type { createInterface } from 'node:readline'; export interface SelectItem { /** 主展示文本。 */ readonly label: string; /** 暗色后缀(如 cliId / 命令前缀),仅展示用。 */ readonly hint?: string; /** 选中后还有二级菜单(渲染 ▸)。 */ readonly submenu?: boolean; } /** 按显示宽度截断,超出时以 … 结尾。用于把每个列表项压进一行,防止软换行破坏视口高度计算。 */ export declare function truncateToWidth(s: string, max: number): string; /** * 计算视口首行,保证光标始终可见:列表超过 capacity 时窗口跟随光标滚动 * (含首尾 wrap-around),并 clamp 到合法范围。纯函数,单测覆盖。 */ export declare function computeViewportTop(cursor: number, top: number, count: number, capacity: number): number; /** * Raw-mode 单选 + 输入过滤。返回选中项在 `items` 中的下标;取消(Esc / Ctrl-C) * 返回 null。要求处于 TTY;非 TTY 直接返回 null(调用方回退)。 */ export declare function interactiveSelect(opts: { title: string; items: ReadonlyArray; footer?: string; }): Promise; /** * 通用选择题:TTY 下走 {@link interactiveSelect}(↑/↓ + 搜索 + ⏎),非 TTY * 回退为「打印带序号列表 + readline 读序号」。setup 里所有"从 N 个选项里挑 * 一个"的问题统一走这里,与 CLI 适配器选择器同款交互。 * * 返回选中项下标;取消(Esc / Ctrl-C)返回 null,由调用方决定取消语义 * (保留当前值 / 中止流程)。非 TTY 下留空返回 defaultIndex(未设则 null), * 无效输入重问(stdin 关闭时 readline 读到空串 → 走默认值,不会死循环)。 */ export declare function pickChoice(rl: ReturnType, opts: { title: string; items: ReadonlyArray; defaultIndex?: number; footer?: string; }): Promise; /** * 级联 CLI 选择器:顶层列出所有 CLI(Aiden 带 ▸),选 Aiden 进二级菜单 * (原生 / × Claude / × Codex)。返回选择键(CLI_SELECT_OPTIONS 的 key), * 取消返回 null。 * * 非 TTY 回退:打印带序号的扁平列表,用 readline 读「序号 / key」。 */ export declare function pickCliSelection(rl: ReturnType, opts?: { title?: string; currentKey?: string; }): Promise; //# sourceMappingURL=interactive-select.d.ts.map