import React from "react"; import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react"; import { TreeViewClassNameContract, TreeViewHandledProps, TreeViewProps, TreeViewUnhandledProps } from "./tree-view.props"; interface TreeViewState { /** * Track if the tree view itself is focusable. It should * only be focusable if no items in the tree-view are focusable */ focusable: boolean; /** * A react reference to the child node that was most previously focused. * Tracking this allows us to easily determine which item the tree should re-focus * when focus is brought back to the tree */ lastFocused: React.RefObject | null; /** * Track if the tree has nested tree-view-item nodes */ nested: boolean; } export interface TreeViewContextValue { /** * Callback to assign the last-focused item of the TreeView */ setLastFocused: (ref: React.RefObject) => void; /** * Callback to adjust the nested tree item counter */ adjustNestedTreeItemCount: (delta: 1 | -1) => void; /** * informs consumers the tree is nested */ nested: boolean; } export declare const TreeViewContext: React.Context; declare class TreeView extends Foundation { static displayName: string; static defaultProps: Partial; protected handledProps: HandledProps; private rootElement; /** * Track how many tree-items have children */ private nestedTreeItemTracker; constructor(props: TreeViewProps); render(): React.ReactNode; componentDidUpdate(): void; protected generateClassNames(): string; private setLastFocused; private adjustNestedTreeItemCount; private handleBlur; private handleFocus; /** * Verifies that the tree has a focusable child. * If it does not, the tree will begin to accept focus */ private ensureFocusability; private handleKeyDown; private getVisibleNodes; } export default TreeView; export * from "./tree-view.props"; export { TreeViewClassNameContract };