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

PropertyTypeDescription
_childrenItem[]Internal array of child items.
ownerOwnerThe tree node that owns these children.

Methods

MethodReturnsDescription
addChild(item)voidAdd a child item to this node.
clear()voidRemove all children from this node.
first()Item | undefinedGet the first child item, or undefined if there are no children.
hasChildren()booleanCheck whether this node has any children.
last()Item | undefinedGet the last child item, or undefined if there are no children.
removeChild(item)voidRemove a specific child item from this node.
setChildren(children)voidReplace all children with the given array.
size()numberGet the number of children.
sort(compareFn)voidSort the children using the provided comparison function.

Links to this page: