Merge pull request #27 from eltociear/main-1

docs: fix typo in interface.md
This commit is contained in:
Ruan YiFeng
2023-08-12 12:16:04 +08:00
committed by GitHub

View File

@@ -322,7 +322,7 @@ interface CountryWithPop extends Country {
### interface 继承 class
inteface 还可以继承 class即继承该类的所有成员。关于 class 的详细解释,参见下一章。
interface 还可以继承 class即继承该类的所有成员。关于 class 的详细解释,参见下一章。
```typescript
class A {
@@ -613,7 +613,7 @@ const obj:A = {
上面示例中,`interface`把类型`A`的两个定义合并在一起。
这表明inteface 是开放的可以添加属性type 是封闭的,不能添加属性,只能定义新的 type。
这表明interface 是开放的可以添加属性type 是封闭的,不能添加属性,只能定义新的 type。
4`interface`不能包含属性映射mapping`type`可以,详见《映射》一章。