共用方式為


CommonProperties type

傳回 2 種型別的交集屬性

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