For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/rspeedy/rspeedy.decorators.version.md.
Rspeedy logo
Rspeedy
  • English
  • 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' },
      },
    })
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.