@copilotkit/react-core
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
20 lines (18 loc) • 575 B
TypeScript
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;
getAllElements: () => Tree;
}
declare const useTree: () => UseTreeReturn;
export { Tree, TreeNode, TreeNodeId, UseTreeReturn, useTree as default };