type MyOptionalType = MakeUndefinedOptional<{
id: number | undefined,
firstName: string,
lastName: string | null,
}>;
// is equal to
type MyOptionalType = {
// this property is optional.
id?: number | undefined,
firstName: string,
// this property is optional.
lastName?: string | null,
};
Makes all shallow properties of an object
optional
if they acceptundefined
ornull
as a value.