Administration/www/dist/async.ts

30 lines
616 B
TypeScript

class AsyncManager {
protected readonly url: string = "/admin/async";
constructor(url?: string) {
if (url !== undefined)
this.url = url;
}
public getTaskList(onSuccess: Function, onError?: Function): void {
let xhr = new XMLHttpRequest();
xhr.open("GET", this.url + ".json", true);
xhr.send();
// @todo Continue
}
}
let async: AsyncManager = new AsyncManager();
const url = "/admin/async";
let xhr = new XMLHttpRequest();
xhr.open("GET", url + ".json", true);
xhr.send();
xhr.onload = function () {
if (xhr.status === 200) {
}
}