PromptAutocompleteQuestion
@tsed/cli-prompts
Usage
typescript
import { PromptAutocompleteQuestion } from "@tsed/cli-prompts";Overview
ts
interface PromptAutocompleteQuestion<Value = any> extends PromptBaseQuestion<Value>, Omit<AutocompleteOptions<Value>, "message" | "options" | "filter"> {
type: "autocomplete";
source?: (answers: Record<string, any>) => MaybePromise<PromptChoice<Value>[]>;
choices?: string[] | PromptChoiceInput<Value>[];
}Description
Searchable prompt that fetches choices dynamically.
type
ts
type: "autocomplete";source:
ts
source?: (answers: Record<string, any>) => MaybePromise<PromptChoice<Value>[]>;Async loader returning the set of choices filtered by the keyword.
choices
ts
choices?: string[] | PromptChoiceInput<Value>[];Available choices displayed to the user.