import { Toggle } from "https://deno.land/x/cliffy@v1.0.0-rc.1/prompt/mod.ts";
Toggle prompt representation.
import { Toggle } from "./mod.ts";
const password: boolean = await Toggle.prompt("Please confirm");
Constructors
new
Toggle(options: string | ToggleOptions)Methods
protected
format(value: boolean): stringFormat output value.
protected
getValue(): stringGet input value.
protected
handleEvent(event: KeyCode): Promise<void>Handle user input event.
protected
message(): stringprotected
read(): Promise<boolean>Read user input from stdin, handle events and validate user input.
protected
selectActive()Set active.
protected
selectInactive()Set inactive.
protected
transform(value: string): boolean | undefinedMap input value to output value.
protected
validate(value: string): boolean | stringValidate input value.
getDefaultSettings(options: ToggleOptions): ToggleSettings
Static Methods
prompt(options: string | ToggleOptions): Promise<boolean>
Execute the prompt.