TypeScript JSON type

👋 FYI, this note is over 6 months old. Some of the content may be out of date.
type JSONValue =
| string
| number
| boolean
| null
| JSONValue[]
| { [key: string]: JSONValue }

interface JSONObject {
[k: string]: JSONValue
}
interface JSONArray extends Array<JSONValue> {}

← Back home