import React, { Dispatch } from 'react'; import { ISidekickMenuItem } from '../types'; export interface MenuState { isOpen: boolean; searchTerm: string; highlightedIndex: number; openSubMenus: { [key: string]: boolean; }; itemVisibility: { [key: string]: "VISIBLE" | "HIDDEN" | "PENDING"; }; /** Drilldown navigation only: item-id breadcrumb trail from the root. */ currentPath: string[]; /** Favourites only: which tab is currently shown. */ activeTab: "favourites" | "all"; /** Desktop rail-collapse only. */ railCollapsed: boolean; } export type MenuAction = { type: 'SET_IS_OPEN'; payload: boolean; } | { type: 'SET_SEARCH_TERM'; payload: string; } | { type: 'SET_HIGHLIGHTED_INDEX'; payload: number; } | { type: 'TOGGLE_SUBMENU'; payload: string; } | { type: 'SET_OPEN_SUBMENUS'; payload: { [key: string]: boolean; }; } | { type: 'SET_ITEM_VISIBILITY'; payload: { [key: string]: "VISIBLE" | "HIDDEN" | "PENDING"; }; } | { type: 'CLOSE_MENU'; } | { type: 'DRILL_IN'; payload: string; } | { type: 'DRILL_BACK'; } | { type: 'DRILL_TO_INDEX'; payload: number; } | { type: 'SET_PATH'; payload: string[]; } | { type: 'SET_ACTIVE_TAB'; payload: 'favourites' | 'all'; } | { type: 'TOGGLE_RAIL'; }; export declare const menuReducer: (state: MenuState, action: MenuAction) => MenuState; export interface MenuContextProps { state: MenuState; dispatch: Dispatch; items: ISidekickMenuItem[]; closeMenu: () => void; toggleSubMenu: (id: string) => void; setHighlightedIndex: (index: number) => void; searchIcon?: React.ReactNode; chevronIcon?: React.ReactNode; alwaysShowUnsearchableItems: boolean; } export declare const MenuContext: React.Context; export declare const useMenuContext: () => MenuContextProps;