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, and this page is available as Markdown at /next/zh/api/packages/rspeedy/interfaces/Decorators.md.
Lynx
  • 简体中文
  • 接口: Decorators

    用于配置装饰器语法。

    备注

    更多信息请参见 Decorators.version。

    属性

    version?

    optional version?: "legacy" | "2022-03"

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

    默认值

    '2022-03'

    备注

    如果想了解不同装饰器版本之间的差异,可以参考:How does this proposal compare to other versions of decorators?

    示例

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

    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      source: {
        decorators: { version: '2022-03' },
      },
    })

    'legacy' 对应 TypeScript 的 experimentalDecorators: true。

    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      source: {
        decorators: { version: 'legacy' },
      },
    })
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。