HTMLElement type in TypeScript

DOM elements also have their own data types. Let's look at working with DOM elements using an example. Let's say we have the following div:

html<div></div>

Let's get a reference to this div into a variable. All DOM elements are of type HTMLElement. Let's specify this type for our variable:

typescriptlet elem: HTMLElement;

Now let's write a link to our div into this variable:

typescriptlet elem: HTMLElement = document.querySelector('div');
console.log(elem);

All divs, in addition to being DOM elements with the HTMLElement type, also belong to the HTMLDivElement type (other tags have similar types). Let's specify a more precise type for our element:

typescriptlet elem: HTMLDivElement = document.querySelector('div');
console.log(elem);
Задание 1

Make a variable that will contain promise.

Задание 2

Make a variable that will contain the DOM element.

Задание 3

Create a variable that will contain a reference to the ul tag.