-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.ts
30 lines (27 loc) · 1.18 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import {
abortRequestExample,
del200OKExample,
downloadProgressExample,
get200OKExample,
get404NotFoundExample,
get500InternalServerErrorExample,
getCorsBlockedExample,
postJSON201CreatedExample,
uploadFilesExample
} from './requests';
import './index.html';
document.getElementById(get200OKExample.name)!.onclick = get200OKExample;
document.getElementById(postJSON201CreatedExample.name)!.onclick = postJSON201CreatedExample;
document.getElementById(del200OKExample.name)!.onclick = del200OKExample;
document.getElementById(get404NotFoundExample.name)!.onclick = get404NotFoundExample;
document.getElementById(get500InternalServerErrorExample.name)!.onclick =
get500InternalServerErrorExample;
document.getElementById(getCorsBlockedExample.name)!.onclick = getCorsBlockedExample;
document.getElementById(uploadFilesExample.name)!.onclick = () => {
const fileField = document.querySelector(
'input[type="file"][multiple][name="fileField"]'
) as HTMLInputElement;
uploadFilesExample(fileField.files!);
};
document.getElementById(abortRequestExample.name)!.onclick = abortRequestExample;
document.getElementById(downloadProgressExample.name)!.onclick = downloadProgressExample;