Avoid confusing with the built-in Map class. PR917

This commit is contained in:
zhongsp 2019-06-01 19:55:36 +08:00
parent 286bf18097
commit 4cebdef2e3

View File

@ -781,11 +781,11 @@ let unknown = getProperty(person, 'unknown'); // error, 'unknown' is not in 'nam
并且`T[string]`为索引签名的类型:
```ts
interface Map<T> {
interface Dictionary<T> {
[key: string]: T;
}
let keys: keyof Map<number>; // string
let value: Map<number>['foo']; // number
let keys: keyof Dictionary<number>; // string
let value: Dictionary<number>['foo']; // number
```
# 映射类型