/** * @license * Copyright (c) 2018 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ import { ASTNode as Node } from 'parse5'; import { Predicate } from './predicates'; import { GetChildNodes } from './util'; export { ASTNode as Node } from 'parse5'; /** * Applies `mapfn` to `node` and the tree below `node`, yielding a flattened * list of results. */ export declare function treeMap(node: Node, mapfn: (node: Node) => Iterable, getChildNodes?: GetChildNodes): IterableIterator; /** * Yields `node` and all of its children, recursively. * * Yields `node` first, then yields each descendent in depth first order. */ export declare function depthFirst(node: Node, getChildNodes?: GetChildNodes): IterableIterator; /** * Yields node and all its descendents in reverse document order. * * Equivalent to: * yield* [...depthFirst(node)].reverse() */ export declare function depthFirstReversed(node: Node, getChildNodes?: GetChildNodes): IterableIterator; /** * Like `depthFirst`, but descends into the bodies of `