feat(tree-view): update docs/types

This commit is contained in:
metonym 2021-10-13 08:28:08 -07:00
commit 4f22c7fc1c
4 changed files with 86 additions and 10 deletions

View file

@ -66,4 +66,30 @@ export default class TreeView extends SvelteComponentTyped<
keydown: WindowEventMap["keydown"];
},
{ labelText: {} }
> {}
> {
/**
* Programmatically expand all nodes
* @default () => { expandedIds = [...nodeIds]; }
*/
expandAll: () => void;
/**
* Programmatically collapse all nodes
* @default () => { expandedIds = []; }
*/
collapseAll: () => void;
/**
* Programmatically expand a subset of nodes.
* Expands all nodes if no argument is provided
* @default () => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); }
*/
expandNodes: (filterId?: (node: TreeNode) => boolean) => void;
/**
* Programmatically collapse a subset of nodes.
* Collapses all nodes if no argument is provided
* @default () => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); }
*/
collapseNodes: (filterId?: (node: TreeNode) => boolean) => void;
}