Skip to content

InferPrompt ​

Infer an answer, preserving literal choice values.

Signatures ​

ts
type InferPrompt<C extends PromptConfig> = C extends ConfirmPromptConfig ? boolean : C extends { choices: readonly infer Choice extends SelectChoice[]; kind: "multiselect"; } ? Choice["value"][] : C extends { choices: readonly infer Choice extends SelectChoice[]; kind: "select"; } ? Choice["value"] : C extends MultiselectPromptConfig ? string[] : string;

See Also ​

Released under the MIT License.