/** * The `Choose` kind: one option from a list that opens under the question. * * A list opens only when the options need reading, so each carries the facts * that tell it apart. The caret stands in the gutter beside the option `enter` * takes. The list shows as many options as the height it is given allows and * names how many it left out above and below, so it never scrolls the * terminal; the window follows the caret. Neither the reducer nor the view touches the terminal. */ import type { Doc } from "../doc.js"; import { type AskKey, type AskKind, type AskReducerAction, type ChooseAsk, type ChooseOption } from "./ask.js"; /** Which option the caret stands on. */ export interface ChooseState { readonly index: number; } export type ChooseAction = AskReducerAction>; /** The question opens on its selected option, else on its first. */ export declare const initialChooseState: (ask: ChooseAsk) => ChooseState; /** * One key against one list. The arrows move the caret and stop at either end, * so holding a key never wraps a person back to where they started; `enter` * takes the option under the caret; escape and an interrupt cancel. Any other * key leaves the list as it stood. */ export declare const reduceChoose: (ask: ChooseAsk, state: ChooseState, key: AskKey) => ChooseAction; /** The question as the live scene shows it in `rows` lines while it stands open. */ export declare const chooseDoc: (ask: ChooseAsk, state: ChooseState, rows: number) => Doc; /** The one transcript line an answered list leaves behind: the option's title. */ export declare const chooseAnswer: (ask: ChooseAsk, option: ChooseOption) => Doc; /** A `Choose` as the `Screen` runs it. */ export declare const chooseKind: (ask: ChooseAsk) => AskKind; //# sourceMappingURL=choose.d.ts.map