Partial

将属性全部变为可选

  1. type Partial<T>={[P in keyof T]?:T[P]}

DeepPartial

递归类型

  1. type DeepPartial<T>={ [ U in keyof T]? T[U] extends Object }?DeepPartial<T[U]>:T[U]

returnType

替换函数类型的返回值类型

  1. type ReturnType<T> = T extends (...args: any[]) => infer P ? P : any;

pick

选择新类型

  1. type Pick<T ,K extends keyof T>={[P in K]:T[P]}

Omit

去除某一个类型

  1. type Omit<T , K extends string|number|symbol>={[P in Exclude<keyof T,K>]:T[P] }

Exclude

排除联合类型中的类型

  1. type Exclude<T,U>= T extends U?nerver:T