import { Checkbox } from "https://deno.land/x/cliffy@v0.18.0/mod.ts";
Checkbox prompt representation.
Methods
protected
checkValue(): voidCheck selected option.
protected
format(value: string[]): stringFormat output value.
protected
getListItem(item: CheckboxOptionSettings, isSelected?: boolean): stringRender checkbox option.
protected
getValue(): string[]Get value of checked options.
protected
handleEvent(event: KeyEvent): Promise<void>Handle user input event.
protected
transform(value: string[]): string[]Map input value to output value.
protected
validate(value: string[]): boolean | stringValidate input value.
Static Methods
protected
mapOptions(options: CheckboxOptions): CheckboxValueSettingsMap string option values to options and set option defaults.
inject(value: string[]): void
Inject prompt value. Can be used for unit tests or pre selections.
prompt(options: CheckboxOptions): Promise<string[]>
Execute the prompt and show cursor on end.
separator(label?): CheckboxOption
Create list separator.