export function getJSON(url: string): Promise> { return new Promise>((resolve, reject) => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.responseType = "json"; xhr.onload = function () { var status = xhr.status; if (status === 200) { resolve(xhr.response); } else { reject(xhr.response); } }; xhr.send(); }); }