📜  在打字稿代码示例中扩展类型

📅  最后修改于: 2022-03-11 14:48:14.039000             🧑  作者: Mango

代码示例1
type Animal = {
  name: string
}
type Bear = Animal & { 
  honey: Boolean 
}
const bear = getBear();
bear.name;
bear.honey;