Partial<T>
将T的所有类型转换为可选类型,返回的类型可以为T的所有子集
interface Todo { title: string; description: string; } type subTodo = Partial<Todo> const todo1: subTodo = { title: 'This is a title' } const todo2: subTodo = { description: 'This is a description' }
never
如果Type
不是函数的类型)。type T0 = ConstructorParameters<ErrorConstructor>; // type T0 = [message?: string] type T1 = ConstructorParameters<FunctionConstructor>; // type T1 = string[] type T2 = ConstructorParameters<RegExpConstructor>; // type T2 = [pattern: string | RegExp, flags?: string] type T3 = ConstructorParameters<any>; // type T3 = unknown[]