import { cliffy } from "https://deno.land/x/alloy_folk@v1.1.1/deps.ts";
const { GenericPrompt } = cliffy;
Generic prompt representation.
Constructors
new
protected
GenericPrompt(settings: S)Methods
protected
optional
body(): string | undefined | Promise<string | undefined>protected
clear(): voidClear prompt output.
protected
defaults(): stringprotected
error(): string | undefinedprotected
handleEvent(event: KeyCode): Promise<void>Handle user input event.
protected
hint(): string | undefinedprotected
isKey<K extends unknown, N extends keyof K>(): booleanCheck if key event has given name or sequence.
protected
message(): stringprotected
read(): Promise<boolean>Read user input from stdin, handle events and validate user input.
protected
render(): Promise<void>Render prompt.
protected
setErrorMessage(message: string)protected
submit(): Promise<void>protected
abstract
validate(value: V): ValidateResultValidate input value.
Static Methods
inject(value: unknown): void
Inject prompt value. Can be used for unit tests or pre selections.