class HttpGetter { async get(filename: string): Promise { const xhr = new XMLHttpRequest(); xhr.addEventListener('load', (e) => { if (xhr.status === 200) { console.log(xhr.responseText); return; } console.log('failed with status ' + xhr.status + ': ' + xhr.statusText); }); xhr.open('GET', filename); xhr.send(); } } export { HttpGetter };