query-selector-shadow-dom
query-selector-shadow-dom copied to clipboard
Argument of type 'CustomQueryHandler' is not assignable to parameter of type 'CustomQueryHandler'
trafficstars
With the latest release of puppeteer it seems that there are some type issues, e.g.
import puppeteer from 'puppeteer-core'
import { QueryHandler } from 'query-selector-shadow-dom/plugins/puppeteer/index.js'
puppeteer.registerCustomQueryHandler('shadow', QueryHandler)
This fails due to:
Argument of type 'CustomQueryHandler' is not assignable to parameter of type 'import("/workspace/webdriverio/packages/devtools/node_modules/puppeteer-core/lib/types").CustomQueryHandler'.
Types of property 'queryAll' are incompatible.
Type '((element: Element | Document, selector: string) => Element[] | NodeListOf<Element>) | undefined' is not assignable to type '((element: Node, selector: string) => Node[]) | undefined'.
Type '(element: Element | Document, selector: string) => Element[] | NodeListOf<Element>' is not assignable to type '(element: Node, selector: string) => Node[]'.
Type 'Element[] | NodeListOf<Element>' is not assignable to type 'Node[]'.
Type 'NodeListOf<Element>' is missing the following properties from type 'Node[]': pop, push, concat, join, and 27 more.ts(2345)