import { SetStateAction, Dispatch } from 'react'; import { SchedulerCellClickEvent, SchedulerEventClickEvent, EventModel, SchedulerResource, SchedulerGroup, EventFields } from '../types/scheduler-types'; import { CalendarChangeEvent } from '@syncfusion/react-calendars'; import { CheckboxChangeEvent } from '@syncfusion/react-buttons'; import { TextBoxChangeEvent, TextAreaChangeEvent, FormState, IFormValidator } from '@syncfusion/react-inputs'; import { ChangeEvent } from '@syncfusion/react-dropdowns'; import { CrudAction, AlertAction, EditAction } from '../types/enums'; /** @private */ export interface UseEditorPopupResult { data?: EventModel; open: boolean; setOpen: Dispatch>; onCellDoubleClickHandler: (args: SchedulerCellClickEvent) => void; onEventDoubleClickHandler: (args: SchedulerEventClickEvent) => void; onClose: () => void; startDateOnly?: Date; startTimeOnly?: Date; endDateOnly?: Date; endTimeOnly?: Date; slotDuration: number; recurrenceStart?: Date; repeatModeValue: string; recurrenceOpen: boolean; setSlotDuration: Dispatch>; handleSubjectChange: (args: TextBoxChangeEvent) => void; handleLocationChange: (args: TextBoxChangeEvent) => void; handleDescriptionChange: (args: TextAreaChangeEvent) => void; handleStartDateChange: (args: CalendarChangeEvent) => void; handleStartTimeChange: (args: CalendarChangeEvent) => void; handleEndDateChange: (args: CalendarChangeEvent) => void; handleEndTimeChange: (args: CalendarChangeEvent) => void; handleIsAllDayChange: (args: CheckboxChangeEvent) => void; handleRecurrenceRuleChange: (args: string) => void; handleRepeatModeChange: (args: ChangeEvent) => void; handleStartTimezoneChange: (args: ChangeEvent) => void; handleEndTimezoneChange: (args: ChangeEvent) => void; handleUseTimezoneChange: (args: CheckboxChangeEvent) => void; closeRecurrenceEditor: () => void; onEditEvent: (eventData: EventModel, action?: EditAction) => void; onMoreDetails: (cellData: SchedulerCellClickEvent) => void; formState?: FormState; setFormState: (state: FormState) => void; formRef: React.RefObject; validateRequiredFields: (getString: (key: string) => string) => string | null; action: CrudAction; originalData?: EventModel; repeatData?: DropdownData[]; timezone?: string; resourceValues: Record; setResourceValues: Dispatch>>; handleResourceChange: (resourceIndex: number) => (args: ChangeEvent) => void; currentCellGroupIndex?: number; } type DropdownData = { text: string; value: string; }; /** * Hook that manages the Scheduler editor popup state and event handlers. * Initializes state based on cell/event double-clicks and provides helpers for * editing subject, location, description, date/time parts, and all-day flag. * * @param {Function} onCellDoubleClick - Callback invoked on cell double-click. * @param {Function} onEventDoubleClick - Callback invoked on event double-click. * @param {Function} closeAllPopups - Callback to close other popups when opening the editor. * @param {Function} showRecurrenceAlert - Callback to show recurrence alert options. * @param {EventModel[]} eventsProcessed - Array of processed events for recurrence rule calculation. * @param {string} timezone - Scheduler's default timezone. * @param {SchedulerResource[]} resources - Array of resource configurations for the scheduler. * @param {SchedulerGroup} group - Grouping configuration for the scheduler * @param {EventFields} eventSettingsFields - Custom field mappings from event settings. * @returns {UseEditorPopupResult} API with current state and handlers to control the editor popup. * @private */ export declare const useEditorPopup: (onCellDoubleClick?: (args: SchedulerCellClickEvent) => void, onEventDoubleClick?: (args: SchedulerEventClickEvent) => void, closeAllPopups?: () => void, showRecurrenceAlert?: (action: AlertAction, onSelect: (selectOption: CrudAction) => void) => void, eventsProcessed?: EventModel[], timezone?: string, resources?: SchedulerResource[], group?: SchedulerGroup, eventSettingsFields?: EventFields) => UseEditorPopupResult; export default useEditorPopup;