codethrasher

Recursive Type Aliases

In TS@4 a type can reference itself, e.g.

1
2
3
4
5
6
7
8
9
type JSONValue =
    | string
    | number
    | boolean
    | null
    | JSONValue[]
    | {
        [k: string]: JSONValue
      }

Previously, this would not be possible without some messy hacks.

← Labeled Tuple Types Nullish Coalescing →