Function: choice()
ts
function choice<T>(instructions, criteria): ChoiceQuestion<T>;Create a single-choice question. Labels are inferred as literals, so the answer's choice is typed as their union.
类型参数
T
T extends ChoiceCriteria
参数
instructions
要问的问题。 / The question.
criteria
T
选项名 → 描述(null 表示不加描述)。 / Labels mapped to descriptions.
返回
示例
ts
choice('工单应分派到哪个部门?', { billing: '扣费、退款', technical: '报错与故障', sales: null })
