import * as React from 'react'; export interface TreeItemData { [key: string]: unknown; } export interface TreeViewLabels { /** Accessible name of the expand/collapse chevron. Default "Expand". */ expand?: string | undefined; /** Chevron name while the item is expanded. Default "Collapse". */ collapse?: string | undefined; } export interface TreeViewBaseProps { /** Root items of the tree. */ items?: readonly T[] | undefined; /** Key of an item. */ getKey?: ((item: T) => React.Key) | undefined; /** Children of an item; undefined for a leaf. */ getChildren?: ((item: T) => readonly T[] | undefined) | undefined; /** Text of an item used for typeahead and the accessible name. */ getTextValue?: ((item: T) => string) | undefined; /** Content rendered inside the component. */ children?: React.ReactNode; /** Item selection: none, single or multiple. */ selectionMode?: 'none' | 'single' | 'multiple' | undefined; /** Controlled selected keys. Pair with `onSelectionChange`. */ selectedKeys?: Iterable | undefined; /** Initially selected keys when uncontrolled. */ defaultSelectedKeys?: Iterable | undefined; /** Called with the next set of selected keys. */ onSelectionChange?: ((keys: Set) => void) | undefined; /** Controlled expanded keys. Pair with `onExpandedChange`. */ expandedKeys?: Iterable | undefined; /** Initially expanded keys when uncontrolled. */ defaultExpandedKeys?: Iterable | undefined; /** Called with the next set of expanded keys. */ onExpandedChange?: ((keys: Set) => void) | undefined; /** Keys of items that cannot be selected or activated. */ disabledKeys?: Iterable | undefined; /** Called with the key of an item when it is activated. */ onAction?: ((key: React.Key) => void) | undefined; /** Custom item content; receives the item and its level, expanded, selected and has-children state. */ renderItem?: ((item: T, state: { level: number; isExpanded: boolean; isSelected: boolean; hasChildren: boolean; }) => React.ReactNode) | undefined; /** Loads the children of an item on first expand. */ loadChildren?: ((item: T) => Promise) | undefined; /** 'files' shows file and folder icons. */ preset?: 'default' | 'files' | undefined; /** REQ-SURF-83: render only the visible rows. `estimateRowHeight` is the fixed row height in px the rows are laid out at (default 32); `overscan` adds that many rows above and below the viewport (default 0). The tree becomes its own scroll container and fills its parent's block size, so give the parent a height. */ virtualize?: boolean | { estimateRowHeight?: number; overscan?: number; } | undefined; /** Localised strings (chevron names). */ labels?: TreeViewLabels | undefined; /** Class name merged onto the root element. */ className?: string | undefined; } /** REQ-SURF-81: the tree must be named — `aria-label` or `aria-labelledby` is a required union (omitting both is a type error). */ export type TreeViewLabelling = { /** Accessible name, required when there is no visible label. */ 'aria-label': string; /** Id of the element that provides the accessible name. */ 'aria-labelledby'?: string | undefined; } | { 'aria-labelledby': string; 'aria-label'?: string | undefined; }; export type TreeViewProps = TreeViewBaseProps & TreeViewLabelling; export declare function TreeView({ items, getKey, getChildren, getTextValue, children, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, expandedKeys, defaultExpandedKeys, onExpandedChange, disabledKeys, onAction, renderItem, loadChildren, preset, virtualize, labels, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, className, }: TreeViewProps): React.JSX.Element; export declare namespace TreeView { var Item: typeof TreeViewItem; } export interface TreeViewItemProps { /** Unique key of the item within the tree. */ id: React.Key; /** Plain-text label used for typeahead and the accessible name. */ textValue: string; /** Mark the item expandable before its children are known. */ hasChildItems?: boolean | undefined; children?: React.ReactNode; className?: string | undefined; 'aria-label'?: string | undefined; } declare function TreeViewItem({ id, textValue, hasChildItems, children, className, 'aria-label': ariaLabel }: TreeViewItemProps): React.JSX.Element; export {}; //# sourceMappingURL=TreeView.d.ts.map