Encountered an issue with the 'DOMTokenList' not being recognized as an array type while trying to convert it using a spread operator. Utilizing Typescript/Playwright for automation purposes, I am attempting to access the classlist of a div element. Initially used Array.from method but received an eslint error prompting me to use the spread operator instead.
The code snippet in question:
let classes = (await this.emailOptionsPage.getMobileView().first().evaluate(classdiv => [...classdiv.classList] as string[]))[0];
An error was flagged indicating that DOMTokenList is not an arraytype.
Seeking guidance on the next steps to resolve this issue and any alternative methods to retrieve the classList would be appreciated.