import type { ReactElement } from "react"; import type { BaseTreeItem, ProvidedTreeItemProps, ProvidedTreeProps } from "./types"; /** * A "reasonable" default implementation for rendering a tree item that extracts * the most used ListItem props and passes them down to the `TreeItem`. * * This is actually exported from this package so it can be used along with a * custom renderer for all items that have `isCustom` enabled. * * ```tsx * const itemRenderer: TreeItemRenderer = ( * itemProps, * item, * treeProps * ) => { * const { key } = itemProps; * const { isCustom } = item; * if (isCustom) { * return * } * * return defaultTreeItemRenderer(itemProps, item, treeProps); * } * ``` * * @param itemProps - The provided tree item props that should be passed down * for keyboard functionality, accessibility, and a `key` for the item. * @param item - The item itself. This is used to extract any of the common * ListItemChildren props. * @param treeProps - The props for the Tree this item is being rendered in. * This is really used so the `expanderLeft`, `expanderIcon`, `labelKey`, * `getItemLabel`, and `getItemProps` can be used to render the TreeItem * itself. * @returns a `TreeItem` or a custom `ReactElement` */ export declare function defaultTreeItemRenderer(itemProps: ProvidedTreeItemProps, item: BaseTreeItem & { visibleIndex: number; }, treeProps: ProvidedTreeProps): ReactElement;