import { VegaCalendarEventVariantType, VegaCalendarRawEvent } from '../../components/vega-calendar/types'; import { Nullable, TimeFormat } from '../../types/general'; import { CalendarDate } from './calendar-date'; import { CalendarPeriod } from './calendar-period/calendar-period.abstract'; import { CalendarTime } from './calendar-time'; /** The `CalendarEvent` class in TypeScript represents a calendar event with methods to validate required fields, initialize dates and times, and determine if it is a group event. */ export declare class CalendarEvent { private _event; private _eventKey; private _startDateTime; private _endDateTime; private _eventSpansDays; private repeatPattern; private _timezone; /** * The constructor initializes a VegaCalendarRawEvent object and performs validation checks on required fields. * * @param {VegaCalendarRawEvent} eventOptions - The `eventOptions` parameter in the constructor * represents the raw event data for a Vega calendar event. It contains information such as the event * title, start and end dates, location, description, and any other relevant details about the event. * @param {string} eventKey If a value is not provided for `eventKey`, a UUID (Universally * Unique Identifier) will be generated as a default value. This identifier is used to distinguish * different events and can be helpful for tracking * @param {string} timezone - Optional timezone identifier for timezone-aware date calculations */ constructor(eventOptions: VegaCalendarRawEvent, eventKey?: string, timezone?: string); /** * The function returns the raw event data for a VegaCalendar event. * * @returns {VegaCalendarRawEvent} The `get event()` method is returning a `VegaCalendarRawEvent` object, which is stored in the `_event` property. */ get event(): VegaCalendarRawEvent; /** * This function returns the key of an event in TypeScript. * * @returns {string} event key */ get eventKey(): string; /** * This function returns the title of an event in TypeScript. * * @returns {string} The title of the event. */ get title(): string; /** * This function returns the disabled of an event in TypeScript. * * @returns {boolean} The disabled of the event. */ get disabled(): boolean; /** * This function returns the variant of an event in TypeScript. * * @returns {Nullable} The variant of the event. */ get variant(): Nullable; /** * This function returns the color of an event in TypeScript. * * @returns {Nullable} The color of the event. */ get color(): Nullable; /** * The function isAllDayEvent returns a boolean value indicating whether the event is an all-day event. * * @returns {boolean} The method `isAllDayEvent()` is returning a boolean value indicating whether the event is an all-day event or not. It returns `true` if the event is an all-day event, and `false` if it is not. */ get isAllDayEvent(): boolean; /** * The function isRepeatEvent returns a boolean value based on whether the event's repeatOptions property is not equal to 'none'. * * @returns {boolean} The method `isRepeatEvent` returns a boolean value indicating whether the `_event` has a repeat value other than 'none'. */ get isRepeatEvent(): boolean; /** * The function returns the start date property of an object. * * @returns {Date} The `startDate` property of type `Date` is being returned. */ get startDate(): Date; /** * The function returns the end date property of an object. * * @returns {Date} The `endDate` property of type `Date` is being returned. */ get endDate(): Date; /** * This function returns the start time as a CalendarTime. * * @returns {CalendarTime} The event start time. */ get startTime(): CalendarTime; /** * This function returns the end time as a CalendarTime. * * @returns {CalendarTime} The event end time. */ get endTime(): CalendarTime; /** * This function returns the number of days that an event spans. * * @returns {number} The method `get eventSpansDays()` is returning the value of the property * `_eventSpansDays`, which is of type `number`. */ get eventSpansDays(): number; /** * The function `copyTo` copies a calendar event with updated start and end dates. * * @param {string} eventKey - The `eventKey` parameter in the `copyTo` function is a string that represents the key or identifier of the new calendar event that will be created. * @param {CalendarDate} startDate - The `startDate` parameter in the `copyTo` function represents * the starting date of a calendar event. It is of type `CalendarDate`, which may contain information such as the day, month, and year of the event. * @returns {CalendarEvent} A new `CalendarEvent` object is being returned with the properties from the original * `_event` object (excluding `repeatOptions`) and the `startDate` and `endDate` properties set to * the `toDate()` values of the `startDate` and `endDate` parameters. */ copyTo(eventKey: string, startDate: CalendarDate): CalendarEvent; /** * Check the event is a group event or not * * @returns {boolean} true or false */ isGroupEvent(): boolean; /** * This TypeScript function checks if a given date falls within the range of a calendar event based on its start and end dates, considering different repeat types like daily, weekly, monthly, and yearly. * * @param {CalendarDate} date - The `date` parameter represents the current date for which you want to * check if it falls within the range of the `calendarEvent`. It is of type `CalendarDate`. * @returns {boolean} a boolean value, either `true` or `false`, based on whether the `calendarEvent` falls on the `date` provided. */ isCurrentDayEvent(date: CalendarDate): boolean; /** * Generate repeat display string. * * @returns {string} repeat display string */ generateRepeatString(): string; /** * Generate date display string. * * @param {CalendarDate} viewDate - The `date` to display * @param {TimeFormat} timeFormat - The `timeFormat` to use * @returns {string} repeat display string */ generateDateTimeString(viewDate: CalendarDate, timeFormat: TimeFormat): string; /** * Get the number of minutes the event lasted * * @returns {number} the minutes */ getEventMinutes(): number; /** * This function returns an array of repeat series based on a given calendar period. * * @param {CalendarPeriod} period - The `period` parameter in the `getRepeatSeries` method is of type * `CalendarPeriod`. It represents a specific time period within a calendar, typically defined by a * start date and an end date. The method uses this period to generate a series of repeated events * based on a daily repeat pattern specified * @returns {CalendarDate[]} repeat start date array */ getRepeatSeries(period: CalendarPeriod): CalendarDate[]; /** * Refresh event dates and related properties when timezone changes * * @param {string} timezone - The new timezone to apply to the event */ updateTimezone(timezone: string): void; /** * The function `checkEventRequireField` validates the required fields of a calendar event item in TypeScript. * * @param {VegaCalendarRawEvent} eventOptions - The `eventOptions` parameter is an object of type * `VegaCalendarRawEvent` that contains information about a calendar event */ private checkEventRequireField; /** * The `initDate` function in TypeScript initializes start and end dates and times for a calendar event based on the provided options. * * @param {VegaCalendarRawEvent} eventOptions - The `initDate` method you provided is used to * initialize the start and end dates for a calendar event based on the options provided in the * `eventOptions` object. The `eventOptions` object contains properties such as `startDate`, * `startTime`, `endDate`, and `endTime` which are used */ private initDate; /** * Parse the supplied start date/time, normalize into calendar wrappers. * * @param {string | Date} startDate - Raw start date value from the event payload. * @param {string} startTime - Optional textual time component to parse. */ private processStartDate; /** * Parse the supplied end date/time, normalize into calendar wrappers. * * @param {string | Date | undefined} endDate - The raw end date value from the event payload. * @param {string | undefined} endTime - The optional textual end time component to parse. * @param {string | Date} originStartDate - The start date value to use as fallback if endDate is missing. */ private processEndDate; /** * The function initializes a repeat pattern controller for a calendar event with specified start and end dates and repeat options. */ private initRepeatPattern; /** * Initializes the event cross days by the event start date and end date. */ private initEventSpansDays; }