/** * Include property keys from T where the property is assignable to U * @public */ export type IncludeUndefined = { [P in keyof T]: undefined extends T[P] ? P : never; }[keyof T]; /** * Excludes property keys from T where the property is assignable to U * @public */ export type ExcludeUndefined = { [P in keyof T]: undefined extends T[P] ? never : P; }[keyof T]; /** * @public */ export type OnlyOptionalUndefinedTypes = { [K in IncludeUndefined]?: T[K]; }; /** * @public */ export type OnlyNonUndefinedTypes = { [K in ExcludeUndefined]: T[K]; }; /** * @public */ export type ToOptional = OnlyOptionalUndefinedTypes & OnlyNonUndefinedTypes;