目标:
type Question = {
id: string;
answer?: string;
thirdProp?: number;
fourthProp?: number;
}
// usage Required<Question, 'answer' | 'thirdProp'> expect to equal
/*
type Question = {
id: string;
answer: string;
thirdProp: number;
fourthProp?: number;
}
*/
上面的例子应该很好解释。我想输入Required
类型,它产生上面解释的结果。一个人怎么能做到呢?