Extract the keys of optional properties.
Object type to analyze
Identifies properties that are optional in the object type, including properties whose value type explicitly allows undefined.
undefined
type Obj = { a: number; b?: string; c: number | undefined; d: boolean };type OptKeys = OptionalKeys< Obj >;// "b" | "c" Copy
type Obj = { a: number; b?: string; c: number | undefined; d: boolean };type OptKeys = OptionalKeys< Obj >;// "b" | "c"
Extract the keys of optional properties.