type User = { id: number; name: string; email: string; active: boolean }; type UserPatch = Partial>; type PublicUser = Omit; type UserById = Record; function patchUser(user: User, patch: UserPatch): User { return { ...user, ...patch }; } const updated = patchUser({ id: 1, name: 'A', email: 'a@example.test', active: true }, { name: 'Ada' }); console.log(updated);