Closed
Description
https://devblogs.microsoft.com/typescript/announcing-typescript-4-0-beta/
Variadic Tuple Types (Supported)
type Strings = [string, string];
type Numbers = number[]
// [string, string, ...Array<number | boolean>]
type Unbounded = [...Strings, ...Numbers, boolean];
This is already supported at the AST level - this is a type functionality change only.
Labelled Tuple Elements (Supported #2378)
type Foo = [first: number, second?: string, ...rest: any[]];
This requires AST updates.
Short-Circuiting Assignment Operators (Supported #2307)
// "Or Or Equals" (or, the Mallet operator :wink:)
a ||= b;
// "And And Equals"
a &&= b;
// "QQ Equals"
a ??= b;
This requires AST updates.
AST: estree/estree#212
unknown
on catch
Clause Bindings (Supported #2306)
try {
// ...
}
catch (e: unknown) {
// ...
}
This requires AST updates