# caique/ask > Every export of caique/ask, with its signature and doc comment: ask, projection, plus 6 types. Source: https://caique.interlace.tools/docs/api/ask The six widgets, in line mode (R5) — and line mode is not a fallback, it is the floor. ```ts import { ask, projection } from 'caique/ask'; ``` ## Functions ### ask Ask one prompt and return its answer. ```ts function ask(prompt: BoundPrompt | PromptSpec, io: Io): Promise; ``` | Parameter | Type | | :-- | :-- | | `prompt` | `BoundPrompt \| PromptSpec` | | `io` | `Io` | **Returns** `Promise` ### projection What a widget would have written, without reading anything — the static projection (U3). The docs gallery, `--help` and a transcript in an issue all want the question without the conversation, and every other package in this family can answer that; so does this. ```ts function projection(spec: PromptSpec): string; ``` | Parameter | Type | | :-- | :-- | | `spec` | `PromptSpec` | **Returns** `string` ## Interfaces ### Io ```ts interface Io { reader: Reader; writer: Writer; /** * The run's language for what caique draws itself — the instruction under a list, a problem * with an answer, the giving-up line — never the author's question (`localised-human-surfaces` * R6). `sayFor(runtime.locale)` from `caique/locale` builds it; absent, it is English. */ say?: (english: string) => string; } ``` ### Reader A line of input, or `undefined` when the stream ended — which is a cancellation. ```ts interface Reader { line(options?: ReadOptions): Promise; } ``` ### ReadOptions ```ts interface ReadOptions { /** * Do not echo what is typed. Set for `password`, and honoured by whatever is reading — * this module never sees a terminal, so it cannot hide anything itself, and a widget * that never writes back what it read cannot leak it either. */ hidden?: boolean; } ``` ### Writer ```ts interface Writer { write(text: string): void; /** * How many columns the terminal behind this writer is, when it knows. Line mode never * reads it; the raw renderer does, because a row wider than the terminal occupies more * than one row of screen and the repaint has to climb all of them. */ readonly columns?: number | undefined; /** * How many rows the terminal is, when it knows. The raw renderer windows a list to it, so a * list longer than the screen never climbs above the top row on a repaint. */ readonly rows?: number | undefined; } ``` ## Types ### Answer ```ts type Answer = string | boolean | string[]; ``` ### Asked Answered, or cancelled — cancellation is a value here and a `CANCELLED` error above (R4). ```ts type Asked = { ok: true; value: Answer; } | { ok: false; reason: 'cancelled'; }; ``` --- # caique/binding > Every export of caique/binding, with its signature and doc comment: resolvePrompts, localise, plus 4 types. Source: https://caique.interlace.tools/docs/api/binding Resolving a whole command's prompts in one pass (R2, R3) — the piece a framework calls from its `preAction` hook, after the environment and config layers have had their turn. ```ts import { resolvePrompts, localise } from 'caique/binding'; ``` ## Functions ### resolvePrompts ```ts function resolvePrompts({ options, values, runtime, flags, io }: ResolveInput): Promise; ``` | Parameter | Type | | :-- | :-- | | `{ options, values, runtime, flags, io }` | `ResolveInput` | **Returns** `Promise` ## Constants ### localise A failure with its translation beside it (R6). `say` is the identity unless a pack speaks the run's locale (`sayFor` returns `String` itself then). A failure without a `fix` gets none. ```ts const localise: (failure: ResolveFailure, say: (english: string) => string) => ResolveFailure; ``` ## Interfaces ### PromptableOption What a host tells us about one option. Structural: any framework's spec satisfies it. ```ts interface PromptableOption { required?: boolean; prompt?: PromptSpec; /** * How a refusal names it when `--