Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/cliffy/prompt/mod.ts>PromptOptions

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
type alias PromptOptions
import { type PromptOptions } from "https://deno.land/x/cliffy@v1.0.0-rc.1/prompt/mod.ts";

Prompt options for the prompt() method.

import { PromptOptions } from "./prompt.ts";
import { Checkbox } from "./checkbox.ts";

const options: PromptOptions<"color", typeof Checkbox> = {
  name: "color",
  message: "Select a color",
  type: Checkbox,
  options: ["red", "green", "blue"],
};

Type Parameters

TName extends string
TPrompt extends GenericPrompt<any, any> | StaticGenericPrompt<any, any>
optional
TResult extends PromptResult<TName, TPrompt> & Record<string, unknown> = PromptResult<TName, TPrompt>
definition: Id<TResult & PromptResult<TName, TPrompt>> extends infer Result ? { name: TName; before?: PromptMiddleware<Result>; after?: PromptMiddleware<Result>; } & (TPrompt extends GenericPrompt<any, any> ? (InferPromptOptions<TPrompt> & { type: StaticGenericPrompt<InferPromptValue<TPrompt>, InferPromptOptions<TPrompt>>; }) : TPrompt extends Checkbox ? (CheckboxOptions<unknown extends Value ? string : Value> & { type: TPrompt; }) : TPrompt extends Select ? (SelectOptions<unknown extends Value ? string : Value> & { type: TPrompt; }) : (Parameters<TPrompt["prompt"]>[0] & { type: TPrompt; })) : never