Skip to content

defineQuestions

function defineQuestions<Q>(questions): Q;

Defined in: src/decisions/types.ts:26

Identity helper that preserves the literal types of an inline question map when it’s stored in a variable before being passed to DecisionModel.ask.

ask already uses a const type parameter, so inline question maps work without any helper. Use defineQuestions only when you need to declare the map ahead of time — it keeps choices tuples and 'boolean' as literal types without an explicit as const.

Type Parameter
Q extends Record<string, Question<"boolean" | readonly string[]>>
ParameterType
questionsQ

Q