New Features:
- In an object type, a bracketed key written as a string or number literal, or as the name of a value, is now a computed key naming a single property rather than an index signature, so several such keys can coexist. A key written as a type-only name is unchanged, and the labeled form
[label: K]keeps index-signature semantics. Breaking: a key headed by a value binding is read as a computed key. Thus a class or enum key such as{[C]: V}is now an error, and a qualified type exposed through a class/namespace merge, as in{[C.K]: V}, must use the labeled form{[key: C.K]: V}to remain an index signature. - In an interface or a
declare classbody, a bracketed key written as a string or number literal, or as the name of a value, is now a computed key naming a single property rather than an index signature, so several such keys can coexist, andstaticputs the property on the static side. A key written as a type-only name is unchanged, and the labeled form[label: K]keeps index-signature semantics. Breaking: a key headed by a value binding is read as a computed key, so a class or enum key such asinterface I {[C]: V}is now an error and must use[key: C]to remain an index signature. - A computed method key
[expr](): Tthat resolves to a single literal string or safe-integer number is now accepted in interface,declare class, and object type bodies (previously a parse error outside.d.tsfiles) and reads as a named method. - A bracketed access on an array with a string-literal key (for example
arr['map']orarr[Symbol.iterator]) now reads the corresponding named member instead of erroring that the key is not an array index, and a string key holding a safe integer (arr['0']) indexes the array like the equivalent numeric key.
Notable bug fixes:
keyof anynow evaluates toanyas expected. Spurious errors related to the bug will no longer fire.- Fix a server crash ("thread 'flow-tokio-runtime' has overflowed its stack") when rechecking a file with an attached LSP client
Parser:
- Parse
componentandhooktype annotations as the declaration ofdeclare export default
Library Definitions:
- Add ES2026 Map methods