Picks a subset of properties from a type and makes them optional.
The type to pick properties from.
The keys of the properties to pick.
type Test = PickOptional<{ a: number; b: string; c: boolean }, "a" | "b">; // { a?: number; b?: string; c: boolean; } Copy
type Test = PickOptional<{ a: number; b: string; c: boolean }, "a" | "b">; // { a?: number; b?: string; c: boolean; }
Picks a subset of properties from a type and makes them optional.