property forEach does not exist on type NodeListOf
You need to convert it to an array:
const frameZones = Array.from(document.querySelectorAll('path.frame-zone'));
frameZones.forEach((...) => {});
Just add "dom.iterable"
to tsconfig.json
, so that it looks somewhat like this:
{
"compilerOptions": {
"lib": [
"es6",
"dom",
"dom.iterable"
],
...
You can cast it to let compiler know it can be iterated:
(document.querySelectorAll('path.frame-zone') as any as Array<HTMLElement>).forEach();