Avoid confusing with the built-in Map class. PR917
This commit is contained in:
parent
286bf18097
commit
4cebdef2e3
@ -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
|
||||
```
|
||||
|
||||
# 映射类型
|
||||
|
Loading…
Reference in New Issue
Block a user