You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: pages/release notes/TypeScript 2.1.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
In JavaScript it is fairly common to have APIs that expect property names as parameters, but so far it hasn't been possible to express the type relationships that occur in those APIs.
4
4
5
-
Enter Index Type Query or `keysof`;
5
+
Enter Index Type Query or `keyof`;
6
6
An indexed type query `keyof T` yields the type of permitted property names for `T`.
7
7
A `keyof T` type is considered a subtype of `string`.
8
8
@@ -67,7 +67,7 @@ interface Person {
67
67
}
68
68
```
69
69
70
-
A partial verion of it can would be:
70
+
A partial version of it would be:
71
71
72
72
```ts
73
73
interfacePartialPerson {
@@ -90,7 +90,7 @@ type PartialPerson = Partial<Person>;
90
90
Mapped types are produced by taking a union of literal types, and computing a set of properties for a new object type.
91
91
They're like [list comprehensions in Python](https://docs.python.org/2/tutorial/datastructures.html#nested-list-comprehensions), but instead of producing new elements in a list, they produce new properties in a type.
92
92
93
-
In addition to `Partial`, Mapped Types can enable expressing many usueful transfomrations on types:
93
+
In addition to `Partial`, Mapped Types can express many useful transformations on types:
94
94
95
95
```ts
96
96
// Keep types the same, but make each property to be read-only.
@@ -223,7 +223,7 @@ Compiling and running the output should result in the correct behavior on an ES3
223
223
224
224
TypeScript injects a handful of helper functions such as `__extends` for inheritance, `__assign` for spread operator in object literals and JSX elements, and `__awaiter` for async functions.
225
225
226
-
Previously there were two options either:
226
+
Previously there were two options:
227
227
228
228
1. inject helpers in *every* file that needs them, or
0 commit comments