import { ContextMenuClassNameContract } from "@microsoft/fast-components-class-name-contracts-base"; import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react"; import React from "react"; import { ContextMenuHandledProps, ContextMenuProps, ContextMenuUnhandledProps } from "./context-menu.props"; export interface ContextMenuState { /** * The index of the focusable child */ focusIndex: number; } declare class ContextMenu extends Foundation { static displayName: string; static defaultProps: Partial; private static focusableElementRoles; protected handledProps: HandledProps; private rootElement; constructor(props: ContextMenuProps); /** * Renders the component */ render(): React.ReactElement; componentDidMount(): void; /** * Brings focus to the appropriate menu-item */ focus(): void; /** * Create class names */ protected generateClassNames(): string; /** * Render all child elements */ private renderChildren; /** * Render a single child */ private renderChild; private isMenuItemElement; /** * Determines if a given element should be focusable by the menu */ private isFocusableElement; private isDisabledElement; /** * Return an array of all focusabled elements that are children * of the context menu */ private domChildren; /** * Ensure we always validate our internal state on item focus events, otherwise * the component can get out of sync from click events */ private handleMenuItemFocus; /** * Sets focus to the nearest focusable element to the supplied focusIndex. * The adjustment controls how the function searches for other focusable elements * if the element at the focusIndex is not focusable. A positive number will search * towards the end of the children array, whereas a negative number will search towards * the beginning of the children array. */ private setFocus; /** * Handle the keydown event of the root menu */ private handleMenuKeyDown; private handleContextMenu; } export default ContextMenu; export * from "./context-menu.props"; export { ContextMenuClassNameContract };