import { ForwardRefExoticComponent, RefAttributes, RefObject } from 'react'; import { EventModel, SchedulerCellDetails, SchedulerProps } from './types/scheduler-types'; import { CrudAction } from './types/enums'; interface ISchedulerApi { /** * Adds the newly created event into the Scheduler dataSource. * * @param {Object | Object[]} data Single or collection of event objects to be added into Scheduler. * @returns {void} */ addEvent(data: Record | Record[]): void; /** * Deletes the events based on the provided ID or event collection in the argument list. * * @param {string | number | Object | Object[]} id Accepts the ID as string or number type or single or collection of the event object * which needs to be removed from the Scheduler. * @param {CrudAction?} action Optional action type for handling recurrence event deletion (DeleteOccurrence, DeleteSeries). * @returns {void} */ deleteEvent(id: string | number | Record | Record[], action?: CrudAction): void; /** * Updates the changes made in the event object by passing it as an parameter into the dataSource. * * @param {Object | Object[]} data Single or collection of event objects to be saved into Scheduler. * @param {CrudAction?} action Optional action type for handling recurrence event edits (Edit, EditSeries, EditOccurrence). * @returns {void} */ saveEvent(data: Record | Record[], action?: CrudAction): void; /** * The Scheduler component element. * * @private * @default null */ element?: HTMLDivElement | null; /** * Gets the details of the currently selected event based on the appointment element or ref. * Returns null if no event is selected or the event cannot be resolved from the element. * * @param {Element | RefObject | null} element Optional appointment element or ref whose `data-guid` * attribute is used to look up the event. When omitted, the element is resolved from the current selection. * @returns {EventModel | null} The matching `EventModel` from the Scheduler data source, or `null` when not found. */ getEventDetails(element?: Element | RefObject | null): EventModel | null; /** * Gets the details of the currently selected cell (time range, all-day state, etc.). * Returns null if no cell is selected. * * @param {Element | Element[] | null} cells Optional cell element or collection of cell elements from which the * start time, end time, and all-day state are computed. When omitted, the cells are resolved from the current selection. * @returns {SchedulerCellDetails | null} The computed cell details containing `startTime`, `endTime`, * `isAllDay`, and the originating `element`, or `null` when no cell can be resolved. */ getCellDetails(cells?: Element | Element[] | null): SchedulerCellDetails | null; /** * Opens the event editor. * * @param {CrudAction} action Specifies the editor mode — `Add` to create a new event from a cell, or * `Edit`/`EditSeries`/`EditOccurrence` to edit an existing event (including recurrence variants). * @param {SchedulerCellDetails | EventModel} data Optional context for the editor: a `SchedulerCellDetails` * to seed a new event from a cell, or an `EventModel` to edit. Required when `action` is `Add`; * for edit actions the event is also resolved from the current selection when omitted. * @returns {void} */ openEditor(action: CrudAction, data?: SchedulerCellDetails | EventModel): void; /** Closes the Editor popup */ closeEditor(): void; /** * Opens the Quick Info popup for a cell or event. * * @param {SchedulerCellDetails | EventModel} data The target context for the popup. When the value carries an * `event`/`guid` field it is treated as an event and the appointment popup is shown; otherwise it is treated as * cell details and the cell (new-event) popup is shown. * @param {HTMLElement | null} element Optional DOM element anchoring the popup. For events this is the appointment * element used to position the popup; for cells it is the cell element from the cell details. * @returns {void} */ openQuickInfoPopup(data: SchedulerCellDetails | EventModel, element: HTMLElement | null): void; /** Closes the Quick Info popup if open */ closeQuickInfoPopup(): void; /** * Programmatically scrolls the current view to the specified date and hour. * - If the date is not in the currently rendered range, the scheduler navigates to it, then scrolls. * - Works in time-based views (Day/Week/WorkWeek). In Month view, it navigates to the date and waits for a time-based view to be active. * * @param date - The target date to ensure is visible. * @param hour - The hour within the day to scrollTo (0-23). */ scrollTo(hour: string, date?: Date): void; } export interface IScheduler extends ISchedulerApi, SchedulerProps { } /** * The React Scheduler component that displays a list of events scheduled at specific dates and times, helping users plan and manage their schedule effectively. * * ```typescript * import { Scheduler, DayView, WeekView, WorkWeekView, MonthView, AgendaView } from '@syncfusion/react-scheduler'; * * export default function App() { * return ( * * * * * * * * ); * } * ``` */ export declare const Scheduler: ForwardRefExoticComponent>; export default Scheduler;