/** * @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 { Predicate } from './predicates'; import { GetChildNodes } from './util'; /** * Applies `mapfn` to `node` and the tree below `node`, yielding a flattened * list of results. */ export declare function treeMap(node: any, mapfn: (node: any) => 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: any, getChildNodes?: GetChildNodes): IterableIterator; /** * Yields node and all its descendents in reverse document order. * * Equivalent to: * yield* [...depthFirst(node)].reverse() */ export declare function depthFirstReversed(node: any, getChildNodes?: GetChildNodes): IterableIterator; /** * Yields `node` and each of its ancestors leading up the tree. */ export declare function ancestors(node: any): IterableIterator; /** * Yields each element that has the same parent as `node` but that * comes before it in the document. * * Nodes are yielded in reverse document order (i.e. starting with the one * closest to `node`) */ export declare function previousSiblings(node: any): IterableIterator; /** * Yields every node in the document that comes before `node`, in reverse * document order. * * So if you have a tree like: * ```html * * *
* * * * ... * ``` * * Then `prior()` will yield: * * ,
,
  • ,