We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43afc88 commit a491e1bCopy full SHA for a491e1b
types/index.d.ts
@@ -20,11 +20,11 @@ declare namespace remove {
20
* @param options Whether to drop parent nodes if they had children, but all their children were filtered out
21
* @param test is-compatible test (such as a type)
22
*/
23
-declare function remove(tree: Node, test?: Test<Node>): Node
24
-declare function remove(
25
- tree: Node,
+declare function remove<T extends Node>(tree: T, test?: Test<Node>): T | null
+declare function remove<T extends Node>(
+ tree: T,
26
options: remove.RemoveOptions = {cascade: true},
27
test?: Test<Node>
28
-): Node
+): T | null
29
30
export = remove
0 commit comments