Skip to content

JsonValue

JsonValue = null | boolean | number | string | JsonValue[] | {[key: string]: JsonValue; }

Defined in: json/json-value.ts:29

Recursive type representing any valid JSON value.

JSON supports six types:

  • null
  • boolean (true/false)
  • number (integer or floating point)
  • string
  • array (ordered list of JSON values)
  • object (string-keyed map of JSON values)
const data: JsonValue = {
name: 'Alice',
age: 30,
active: true,
tags: ['admin', 'user'],
metadata: null
}