Type alias MakeOptional<T, K>

MakeOptional<T, K>: Compute<Omit<T, K> & Partial<Pick<T, K>>>

Makes keys of type optional

Example

type PartiallyOptionalProps = MakeOptional<{test: string; another: number;}, 'another'>; // {test: string; another?: number;}

Type Parameters

  • T

  • K extends keyof T

Generated using TypeDoc