次の方法で共有


CommonProperties type

2 種類の交差プロパティを返す

type CommonProperties<A, B> = {
  [P in keyof A & keyof B]: A[P] extends B[P] ? P : never
}[keyof A & keyof B]