/** * SPDX-FileCopyrightText: © 2021 Liferay, Inc. * SPDX-License-Identifier: BSD-3-Clause */ import React from 'react'; import { ICollectionProps } from './Collection'; import { DragAndDropMessages } from './DragAndDrop'; import { Icons, MoveItemIndex, OnLoadMore } from './context'; import { ITreeProps } from './useTree'; interface ITreeViewProps> extends Omit, 'children' | 'onSelect'>, ITreeProps, ICollectionProps { /** * Flag to determine which style the TreeView will display. */ displayType?: 'light' | 'dark'; /** * Flag to enable Drag and Drop of Nodes over the Tree. */ dragAndDrop?: boolean; /** * Optional drag and drop context: this is to avoid * errors when using various drag and drop contexts * on the same page. */ dragAndDropContext?: Window & typeof globalThis; /** * Flag to expand the node's children when double-clicking the node. */ expandDoubleClick?: boolean; /** * Flag to expand child nodes when a parent node is checked. */ expandOnCheck?: boolean; /** * Extra classes passed to the expander button. */ expanderClassName?: string; /** * Flag to modify Node expansion state icons. */ expanderIcons?: Icons; /** * Flag to indicate which key name matches the item name to be displayed * in drag preview. */ itemNameKey?: string; /** * Messages that the TreeView uses to announce to the screen reader. Use * this to handle internationalization. */ messages?: DragAndDropMessages; /** * The callback is called whenever there is an item dragging over * another item. */ onItemHover?: (item: T, parentItem: T, index: MoveItemIndex) => boolean; /** * Callback is called when an item is about to be moved elsewhere in the tree. */ onItemMove?: (item: T, parentItem: T, index: MoveItemIndex) => boolean; /** * When a tree is very large, loading items (nodes) asynchronously is preferred to * decrease the initial payload and memory space. The callback is called every time * the item is a leaf node of the tree. */ onLoadMore?: OnLoadMore; /** * Callback called whenever an item is selected. Similar to the `onSelectionChange` * callback but instead of passing the selected keys it is called with the current * item being selected. */ onSelect?: (item: T) => void; /** * Calback is called when the user presses the R or F2 hotkey. */ onRenameItem?: (item: T) => Promise; /** * Flag changes the Node selection behavior when a checkbox is rendered on the Node. * - single: select only node. * - multiple: select multiple nodes. * - multiple-recursive: selects multiple nodes and recursively. */ selectionMode?: 'single' | 'multiple' | 'multiple-recursive' | null; /** * Flag to indicate if the TreeView will show the expander in the hover in the Node. */ showExpanderOnHover?: boolean; } export declare function TreeView>({ children, className, defaultExpandedKeys, defaultItems, defaultSelectedKeys, displayType, dragAndDrop, dragAndDropContext, expandDoubleClick, expandedKeys, expanderClassName, expanderIcons, expandOnCheck, indeterminate, itemNameKey, items, messages, nestedKey, onExpandedChange, onItemHover, onItemMove, onItemsChange, onLoadMore, onRenameItem, onSelect, onSelectionChange, selectedKeys, selectionHydrationMode, selectionMode, showExpanderOnHover, ...otherProps }: ITreeViewProps): JSX.Element; export declare namespace TreeView { var Group: typeof import("./TreeViewGroup").Group; var Item: React.ForwardRefExoticComponent>; var ItemStack: typeof import("./TreeViewItem").ItemStack; } export {};