HierarchyQuery Class

    Package: @esfx/iter-query

    Represents a sequence of hierarchically organized values.

    Declaration
    export declare class HierarchyQuery<TNode, T extends TNode = TNode> extends Query<T> implements HierarchyIterable<TNode, T> 
    Inheritance
    Query<T>
    HierarchyQuery
    Inherited Members
    _from(source)
    _from(source)
    _from(source, provider)
    _from(source, provider)
    _from(source)
    _from(source)
    _from(source)
    [Symbol.iterator]()
    constructor(source)
    append(value)
    average()
    average(elementSelector)
    break(predicate)
    concat(right)
    concat(right)
    consume(iterator, options)
    continuous(value)
    copyTo(dest, start, count)
    copyTo(dest, start, count)
    corresponds(right, equaler)
    corresponds(right, equaler)
    correspondsBy(right, keySelector, keyEqualer)
    correspondsBy(right, leftKeySelector, rightKeySelector, keyEqualer)
    count(predicate)
    defaultIfEmpty(defaultValue)
    distinct(equaler)
    distinctBy(keySelector, keyEqualer)
    drop(count)
    dropRight(count)
    dropUntil(predicate)
    dropWhile(predicate)
    elementAt(offset)
    empty()
    endsWith(right, equaler)
    endsWith(right, equaler)
    every(predicate)
    every(predicate)
    except(right, equaler)
    exceptBy(right, keySelector, keyEqualer)
    exclude(values)
    filter(predicate)
    filter(predicate)
    filterBy(keySelector, predicate)
    filterDefined()
    filterDefinedBy(keySelector)
    filterNot(predicate)
    filterNot(predicate)
    filterNotBy(keySelector, predicate)
    filterNotDefinedBy(keySelector)
    first(predicate)
    first(predicate)
    flatMap(projection)
    flatMap(projection, resultSelector)
    forEach(callback)
    from(source)
    from(source)
    from(source, provider)
    from(source, provider)
    from(source)
    from(source)
    from(source)
    fullJoin(inner, outerKeySelector, innerKeySelector, resultSelector, keyEqualer)
    generate(count, generator)
    groupBy(keySelector, keyEqualer)
    groupBy(keySelector, elementSelector, keyEqualer)
    groupBy(keySelector, elementSelector, resultSelector, keyEqualer)
    groupBy(keySelector, elementSelector, resultSelector, keyEqualer)
    groupJoin(inner, outerKeySelector, innerKeySelector, resultSelector, keyEqualer)
    includes(value, equaler)
    includes(value, equaler)
    includesSequence(right, equaler)
    includesSequence(right, equaler)
    intersect(right, equaler)
    intersect(right, equaler)
    intersectBy(right, keySelector, keyEqualer)
    intersectBy(right, keySelector, keyEqualer)
    into(callback)
    join(inner, outerKeySelector, innerKeySelector, resultSelector, keyEqualer)
    last(predicate)
    last(predicate)
    map(selector)
    materialize()
    max(comparer)
    maxBy(keySelector, keyComparer)
    min(comparer)
    minBy(keySelector, keyComparer)
    nth(offset)
    of(elements)
    once(value)
    orderBy(keySelector, comparer)
    orderByDescending(keySelector, comparer)
    pageBy(pageSize)
    pageBy(pageSize, pageSelector)
    patch(start, skipCount, range)
    prepend(value)
    range(start, end, increment)
    reduce(accumulator)
    reduce(accumulator, seed, resultSelector)
    reduce(accumulator, seed, resultSelector)
    reduceRight(accumulator)
    reduceRight(accumulator, seed, resultSelector)
    reduceRight(accumulator, seed, resultSelector)
    relativeComplement(right, equaler)
    relativeComplementBy(right, keySelector, keyEqualer)
    repeat(value, count)
    reverse()
    scan(accumulator)
    scan(accumulator, seed)
    scanRight(accumulator)
    scanRight(accumulator, seed)
    select(selector)
    selectMany(projection)
    selectMany(projection, resultSelector)
    single(predicate)
    single(predicate)
    skip(count)
    skipRight(count)
    skipUntil(predicate)
    skipWhile(predicate)
    some(predicate)
    span(predicate)
    span(predicate)
    spanMap(keySelector, keyEqualer)
    spanMap(keySelector, elementSelector, keyEqualer)
    spanMap(keySelector, elementSelector, spanSelector, keyEqualer)
    spanMap(keySelector, elementSelector, spanSelector, keyEqualer)
    spanUntil(predicate)
    startsWith(right, equaler)
    startsWith(right, equaler)
    sum()
    sum(elementSelector)
    symmetricDifference(right, equaler)
    symmetricDifference(right, equaler)
    symmetricDifferenceBy(right, keySelector, keyEqualer)
    symmetricDifferenceBy(right, keySelector, keyEqualer)
    take(count)
    takeRight(count)
    takeUntil(predicate)
    takeWhile(predicate)
    takeWhile(predicate)
    tap(callback)
    through(callback)
    toArray()
    toArray(elementSelector)
    toHashMap(keySelector, keyEqualer)
    toHashMap(keySelector, elementSelector, keyEqualer)
    toHashSet(equaler)
    toHashSet(elementSelector, equaler)
    toHierarchy(provider)
    toJSON()
    toLookup(keySelector, keyEqualer)
    toLookup(keySelector, elementSelector, keyEqualer)
    toMap(keySelector)
    toMap(keySelector, elementSelector)
    toObject(prototype, keySelector)
    toObject(prototype, keySelector)
    toObject(prototype, keySelector)
    toObject(prototype, keySelector)
    toObject(prototype, keySelector, elementSelector, descriptorSelector)
    toObject(prototype, keySelector, elementSelector, descriptorSelector)
    toObject(prototype, keySelector, elementSelector, descriptorSelector)
    toObject(prototype, keySelector, elementSelector, descriptorSelector)
    toObject(prototype, keySelector, elementSelector, descriptorSelector)
    toSet()
    toSet(elementSelector)
    union(right, equaler)
    union(right, equaler)
    unionBy(right, keySelector, keyEqualer)
    unionBy(right, keySelector, keyEqualer)
    unzip()
    unzip(partSelector)
    where(predicate)
    where(predicate)
    whereBy(keySelector, predicate)
    whereDefined()
    whereDefinedBy(keySelector)
    whereNot(predicate)
    whereNot(predicate)
    whereNotBy(keySelector, predicate)
    whereNotDefinedBy(keySelector)
    zip(right)
    zip(right, selector)

    Constructors

    constructor(source)

    Constructs a new instance of the HierarchyQuery class

    Declaration
    constructor(source: HierarchyIterable<TNode, T>);
    Parameters
    source
    HierarchyIterable<TNode, T>

    constructor(source, provider)

    Constructs a new instance of the HierarchyQuery class

    Declaration
    constructor(source: Iterable<T>, provider: HierarchyProvider<TNode>);
    Parameters
    source
    Iterable<T>

    provider
    HierarchyProvider<TNode>

    Methods

    [Hierarchical.hierarchy]()

    Declaration
    [Hierarchical.hierarchy](): HierarchyProvider<TNode>;
    Returns
    HierarchyProvider<TNode>

    ancestors(predicate)

    Creates a subquery for the ancestors of each element in the hierarchy.

    Declaration
    ancestors<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    ancestors(predicate)

    Creates a subquery for the ancestors of each element in the hierarchy.

    Declaration
    ancestors(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    ancestorsAndSelf(predicate)

    Creates a subquery for the ancestors of each element as well as each element in the hierarchy.

    Declaration
    ancestorsAndSelf<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    ancestorsAndSelf(predicate)

    Creates a subquery for the ancestors of each element as well as each element in the hierarchy.

    Declaration
    ancestorsAndSelf(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    bottomMost(predicate)

    Creates a subquery for the bottom-most elements. Elements that are an ancestor of any other element are removed. Hierarchy

    Declaration
    bottomMost<U extends T>(predicate: (element: T) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: T) => element is U

    Returns
    HierarchyQuery<TNode, U>

    bottomMost(predicate)

    Creates a subquery for the bottom-most elements. Elements that are an ancestor of any other element are removed. Hierarchy

    Declaration
    bottomMost(predicate?: (element: T) => boolean): HierarchyQuery<TNode, T>;
    Parameters
    predicate
    (element: T) => boolean

    Returns
    HierarchyQuery<TNode, T>

    children(predicate)

    Creates a subquery for the children of each element in the hierarchy.

    Declaration
    children<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    children(predicate)

    Creates a subquery for the children of each element in the hierarchy.

    Declaration
    children(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    descendants(predicate)

    Creates a subquery for the descendants of each element in the hierarchy.

    Declaration
    descendants<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    descendants(predicate)

    Creates a subquery for the descendants of each element in the hierarchy.

    Declaration
    descendants(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    descendantsAndSelf(predicate)

    Creates a subquery for the descendants of each element as well as each element in the hierarchy.

    Declaration
    descendantsAndSelf<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    descendantsAndSelf(predicate)

    Creates a subquery for the descendants of each element as well as each element in the hierarchy.

    Declaration
    descendantsAndSelf(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    firstChild(predicate)

    Creates a subquery for the first child of each element in the hierarchy.

    Declaration
    firstChild<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    firstChild(predicate)

    Creates a subquery for the first child of each element in the hierarchy.

    Declaration
    firstChild(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    following(predicate)

    Creates a subquery for the nodes following each element in the hierarchy.

    Declaration
    following<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    following(predicate)

    Creates a subquery for the nodes following each element in the hierarchy.

    Declaration
    following(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    followingSiblings(predicate)

    Creates a subquery for the siblings after each element in the hierarchy.

    Declaration
    followingSiblings<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    followingSiblings(predicate)

    Creates a subquery for the siblings after each element in the hierarchy.

    Declaration
    followingSiblings(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    lastChild(predicate)

    Creates a subquery for the last child of each element in the hierarchy.

    Declaration
    lastChild<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    lastChild(predicate)

    Creates a subquery for the last child of each element in the hierarchy.

    Declaration
    lastChild(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    nthChild(offset, predicate)

    Creates a subquery for the child of each element at the specified offset. A negative offset starts from the last child.

    Declaration
    nthChild<U extends TNode>(offset: number, predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    offset
    number

    The offset for the child. Hierarchy

    predicate
    (element: TNode) => element is U

    Returns
    HierarchyQuery<TNode, U>

    nthChild(offset, predicate)

    Creates a subquery for the child of each element at the specified offset. A negative offset starts from the last child.

    Declaration
    nthChild(offset: number, predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    offset
    number

    The offset for the child. Hierarchy

    predicate
    (element: TNode) => boolean

    Returns
    HierarchyQuery<TNode>

    parents(predicate)

    Creates a subquery for the parents of each element in the hierarchy.

    Declaration
    parents<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    parents(predicate)

    Creates a subquery for the parents of each element in the hierarchy.

    Declaration
    parents(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    preceding(predicate)

    Creates a subquery for the nodes preceding each element in the hierarchy.

    Declaration
    preceding<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    preceding(predicate)

    Creates a subquery for the nodes preceding each element in the hierarchy.

    Declaration
    preceding(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    precedingSiblings(predicate)

    Creates a subquery for the siblings before each element in the hierarchy.

    Declaration
    precedingSiblings<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    precedingSiblings(predicate)

    Creates a subquery for the siblings before each element in the hierarchy.

    Declaration
    precedingSiblings(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    root(predicate)

    Creates a subquery for the roots of each element in the hierarchy.

    Declaration
    root<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    root(predicate)

    Creates a subquery for the roots of each element in the hierarchy.

    Declaration
    root(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    self(predicate)

    Creates a subquery for this query.

    Declaration
    self<U extends T>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    self(predicate)

    Creates a subquery for this query.

    Declaration
    self<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    self(predicate)

    Creates a subquery for this query.

    Declaration
    self(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    siblings(predicate)

    Creates a subquery for the siblings of each element in the hierarchy.

    Declaration
    siblings<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    siblings(predicate)

    Creates a subquery for the siblings of each element in the hierarchy.

    Declaration
    siblings(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    siblingsAfterSelf(predicate)

    Creates a subquery for the siblings after each element in the hierarchy.

    NOTE: This is an alias for followingSiblings.

    Declaration
    siblingsAfterSelf<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    siblingsAfterSelf(predicate)

    Creates a subquery for the siblings after each element in the hierarchy.

    NOTE: This is an alias for followingSiblings.

    Declaration
    siblingsAfterSelf(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    siblingsAndSelf(predicate)

    Creates a subquery for the siblings of each element as well as each element in the hierarchy.

    Declaration
    siblingsAndSelf<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    siblingsAndSelf(predicate)

    Creates a subquery for the siblings of each element as well as each element in the hierarchy.

    Declaration
    siblingsAndSelf(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    siblingsBeforeSelf(predicate)

    Creates a subquery for the siblings before each element in the hierarchy.

    NOTE: This is an alias for precedingSiblings.

    Declaration
    siblingsBeforeSelf<U extends TNode>(predicate: (element: TNode) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: TNode) => element is U

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode, U>

    siblingsBeforeSelf(predicate)

    Creates a subquery for the siblings before each element in the hierarchy.

    NOTE: This is an alias for precedingSiblings.

    Declaration
    siblingsBeforeSelf(predicate?: (element: TNode) => boolean): HierarchyQuery<TNode>;
    Parameters
    predicate
    (element: TNode) => boolean

    A callback used to filter the results. Hierarchy

    Returns
    HierarchyQuery<TNode>

    topMost(predicate)

    Creates a subquery for the top-most elements. Elements that are a descendant of any other element are removed. Hierarchy

    Declaration
    topMost<U extends T>(predicate: (element: T) => element is U): HierarchyQuery<TNode, U>;
    Type Parameters
    U

    Parameters
    predicate
    (element: T) => element is U

    Returns
    HierarchyQuery<TNode, U>

    topMost(predicate)

    Creates a subquery for the top-most elements. Elements that are a descendant of any other element are removed. Hierarchy

    Declaration
    topMost(predicate?: (element: T) => boolean): HierarchyQuery<TNode, T>;
    Parameters
    predicate
    (element: T) => boolean

    Returns
    HierarchyQuery<TNode, T>

    Generated by DocFX