Skip to content

TreeNodeVChildren<Item, Owner>

Unofficial

Manages the virtual children of a tree node for use with virtual scrolling.

Import:

import type { TreeNodeVChildren } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface TreeNodeVChildren<Item extends TreeNode, Owner extends TreeNode>

Properties

Property Type Description
_children Item[] Internal array of child items.
owner Owner The tree node that owns these children.

Methods

Method Returns Description
addChild(item) void Add a child item to this node.
clear() void Remove all children from this node.
first() Item | undefined Get the first child item, or undefined if there are no children.
hasChildren() boolean Check whether this node has any children.
last() Item | undefined Get the last child item, or undefined if there are no children.
removeChild(item) void Remove a specific child item from this node.
setChildren(children) void Replace all children with the given array.
size() number Get the number of children.
sort(compareFn) void Sort the children using the provided comparison function.

Links to this page: