Skip to content

Intersection

Category
Generate Object

From T pick properties that exist in U.

Usage

ts
import type { Intersection } from '@utype/core'

type Prop = { name: string; age: number; visible: boolean }
type DefaultProps = { age: number; sex: string }

// Expect: { age: number; }
type IntersectionProp = Intersection<Prop, DefaultProps>