Remove the part that do not exist in EN version (#91)

* Remove the part that do not exist in EN version

* Remove the part duplicate of  in EN version
This commit is contained in:
nnecec 2024-01-16 02:51:37 +08:00 committed by GitHub
parent ab9f9b20d6
commit 6299039646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,10 +80,8 @@
- [只读属性](#只读属性)
- [索引签名](#索引签名)
- [扩展类型](#扩展类型)
- [类型交集](#类型交集)
- [字面量类型](#字面量类型)
- [字面量推断](#字面量推断)
- [空和未定义](#空和未定义)
- [严格空检查](#严格空检查)
- [枚举](#枚举)
- [数字枚举](#数字枚举)
@ -1693,31 +1691,6 @@ interface B extends A {
}
```
## 类型交集
交集类型由 `&` 运算符定义,是扩展类型的主要机制,`extends` 仅适用于 `interface`
```typescript
type A = {
a: string;
};
type B = {
b: string;
};
type C = A & B;
```
或者:
```typescript
interface X {
x: string;
}
interface Y {
y: string;
}
type J = X & Y;
```
## 字面量类型
@ -1785,13 +1758,6 @@ let o = {
};
```
## 空和未定义
在 TypeScript 中,`null` 和 `undefined` 是代表不同值的两种不同类型。
`undefined` 用于表示变量或属性尚未初始化或没有值,而 `null` 用于表示故意不存在值。
启用该 `strictNullChecks` 选项后TypeScript 要求将变量和属性显式键入为可为空或不可为空。
## 严格空检查