diff --git a/README-zh_CN.md b/README-zh_CN.md index d03e1007..4a63f3fc 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -1298,7 +1298,7 @@ TypeScript 提供了控制加宽过程的方法,例如使用"const"。 For example: ```typescript -const x = 'x'; // TypeScript 将 x 的类型推断为 'x',一种较窄的类型 +const x = 'x'; // TypeScript 将 'x' 推断为带有 'const'(不可变)的字符串字面量,但将其扩展为带有 'let'(可重新赋值)的 'string'。 let y: 'y' | 'x' = 'y'; y = x; // 有效: x的类型推断为 'x' ``` @@ -3760,7 +3760,7 @@ type MyType = MyTuple[2]; // boolean #### Awaited\ -构造一个递归解包 Promise 的类型。 +构造一个递归解包 Promise 类型的类型。 ```typescript type A = Awaited>; // string @@ -4174,7 +4174,7 @@ WebSocket: ### 迭代器和生成器 -TypeScript 很好地支持交互器和生成器。 +TypeScript 对迭代器和生成器都提供了很好的支持。 迭代器是实现迭代器协议的对象,提供了一种逐个访问集合或序列元素的方法。它是一个包含指向迭代中下一个元素的指针的结构。他们有一个 `next()` 方法返回序列中的下一个值以及指示序列是否为 的布尔值 `done` 。 diff --git a/downloads/typescript-book-zh_CN.epub b/downloads/typescript-book-zh_CN.epub index 026c82b2..2e75d9ce 100644 Binary files a/downloads/typescript-book-zh_CN.epub and b/downloads/typescript-book-zh_CN.epub differ diff --git a/downloads/typescript-book-zh_CN.pdf b/downloads/typescript-book-zh_CN.pdf index d93b8091..57384dfd 100644 Binary files a/downloads/typescript-book-zh_CN.pdf and b/downloads/typescript-book-zh_CN.pdf differ diff --git a/downloads/typescript-book.epub b/downloads/typescript-book.epub index f2cb7fc6..a1856c21 100644 Binary files a/downloads/typescript-book.epub and b/downloads/typescript-book.epub differ diff --git a/downloads/typescript-book.pdf b/downloads/typescript-book.pdf index 9b9cd4b8..751adec2 100644 Binary files a/downloads/typescript-book.pdf and b/downloads/typescript-book.pdf differ diff --git a/website/src/content/docs/book/others.md b/website/src/content/docs/book/others.md index 7d51eeca..e117aca0 100644 --- a/website/src/content/docs/book/others.md +++ b/website/src/content/docs/book/others.md @@ -139,7 +139,7 @@ WebSocket: ### Iterators and Generators -Both Interators and Generators are well supported in TypeScript. +Both Iterators and Generators are well supported in TypeScript. Iterators are objects that implement the iterator protocol, providing a way to access elements of a collection or sequence one by one. It is a structure that contains a pointer to the next element in the iteration. They have a `next()` method that returns the next value in the sequence along with a boolean indicating if the sequence is `done`. diff --git a/website/src/content/docs/book/type-from-value.md b/website/src/content/docs/book/type-from-value.md index 14331090..3d9d9a07 100644 --- a/website/src/content/docs/book/type-from-value.md +++ b/website/src/content/docs/book/type-from-value.md @@ -9,6 +9,6 @@ sidebar: Type from Value in TypeScript refers to the automatic inference of a type from a value or expression through type inference. ```typescript -const x = 'x'; // TypeScript can automatically infer that the type of the message variable is string +const x = 'x'; // TypeScript infers 'x' as a string literal with 'const' (immutable), but widens it to 'string' with 'let' (reassignable). ``` diff --git a/website/src/content/docs/book/type-manipulation.md b/website/src/content/docs/book/type-manipulation.md index f2bab6be..1fe6a989 100644 --- a/website/src/content/docs/book/type-manipulation.md +++ b/website/src/content/docs/book/type-manipulation.md @@ -80,7 +80,7 @@ Several built-in utility types can be used to manipulate types, below a list of #### Awaited\ -Constructs a type recursively unwrap Promises. +Constructs a type that recursively unwraps Promise types. ```typescript type A = Awaited>; // string diff --git a/website/src/content/docs/zh-cn/book/exploring-the-type-system.md b/website/src/content/docs/zh-cn/book/exploring-the-type-system.md index 63f83f07..28ba86e3 100644 --- a/website/src/content/docs/zh-cn/book/exploring-the-type-system.md +++ b/website/src/content/docs/zh-cn/book/exploring-the-type-system.md @@ -664,7 +664,7 @@ TypeScript 提供了控制加宽过程的方法,例如使用"const"。 For example: ```typescript -const x = 'x'; // TypeScript 将 x 的类型推断为 'x',一种较窄的类型 +const x = 'x'; // TypeScript 将 'x' 推断为带有 'const'(不可变)的字符串字面量,但将其扩展为带有 'let'(可重新赋值)的 'string'。 let y: 'y' | 'x' = 'y'; y = x; // 有效: x的类型推断为 'x' ``` diff --git a/website/src/content/docs/zh-cn/book/others.md b/website/src/content/docs/zh-cn/book/others.md index 189eecdb..1d2b21dd 100644 --- a/website/src/content/docs/zh-cn/book/others.md +++ b/website/src/content/docs/zh-cn/book/others.md @@ -139,7 +139,7 @@ WebSocket: ### 迭代器和生成器 -TypeScript 很好地支持交互器和生成器。 +TypeScript 对迭代器和生成器都提供了很好的支持。 迭代器是实现迭代器协议的对象,提供了一种逐个访问集合或序列元素的方法。它是一个包含指向迭代中下一个元素的指针的结构。他们有一个 `next()` 方法返回序列中的下一个值以及指示序列是否为 的布尔值 `done` 。 diff --git a/website/src/content/docs/zh-cn/book/type-manipulation.md b/website/src/content/docs/zh-cn/book/type-manipulation.md index 8314332f..4fe4fffa 100644 --- a/website/src/content/docs/zh-cn/book/type-manipulation.md +++ b/website/src/content/docs/zh-cn/book/type-manipulation.md @@ -80,7 +80,7 @@ type MyType = MyTuple[2]; // boolean #### Awaited\ -构造一个递归解包 Promise 的类型。 +构造一个递归解包 Promise 类型的类型。 ```typescript type A = Awaited>; // string