Recursive Type Aliases

Recursive Type Aliases

Updated: January 16, 2021
TypeScript Programming

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

type JSONValue =
    | string
    | number
    | boolean
    | null
    | JSONValue[]
    | {
        [k: string]: JSONValue
      }

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