Type alias AllOptional<TYPE>

AllOptional<TYPE>: {
    [key in keyof TYPE]?: TYPE[key]
}

Utility type to make all properties of an object optional.

Type Parameters

  • TYPE extends object

Example

type Foo = {
a: string;
b: number;
};

type Bar = AllOptional<Foo>;
// Bar = {
// a?: string;
// b?: number;
// };

Generated using TypeDoc