在TypeScript里,接口的作用就是为这些类型命名和为你的代码或第三方代码定义契约。 在Typescript中使用interface来定义接口 interface MyInterface { name: string;} 参考:官方文档千峰前端视频教程