/** Simplifies a type while including and/or excluding certain types from being simplified. Useful to improve type hints shown in editors. And also to transform an `interface` into a `type` to aid with assignability. @example ``` import type {ConditionalSimplify} from 'type-fest'; type TypeA = { a: string; }; type TypeB = { b: string; }; type TypeAB = TypeA & TypeB; //=> TypeA & TypeB type SimplifyTypeAB = ConditionalSimplify; //=> {a: string; b: string} ``` @example ``` import type {ConditionalSimplify} from 'type-fest'; type Simplify = ConditionalSimplify | Map | unknown[], object>; type A = Simplify & Set>; //=> Set & Set type B = Simplify & Map>; //=> Map & Map type C = Simplify<{a: number} & {b: string}>; //=> {a: number; b: string} ``` @see ConditionalSimplifyDeep @category Object */ export type ConditionalSimplify = Type extends ExcludeType ? Type : Type extends IncludeType ? {[TypeKey in keyof Type]: Type[TypeKey]} : Type; export {};