import { Accessibility, TreeBehaviorProps } from '@fluentui/accessibility'; import { ComponentWithAs } from '@fluentui/react-bindings'; import * as React from 'react'; import { TreeItem, TreeItemProps } from './TreeItem'; import { TreeTitle, TreeTitleProps } from './TreeTitle'; import { UIComponentProps, ChildrenComponentProps } from '../../utils'; import { ShorthandRenderFunction, ShorthandCollection, ComponentEventHandler, ObjectShorthandCollection, FluentComponentStaticProps } from '../../types'; export interface TreeProps extends UIComponentProps, ChildrenComponentProps { /** Accessibility behavior if overridden by the user. */ accessibility?: Accessibility; /** Ids of expanded items. */ activeItemIds?: string[]; /** Ids of selected items. */ selectedItemIds?: string[]; /** Initial activeItemIds value. */ defaultActiveItemIds?: string[]; /** Initial selectedItemIds value. */ defaultSelectedItemIds?: string[]; /** Only allow one subtree to be expanded at a time. */ exclusive?: boolean; /** Shorthand array of props for Tree. */ items?: ObjectShorthandCollection; /** * A custom render function for the title slot. * * @param Component - The computed component for this slot. * @param props - The computed props for this slot. * @param children - The computed children for this slot. */ renderItemTitle?: ShorthandRenderFunction; /** * Called when active item ids change. * @param event - React's original SyntheticEvent. * @param data - All props, with `activeItemIds` reflecting the new state. */ onActiveItemIdsChange?: ComponentEventHandler; /** * Called when tree item selection state is changed. * @param event - React's original SyntheticEvent. * @param data - All props, with `selectedItemIds` reflecting the new state. */ onSelectedItemIdsChange?: ComponentEventHandler; /** * Callback that provides rendered tree items to be used by react-virtualized for instance. * Acts as a render prop, with the rendered tree items being the re-used logic. * * @param renderedItem - The array of rendered items. * @returns The render prop result. */ renderedItems?: (renderedItems: React.ReactElement[]) => React.ReactNode; /** Whether or not tree items are selectable. */ selectable?: boolean; } export interface TreeItemForRenderProps { elementRef: React.RefObject; id: string; index: number; level: number; parent: string; siblings: ShorthandCollection; } export declare const treeClassName = "ui-tree"; export declare type TreeStylesProps = never; /** * A Tree displays data organised in tree hierarchy. * * @accessibility * Implements [ARIA TreeView](https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView) design pattern. * @accessibilityIssues * [Treeview - JAWS doesn't narrate position for each tree item](https://github.com/FreedomScientific/VFO-standards-support/issues/338) * [Aria compliant trees are read as empty tables](https://bugs.chromium.org/p/chromium/issues/detail?id=1048770) */ export declare const Tree: ComponentWithAs<'div', TreeProps> & FluentComponentStaticProps & { Item: typeof TreeItem; Title: typeof TreeTitle; };