import React from 'react'; import { NestedDropdownConfig, NestedDropdownContextValue } from '../types/nestedDropdown'; /** * React Context for managing nested dropdown state across the component tree. * Provides centralized state management for all submenus, including their open/close state, * hover state, nesting levels, and timeout management. */ export declare const NestedDropdownContext: React.Context; /** * Props for the NestedDropdownProvider component. */ interface NestedDropdownProviderProps { /** Child components that will have access to the nested dropdown context */ children: React.ReactNode; /** Configuration options for nested dropdown behavior. Will be merged with defaults */ config?: Partial; } /** * Provider component that manages the state for all nested dropdowns within its tree. * * This component provides: * - Centralized state management for all submenus * - Timeout management for hover delays * - Level-based z-index calculation * - Automatic cleanup of child submenus when parents close * * @example * ```tsx * * * ...}> * Parent Item * * * * ``` */ export declare const NestedDropdownProvider: React.FC; /** * Hook to access the nested dropdown context. * Must be used within a NestedDropdownProvider. * * @returns The nested dropdown context value with all state and methods * @throws Error if used outside of a NestedDropdownProvider * * @example * ```tsx * const { openSubmenu, closeSubmenu, config } = useNestedDropdown(); * ``` */ export declare const useNestedDropdown: () => NestedDropdownContextValue; /** * Hook for managing a specific submenu's state and interactions. * Provides a convenient interface for individual submenu components. * * @param id - Unique identifier for the submenu * @returns Object containing submenu state and control methods * * @example * ```tsx * const { isOpen, open, close, setHover, canOpen } = useSubmenu('my-submenu-id'); * * // Open the submenu with a parent context * const handleMouseEnter = () => { * if (canOpen(parentId)) { * open(parentId); * } * }; * * // Update hover state * const handleMouseLeave = () => setHover(false); * ``` */ export declare const useSubmenu: (id: string) => { /** Whether the submenu is currently open */ isOpen: boolean; /** Whether the submenu is currently being hovered */ isHovered: boolean; /** The nesting level of this submenu (0 = top level) */ level: number; /** Function to open this submenu */ open: (parentId?: string) => void; /** Function to close this submenu */ close: () => void; /** Function to update hover state */ setHover: (isHovered: boolean) => void; /** Function to check if submenu can be opened */ canOpen: (parentId?: string) => boolean; }; export {};