Pick<ParentType['nested'], K> | Extract specific keys from a nested type | Pick<AccountQuery['user'], 'id' | 'name'> |
Omit<ParentType['nested'], K> | Remove unwanted keys from a nested type | Omit<AccountQuery['user'], 'password'> |
Partial<ParentType['nested']> | Make a nested type partially optional | Partial<AccountQuery['user']> |
Required<Pick<T, K>> | Ensure a subset of props are required | Required<Pick<User, 'email'>> |
NonNullable<ParentType['nested']> | Remove null and undefined from a nested type | NonNullable<AccountQuery['user']> |
ReturnType<typeof fn> + Pick<> | Grab only the needed parts of a function's return | Pick<ReturnType<typeof getUser>, 'id'> |
Partial<Pick<T, K>> | Optional subset for mock/test data | Partial<Pick<User, 'id' | 'name'>> |
Omit<ReturnType<typeof fn>, K> | Drop noisy keys from function return types | Omit<ReturnType<typeof getUser>, 'metadata'> |
Indexed Access + Partial<> | Make part of a deeply nested object optional | Partial<AccountQuery['user']['stats']> |
Pick<Extract<T, U>, K> | Combine filtering + selection | Pick<Extract<UserRole, 'admin' | 'moderator'>, 'permissions'> |