次の方法で共有


UnionToIntersection type

type UnionToIntersection<Union> = (
  Union extends unknown ? (_: Union) => unknown : never
) extends (_: I) => unknown
  ? I
  : never