TS TypeSafe 文档中文版 原文 ↗

类型别名:ResultFor<T>

typescript
type ResultFor<T> = T extends NoulQuestion ? NoulResponse : T extends ScoreQuestion<infer S> ? ScoreResponse<S> : T extends ChoiceQuestion<infer E> ? ChoiceResponse<E> : never;
 

某个问题的答案类型,保留其 criteria 键。

类型参数

T

T extends Question