ixfx
    Preparing search index...

    Type Alias WrappedNode<T>

    WrappedNode: TraversableTree<T> & {
        add: (child: WrappedNode<T> | TreeNode<T>) => WrappedNode<T>;
        addValue: (value: T) => WrappedNode<T>;
        findParentsValue: <T>(
            child: TreeNode<T>,
            value: T,
            eq: IsEqual<T>,
        ) => WrappedNode<T> | undefined;
        getValue: () => T | undefined;
        hasAnyChild: (child: WrappedNode<T> | TreeNode<T>) => boolean;
        hasAnyParent: (parent: WrappedNode<T> | TreeNode<T>) => boolean;
        hasChild: (child: WrappedNode<T> | TreeNode<T>) => boolean;
        hasParent: (parent: WrappedNode<T> | TreeNode<T>) => boolean;
        parentsValues: <T>(child: TreeNode<T>) => IterableIterator<T>;
        queryParentsValue: <T>(
            child: TreeNode<T>,
            value: T,
            eq?: IsEqual<T>,
        ) => IterableIterator<WrappedNode<T>>;
        queryValue: (value: T) => IterableIterator<WrappedNode<T>>;
        remove: () => void;
        wraps: TreeNode<T>;
    }

    Wraps a TreeNode for a more object-oriented means of access.

    Create: Trees.FromObject.createWrapped: Create based on an object Trees.Mutable.wrap: Create based on a Trees.TreeNode instance

    Type Parameters

    • T

    Type Declaration

    • add: (child: WrappedNode<T> | TreeNode<T>) => WrappedNode<T>

      Adds a child node

    • addValue: (value: T) => WrappedNode<T>

      Adds a new child node, with value as its value

    • findParentsValue: <T>(child: TreeNode<T>, value: T, eq: IsEqual<T>) => WrappedNode<T> | undefined

      Returns the first parent that has a given value.

    • getValue: () => T | undefined

      Gets value of node, if defined

    • hasAnyChild: (child: WrappedNode<T> | TreeNode<T>) => boolean

      Returns true if child is contained any any descendant

    • hasAnyParent: (parent: WrappedNode<T> | TreeNode<T>) => boolean

      Returns true if parent is the immediate or ancestor parent for this node

    • hasChild: (child: WrappedNode<T> | TreeNode<T>) => boolean

      Returns true if child is an immediate child of this node

    • hasParent: (parent: WrappedNode<T> | TreeNode<T>) => boolean

      Returns true if parent is the immediate parent for this node

    • parentsValues: <T>(child: TreeNode<T>) => IterableIterator<T>

      Yields the node value of each parent of child. undefined values are not returned.

      Use 'queryParentsValue' to search for a particular value

    • queryParentsValue: <T>(
          child: TreeNode<T>,
          value: T,
          eq?: IsEqual<T>,
      ) => IterableIterator<WrappedNode<T>>

      Yields all parents of child that have a given value. Use 'findParentsValue' to find the first match only.

    • queryValue: (value: T) => IterableIterator<WrappedNode<T>>
    • remove: () => void

      Remove node and its children from tree

    • wraps: TreeNode<T>

      Underlying Node