import { List } from "https://deno.land/x/cliffy@v1.0.0-rc.1/prompt/mod.ts";
List prompt representation.
import { List } from "./mod.ts";
const confirmed: Array<string> = await List.prompt("Enter some keywords");
Constructors
new
List(options: string | ListOptions)Methods
protected
addChar(char: string): voidAdd char.
protected
complete(): Promise<string>protected
deleteChar(): voidDelete char left.
protected
format(value: string[]): stringFormat output value.
protected
getCurrentInputValue(): stringprotected
getTags(value?: string): Array<string>protected
getValue(): stringGet input value.
protected
input(): stringprotected
regexp(): RegExpCreate list regex.
protected
success(value: string[]): string | undefinedprotected
transform(value: string): string[]Map input value to output value.
protected
validate(value: string): boolean | stringValidate input value.
getDefaultSettings(options: ListOptions): ListSettings
Static Methods
inject(value: string): void
Inject prompt value. If called, the prompt doesn't prompt for an input and returns immediately the injected value. Can be used for unit tests or pre selections.
prompt(options: string | ListOptions): Promise<string[]>
Execute the prompt with provided options.