@142vip.utils.变量.VipInquirer - 142vip/core-x GitHub Wiki
API 参考 / @142vip/utils / VipInquirer
constVipInquirer:object
定义于: packages/utils/src/pkgs/inquirer.ts:179
终端交互
handleSimpleSearchSource: (
sources) =>SimpleSearchSource<string>
搜索源简单处理
string[]
SimpleSearchSource<string>
promptCheckBox: <
T>(message,choices,options?) =>Promise<T[]>
终端交互选择,多选
T extends string
string
string[] | VipInquirerChoiceList<T>
VipInquirerOptions
Promise<T[]>
promptConfirm: (
message,defaultValue?) =>Promise<boolean>
终端交互确认,确认框,可配置默认值
string
boolean
Promise<boolean>
promptConfirmWithSuccessExit: (
message,__namedParameters) =>Promise<void>
终端交互确认,支持安全退出、自定义信息
string
boolean
string
Promise<void>
promptInput: (
message,defaultValue?) =>Promise<string>
终端交互输入,输入框,可选
string
string
Promise<string>
promptInputRequired: (
message) =>Promise<string>
终端交互输入,输入框,必填
string
Promise<string>
promptList: <
T>(message,choices) =>Promise<T>
终端交互选择,单选
T extends string
string
VipInquirerChoiceList<T>
Promise<T>
promptNumber: (
message,defaultValue?) =>Promise<undefined|number>
输入框,只输入数字
string
number
Promise<undefined | number>
promptPassword: (
message) =>Promise<string>
输入框,隐藏输入
string
Promise<string>
promptSearch: <
T>(message,source,pageSize?) =>Promise<T>
搜索框
T extends string
string
SearchSource<T>
number
Promise<T>
promptSelect: <
T>(message,choices,options?) =>Promise<T>
选择框,必选选择框
T extends string
string
string[] | VipInquirerChoiceList<T>
VipInquirerOptions
Promise<T>