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/rspeedy/rspeedy.decorators.version.md.
Rspeedy logo
Rspeedy
  • 简体中文
  • Home > @lynx-js/rspeedy > Decorators > version

    Decorators.version property

    Specify the decorator syntax version to be used.

    Signature:

    version?: 'legacy' | '2022-03';

    Default Value

    '2022-03'

    Remarks

    If you want to know the differences between different decorators versions, you can refer to: How does this proposal compare to other versions of decorators?

    Example 1

    '2022-03' corresponds to the Stage 3 decorator proposal, equivalent to the decorator syntax supported by TypeScript 5.0 by default.

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

    Example 2

    'legacy' corresponds to TypeScript's experimentalDecorators: true.

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