import { RefObject, Dispatch, SetStateAction } from 'react'; import { EventModel, SchedulerCellClickEvent, SchedulerEventClickEvent } from '../types/scheduler-types'; import { IQuickInfoPopup } from '../components/popup/quick-info-popup'; /** * Interface for useSchedulerPopups hook * * @private */ export interface UseSchedulerPopupsResult { /** * Ref for the quick info popup (handles both cell and event clicks) */ cellEditRef: RefObject; /** * Ref for the event edit popup (maintained for backward compatibility) */ eventEditRef: RefObject; /** * Handler for cell click - directly calls the standalone popup */ handleCellClick: (data: SchedulerCellClickEvent, element: HTMLElement) => void; /** * Handler for event click - directly calls the standalone popup */ handleEventClick: (data: EventModel, element: HTMLElement) => void; /** * Handler for edit event */ handleEditEvent: () => void; } /** * Interface for legacy usePopupState hook * * @private */ export interface UsePopupStateResult { visible: boolean; setVisible: Dispatch>; target: HTMLElement | null; setTarget: Dispatch>; containerRef: RefObject; popupElement: RefObject; schedulerElement: RefObject; handleClose: () => void; handleRef: (el: HTMLDivElement | null) => void; } /** * Result interface for consolidated usePopup hook * * @private */ export interface UsePopupResult { visible: boolean; setVisible: Dispatch>; target: HTMLElement | null; setTarget: Dispatch>; containerRef: RefObject; popupElement: RefObject; schedulerElement: RefObject; handleClose: () => void; handleRef: (el: HTMLDivElement | null) => void; cellEditRef: RefObject; eventEditRef: RefObject; handleCellClick: (data: SchedulerCellClickEvent, element: HTMLElement) => void; handleEventClick: (data: EventModel, element: HTMLElement) => void; handleEditEvent: () => void; closeAllPopups: () => void; onCellClickHandler: (args: SchedulerCellClickEvent) => void; onEventClickHandler: (args: SchedulerEventClickEvent) => void; } /** * Consolidated hook for popup management. * Combines functionality from usePopupState and useSchedulerPopups * * @param {Function} onCellClick - User-provided cell click handler * @param {Function} onEventClick - User-provided event click handler * @param {Function} onClose - Function to call when popup is closed * @returns {UsePopupResult} - Combined popup state and handlers * @private */ export declare const usePopup: (onCellClick?: (args: SchedulerCellClickEvent) => void, onEventClick?: (args: SchedulerEventClickEvent) => void, onClose?: () => void) => UsePopupResult; /** * Legacy hook to handle Escape key press for popups * This is exported directly from usePopup.ts for backward compatibility * * @param {Function} onClose Callback to execute on Escape key press * @returns {void} No return value * @private */ export declare const useEscapeKey: (onClose: () => void) => void; /** * Legacy hook to handle focus trap for modal popups * This is exported directly from usePopup.ts for backward compatibility * * @param {boolean} isOpen Whether the popup is open * @returns {RefObject} Ref to be attached to the popup container * @private */ export declare const useFocusTrap: (isOpen: boolean) => RefObject; export default usePopup;