MakeUpdatable<T, U>: {
    [P in keyof T as P extends U
        ? never
        : P]?: undefined extends T[P]
        ? T[P] | null
        : T[P]
} & Required<Pick<T, U>>

Makes all properties of T except for U optional and, if originally optional, nullable. Makes U required.

Type Parameters

  • T extends object

    The type to make updatable.

  • U extends keyof T = never

    The properties to reserve as required.