Merge pull request #57 from nextchentong/update-text

docs: fix typo
This commit is contained in:
Ruan YiFeng
2023-08-19 13:50:46 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -532,7 +532,7 @@ enum MyEnum {
B = 'b'
}
// { aany, b: any }
// { a: any, b: any }
type Foo = { [key in MyEnum]: any };
```

View File

@@ -312,7 +312,7 @@ type T = Obj[string];
这个语法对于数组也适用,可以使用`number`作为方括号的参数。
```typescript
// MyArray 的类型是 { [key:number]string }
// MyArray 的类型是 { [key:number]: string }
const MyArray = ['a','b','c'];
// 等同于 (typeof MyArray)[number]