I enjoy doing this particular task, ensuring the types are correct.
const qs = document.querySelector.bind(document) as HTMLElementTagNameMap | null;
const qsa = document.querySelectorAll.bind(document) as NodeListOf<any>;
While hovering over querySelectorAll
in my code editor, I see a lot of information like "return Type of
NodeListOf<...> (+2 overloads)
", but I am unsure of what those overloads mean and how to use <...>. Therefore, I tried ...
However, I encounter errors with qsa
stating that
NodeListOf<any> has no callable signatures
.