교차 타입(Intersection)

사용방법

type ProductItem = {
	id: number;
	name: string;
	type: string;
	price: number;
	imageUrl: string;
	quantity: number;
}

type ProductItemWithDiscount = ProductItem & { discountAmount: number } ;

유니온 타입(Union)

사용방법

type CardItem = {
	id: number;
	name: string;
	type: string;
	imageUrl: string;
};

type PromotionEventItem = ProductItem | CardItem;