flattenTree
import { flattenTree } from 'pixi-silk/ui/layers';
function flattenTree<T>(
adapter: Pick<TreeAdapter<T>, "getChildren">,
root: T,
isExpanded: (node: T) => boolean,
showRoot?: boolean
): FlatRow<T>[];
Lists the visible rows of a tree, depth first: the children of root (or root itself with
showRoot), and the children of every expanded node under them.
Type Parameters#
| Type Parameter |
|---|
T |
Parameters#
| Parameter | Type | Default value |
|---|---|---|
adapter | Pick<TreeAdapter<T>, "getChildren"> | undefined |
root | T | undefined |
isExpanded | (node: T) => boolean | undefined |
showRoot | boolean | false |
Returns#
FlatRow<T>[]