/** * The `Confirm` kind: a question answered by one lettered key. * * A reducer takes a key and answers with the next state, a submission, or a * cancellation; a view takes that state to a document. Neither touches the * terminal, so both are ordinary pure functions. The choice `enter` takes is * shown by a filled chip and by its capital letter, so the default survives a * terminal without color; risk flips which choice comes first, and nothing * else about the question changes. */ import type { Doc } from "../doc.js"; import { type AskKey, type AskKind, type AskReducerAction, type ConfirmAsk, type ConfirmChoice } from "./ask.js"; /** Which choice `enter` takes. */ export interface ConfirmState { readonly index: number; } export type ConfirmAction = AskReducerAction>; /** The question opens on its default, which is its first choice. */ export declare const initialConfirmState: ConfirmState; /** * One key against one question. A choice's own key answers it outright; the * arrows and tab move which choice `enter` would take; escape and an interrupt * cancel. Any other key leaves the question exactly as it stood, because a * mistyped letter is not an answer and has nothing to report. */ export declare const reduceConfirm: (ask: ConfirmAsk, state: ConfirmState, key: AskKey) => ConfirmAction; /** The question as the live scene shows it while it stands open. */ export declare const confirmDoc: (ask: ConfirmAsk, state: ConfirmState) => Doc; /** The one transcript line an answered question leaves behind. */ export declare const confirmAnswer: (ask: ConfirmAsk, choice: ConfirmChoice) => Doc; /** A `Confirm` as the `Screen` runs it. */ export declare const confirmKind: (ask: ConfirmAsk) => AskKind; //# sourceMappingURL=confirm.d.ts.map