/** * Picks all the keys where the value is compatible with the Condition type. */ export type CompatiblePick = Pick>; /** * Returns all keys, where the value is compatible with the Condition type. */ export type CompatibleKeys = { [Key in keyof Base]-?: TypesAreCompatible extends true ? Key : never; }[keyof Base]; /** * Returns true if A and B are compatible types, like strings, literals, numbers, etc. */ export type TypesAreCompatible = [ A ] extends [B] ? true : [B] extends [A] ? true : false;