import { RefObject } from 'react'; export type TreeNodeId = string; export type TreeSelectableType = 'radio' | 'multi' | undefined; export type TreeOnKeyDown = (e: React.KeyboardEvent, node: { id: TreeNodeId; isExpanded: boolean; isSelectable: boolean; hasChildren: boolean; value: T; }) => void; export type TreeOnNodeClick = (e: React.MouseEvent, nodeId: TreeNodeId) => void; export interface TreeNodeProps { children?: Array>; icon?: React.ReactNode | null; id: TreeNodeId; label: string; value?: T; } export interface TreeExpandable { expandedNodes: TreeNodeId[]; onCollapse?(nodeId: TreeNodeId): void; onExpand?(nodeId: TreeNodeId): void; onToggle?(nodeId: TreeNodeId, isExpanded: boolean): void; } export interface TreeSelectable { selectedNodes?: TreeNodeId[]; type: TreeSelectableType; onSelect?: (nodeId: TreeNodeId, value: T) => void; } export interface TreeFocusable { focusedNode: TreeNodeId; onFocus(nodeId: TreeNodeId): void; } export interface TreeProps { nodes: Array>; iconless?: boolean; id?: string; expandable: TreeExpandable; focusable: TreeFocusable; selectable?: TreeSelectable; disabledNodes?: TreeNodeId[]; onKeyDown: TreeOnKeyDown; onNodeClick?: TreeOnNodeClick; } export interface TreeContextState { disabledNodes?: TreeNodeId[]; expandable: TreeExpandable; focusable: TreeFocusable; iconless?: boolean; selectable?: TreeSelectable; onKeyDown: TreeOnKeyDown; onNodeClick?: TreeOnNodeClick; treeRef: RefObject; } export interface MapValues { children: TreeNodeId[]; id: TreeNodeId; parent?: TreeNodeId; } export type NodeMap = Map; //# sourceMappingURL=types.d.ts.map