UNPKG

rsuite

Version:

A suite of react components

24 lines (23 loc) 947 B
import type { TreeNode } from '../../internals/Tree/types'; interface UseFocusTreeProps<T extends TreeNode> { filteredData: T[]; disabledItemValues: any[]; expandItemValues: any[]; searchKeyword: string; flattenedNodes: any; onExpand?: (nodeData: T, expanded: boolean) => void; onFocused?: (value: TreeNode['value']) => void; } /** * Custom hook that manages the focus behavior of a tree component. */ declare function useFocusTree(props: UseFocusTreeProps<TreeNode>): { treeViewRef: import("react").RefObject<HTMLDivElement | null>; focusTreeFirstNode: (...args: any[]) => any; focusItemValue: string | number | null | undefined; treeNodesRefs: {}; saveTreeNodeRef: (ref: any, refKey?: string) => void; setFocusItemValue: import("react").Dispatch<import("react").SetStateAction<string | number | null | undefined>>; onTreeKeydown: (...args: any[]) => any; }; export default useFocusTree;