import * as React from 'react'; import type { IStyle, ITheme } from '../../Styling'; import type { IRefObject, IRenderFunction, IStyleFunctionOrObject, IComponentAs } from '../../Utilities'; import type { IIconProps } from '../Icon/Icon.types'; import type { IButtonProps } from '../../Button'; import type { IFocusZoneProps } from '../../FocusZone'; /** * {@doccategory Nav} */ export interface IRenderGroupHeaderProps extends INavLinkGroup { /** * Whether or not the group is presently expanded. */ isExpanded?: boolean; } /** * {@docCategory Nav} */ export interface INav { /** * The meta 'key' property of the currently selected NavItem of the Nav. Can return * undefined if the currently selected nav item has no populated key property. Be aware * that in order for Nav to properly understand which key is selected all NavItems in * all groups of the Nav must have populated key properties. */ selectedKey: string | undefined; /** * Sets focus to the first tabbable item in the zone. * @param forceIntoFirstElement - If true, focus will be forced into the first element, even * if focus is already in the focus zone. * @returns True if focus could be set to an active element, false if no operation was taken. */ focus(forceIntoFirstElement?: boolean): boolean; } /** * {@docCategory Nav} */ export interface INavProps { /** * Optional callback to access the INav interface. Use this instead of ref for accessing * the public methods and properties of the component. */ componentRef?: IRefObject; /** * Call to provide customized styling that will layer on top of the variant rules */ styles?: IStyleFunctionOrObject; /** * Theme provided by HOC. */ theme?: ITheme; /** * Additional css class to apply to the Nav * @defaultvalue undefined */ className?: string; /** * A collection of link groups to display in the navigation bar */ groups: INavLinkGroup[] | null; /** * Used to customize how content inside the group header is rendered */ onRenderGroupHeader?: IRenderFunction; /** * Render a custom link in place of the normal one. * This replaces the entire button rather than simply button content */ linkAs?: IComponentAs; /** * Used to customize how content inside the link tag is rendered */ onRenderLink?: IRenderFunction; /** * Function callback invoked when a link in the navigation is clicked */ onLinkClick?: (ev?: React.MouseEvent, item?: INavLink) => void; /** * Function callback invoked when the chevron on a link is clicked */ onLinkExpandClick?: (ev?: React.MouseEvent, item?: INavLink) => void; /** * Indicates whether the navigation component renders on top of other content in the UI */ isOnTop?: boolean; /** * (Optional) The key of the nav item initially selected. */ initialSelectedKey?: string; /** * (Optional) Override the role of the `