UNPKG

@copilotkit/react-core

Version:

<div align="center"> <a href="https://copilotkit.ai" target="_blank"> <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/banner.png" alt="CopilotKit Logo"> </a>

19 lines (17 loc) 543 B
type TreeNodeId = string; interface TreeNode { id: TreeNodeId; value: string; children: TreeNode[]; parentId?: TreeNodeId; categories: Set<string>; } type Tree = TreeNode[]; interface UseTreeReturn { tree: Tree; addElement: (value: string, categories: string[], parentId?: TreeNodeId) => TreeNodeId; printTree: (categories: string[]) => string; removeElement: (id: TreeNodeId) => void; } declare const useTree: () => UseTreeReturn; export { Tree, TreeNode, TreeNodeId, UseTreeReturn, useTree as default };