View as Markdown

API reference: @salmonui/navigation/tree-view

moveTreeItemsfunction

import { moveTreeItems } from '@salmonui/navigation/tree-view';
function moveTreeItems<T>(data: readonly T[], move: {
    readonly ids: readonly TreeViewKey[];
    readonly targetId: TreeViewKey;
    readonly position: TreeViewDropPosition;
    readonly items?: readonly T[];
}, options: MoveTreeItemsOptions<T>): T[];

Moves the items ids (taken from data, or from items when they come from another tree) before, after or into the item targetId.