Skip to content

常用的实用类型(Utility Types) 有哪些?

  • Awaited<Type>

  • Partial<Type>

  • Required<Type>

  • Readonly<Type>

  • Record<Keys, Type>

  • Pick<Type, Keys>

  • Omit<Type, Keys>

  • Exclude<UnionType, ExcludedMembers>

  • Extract<Type, Union>

  • NonNullable<Type>

  • Parameters<Type>

  • ConstructorParameters<Type>

  • ReturnType<Type>

  • InstanceType<Type>

  • NoInfer<Type>

  • ThisParameterType<Type>

  • Uppercase<StringType>

  • Lowercase<StringType>

  • Capitalize<StringType>

  • Uncapitalize<StringType>

参考