diff --git a/README-zh_CN.md b/README-zh_CN.md index b838ab7..789b57e 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -1140,6 +1140,8 @@ npm install --save-dev @types/library-name 即使在 JavaScript 文件中,您也可以通过 `// @ts-check` 使用环境声明。 +`declare` 关键字可以为现有的 JavaScript 代码启用类型定义,而无需导入它,作为来自另一个文件或全局的类型的占位符。 + ### 属性检测和多余属性检测 TypeScript 基于结构类型系统,但过多的属性检查是 TypeScript 的一个属性,它允许它检查对象是否具有类型中指定的确切属性。 diff --git a/README.md b/README.md index 2b70ec5..3f28e5b 100644 --- a/README.md +++ b/README.md @@ -1145,6 +1145,8 @@ For your defined Ambient Declarations, you can import using the "triple-slash" r You can use Ambient Declarations even within JavaScript files using `// @ts-check`. +The `declare` keyword enables type definitions for existing JavaScript code without importing it, serving as a placeholder for types from another file or globally. + ### Property Checking and Excess Property Checking TypeScript is based on a structural type system but excess property checking is a property of TypeScript which allows it to check whether an object has the exact properties specified in the type. diff --git a/downloads/typescript-book-zh_CN.epub b/downloads/typescript-book-zh_CN.epub index 62d681d..720a332 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 d6acc69..2fd9f33 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 80438ed..4cbe136 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 e6b50b1..208a67f 100644 Binary files a/downloads/typescript-book.pdf and b/downloads/typescript-book.pdf differ diff --git a/website/src/content/docs/book/exploring-the-type-system.md b/website/src/content/docs/book/exploring-the-type-system.md index 4b398f7..3616873 100644 --- a/website/src/content/docs/book/exploring-the-type-system.md +++ b/website/src/content/docs/book/exploring-the-type-system.md @@ -503,6 +503,8 @@ For your defined Ambient Declarations, you can import using the "triple-slash" r You can use Ambient Declarations even within JavaScript files using `// @ts-check`. +The `declare` keyword enables type definitions for existing JavaScript code without importing it, serving as a placeholder for types from another file or globally. + ### Property Checking and Excess Property Checking TypeScript is based on a structural type system but excess property checking is a property of TypeScript which allows it to check whether an object has the exact properties specified in the type. 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 6b2a88f..63f83f0 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 @@ -506,6 +506,8 @@ npm install --save-dev @types/library-name 即使在 JavaScript 文件中,您也可以通过 `// @ts-check` 使用环境声明。 +`declare` 关键字可以为现有的 JavaScript 代码启用类型定义,而无需导入它,作为来自另一个文件或全局的类型的占位符。 + ### 属性检测和多余属性检测 TypeScript 基于结构类型系统,但过多的属性检查是 TypeScript 的一个属性,它允许它检查对象是否具有类型中指定的确切属性。