ts 交集类型

type Event = {
   name: string;
   dateCreated: string;
   type: string;
}

// error
type UserEvent extends Event = {
   UserId: string; 
}

// 交集类型
type UserEvent = Event & {UserId: string}
posted @ 2020-02-02 17:59  Ajanuw  阅读(628)  评论(0编辑  收藏  举报