import React, { ReactNode } from 'react'; declare type NavLabelFn = (props: TreeItem & { isExpanded: boolean; }) => ReactNode; export declare type TreeItems = TreeItem[]; export declare type TreeItem = { /** Unique id */ id?: string; /** Label of the item */ label?: ReactNode | NavLabelFn; /** Initial expanded state */ expanded?: boolean; /** Icon in front of the label */ icon?: ReactNode; /** Widget or icon to place at the end of the item */ widget?: ReactNode; /** Array of child/sub-menu items */ items?: TreeItems; /** href parameter for anchor type child elements */ href?: string; /** event handler onClick */ onClick?: (id: string) => void; }; export declare const hasActiveChidlren: (item: TreeItem, active?: Pick | undefined) => boolean; export declare const expandTreeItems: (items: TreeItems, expanded: boolean) => TreeItems; export declare const getTreeItemsStats: (items: TreeItems) => { total: number; expanded: number; }; export declare const getFlatChildrenIds: (children?: TreeItems | undefined) => TreeItems; export declare const getChildrenById: (children?: TreeItems | undefined, id?: string | undefined) => TreeItems | undefined; export declare type TreeOwnProps = { /** Array of child items */ items: TreeItems; /** POsition of the expand/collapse arrow */ arrowPosition?: 'start' | 'end'; /** Initially active item */ activeItem?: Pick; /** If specified, will expand all items with chidren */ expandAll?: boolean; /** Function that will be called when the user selects a item */ onSelect?: (item?: TreeItem) => void; /** * Function that will be called on expand/collapse */ onExpandCollapse?: (expandedCount: number) => void; /** If specified, will filter the items by the search terms */ search?: string; /** * custom chevron icon */ chevronIcon?: ReactNode; /** * indentation in pixels for each elevel, By default 6 pixels */ indentPixels?: number; /** * row link class - to avoid anchor in anchor warning */ rowLinkClass?: React.ElementType; }; export interface TreeState { expandedItems?: TreeItems; originalExpandAll?: boolean; search?: string; items?: TreeItems; filteredItems?: TreeItems; collapsibleItems?: TreeItems; allExpanded?: boolean; expandAll?: boolean; } export declare const stateFromProps: ({ items, expandAll, activeItem, search, }: Pick) => TreeState; export {};