type JSONValue = | string | number | boolean | JSONObject | JSONArray; type JSONArray = Array; type Maybe = { just: T, error: null, } | { just: null, error: { message: string }, }; interface JSONObject { [x: string]: JSONValue; }