跳到主要内容

TS 中 interface 和 type 关键字

  1. interface 使用 extends, type 使用 &,|
  2. interface 支持声明合并(即重名时,定义的自动会进行合并), type 不支持声明合并
  3. interface 主要用于对象类型(推荐)