Not<Type>: {
    [Property in keyof Type]?: undefined
}

Creates a new type with the same properties as Type, but with all property values set to undefined and optional.

Type Parameters

  • Type

    The type to negate.

Example

   interface Person {
name: string;
age: number;
email: string;
}
type EmptyPerson = Not<Person>;
const emptyPerson: EmptyPerson = {};
// The EmptyPerson type will be equivalent to:
{
name?: undefined;
age?: undefined;
email?: undefined,
}

Generated using TypeDoc