接口: Decorators
用于配置装饰器语法。
备注
更多信息请参见 Decorators.version。
属性
version?
optionalversion?:"legacy"|"2022-03"
指定使用的装饰器语法版本。
默认值
'2022-03'
备注
如果想了解不同装饰器版本之间的差异,可以参考:How does this proposal compare to other versions of decorators?
示例
'2022-03' 对应 Stage 3 装饰器提案,等同于 TypeScript 5.0 默认支持的装饰器语法。
'legacy' 对应 TypeScript 的 experimentalDecorators: true。