AnswerOf
type AnswerOf<Q> = Q extends Question<"boolean"> ? boolean | Uncertain : Q extends Question<infer S> ? S[number] | Uncertain : boolean | string | Uncertain;Defined in: src/decisions/types.ts:82
Statically narrows each question’s answer type from its choices.
Question<'boolean'>yieldsboolean | Uncertain.Question<readonly ['red', 'green']>yields'red' | 'green' | Uncertain.- An un-narrowed
Question(e.g. an entry ofRecord<string, Question>withoutas const) falls back toboolean | string | Uncertain.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Q |