Skip to content

Commit e5ffe1b

Browse files
committed
feat(intersection-types): update
1 parent 978e800 commit e5ffe1b

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [1.0.0](https://github.com/Rain120/typescript-guide/compare/0.0.1...1.0.0) (2021-04-30)
1+
# [1.0.0](https://github.com/Rain120/typescript-guide/compare/0.0.1...1.0.0) (2022-01-14)
22

33

44
### Bug Fixes
@@ -16,8 +16,12 @@
1616

1717
### Features
1818

19+
* **declaration:** update ([978e800](https://github.com/Rain120/typescript-guide/commit/978e8002c92198ac37a6c09c20c9a6f55bc4145e))
20+
* **extends:** update ([8cd0fdc](https://github.com/Rain120/typescript-guide/commit/8cd0fdc819baf8178a16e3b3dcc77b3b90c11ec3))
21+
* **keyof:** update usage ([37c61cb](https://github.com/Rain120/typescript-guide/commit/37c61cbf14eb66f5c84c8cd90a27b79183cc0bf7))
1922
* add Previously at keyword for descript the resource about it ([be81d8e](https://github.com/Rain120/typescript-guide/commit/be81d8e5f2f6d2892852f72143b09607ddc1d78a))
2023
* blog tips & pdfs & books ([310765f](https://github.com/Rain120/typescript-guide/commit/310765ffd4e95bcde3dc3a33c3ca7115f80d30f1))
24+
* compile-config about module resolver & flie inclusive; keyword about is ([4b5832d](https://github.com/Rain120/typescript-guide/commit/4b5832df75a82cd75b553463d1ed476f22d20fd1))
2125
* faqs about tsconfig module target ([d40988c](https://github.com/Rain120/typescript-guide/commit/d40988c26b6c287dc72aac94a4c76b2f07cfa8cf))
2226
* faqs add interface vs type ([3bf6171](https://github.com/Rain120/typescript-guide/commit/3bf61710c8395d8ba73adfc0ae4eb7a3be0f5021))
2327
* finished declaration ([b30964d](https://github.com/Rain120/typescript-guide/commit/b30964d056cd2c03bcaa0dd3a19a60215510ec90))

docs/zh/advanced-types/intersection-types/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,32 @@
44
交叉类型是将多个类型合并为一个类型。 这让我们可以把现有的多种类型叠加到一起成为一种类型, 它包含了所需的所有类型的特性。
55
:::
66

7-
**Note:** 交叉类型是 **** 的关系, 即 $A \cup B$, 使用 `&` 运算符。
7+
**Note:** 交叉类型是 **** 的关系, 即 $A \cup B$, 使用 `&` 运算符。**如果两个类型中出现相同的key,但是类型不同****则该key为never**
88

99
## 使用
1010

1111
```ts
1212
interface Boy {
1313
handsome: boolean;
14+
name?: string;
1415
}
1516

1617
interface Girl {
1718
cute: boolean;
19+
name?: string;
1820
}
1921

22+
// {
23+
// cute: boolean;
24+
// handsome: boolean;
25+
// name?: never;
26+
// }
2027
type Person = Boy & Girl;
2128

2229
const someone: Person = {
23-
handsome: true,
24-
cute: false
30+
handsome: true,
31+
cute: false,
32+
name: 'Rain120'
2533
};
2634
```
2735

0 commit comments

Comments
 (0)