Pick<T, K>

The utility type that keeps only the listed keys K of type T, like an allowlist of fields.

In more detail

Pick<UserEntity, "id" | "email"> produces { id: string; email: string }. Use it when the new shape has only a few fields.

Related terms

Taught in

References