import { ComponentPropsWithoutRef } from "react"; import { NodeData, Tree } from "@itwin/itwinui-react"; import { LocalizationContextProvider } from "../LocalizationContext.js"; import { PresentationTreeNode } from "../TreeNode.js"; import { SelectionMode } from "../UseSelectionHandler.js"; import { useTree } from "../UseTree.js"; import { TreeNodeRenderer } from "./TreeNodeRenderer.js"; /** @public */ type TreeProps = ComponentPropsWithoutRef>; /** @public */ type TreeNodeRendererProps = ComponentPropsWithoutRef; /** @public */ interface TreeRendererOwnProps { /** Root nodes of the tree. */ rootNodes: PresentationTreeNode[]; /** Active selection mode used by the tree. Defaults to `"single"`. */ selectionMode?: SelectionMode; } /** @public */ type TreeRendererProps = Pick, "rootNodes" | "expandNode"> & Partial, "selectNodes" | "isNodeSelected" | "getHierarchyLevelDetails" | "reloadTree">> & Pick & TreeRendererOwnProps & Omit & ComponentPropsWithoutRef; /** * A component that renders a tree using the `Tree` component from `@itwin/itwinui-react`. The tree nodes * are rendered using `TreeNodeRenderer` component from this package. * * @see https://itwinui.bentley.com/docs/tree * @public */ export declare function TreeRenderer({ rootNodes, expandNode, selectNodes, isNodeSelected, onFilterClick, getIcon, getLabel, getSublabel, getHierarchyLevelDetails, reloadTree, selectionMode, localizedStrings, size, filterButtonsVisibility, getActions, ...treeProps }: TreeRendererProps): import("react/jsx-runtime.js").JSX.Element; /** * A data structure for a tree node that is rendered using the `TreeRenderer` component. * * In addition to the `PresentationTreeNode` union, this type may have one additional variation - an informational * type of node with `ChildrenPlaceholder` type. This type of node is returned as the single child node of a parent * while its children are being loaded. This allows the node renderer to show a placeholder under the parent during * the process. * * @public */ export type RenderedTreeNode = PresentationTreeNode | { id: string; parentNodeId: string | undefined; type: "ChildrenPlaceholder"; }; /** * An utility function that creates an `@itwin/itwinui-react` `NodeData` object for the `Tree` component from a * `RenderedTreeNode` object. * * Usage example: * ```tsx * function MyComponent({ rootNodes, nodeRenderer }: MyComponentProps) { * const getNode = useCallback((node) => createRenderedTreeNodeData(node, () => false), []); * return data={rootNodes} getNode={getNode} nodeRenderer={nodeRenderer} />; * } * ``` * * @public */ export declare function createRenderedTreeNodeData(node: RenderedTreeNode, isNodeSelected: (nodeId: string) => boolean): NodeData; export {}; //# sourceMappingURL=TreeRenderer.d.ts.map