import { TrackerFactoryConfiguration } from '@episerver/telemetry';
import { EventHandler, FunctionComponent, HTMLAttributes, HTMLProps, ReactElement, SyntheticEvent } from 'react';

export interface ActionItem {
	/** Text used for the tooltip. */
	name: string;
	/** Icon name to be used for the action link. */
	icon: string;
	/** Url that the action link navigates to. */
	url: string;
	/** Target for the url. */
	target?: string;
}
export interface ActionItemWithSubItems {
	/** Text used for the tooltip. */
	name: string;
	/** Icon name to be used for the action link. */
	icon: string;
	/** Sub items to appear in the context menu. */
	children: ActionSubItem[];
}
export interface ActionSubItem {
	/** Text used for the tooltip. */
	name: string;
	/** Url that the action sub item navigates to. */
	url: string;
	/** Target for the url. */
	target?: string;
}
export interface MenuItem {
	/** Name to be displayed. */
	name: string;
	/** Url the menu item navigates to. */
	url: string;
	/** Child menu items used when there are multiple levels of navigation. */
	children: MenuItem[];
}
export interface Product {
	/** Name to be displayed. */
	name: string;
	/** Url the product navigates to. */
	url: string;
}
export interface TelemetryConfiguration extends Omit<TrackerFactoryConfiguration, "config"> {
	/** Set to true for applications with SPA behavior when navigating.  */
	isSPA?: boolean;
}
export interface NavigationProps extends HTMLAttributes<HTMLElement> {
	/** Menu items that populate the first and second levels. */
	menuItems: MenuItem[];
	/**  Products that populate the global navigation. */
	products?: Product[];
	/** Currently selected product. */
	product: Product;
	/** Currently selected item in the first level. Defaults to the first item. */
	levelOne?: MenuItem;
	/** Currently selected item in the second level. Defaults to the first item. */
	levelTwo?: MenuItem;
	/** Action links to be added to the right-hand section of the first level. */
	actionItems?: (ActionItem | ActionItemWithSubItems | ReactElement)[];
	/** Turns on telemetry tracking. */
	telemetry?: TelemetryConfiguration;
	/** Callback when a product is selected. */
	onProductSelect?: (item: Product) => void;
	/** Callback when a local navigation item is selected. */
	onItemSelect: (levelOne: MenuItem, levelTwo: MenuItem) => void;
	/** Callback when an action link is selected. Only applies to action links passed in as `ActionItem` or `ActionSubItem` types. */
	onActionItemSelect?: (item: ActionItem | ActionSubItem) => void;
}
export declare const Navigation: FunctionComponent<NavigationProps>;
export declare type IconToggleChangeEvent = CustomEvent<{
	isOn: boolean;
}> & SyntheticEvent<EventTarget>;
export interface NavigationBarIconProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
	href?: string;
	target?: string;
	onChange?: EventHandler<IconToggleChangeEvent>;
}
export declare const NavigationBarIcon: FunctionComponent<NavigationBarIconProps>;
export interface ContextMenuItem {
	name: string;
	url: string;
	target?: string;
	onSelected: () => void;
}
export interface ContextMenuProps {
	icon: ReactElement<HTMLProps<HTMLOrSVGElement>> | string;
	menuItems: ContextMenuItem[];
	className?: string;
	tooltip?: string;
}
export declare const ContextMenu: FunctionComponent<ContextMenuProps>;
export interface NavigationAdjustProps extends HTMLAttributes<HTMLElement> {
	/** Classes to be applied to the navigation adjust. */
	className?: string;
	/** Disables fullscreen styling for compatiblity with legacy products. */
	disableFullscreen?: boolean;
}
export declare const NavigationAdjust: FunctionComponent<NavigationAdjustProps>;