Typescript手写实现工具类型
Typescript手写工具类型
起因
工具类型
手写工具类型
Pick<Type, Keys>
type MyPick<Type, Keys extends keyof Type> = {
[P in Keys]: Type[P]
}Omit<Type, Keys>
Recod<K, T>
Exclude<T, U>
Extract<T, U>
NonNullable
Required
Partial
Readonly
Parameters
ReturnType
ConstructorParameters
InstanceType
ThisParameterType
OmitThisParameter
参考
最后更新于