Home > @infiniteobjects/type-utils > SetOptionalKeys
Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the SetRequired
type.
Signature:
export type SetOptionalKeys<BaseType, Keys extends keyof BaseType> = Simplify<Except<BaseType, Keys> & Partial<Pick<BaseType, Keys>>>;
Useful to define a single model where the only thing that changes is whether or not some of the keys are optional.