> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Interface: Decorators

用于配置装饰器语法。

## Remarks

更多信息请参见 [Decorators.version](#version)。

## Properties

### version?

> `optional` **version?**: `"legacy"` | `"2022-03"`

指定使用的装饰器语法版本。

#### Default Value

`'2022-03'`

#### Remarks

如果想了解不同装饰器版本之间的差异，可以参考：[How does this proposal compare to other versions of decorators?](https://github.com/tc39/proposal-decorators?tab=readme-ov-file#how-does-this-proposal-compare-to-other-versions-of-decorators)

#### Examples

`'2022-03'` 对应 Stage 3 装饰器提案，等同于 TypeScript 5.0 默认支持的装饰器语法。

```js
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  source: {
    decorators: { version: '2022-03' },
  },
})
```

`'legacy'` 对应 TypeScript 的 `experimentalDecorators: true`。

```js
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  source: {
    decorators: { version: 'legacy' },
  },
})
```
