-
-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Description
I got multiple problems when using DomUtils with typescript
DomUtils.findAll(el => el.name === 'div' && el.parent?.name === 'body', dom.children')TS2339: Property 'name' does not exist on type 'NodeWithChildren'.
DomUtils.getElements({name: 'div'}, dom.children).map(elment => element.children)TS2339: Property 'children' does not exist on type 'Node'.
find(test: (elem: Node) => boolean, nodes: Node[], recurse: boolean, limit: number): Node[]
findAll(test: (elem: Element) => boolean, nodes: Node[]): Element[]Why typeof test's params of find is Node but findAll is Element? and their return too?
There are cases like these but I can't remember now
How to be clear
Why getElements not return Element[] ?
When will method return Element, Node, NodeWithChildren, ... ?
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels