Typescript Changelog
5.1 (opens in a new tab)
- 返回函数可以隐式返回了
// ✅ Works in TypeScript 5.1!
function f4(): undefined {
// no returns
}
- get、set 可以是不同类型的值了
interface CSSStyleRule {
/** Always reads as a `CSSStyleDeclaration` */
get style(): CSSStyleDeclaration;
/** Can only write a `string` here. */
set style(newValue: string);
}