Viewer
    Preparing search index...

    Interface ITree

    interface ITree {
        root: ITreeNode;
        addNode(node: ITreeNode, parent?: ITreeNode, root?: ITreeNode): boolean;
        addNodeAtPath(node: ITreeNode, path?: string, root?: ITreeNode): boolean;
        getNodeAtPath(path?: string, root?: ITreeNode): ITreeNode | null;
        removeNode(node: ITreeNode, root?: ITreeNode): boolean;
        removeNodeAtPath(path: string, root?: ITreeNode): boolean;
    }

    Implemented by

    Index

    Properties

    root: ITreeNode

    The root of the tree.

    Methods

    • Add the node as a child of the corresponding parent node.

      Parameters

      • node: ITreeNode

        the node to be added

      • Optionalparent: ITreeNode

        the targeted parent node

      • Optionalroot: ITreeNode

        optional root at which the process begins, root node will be used per default

      Returns boolean

    • Add the node at the corresponding path. (paths are dot separated ids)

      Parameters

      • node: ITreeNode

        the node to be added

      • Optionalpath: string

        the path at which the node should be added

      • Optionalroot: ITreeNode

        optional root at which the process begins, root node will be used per default

      Returns boolean

    • Remove a node from the tree.

      Parameters

      • node: ITreeNode

        the node to remove

      • Optionalroot: ITreeNode

        optional root at which the process begins, root node will be used per default

      Returns boolean

    • Remove a node via the path of it.

      Parameters

      • path: string

        the path of the node to be removed

      • Optionalroot: ITreeNode

        optional root at which the process begins, root node will be used per default

      Returns boolean