Skip to content

Commit 610c241

Browse files
authored
docs: list a table of all dts features (#1055)
1 parent 01fb893 commit 610c241

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

website/docs/en/guide/advanced/dts.mdx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,16 @@ The priority from highest to lowest of final output directory of declaration fil
7676
- The configuration option `declarationDir` in `tsconfig.json`
7777
- The configuration option [output.distPath.root](/config/rsbuild/output#outputdistpath)
7878

79-
::: tip
80-
81-
You can refer to [lib.dts](/config/lib/dts) for more details about declaration files configuration.
82-
83-
:::
79+
## Related configuration of declaration files
80+
81+
| Configuration item | Description |
82+
| ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
83+
| [dts.bundle](/config/lib/dts#dtsbundle) | Whether to bundle the declaration files. |
84+
| [dts.distPath](/config/lib/dts#dtsdistpath) | The output directory of declaration files. |
85+
| [dts.build](/config/lib/dts#dtsbuild) | Whether to generate declaration files with building the project references. |
86+
| [dts.abortOnError](/config/lib/dts#dtsabortonerror) | Whether to abort the build process when an error occurs during declaration files generation. |
87+
| [dts.autoExtension](/config/lib/dts#dtsautoextension) | Whether to automatically set the declaration file extension based on the [format](/config/lib/format) option. |
88+
| [banner.dts](/config/lib/banner#bannerdts) | Inject content into the top of each declaration output file. |
89+
| [footer.dts](/config/lib/footer#footerdts) | Inject content into the bottom of each declaration file. |
90+
| [redirect.dts.path](/config/lib/redirect#redirectdtspath) | Whether to automatically redirect the import paths of TypeScript declaration output files. |
91+
| [redirect.dts.extension](/config/lib/redirect#redirectdtsextension) | Whether to automatically redirect the file extension to import paths based on the TypeScript declaration output files. |

website/docs/zh/config/lib/dts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default {
157157
- **类型:** `boolean`
158158
- **默认值:** `false`
159159

160-
是否在生成类型声明文件时构建项目的 references。这相当于在 `tsc` 命令中使用 `--build` 标志。更多详细信息请参考 [项目引用](https://www.typescriptlang.org/docs/handbook/project-references.html)
160+
是否在生成类型声明文件时构建项目的 project references。这相当于在 `tsc` 命令中使用 `--build` 标志。更多详细信息请参考 [项目引用](https://www.typescriptlang.org/docs/handbook/project-references.html)
161161

162162
::: note
163163

website/docs/zh/guide/advanced/dts.mdx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,16 @@ import { PackageManagerTabs } from '@theme';
7676
- `tsconfig.json` 中的 `declarationDir` 配置项
7777
- [output.distPath.root](/config/rsbuild/output#outputdistpath) 配置项
7878

79-
::: tip
80-
81-
你可以参考 [lib.dts](/config/lib/dts) 获取更多有关类型声明文件配置的详细信息。
82-
83-
:::
79+
## 类型声明文件的相关配置
80+
81+
| 配置项 | 描述说明 |
82+
| ------------------------------------------------------------------- | ---------------------------------------------------------------------- |
83+
| [dts.bundle](/config/lib/dts#dtsbundle) | 是否打包类型声明文件。 |
84+
| [dts.distPath](/config/lib/dts#dtsdistpath) | 类型声明文件的输出目录。 |
85+
| [dts.build](/config/lib/dts#dtsbuild) | 是否在生成类型声明文件时构建项目的 project references。 |
86+
| [dts.abortOnError](/config/lib/dts#dtsabortonerror) | 当类型声明文件生成过程中出现错误时,是否中止构建过程。 |
87+
| [dts.autoExtension](/config/lib/dts#dtsautoextension) | 是否根据 [format](/config/lib/format) 选项自动设置类型声明文件扩展名。 |
88+
| [banner.dts](/config/lib/banner#bannerdts) | 在每个类型声明文件顶部注入内容。 |
89+
| [footer.dts](/config/lib/footer#footerdts) | 在每个类型声明文件底部注入内容。 |
90+
| [redirect.dts.path](/config/lib/redirect#redirectdtspath) | 是否自动重定向类型声明文件中的导入路径。 |
91+
| [redirect.dts.extension](/config/lib/redirect#redirectdtsextension) | 是否根据类型声明文件自动重定向文件扩展名到导入路径。 |

0 commit comments

Comments
 (0)